diff --git a/.apigentools-info b/.apigentools-info index 23489779f09e..693ca67cdceb 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-01-28 16:03:45.588352", - "spec_repo_commit": "c2cedbf" + "regenerated": "2021-01-28 17:53:44.274625", + "spec_repo_commit": "f21827d" }, "v2": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-01-28 16:03:58.136402", - "spec_repo_commit": "c2cedbf" + "regenerated": "2021-01-28 17:53:56.823698", + "spec_repo_commit": "f21827d" } } } \ No newline at end of file diff --git a/data/v1/openapi.yaml b/data/v1/openapi.yaml index d15c3a57059f..c4411fe619ba 100644 --- a/data/v1/openapi.yaml +++ b/data/v1/openapi.yaml @@ -14652,7 +14652,7 @@ paths: type: safe /api/v1/slo: get: - description: Get multiple service level objective objects by their IDs. + description: Get a list of service level objective objects for your organization. operationId: ListSLOs parameters: - description: A comma separated list of the IDs of the service level objectives @@ -14660,7 +14660,29 @@ paths: example: id1, id2, id3 in: query name: ids - required: true + required: false + schema: + type: string + - description: The query string to filter results based on SLO names. + example: monitor + in: query + name: query + required: false + schema: + type: string + - description: The query string to filter results based on SLO tags. + example: env:prod + in: query + name: tags_query + required: false + schema: + type: string + - description: The query string to filter results based on SLO numerator and + denominator. + example: aws.elb.request_count + in: query + name: metrics_query + required: false schema: type: string responses: @@ -14688,7 +14710,7 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Not Found - summary: Search SLOs + summary: Get all SLOs tags: - Service Level Objectives x-undo: diff --git a/docs/v1/README.md b/docs/v1/README.md index 74fe56dae01f..d14ac065ac8d 100644 --- a/docs/v1/README.md +++ b/docs/v1/README.md @@ -190,7 +190,7 @@ Class | Method | HTTP request | Description *DatadogAPIClient::V1::ServiceLevelObjectivesApi* | [**delete_slo_timeframe_in_bulk**](ServiceLevelObjectivesApi.md#delete_slo_timeframe_in_bulk) | **POST** /api/v1/slo/bulk_delete | Bulk Delete SLO Timeframes *DatadogAPIClient::V1::ServiceLevelObjectivesApi* | [**get_slo**](ServiceLevelObjectivesApi.md#get_slo) | **GET** /api/v1/slo/{slo_id} | Get a SLO's details *DatadogAPIClient::V1::ServiceLevelObjectivesApi* | [**get_slo_history**](ServiceLevelObjectivesApi.md#get_slo_history) | **GET** /api/v1/slo/{slo_id}/history | Get an SLO's history -*DatadogAPIClient::V1::ServiceLevelObjectivesApi* | [**list_slos**](ServiceLevelObjectivesApi.md#list_slos) | **GET** /api/v1/slo | Search SLOs +*DatadogAPIClient::V1::ServiceLevelObjectivesApi* | [**list_slos**](ServiceLevelObjectivesApi.md#list_slos) | **GET** /api/v1/slo | Get all SLOs *DatadogAPIClient::V1::ServiceLevelObjectivesApi* | [**update_slo**](ServiceLevelObjectivesApi.md#update_slo) | **PUT** /api/v1/slo/{slo_id} | Update a SLO *DatadogAPIClient::V1::SnapshotsApi* | [**get_graph_snapshot**](SnapshotsApi.md#get_graph_snapshot) | **GET** /api/v1/graph/snapshot | Take graph snapshots *DatadogAPIClient::V1::SyntheticsApi* | [**create_global_variable**](SyntheticsApi.md#create_global_variable) | **POST** /api/v1/synthetics/variables | Create a global variable diff --git a/docs/v1/ServiceLevelObjectivesApi.md b/docs/v1/ServiceLevelObjectivesApi.md index 9cacb74e39e8..22f865d77691 100644 --- a/docs/v1/ServiceLevelObjectivesApi.md +++ b/docs/v1/ServiceLevelObjectivesApi.md @@ -10,7 +10,7 @@ All URIs are relative to *https://api.datadoghq.com* | [**delete_slo_timeframe_in_bulk**](ServiceLevelObjectivesApi.md#delete_slo_timeframe_in_bulk) | **POST** /api/v1/slo/bulk_delete | Bulk Delete SLO Timeframes | | [**get_slo**](ServiceLevelObjectivesApi.md#get_slo) | **GET** /api/v1/slo/{slo_id} | Get a SLO's details | | [**get_slo_history**](ServiceLevelObjectivesApi.md#get_slo_history) | **GET** /api/v1/slo/{slo_id}/history | Get an SLO's history | -| [**list_slos**](ServiceLevelObjectivesApi.md#list_slos) | **GET** /api/v1/slo | Search SLOs | +| [**list_slos**](ServiceLevelObjectivesApi.md#list_slos) | **GET** /api/v1/slo | Get all SLOs | | [**update_slo**](ServiceLevelObjectivesApi.md#update_slo) | **PUT** /api/v1/slo/{slo_id} | Update a SLO | @@ -458,11 +458,11 @@ end ## list_slos -> list_slos(ids) +> list_slos(opts) -Search SLOs +Get all SLOs -Get multiple service level objective objects by their IDs. +Get a list of service level objective objects for your organization. ### Examples @@ -479,11 +479,16 @@ DatadogAPIClient::V1.configure do |config| end api_instance = DatadogAPIClient::V1::ServiceLevelObjectivesApi.new -ids = 'id1, id2, id3' # String | A comma separated list of the IDs of the service level objectives objects. +opts = { + ids: 'id1, id2, id3', # String | A comma separated list of the IDs of the service level objectives objects. + query: 'monitor', # String | The query string to filter results based on SLO names. + tags_query: 'env:prod', # String | The query string to filter results based on SLO tags. + metrics_query: 'aws.elb.request_count' # String | The query string to filter results based on SLO numerator and denominator. +} begin - # Search SLOs - result = api_instance.list_slos(ids) + # Get all SLOs + result = api_instance.list_slos(opts) p result rescue DatadogAPIClient::V1::ApiError => e puts "Error when calling ServiceLevelObjectivesApi->list_slos: #{e}" @@ -494,12 +499,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> list_slos_with_http_info(ids) +> , Integer, Hash)> list_slos_with_http_info(opts) ```ruby begin - # Search SLOs - data, status_code, headers = api_instance.list_slos_with_http_info(ids) + # Get all SLOs + data, status_code, headers = api_instance.list_slos_with_http_info(opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -512,7 +517,10 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **ids** | **String** | A comma separated list of the IDs of the service level objectives objects. | | +| **ids** | **String** | A comma separated list of the IDs of the service level objectives objects. | [optional] | +| **query** | **String** | The query string to filter results based on SLO names. | [optional] | +| **tags_query** | **String** | The query string to filter results based on SLO tags. | [optional] | +| **metrics_query** | **String** | The query string to filter results based on SLO numerator and denominator. | [optional] | ### Return type diff --git a/features/v1/service_level_objectives.feature b/features/v1/service_level_objectives.feature index 603896c5d856..87e06a7b56e2 100644 --- a/features/v1/service_level_objectives.feature +++ b/features/v1/service_level_objectives.feature @@ -95,44 +95,44 @@ Feature: Service Level Objectives Then the response status is 200 OK @generated @skip - Scenario: Get an SLO's history returns "Bad Request" response - Given operation "GetSLOHistory" enabled - And new "GetSLOHistory" request - And request contains "slo_id" parameter from "" + Scenario: Get all SLOs returns "Bad Request" response + Given new "ListSLOs" request When the request is sent Then the response status is 400 Bad Request @generated @skip - Scenario: Get an SLO's history returns "Not Found" response - Given operation "GetSLOHistory" enabled - And new "GetSLOHistory" request - And request contains "slo_id" parameter from "" + Scenario: Get all SLOs returns "Not Found" response + Given new "ListSLOs" request When the request is sent Then the response status is 404 Not Found @generated @skip - Scenario: Get an SLO's history returns "OK" response - Given operation "GetSLOHistory" enabled - And new "GetSLOHistory" request - And request contains "slo_id" parameter from "" + Scenario: Get all SLOs returns "OK" response + Given new "ListSLOs" request When the request is sent Then the response status is 200 OK @generated @skip - Scenario: Search SLOs returns "Bad Request" response - Given new "ListSLOs" request + Scenario: Get an SLO's history returns "Bad Request" response + Given operation "GetSLOHistory" enabled + And new "GetSLOHistory" request + And request contains "slo_id" parameter from "" When the request is sent Then the response status is 400 Bad Request @generated @skip - Scenario: Search SLOs returns "Not Found" response - Given new "ListSLOs" request + Scenario: Get an SLO's history returns "Not Found" response + Given operation "GetSLOHistory" enabled + And new "GetSLOHistory" request + And request contains "slo_id" parameter from "" When the request is sent Then the response status is 404 Not Found @generated @skip - Scenario: Search SLOs returns "OK" response - Given new "ListSLOs" request + Scenario: Get an SLO's history returns "OK" response + Given operation "GetSLOHistory" enabled + And new "GetSLOHistory" request + And request contains "slo_id" parameter from "" When the request is sent Then the response status is 200 OK diff --git a/lib/datadog_api_client/v1/api/service_level_objectives_api.rb b/lib/datadog_api_client/v1/api/service_level_objectives_api.rb index 4bcd9353b58d..6035ff9057bd 100644 --- a/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +++ b/lib/datadog_api_client/v1/api/service_level_objectives_api.rb @@ -482,22 +482,28 @@ def get_slo_history_with_http_info(slo_id, from_ts, to_ts, opts = {}) return data, status_code, headers end - # Search SLOs - # Get multiple service level objective objects by their IDs. - # @param ids [String] A comma separated list of the IDs of the service level objectives objects. + # Get all SLOs + # Get a list of service level objective objects for your organization. # @param [Hash] opts the optional parameters + # @option opts [String] :ids A comma separated list of the IDs of the service level objectives objects. + # @option opts [String] :query The query string to filter results based on SLO names. + # @option opts [String] :tags_query The query string to filter results based on SLO tags. + # @option opts [String] :metrics_query The query string to filter results based on SLO numerator and denominator. # @return [SLOListResponse] - def list_slos(ids, opts = {}) - data, _status_code, _headers = list_slos_with_http_info(ids, opts) + def list_slos(opts = {}) + data, _status_code, _headers = list_slos_with_http_info(opts) data end - # Search SLOs - # Get multiple service level objective objects by their IDs. - # @param ids [String] A comma separated list of the IDs of the service level objectives objects. + # Get all SLOs + # Get a list of service level objective objects for your organization. # @param [Hash] opts the optional parameters + # @option opts [String] :ids A comma separated list of the IDs of the service level objectives objects. + # @option opts [String] :query The query string to filter results based on SLO names. + # @option opts [String] :tags_query The query string to filter results based on SLO tags. + # @option opts [String] :metrics_query The query string to filter results based on SLO numerator and denominator. # @return [Array<(SLOListResponse, Integer, Hash)>] SLOListResponse data, response status code and response headers - def list_slos_with_http_info(ids, opts = {}) + def list_slos_with_http_info(opts = {}) if @api_client.config.unstable_operations.has_key?(:list_slos) unstable_enabled = @api_client.config.unstable_operations[:list_slos] @@ -511,16 +517,15 @@ def list_slos_with_http_info(ids, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesApi.list_slos ...' end - # verify the required parameter 'ids' is set - if @api_client.config.client_side_validation && ids.nil? - fail ArgumentError, "Missing the required parameter 'ids' when calling ServiceLevelObjectivesApi.list_slos" - end # resource path local_var_path = '/api/v1/slo' # query parameters query_params = opts[:query_params] || {} - query_params[:'ids'] = ids + query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil? + query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? + query_params[:'tags_query'] = opts[:'tags_query'] if !opts[:'tags_query'].nil? + query_params[:'metrics_query'] = opts[:'metrics_query'] if !opts[:'metrics_query'].nil? # header parameters header_params = opts[:header_params] || {}