diff --git a/.apigentools-info b/.apigentools-info index 88a9ce2ab404..7ff301a95e73 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-08-28 20:31:00.396808", - "spec_repo_commit": "6b2f00dd" + "regenerated": "2024-08-29 20:02:08.736415", + "spec_repo_commit": "518ca9df" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-08-28 20:31:00.415198", - "spec_repo_commit": "6b2f00dd" + "regenerated": "2024-08-29 20:02:08.754668", + "spec_repo_commit": "518ca9df" } } } \ No newline at end of file diff --git a/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-Bad-Request-response.frozen b/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-Bad-Request-response.frozen index f787a0926d0a..0dc730d632b9 100644 --- a/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-Bad-Request-response.frozen @@ -1 +1 @@ -2024-04-18T20:09:43.575Z \ No newline at end of file +2024-08-29T19:53:50.818Z \ No newline at end of file diff --git a/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-Bad-Request-response.yml b/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-Bad-Request-response.yml index 58c20af58d62..87d3b3bfd7d8 100644 --- a/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-Bad-Request-response.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Thu, 18 Apr 2024 20:09:43 GMT +- recorded_at: Thu, 29 Aug 2024 19:53:50 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"from_ts":1690901870,"interval":"bad-interval","query":"slo_type:metric - \"SLO Reporting Test\"","to_ts":1706803070}}}' + string: '{"data":{"attributes":{"from_ts":1721505230,"interval":"bad-interval","query":"slo_type:metric + \"SLO Reporting Test\"","to_ts":1724961230}}}' headers: Accept: - application/json diff --git a/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-OK-response.frozen b/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-OK-response.frozen index d6c3a47434bd..6c52b465fd7d 100644 --- a/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-OK-response.frozen +++ b/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-OK-response.frozen @@ -1 +1 @@ -2024-04-18T20:09:43.729Z \ No newline at end of file +2024-08-29T19:53:50.962Z \ No newline at end of file diff --git a/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-OK-response.yml b/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-OK-response.yml index 1cbd889460a6..1473154731a9 100644 --- a/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-OK-response.yml +++ b/cassettes/features/v2/service_level_objectives/Create-a-new-SLO-report-returns-OK-response.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Thu, 18 Apr 2024 20:09:43 GMT +- recorded_at: Thu, 29 Aug 2024 19:53:50 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"from_ts":1690901870,"interval":"monthly","query":"slo_type:metric - \"SLO Reporting Test\"","timezone":"America/New_York","to_ts":1706803070}}}' + string: '{"data":{"attributes":{"from_ts":1721505230,"interval":"monthly","query":"slo_type:metric + \"SLO Reporting Test\"","timezone":"America/New_York","to_ts":1724961230}}}' headers: Accept: - application/json @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"98c67bea-fdbf-11ee-8a01-bfd37432018b","type":"report_id"}}' + string: '{"data":{"id":"69cfaa02-6640-11ef-8501-33b2b403f044","type":"report_id"}}' headers: Content-Type: - application/vnd.api+json diff --git a/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Bad-Request-response.frozen b/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Bad-Request-response.frozen index d6cbfd2955c9..d61ccc0ec18f 100644 --- a/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Bad-Request-response.frozen @@ -1 +1 @@ -2024-04-18T20:09:43.887Z \ No newline at end of file +2024-08-29T19:53:51.070Z \ No newline at end of file diff --git a/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Bad-Request-response.yml b/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Bad-Request-response.yml index b73d1753b421..459159b4c33e 100644 --- a/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Bad-Request-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 18 Apr 2024 20:09:43 GMT +- recorded_at: Thu, 29 Aug 2024 19:53:51 GMT request: body: null headers: diff --git a/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Not-Found-response.frozen b/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Not-Found-response.frozen index ca9dd757d7a0..953ab1af0ddb 100644 --- a/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Not-Found-response.frozen +++ b/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Not-Found-response.frozen @@ -1 +1 @@ -2024-04-18T20:09:43.972Z \ No newline at end of file +2024-08-29T19:53:51.158Z \ No newline at end of file diff --git a/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Not-Found-response.yml b/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Not-Found-response.yml index 219ef6a98b0b..de3dd8362560 100644 --- a/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Not-Found-response.yml +++ b/cassettes/features/v2/service_level_objectives/Get-SLO-report-returns-Not-Found-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 18 Apr 2024 20:09:43 GMT +- recorded_at: Thu, 29 Aug 2024 19:53:51 GMT request: body: null headers: diff --git a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Bad-Request-response.frozen b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Bad-Request-response.frozen index 8cd931b4dedb..cc82db8e49c0 100644 --- a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Bad-Request-response.frozen @@ -1 +1 @@ -2024-04-18T20:09:44.063Z \ No newline at end of file +2024-08-29T19:53:51.260Z \ No newline at end of file diff --git a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Bad-Request-response.yml b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Bad-Request-response.yml index c71f9805073e..75ce90708018 100644 --- a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Bad-Request-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 18 Apr 2024 20:09:44 GMT +- recorded_at: Thu, 29 Aug 2024 19:53:51 GMT request: body: null headers: diff --git a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Not-Found-response.frozen b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Not-Found-response.frozen index 1222e616df0a..b828d85a4a38 100644 --- a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Not-Found-response.frozen +++ b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Not-Found-response.frozen @@ -1 +1 @@ -2024-04-18T20:09:44.147Z \ No newline at end of file +2024-08-29T19:53:51.364Z \ No newline at end of file diff --git a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Not-Found-response.yml b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Not-Found-response.yml index ec8d920a2f18..65b2331e2e39 100644 --- a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Not-Found-response.yml +++ b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-Not-Found-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 18 Apr 2024 20:09:44 GMT +- recorded_at: Thu, 29 Aug 2024 19:53:51 GMT request: body: null headers: diff --git a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-OK-response.frozen b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-OK-response.frozen index a30ab5d00912..5ed841abbecd 100644 --- a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-OK-response.frozen +++ b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-OK-response.frozen @@ -1 +1 @@ -2024-04-18T20:09:44.243Z \ No newline at end of file +2024-08-29T19:53:51.486Z \ No newline at end of file diff --git a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-OK-response.yml b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-OK-response.yml index 53910bbb29b7..2c1760bb1728 100644 --- a/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-OK-response.yml +++ b/cassettes/features/v2/service_level_objectives/Get-SLO-report-status-returns-OK-response.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Thu, 18 Apr 2024 20:09:44 GMT +- recorded_at: Thu, 29 Aug 2024 19:53:51 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"from_ts":1711656584,"interval":"monthly","query":"slo_type:metric - \"SLO Reporting Test\"","to_ts":1713470984}}}' + string: '{"data":{"attributes":{"from_ts":1723146831,"interval":"monthly","query":"slo_type:metric + \"SLO Reporting Test\"","to_ts":1724961231}}}' headers: Accept: - application/json @@ -15,25 +15,25 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"990d70d6-fdbf-11ee-99ae-1f9640631fbf","type":"report_id"}}' + string: '{"data":{"id":"6a25239c-6640-11ef-943f-83644ac57ee3","type":"report_id"}}' headers: Content-Type: - application/vnd.api+json status: code: 200 message: OK -- recorded_at: Thu, 18 Apr 2024 20:09:44 GMT +- recorded_at: Thu, 29 Aug 2024 19:53:51 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/slo/report/990d70d6-fdbf-11ee-99ae-1f9640631fbf/status + uri: https://api.datadoghq.com/api/v2/slo/report/6a25239c-6640-11ef-943f-83644ac57ee3/status response: body: encoding: UTF-8 - string: '{"data":{"id":"990d70d6-fdbf-11ee-99ae-1f9640631fbf","type":"report_id","attributes":{"status":"in_progress"}}}' + string: '{"data":{"id":"6a25239c-6640-11ef-943f-83644ac57ee3","type":"report_id","attributes":{"status":"in_progress"}}}' headers: Content-Type: - application/vnd.api+json diff --git a/examples/v2/service-level-objectives/CreateSLOReportJob.rb b/examples/v2/service-level-objectives/CreateSLOReportJob.rb index 3f056b7872dc..b0a5f8460296 100644 --- a/examples/v2/service-level-objectives/CreateSLOReportJob.rb +++ b/examples/v2/service-level-objectives/CreateSLOReportJob.rb @@ -9,8 +9,8 @@ body = DatadogAPIClient::V2::SloReportCreateRequest.new({ data: DatadogAPIClient::V2::SloReportCreateRequestData.new({ attributes: DatadogAPIClient::V2::SloReportCreateRequestAttributes.new({ - from_ts: 1690901870, - to_ts: 1706803070, + from_ts: (Time.now + -40 * 86400).to_i, + to_ts: Time.now.to_i, query: 'slo_type:metric "SLO Reporting Test"', interval: DatadogAPIClient::V2::SLOReportInterval::MONTHLY, timezone: "America/New_York", diff --git a/features/v2/service_level_objectives.feature b/features/v2/service_level_objectives.feature index ab7cb826557b..a415d16ccec9 100644 --- a/features/v2/service_level_objectives.feature +++ b/features/v2/service_level_objectives.feature @@ -17,7 +17,7 @@ Feature: Service Level Objectives Scenario: Create a new SLO report returns "Bad Request" response Given operation "CreateSLOReportJob" enabled And new "CreateSLOReportJob" request - And body with value {"data": {"attributes": {"from_ts": 1690901870, "to_ts": 1706803070, "query": "slo_type:metric \"SLO Reporting Test\"", "interval": "bad-interval"}}} + And body with value {"data": {"attributes": {"from_ts": {{ timestamp('now - 40d') }}, "to_ts": {{ timestamp('now') }}, "query": "slo_type:metric \"SLO Reporting Test\"", "interval": "bad-interval"}}} When the request is sent Then the response status is 400 Bad Request @@ -25,7 +25,7 @@ Feature: Service Level Objectives Scenario: Create a new SLO report returns "OK" response Given operation "CreateSLOReportJob" enabled And new "CreateSLOReportJob" request - And body with value {"data": {"attributes": {"from_ts": 1690901870, "to_ts": 1706803070, "query": "slo_type:metric \"SLO Reporting Test\"", "interval": "monthly", "timezone": "America/New_York"}}} + And body with value {"data": {"attributes": {"from_ts": {{ timestamp('now - 40d') }}, "to_ts": {{ timestamp('now') }}, "query": "slo_type:metric \"SLO Reporting Test\"", "interval": "monthly", "timezone": "America/New_York"}}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "report_id"