From a049dd48762220d1fb7ec9ffeb344bbc2bf9588b Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 4 Jun 2026 18:33:32 +0000 Subject: [PATCH] Regenerate client from commit 948302c of spec repo --- .generator/schemas/v1/openapi.yaml | 56 ++++++++++++-- ...-with-slo-query-returns-OK-response.frozen | 1 + ...ion-with-slo-query-returns-OK-response.yml | 48 ++++++++++++ ...-with-slo-query-returns-OK-response.frozen | 1 + ...ion-with-slo-query-returns-OK-response.yml | 77 +++++++++++++++++++ .../CreateSLOCorrection_2888963657.rb | 19 +++++ .../UpdateSLOCorrection_2949191256.rb | 22 ++++++ features/v1/given.json | 12 +++ ...ervice_level_objective_corrections.feature | 23 +++++- ...service_level_objective_corrections_api.rb | 3 +- .../v1/models/slo_correction_create_data.rb | 2 + .../models/slo_correction_create_request.rb | 2 +- ...lo_correction_create_request_attributes.rb | 31 ++++---- .../slo_correction_response_attributes.rb | 16 +++- ...lo_correction_update_request_attributes.rb | 14 +++- 15 files changed, 301 insertions(+), 26 deletions(-) create mode 100644 cassettes/features/v1/service_level_objective_corrections/Create-an-SLO-correction-with-slo-query-returns-OK-response.frozen create mode 100644 cassettes/features/v1/service_level_objective_corrections/Create-an-SLO-correction-with-slo-query-returns-OK-response.yml create mode 100644 cassettes/features/v1/service_level_objective_corrections/Update-an-SLO-correction-with-slo-query-returns-OK-response.frozen create mode 100644 cassettes/features/v1/service_level_objective_corrections/Update-an-SLO-correction-with-slo-query-returns-OK-response.yml create mode 100644 examples/v1/service-level-objective-corrections/CreateSLOCorrection_2888963657.rb create mode 100644 examples/v1/service-level-objective-corrections/UpdateSLOCorrection_2949191256.rb diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 82c52ea77c72..7131ce19a0c1 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -13177,13 +13177,16 @@ components: type: object SLOCorrectionCreateRequest: description: |- - An object that defines a correction to be applied to an SLO. + An object that defines a correction to be applied to one or more SLOs. properties: data: $ref: "#/components/schemas/SLOCorrectionCreateData" type: object SLOCorrectionCreateRequestAttributes: - description: The attribute object associated with the SLO correction to be created. + description: |- + The attribute object associated with the SLO correction to be created. + + Exactly one of `slo_id` or `slo_query` must be provided. properties: category: $ref: "#/components/schemas/SLOCorrectionCategory" @@ -13207,9 +13210,16 @@ components: example: FREQ=DAILY;INTERVAL=10;COUNT=5 type: string slo_id: - description: ID of the SLO that this correction applies to. + description: ID of the single SLO that this correction applies to. example: sloId type: string + slo_query: + description: |- + Query that matches the SLOs this correction applies to. + The query uses the [Events search syntax](https://docs.datadoghq.com/events/explorer/searching/) + and can filter SLOs by SLO tags. + example: "env:prod service:checkout" + type: string start: description: Starting time of the correction in epoch seconds. example: 1600000000 @@ -13220,7 +13230,6 @@ components: example: UTC type: string required: - - slo_id - start - category type: object @@ -13284,7 +13293,12 @@ components: nullable: true type: string slo_id: - description: ID of the SLO that this correction applies to. + description: ID of the single SLO that this correction applies to. + nullable: true + type: string + slo_query: + description: Query that matches the SLOs this correction applies to. + nullable: true type: string start: description: Starting time of the correction in epoch seconds. @@ -13356,6 +13370,13 @@ components: are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`. example: FREQ=DAILY;INTERVAL=10;COUNT=5 type: string + slo_query: + description: |- + Query that matches the SLOs this correction applies to. + The query uses the [Events search syntax](https://docs.datadoghq.com/events/explorer/searching/) + and can filter SLOs by SLO tags. + example: "env:prod service:checkout" + type: string start: description: Starting time of the correction in epoch seconds. example: 1600000000 @@ -37493,7 +37514,8 @@ paths: - slos_read post: description: |- - Create an SLO Correction. + Create an SLO correction. Use `slo_id` to apply the correction to a single SLO, or `slo_query` to apply the + correction to SLOs that match a query. Exactly one of `slo_id` or `slo_query` is required. operationId: CreateSLOCorrection requestBody: content: @@ -37510,6 +37532,17 @@ paths: start: 1600000000 timezone: UTC type: correction + slo_query: + value: + data: + attributes: + category: "Scheduled Maintenance" + description: "Planned maintenance window for checkout services." + end: 1600003600 + slo_query: "env:prod service:checkout" + start: 1600000000 + timezone: UTC + type: correction schema: $ref: "#/components/schemas/SLOCorrectionCreateRequest" description: Create an SLO Correction @@ -37669,6 +37702,17 @@ paths: start: 1600000000 timezone: UTC type: correction + slo_query: + value: + data: + attributes: + category: "Scheduled Maintenance" + description: "Updated correction for checkout services." + end: 1600003600 + slo_query: "env:prod service:checkout" + start: 1600000000 + timezone: UTC + type: correction schema: $ref: "#/components/schemas/SLOCorrectionUpdateRequest" description: The edited SLO correction object. diff --git a/cassettes/features/v1/service_level_objective_corrections/Create-an-SLO-correction-with-slo-query-returns-OK-response.frozen b/cassettes/features/v1/service_level_objective_corrections/Create-an-SLO-correction-with-slo-query-returns-OK-response.frozen new file mode 100644 index 000000000000..d4db7da28f63 --- /dev/null +++ b/cassettes/features/v1/service_level_objective_corrections/Create-an-SLO-correction-with-slo-query-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-05-27T20:45:22.423Z \ No newline at end of file diff --git a/cassettes/features/v1/service_level_objective_corrections/Create-an-SLO-correction-with-slo-query-returns-OK-response.yml b/cassettes/features/v1/service_level_objective_corrections/Create-an-SLO-correction-with-slo-query-returns-OK-response.yml new file mode 100644 index 000000000000..b2aa1d4411a4 --- /dev/null +++ b/cassettes/features/v1/service_level_objective_corrections/Create-an-SLO-correction-with-slo-query-returns-OK-response.yml @@ -0,0 +1,48 @@ +http_interactions: +- recorded_at: Wed, 27 May 2026 20:45:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"category":"Scheduled Maintenance","description":"Test-Create_an_SLO_correction_with_slo_query_returns_OK_response-1779914722","end":1779918322,"slo_query":"env:prod + service:checkout","start":1779914722,"timezone":"UTC"},"type":"correction"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/slo/correction + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"correction","id":"fb3a5c0a-5a0c-11f1-8207-da7ad0902002","attributes":{"slo_id":null,"start":1779914722,"end":1779918322,"description":"Test-Create_an_SLO_correction_with_slo_query_returns_OK_response-1779914722","category":"Scheduled + Maintenance","timezone":"UTC","created_at":null,"modified_at":null,"rrule":null,"duration":null,"slo_query":"env:prod + service:checkout","creator":{"data":{"type":"users","id":"780cfef8-1736-4a4e-a826-b875b1cadcec","attributes":{"uuid":"780cfef8-1736-4a4e-a826-b875b1cadcec","handle":"blaise.vonohlen@datadoghq.com","email":"blaise.vonohlen@datadoghq.com","name":"Blaise + von Ohlen","icon":"https://secure.gravatar.com/avatar/c78d8282d57321884e8f77172229634f?s=48&d=retro"}}},"modifier":null}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 27 May 2026 20:45:22 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v1/slo/correction/fb3a5c0a-5a0c-11f1-8207-da7ad0902002 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v1/service_level_objective_corrections/Update-an-SLO-correction-with-slo-query-returns-OK-response.frozen b/cassettes/features/v1/service_level_objective_corrections/Update-an-SLO-correction-with-slo-query-returns-OK-response.frozen new file mode 100644 index 000000000000..2772dc4740e0 --- /dev/null +++ b/cassettes/features/v1/service_level_objective_corrections/Update-an-SLO-correction-with-slo-query-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-03T15:43:01.600Z \ No newline at end of file diff --git a/cassettes/features/v1/service_level_objective_corrections/Update-an-SLO-correction-with-slo-query-returns-OK-response.yml b/cassettes/features/v1/service_level_objective_corrections/Update-an-SLO-correction-with-slo-query-returns-OK-response.yml new file mode 100644 index 000000000000..120d0b1d7b90 --- /dev/null +++ b/cassettes/features/v1/service_level_objective_corrections/Update-an-SLO-correction-with-slo-query-returns-OK-response.yml @@ -0,0 +1,77 @@ +http_interactions: +- recorded_at: Wed, 03 Jun 2026 15:43:01 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"category":"Other","description":"Test Correction","end":1780504981,"slo_query":"env:prod + service:checkout","start":1780501381,"timezone":"UTC"},"type":"correction"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/slo/correction + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"correction","id":"e74cc4de-5f62-11f1-a69d-da7ad0902002","attributes":{"slo_id":null,"start":1780501381,"end":1780504981,"description":"Test + Correction","category":"Other","timezone":"UTC","created_at":null,"modified_at":null,"rrule":null,"duration":null,"slo_query":"env:prod + service:checkout","creator":{"data":{"type":"users","id":"780cfef8-1736-4a4e-a826-b875b1cadcec","attributes":{"uuid":"780cfef8-1736-4a4e-a826-b875b1cadcec","handle":"blaise.vonohlen@datadoghq.com","email":"blaise.vonohlen@datadoghq.com","name":"Blaise + von Ohlen","icon":"https://secure.gravatar.com/avatar/c78d8282d57321884e8f77172229634f?s=48&d=retro"}}},"modifier":null}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 03 Jun 2026 15:43:01 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"category":"Scheduled Maintenance","description":"Test-Update_an_SLO_correction_with_slo_query_returns_OK_response-1780501381","end":1780504981,"slo_query":"env:staging + service:checkout","start":1780501381,"timezone":"UTC"},"type":"correction"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v1/slo/correction/e74cc4de-5f62-11f1-a69d-da7ad0902002 + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"correction","id":"e74cc4de-5f62-11f1-a69d-da7ad0902002","attributes":{"slo_id":null,"start":1780501381,"end":1780504981,"description":"Test-Update_an_SLO_correction_with_slo_query_returns_OK_response-1780501381","category":"Scheduled + Maintenance","timezone":"UTC","created_at":1780501381,"modified_at":1780501381,"rrule":null,"duration":null,"slo_query":"env:staging + service:checkout","creator":{"data":{"type":"users","id":"780cfef8-1736-4a4e-a826-b875b1cadcec","attributes":{"uuid":"780cfef8-1736-4a4e-a826-b875b1cadcec","handle":"blaise.vonohlen@datadoghq.com","email":"blaise.vonohlen@datadoghq.com","name":"Blaise + von Ohlen","icon":"https://secure.gravatar.com/avatar/c78d8282d57321884e8f77172229634f?s=48&d=retro"}}},"modifier":{"data":{"type":"users","id":"780cfef8-1736-4a4e-a826-b875b1cadcec","attributes":{"uuid":"780cfef8-1736-4a4e-a826-b875b1cadcec","handle":"blaise.vonohlen@datadoghq.com","email":"blaise.vonohlen@datadoghq.com","name":"Blaise + von Ohlen","icon":"https://secure.gravatar.com/avatar/c78d8282d57321884e8f77172229634f?s=48&d=retro"}}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 03 Jun 2026 15:43:01 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v1/slo/correction/e74cc4de-5f62-11f1-a69d-da7ad0902002 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v1/service-level-objective-corrections/CreateSLOCorrection_2888963657.rb b/examples/v1/service-level-objective-corrections/CreateSLOCorrection_2888963657.rb new file mode 100644 index 000000000000..dd9fba9ef0c4 --- /dev/null +++ b/examples/v1/service-level-objective-corrections/CreateSLOCorrection_2888963657.rb @@ -0,0 +1,19 @@ +# Create an SLO correction with slo_query returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::ServiceLevelObjectiveCorrectionsAPI.new + +body = DatadogAPIClient::V1::SLOCorrectionCreateRequest.new({ + data: DatadogAPIClient::V1::SLOCorrectionCreateData.new({ + attributes: DatadogAPIClient::V1::SLOCorrectionCreateRequestAttributes.new({ + category: DatadogAPIClient::V1::SLOCorrectionCategory::SCHEDULED_MAINTENANCE, + description: "Example-Service-Level-Objective-Correction", + _end: (Time.now + 1 * 3600).to_i, + slo_query: "env:prod service:checkout", + start: Time.now.to_i, + timezone: "UTC", + }), + type: DatadogAPIClient::V1::SLOCorrectionType::CORRECTION, + }), +}) +p api_instance.create_slo_correction(body) diff --git a/examples/v1/service-level-objective-corrections/UpdateSLOCorrection_2949191256.rb b/examples/v1/service-level-objective-corrections/UpdateSLOCorrection_2949191256.rb new file mode 100644 index 000000000000..0637c5b9e5bd --- /dev/null +++ b/examples/v1/service-level-objective-corrections/UpdateSLOCorrection_2949191256.rb @@ -0,0 +1,22 @@ +# Update an SLO correction with slo_query returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::ServiceLevelObjectiveCorrectionsAPI.new + +# there is a valid "correction_with_query" in the system +CORRECTION_WITH_QUERY_DATA_ID = ENV["CORRECTION_WITH_QUERY_DATA_ID"] + +body = DatadogAPIClient::V1::SLOCorrectionUpdateRequest.new({ + data: DatadogAPIClient::V1::SLOCorrectionUpdateData.new({ + attributes: DatadogAPIClient::V1::SLOCorrectionUpdateRequestAttributes.new({ + category: DatadogAPIClient::V1::SLOCorrectionCategory::SCHEDULED_MAINTENANCE, + description: "Example-Service-Level-Objective-Correction", + _end: (Time.now + 1 * 3600).to_i, + slo_query: "env:staging service:checkout", + start: Time.now.to_i, + timezone: "UTC", + }), + type: DatadogAPIClient::V1::SLOCorrectionType::CORRECTION, + }), +}) +p api_instance.update_slo_correction(CORRECTION_WITH_QUERY_DATA_ID, body) diff --git a/features/v1/given.json b/features/v1/given.json index 4415a28bc00c..3c1540f6faa5 100644 --- a/features/v1/given.json +++ b/features/v1/given.json @@ -234,6 +234,18 @@ "tag": "Service Level Objective Corrections", "operationId": "CreateSLOCorrection" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"slo_query\": \"env:prod service:checkout\",\n \"start\": {{ timestamp(\"now\") }},\n \"end\": {{ timestamp(\"now + 1h\") }},\n \"category\": \"Other\",\n \"timezone\": \"UTC\",\n \"description\": \"Test Correction\"\n },\n \"type\": \"correction\"\n }\n}" + } + ], + "step": "there is a valid \"correction_with_query\" in the system", + "key": "correction_with_query", + "tag": "Service Level Objective Corrections", + "operationId": "CreateSLOCorrection" + }, { "parameters": [ { diff --git a/features/v1/service_level_objective_corrections.feature b/features/v1/service_level_objective_corrections.feature index d301d8e6764f..5b89ea6df2d9 100644 --- a/features/v1/service_level_objective_corrections.feature +++ b/features/v1/service_level_objective_corrections.feature @@ -49,6 +49,16 @@ Feature: Service Level Objective Corrections And the response "data.type" is equal to "correction" And the response "data.attributes.rrule" is equal to "FREQ=DAILY;INTERVAL=10;COUNT=5" + @team:DataDog/slo-app + Scenario: Create an SLO correction with slo_query returns "OK" response + Given new "CreateSLOCorrection" request + And body with value {"data": {"attributes": {"category": "Scheduled Maintenance", "description": "{{ unique }}", "end": {{ timestamp("now + 1h") }}, "slo_query": "env:prod service:checkout", "start": {{ timestamp("now") }}, "timezone": "UTC"}, "type": "correction"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "correction" + And the response "data.attributes.category" is equal to "Scheduled Maintenance" + And the response "data.attributes.slo_query" is equal to "env:prod service:checkout" + @generated @skip @team:DataDog/slo-app Scenario: Delete an SLO correction returns "Not found" response Given new "DeleteSLOCorrection" request @@ -114,7 +124,7 @@ Feature: Service Level Objective Corrections Scenario: Update an SLO correction returns "Not Found" response Given new "UpdateSLOCorrection" request And request contains "slo_correction_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"category": "Scheduled Maintenance", "duration": 3600, "end": 1600000000, "rrule": "FREQ=DAILY;INTERVAL=10;COUNT=5", "start": 1600000000, "timezone": "UTC"}, "type": "correction"}} + And body with value {"data": {"attributes": {"category": "Scheduled Maintenance", "duration": 3600, "end": 1600000000, "rrule": "FREQ=DAILY;INTERVAL=10;COUNT=5", "slo_query": "env:prod service:checkout", "start": 1600000000, "timezone": "UTC"}, "type": "correction"}} When the request is sent Then the response status is 404 Not Found @@ -130,3 +140,14 @@ Feature: Service Level Objective Corrections And the response "data.id" has the same value as "correction.data.id" And the response "data.attributes.slo_id" has the same value as "correction.data.attributes.slo_id" And the response "data.attributes.category" is equal to "Deployment" + + @team:DataDog/slo-app + Scenario: Update an SLO correction with slo_query returns "OK" response + Given there is a valid "correction_with_query" in the system + And new "UpdateSLOCorrection" request + And request contains "slo_correction_id" parameter from "correction_with_query.data.id" + And body with value {"data": {"attributes": {"category": "Scheduled Maintenance", "description": "{{ unique }}", "end": {{ timestamp("now + 1h") }}, "slo_query": "env:staging service:checkout", "start": {{ timestamp("now") }}, "timezone": "UTC"}, "type": "correction"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "correction_with_query.data.id" + And the response "data.attributes.slo_query" is equal to "env:staging service:checkout" diff --git a/lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb b/lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb index 01e9acc7f899..eaac1f77baab 100644 --- a/lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb +++ b/lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb @@ -33,7 +33,8 @@ def create_slo_correction(body, opts = {}) # Create an SLO correction. # - # Create an SLO Correction. + # Create an SLO correction. Use `slo_id` to apply the correction to a single SLO, or `slo_query` to apply the + # correction to SLOs that match a query. Exactly one of `slo_id` or `slo_query` is required. # # @param body [SLOCorrectionCreateRequest] Create an SLO Correction # @param opts [Hash] the optional parameters diff --git a/lib/datadog_api_client/v1/models/slo_correction_create_data.rb b/lib/datadog_api_client/v1/models/slo_correction_create_data.rb index 697d4d3f4a57..635df8b71137 100644 --- a/lib/datadog_api_client/v1/models/slo_correction_create_data.rb +++ b/lib/datadog_api_client/v1/models/slo_correction_create_data.rb @@ -22,6 +22,8 @@ class SLOCorrectionCreateData include BaseGenericModel # The attribute object associated with the SLO correction to be created. + # + # Exactly one of `slo_id` or `slo_query` must be provided. attr_accessor :attributes # SLO correction resource type. diff --git a/lib/datadog_api_client/v1/models/slo_correction_create_request.rb b/lib/datadog_api_client/v1/models/slo_correction_create_request.rb index c5e0d8e0aa81..c575f346f36a 100644 --- a/lib/datadog_api_client/v1/models/slo_correction_create_request.rb +++ b/lib/datadog_api_client/v1/models/slo_correction_create_request.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V1 - # An object that defines a correction to be applied to an SLO. + # An object that defines a correction to be applied to one or more SLOs. class SLOCorrectionCreateRequest include BaseGenericModel diff --git a/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb b/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb index efd21a9fe3a5..0320b499e768 100644 --- a/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb +++ b/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb @@ -18,6 +18,8 @@ module DatadogAPIClient::V1 # The attribute object associated with the SLO correction to be created. + # + # Exactly one of `slo_id` or `slo_query` must be provided. class SLOCorrectionCreateRequestAttributes include BaseGenericModel @@ -37,8 +39,13 @@ class SLOCorrectionCreateRequestAttributes # are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`. attr_accessor :rrule - # ID of the SLO that this correction applies to. - attr_reader :slo_id + # ID of the single SLO that this correction applies to. + attr_accessor :slo_id + + # Query that matches the SLOs this correction applies to. + # The query uses the [Events search syntax](https://docs.datadoghq.com/events/explorer/searching/) + # and can filter SLOs by SLO tags. + attr_accessor :slo_query # Starting time of the correction in epoch seconds. attr_reader :start @@ -58,6 +65,7 @@ def self.attribute_map :'_end' => :'end', :'rrule' => :'rrule', :'slo_id' => :'slo_id', + :'slo_query' => :'slo_query', :'start' => :'start', :'timezone' => :'timezone' } @@ -73,6 +81,7 @@ def self.openapi_types :'_end' => :'Integer', :'rrule' => :'String', :'slo_id' => :'String', + :'slo_query' => :'String', :'start' => :'Integer', :'timezone' => :'String' } @@ -120,6 +129,10 @@ def initialize(attributes = {}) self.slo_id = attributes[:'slo_id'] end + if attributes.key?(:'slo_query') + self.slo_query = attributes[:'slo_query'] + end + if attributes.key?(:'start') self.start = attributes[:'start'] end @@ -134,7 +147,6 @@ def initialize(attributes = {}) # @!visibility private def valid? return false if @category.nil? - return false if @slo_id.nil? return false if @start.nil? true end @@ -149,16 +161,6 @@ def category=(category) @category = category end - # Custom attribute writer method with validation - # @param slo_id [Object] Object to be assigned - # @!visibility private - def slo_id=(slo_id) - if slo_id.nil? - fail ArgumentError, 'invalid value for "slo_id", slo_id cannot be nil.' - end - @slo_id = slo_id - end - # Custom attribute writer method with validation # @param start [Object] Object to be assigned # @!visibility private @@ -201,6 +203,7 @@ def ==(o) _end == o._end && rrule == o.rrule && slo_id == o.slo_id && + slo_query == o.slo_query && start == o.start && timezone == o.timezone && additional_properties == o.additional_properties @@ -210,7 +213,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [category, description, duration, _end, rrule, slo_id, start, timezone, additional_properties].hash + [category, description, duration, _end, rrule, slo_id, slo_query, start, timezone, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb b/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb index ae601255889f..7b5602775eaf 100644 --- a/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb +++ b/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb @@ -49,9 +49,12 @@ class SLOCorrectionResponseAttributes # are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`. attr_accessor :rrule - # ID of the SLO that this correction applies to. + # ID of the single SLO that this correction applies to. attr_accessor :slo_id + # Query that matches the SLOs this correction applies to. + attr_accessor :slo_query + # Starting time of the correction in epoch seconds. attr_accessor :start @@ -74,6 +77,7 @@ def self.attribute_map :'modifier' => :'modifier', :'rrule' => :'rrule', :'slo_id' => :'slo_id', + :'slo_query' => :'slo_query', :'start' => :'start', :'timezone' => :'timezone' } @@ -93,6 +97,7 @@ def self.openapi_types :'modifier' => :'SLOCorrectionResponseAttributesModifier', :'rrule' => :'String', :'slo_id' => :'String', + :'slo_query' => :'String', :'start' => :'Integer', :'timezone' => :'String' } @@ -108,6 +113,8 @@ def self.openapi_nullable :'modified_at', :'modifier', :'rrule', + :'slo_id', + :'slo_query', ]) end @@ -169,6 +176,10 @@ def initialize(attributes = {}) self.slo_id = attributes[:'slo_id'] end + if attributes.key?(:'slo_query') + self.slo_query = attributes[:'slo_query'] + end + if attributes.key?(:'start') self.start = attributes[:'start'] end @@ -214,6 +225,7 @@ def ==(o) modifier == o.modifier && rrule == o.rrule && slo_id == o.slo_id && + slo_query == o.slo_query && start == o.start && timezone == o.timezone && additional_properties == o.additional_properties @@ -223,7 +235,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [category, created_at, creator, description, duration, _end, modified_at, modifier, rrule, slo_id, start, timezone, additional_properties].hash + [category, created_at, creator, description, duration, _end, modified_at, modifier, rrule, slo_id, slo_query, start, timezone, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb b/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb index 3beecde9f196..236cc61af40d 100644 --- a/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb +++ b/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb @@ -37,6 +37,11 @@ class SLOCorrectionUpdateRequestAttributes # are `FREQ`, `INTERVAL`, `COUNT`, `UNTIL` and `BYDAY`. attr_accessor :rrule + # Query that matches the SLOs this correction applies to. + # The query uses the [Events search syntax](https://docs.datadoghq.com/events/explorer/searching/) + # and can filter SLOs by SLO tags. + attr_accessor :slo_query + # Starting time of the correction in epoch seconds. attr_accessor :start @@ -54,6 +59,7 @@ def self.attribute_map :'duration' => :'duration', :'_end' => :'end', :'rrule' => :'rrule', + :'slo_query' => :'slo_query', :'start' => :'start', :'timezone' => :'timezone' } @@ -68,6 +74,7 @@ def self.openapi_types :'duration' => :'Integer', :'_end' => :'Integer', :'rrule' => :'String', + :'slo_query' => :'String', :'start' => :'Integer', :'timezone' => :'String' } @@ -111,6 +118,10 @@ def initialize(attributes = {}) self.rrule = attributes[:'rrule'] end + if attributes.key?(:'slo_query') + self.slo_query = attributes[:'slo_query'] + end + if attributes.key?(:'start') self.start = attributes[:'start'] end @@ -151,6 +162,7 @@ def ==(o) duration == o.duration && _end == o._end && rrule == o.rrule && + slo_query == o.slo_query && start == o.start && timezone == o.timezone && additional_properties == o.additional_properties @@ -160,7 +172,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [category, description, duration, _end, rrule, start, timezone, additional_properties].hash + [category, description, duration, _end, rrule, slo_query, start, timezone, additional_properties].hash end end end