From 236d3d16d4b3db88670115e90c4e83ff6fa923cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Tue, 12 Jan 2021 12:13:17 +0100 Subject: [PATCH 1/8] Add lifecycle test for SLO correction --- .../api_service_level_objectives_test.go | 94 ++++ .../TestSLOCorrectionsLifecycle.freeze | 1 + .../TestSLOCorrectionsLifecycle.yaml | 408 ++++++++++++++++++ 3 files changed, 503 insertions(+) create mode 100644 tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze create mode 100644 tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml diff --git a/tests/api/v1/datadog/api_service_level_objectives_test.go b/tests/api/v1/datadog/api_service_level_objectives_test.go index edddb390c30..517aadf845d 100644 --- a/tests/api/v1/datadog/api_service_level_objectives_test.go +++ b/tests/api/v1/datadog/api_service_level_objectives_test.go @@ -621,3 +621,97 @@ func deleteSLOIfExists(ctx context.Context, sloID string) { sloID, httpresp.StatusCode, err) } } + +func TestSLOCorrectionsLifecycle(t *testing.T) { + ctx, finish := WithRecorder(WithTestAuth(context.Background()), t) + defer finish() + assert := tests.Assert(ctx, t) + + // Create SLO + testEventSLO := getTestEventSLO(ctx, t) + sloResp, httpresp, err := Client(ctx).ServiceLevelObjectivesApi.CreateSLO(ctx).Body(testEventSLO).Execute() + if err != nil { + t.Fatalf("Error creating SLO %v: Response %s: %v", testEventSLO, err.(datadog.GenericOpenAPIError).Body(), err) + } + slo := sloResp.GetData()[0] + defer deleteSLOIfExists(ctx, slo.GetId()) + + testSLOCorrectionData := datadog.NewSLOCorrectionRequestData() + now := tests.ClockFromContext(ctx).Now().Unix() + testSLOCorrectionAttributes := datadog.SLOCorrectionRequestAttributes{ + Timezone: datadog.PtrString("UTC"), + SloId: datadog.PtrString(slo.GetId()), + Category: datadog.SLOCORRECTIONCATEGORY_SCHEDULED_MAINTENANCE.Ptr(), + Start: datadog.PtrInt32(int32(now)), + End: datadog.PtrInt32(int32(now + 3600)), + } + testSLOCorrectionData.SetAttributes(testSLOCorrectionAttributes) + testSLOCorrection := datadog.SLOCorrectionRequest{ + Data: testSLOCorrectionData, + } + + sloCorrectionResp, httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.CreateSLOCorrection(ctx).Body(testSLOCorrection).Execute() + if err != nil { + t.Fatalf("Error creating SLO Correction %v: Response %s: %v", testSLOCorrection, err.(datadog.GenericOpenAPIError).Body(), err) + } + assert.Equal(200, httpresp.StatusCode) + sloCorrection := sloCorrectionResp.GetData() + defer deleteSLOCorrectionIfExists(ctx, sloCorrection.GetId()) + + sloCorrectionListResp, httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.ListSLOCorrection(ctx).Execute() + if err != nil { + t.Fatalf("Error getting SLO corrections: Response %s: %v", err.(datadog.GenericOpenAPIError).Body(), err) + } + assert.Equal(200, httpresp.StatusCode) + + sloCorrections := sloCorrectionListResp.GetData() + assert.NoError(isSLOCorrecionIDPresent(sloCorrection.GetId(), sloCorrections)) + + sloCorrectionGetResp, httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.GetSLOCorrection(ctx, sloCorrection.GetId()).Execute() + if err != nil { + t.Fatalf("Error getting SLO correction %s: Response %s: %v", sloCorrection.GetId(), err.(datadog.GenericOpenAPIError).Body(), err) + } + assert.Equal(200, httpresp.StatusCode) + sloCorrectionGetData := sloCorrectionGetResp.GetData() + assert.Equal(sloCorrectionGetData.GetId(), sloCorrection.GetId()) + sloCorrectionAttributes := sloCorrectionGetData.GetAttributes() + assert.Equal(sloCorrectionAttributes.GetTimezone(), "UTC") + assert.Equal(sloCorrectionAttributes.GetCategory(), "Scheduled Maintenance") + + testSLOCorrectionAttributes.SetCategory(datadog.SLOCORRECTIONCATEGORY_OTHER) + testSLOCorrectionData.SetAttributes(testSLOCorrectionAttributes) + testSLOCorrection = datadog.SLOCorrectionRequest{ + Data: testSLOCorrectionData, + } +// sloCorrectionUpdateResp, httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.UpdateSLOCorrection(ctx, sloCorrection.GetId()).Body(testSLOCorrection).Execute() +// if err != nil { +// t.Fatalf("Error updating SLO correction %v: Response %s: %v", testSLOCorrection, err.(datadog.GenericOpenAPIError).Body(), err) +// } +// assert.Equal(200, httpresp.StatusCode) +// sloCorrectionUpdateData := sloCorrectionUpdateResp.GetData() +// sloCorrectionAttributes = sloCorrectionUpdateData.GetAttributes() +// assert.Equal(sloCorrectionAttributes.GetCategory(), "Other") + + httpresp, err = Client(ctx).ServiceLevelObjectiveCorrectionsApi.DeleteSLOCorrection(ctx, sloCorrection.GetId()).Execute() + if err != nil { + t.Fatalf("Error deleting SLO correction %s: Response %s: %v", sloCorrection.GetId(), err.(datadog.GenericOpenAPIError).Body(), err) + } + assert.Equal(204, httpresp.StatusCode) +} + +func deleteSLOCorrectionIfExists(ctx context.Context, sloCorrectionID string) { + httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.DeleteSLOCorrection(ctx, sloCorrectionID).Execute() + if err != nil && httpresp.StatusCode != 404 { + log.Printf("Deleting SLO correction: %v failed with %v, Another test may have already deleted this SLO correction: %v", + sloCorrectionID, httpresp.StatusCode, err) + } +} + +func isSLOCorrecionIDPresent(sloCorrectionID string, sloCorrections []datadog.SLOCorrectionListResponseData) error { + for _, sloCorrection := range sloCorrections { + if sloCorrection.GetId() == sloCorrectionID { + return nil + } + } + return fmt.Errorf("SLO correction %s expected but not found", sloCorrectionID) +} diff --git a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze new file mode 100644 index 00000000000..2e438de228b --- /dev/null +++ b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze @@ -0,0 +1 @@ +2021-01-12T12:11:45.847554+01:00 \ No newline at end of file diff --git a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml new file mode 100644 index 00000000000..f4a2c7fe7f5 --- /dev/null +++ b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml @@ -0,0 +1,408 @@ +--- +version: 1 +interactions: +- request: + body: | + {"description":"Make sure we don't have too many failed HTTP responses.","name":"go-TestSLOCorrectionsLifecycle-local-1610449905","query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"tags":["app:httpd"],"thresholds":[{"target":95,"timeframe":"7d","warning":98}],"type":"metric"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + Dd-Operation-Id: + - CreateSLO + User-Agent: + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + X-Datadog-Parent-Id: + - "8911736583708477838" + X-Datadog-Sampling-Priority: + - "1" + X-Datadog-Trace-Id: + - "3053573243754102975" + url: https://api.datadoghq.com/api/v1/slo + method: POST + response: + body: '{"data":[{"description":"Make sure we don''t have too many failed HTTP + responses.","monitor_tags":[],"creator":{"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"thresholds":[{"warning":98.0,"warning_display":"98.","target":95.0,"target_display":"95.","timeframe":"7d"}],"type_id":1,"query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","name":"go-TestSLOCorrectionsLifecycle-local-1610449905","created_at":1610449906,"tags":["app:httpd"],"modified_at":1610449906,"type":"metric"}],"error":null}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Tue, 12 Jan 2021 11:11:46 GMT + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:46 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - KdWc5RppKH51u1oZ6tf2ghJTVEevh006eS91RDKZLGoax50FN2VjMvek2ayUmkXw + X-Dd-Version: + - "35.3684804" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "500" + X-Ratelimit-Period: + - "60" + X-Ratelimit-Remaining: + - "498" + X-Ratelimit-Reset: + - "14" + status: 200 OK + code: 200 + duration: "" +- request: + body: | + {"data":{"attributes":{"category":"Scheduled Maintenance","end":1610453505,"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"timezone":"UTC"},"type":"correction"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + Dd-Operation-Id: + - CreateSLOCorrection + User-Agent: + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + X-Datadog-Parent-Id: + - "5451458942116093691" + X-Datadog-Sampling-Priority: + - "1" + X-Datadog-Trace-Id: + - "3053573243754102975" + url: https://api.datadoghq.com/api/v1/slo/correction + method: POST + response: + body: '{"data":{"type":"correction","id":"f5939466-54c6-11eb-8ca4-fb307da5438d","attributes":{"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"end":1610453505,"description":"","category":"Scheduled + Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Tue, 12 Jan 2021 11:11:46 GMT + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:46 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - nHGjqTbGmPRJGWoHEDsaMxmZCicxo5Y/AObJEW+YW63Ub16t9U+JqCkAyvEnf+xI + X-Dd-Version: + - "35.3684804" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "12000" + X-Ratelimit-Period: + - "60" + X-Ratelimit-Remaining: + - "11998" + X-Ratelimit-Reset: + - "14" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - ListSLOCorrection + User-Agent: + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + X-Datadog-Parent-Id: + - "2342602452884712427" + X-Datadog-Sampling-Priority: + - "1" + X-Datadog-Trace-Id: + - "3053573243754102975" + url: https://api.datadoghq.com/api/v1/slo/correction + method: GET + response: + body: '{"data":[{"type":"correction","id":"f5939466-54c6-11eb-8ca4-fb307da5438d","attributes":{"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"end":1610453505,"description":"","category":"Scheduled + Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}]}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Tue, 12 Jan 2021 11:11:46 GMT + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:46 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - tiNEXsvR/PrH3MknQHoRY29RAegY48fFaM1JBTKdmLfVGZaOAOJ9J4IqHffvPV7g + X-Dd-Version: + - "35.3684804" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "12000" + X-Ratelimit-Period: + - "60" + X-Ratelimit-Remaining: + - "11998" + X-Ratelimit-Reset: + - "14" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetSLOCorrection + User-Agent: + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + X-Datadog-Parent-Id: + - "3005012285325452055" + X-Datadog-Sampling-Priority: + - "1" + X-Datadog-Trace-Id: + - "3053573243754102975" + url: https://api.datadoghq.com/api/v1/slo/correction/f5939466-54c6-11eb-8ca4-fb307da5438d + method: GET + response: + body: '{"data":{"type":"correction","id":"f5939466-54c6-11eb-8ca4-fb307da5438d","attributes":{"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"end":1610453505,"description":"","category":"Scheduled + Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Tue, 12 Jan 2021 11:11:46 GMT + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:46 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - ks6TYG2WFSBr2qT+ZTFJB8BB7VWuwPmODDq52A4JjLzCAAitR8HQc9JBq+LHjJu4 + X-Dd-Version: + - "35.3684804" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "12000" + X-Ratelimit-Period: + - "60" + X-Ratelimit-Remaining: + - "11998" + X-Ratelimit-Reset: + - "14" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - DeleteSLOCorrection + User-Agent: + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + X-Datadog-Parent-Id: + - "8958982086034574439" + X-Datadog-Sampling-Priority: + - "1" + X-Datadog-Trace-Id: + - "3053573243754102975" + url: https://api.datadoghq.com/api/v1/slo/correction/f5939466-54c6-11eb-8ca4-fb307da5438d + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Length: + - "0" + Content-Type: + - application/json + Date: + - Tue, 12 Jan 2021 11:11:47 GMT + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:47 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - LuHK+OcIuxuCTL7xVM4sMdR/Gv1H1hu+bgYJvWIAWOVtmiGVhdUVKBuef1C5aMk6 + X-Dd-Version: + - "35.3684804" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "12000" + X-Ratelimit-Period: + - "60" + X-Ratelimit-Remaining: + - "11997" + X-Ratelimit-Reset: + - "13" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - DeleteSLOCorrection + User-Agent: + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + X-Datadog-Parent-Id: + - "3518776256192407746" + X-Datadog-Sampling-Priority: + - "1" + X-Datadog-Trace-Id: + - "3053573243754102975" + url: https://api.datadoghq.com/api/v1/slo/correction/f5939466-54c6-11eb-8ca4-fb307da5438d + method: DELETE + response: + body: '{"errors": ["slo correction public id f5939466-54c6-11eb-8ca4-fb307da5438d + not found"]}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Tue, 12 Jan 2021 11:11:47 GMT + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Version: + - "35.3684804" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "12000" + X-Ratelimit-Period: + - "60" + X-Ratelimit-Remaining: + - "11996" + X-Ratelimit-Reset: + - "13" + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - DeleteSLO + User-Agent: + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + X-Datadog-Parent-Id: + - "1233373855551692306" + X-Datadog-Sampling-Priority: + - "1" + X-Datadog-Trace-Id: + - "3053573243754102975" + url: https://api.datadoghq.com/api/v1/slo/b31fd6b4695a59c4bd3dc492dd8b9ceb + method: DELETE + response: + body: '{"data":["b31fd6b4695a59c4bd3dc492dd8b9ceb"],"error":null}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Tue, 12 Jan 2021 11:11:47 GMT + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:47 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - V26KHlc/RfdWahgILvghYzp00rgLN6YCNAgg+V0KrlqUWK5TouaimNqGpGYzd/eX + X-Dd-Version: + - "35.3684804" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "12000" + X-Ratelimit-Period: + - "60" + X-Ratelimit-Remaining: + - "11998" + X-Ratelimit-Reset: + - "13" + status: 200 OK + code: 200 + duration: "" From 949433322050802c6f0a08aa4d0a68718bed1fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Tue, 12 Jan 2021 22:20:01 +0100 Subject: [PATCH 2/8] Update test --- .../api_service_level_objectives_test.go | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/tests/api/v1/datadog/api_service_level_objectives_test.go b/tests/api/v1/datadog/api_service_level_objectives_test.go index 517aadf845d..e5be188eb14 100644 --- a/tests/api/v1/datadog/api_service_level_objectives_test.go +++ b/tests/api/v1/datadog/api_service_level_objectives_test.go @@ -639,11 +639,11 @@ func TestSLOCorrectionsLifecycle(t *testing.T) { testSLOCorrectionData := datadog.NewSLOCorrectionRequestData() now := tests.ClockFromContext(ctx).Now().Unix() testSLOCorrectionAttributes := datadog.SLOCorrectionRequestAttributes{ - Timezone: datadog.PtrString("UTC"), - SloId: datadog.PtrString(slo.GetId()), - Category: datadog.SLOCORRECTIONCATEGORY_SCHEDULED_MAINTENANCE.Ptr(), - Start: datadog.PtrInt32(int32(now)), - End: datadog.PtrInt32(int32(now + 3600)), + Timezone: "UTC", + SloId: slo.GetId(), + Category: datadog.SLOCORRECTIONCATEGORY_SCHEDULED_MAINTENANCE, + Start: now, + End: now + 3600, } testSLOCorrectionData.SetAttributes(testSLOCorrectionAttributes) testSLOCorrection := datadog.SLOCorrectionRequest{ @@ -676,21 +676,22 @@ func TestSLOCorrectionsLifecycle(t *testing.T) { assert.Equal(sloCorrectionGetData.GetId(), sloCorrection.GetId()) sloCorrectionAttributes := sloCorrectionGetData.GetAttributes() assert.Equal(sloCorrectionAttributes.GetTimezone(), "UTC") - assert.Equal(sloCorrectionAttributes.GetCategory(), "Scheduled Maintenance") + assert.Equal(sloCorrectionAttributes.GetCategory(), datadog.SLOCORRECTIONCATEGORY_SCHEDULED_MAINTENANCE) testSLOCorrectionAttributes.SetCategory(datadog.SLOCORRECTIONCATEGORY_OTHER) testSLOCorrectionData.SetAttributes(testSLOCorrectionAttributes) testSLOCorrection = datadog.SLOCorrectionRequest{ Data: testSLOCorrectionData, } -// sloCorrectionUpdateResp, httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.UpdateSLOCorrection(ctx, sloCorrection.GetId()).Body(testSLOCorrection).Execute() -// if err != nil { -// t.Fatalf("Error updating SLO correction %v: Response %s: %v", testSLOCorrection, err.(datadog.GenericOpenAPIError).Body(), err) -// } -// assert.Equal(200, httpresp.StatusCode) -// sloCorrectionUpdateData := sloCorrectionUpdateResp.GetData() -// sloCorrectionAttributes = sloCorrectionUpdateData.GetAttributes() -// assert.Equal(sloCorrectionAttributes.GetCategory(), "Other") + + sloCorrectionUpdateResp, httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.UpdateSLOCorrection(ctx, sloCorrection.GetId()).Body(testSLOCorrection).Execute() + if err != nil { + t.Fatalf("Error updating SLO correction %v: Response %s: %v", testSLOCorrection, err.(datadog.GenericOpenAPIError).Body(), err) + } + assert.Equal(200, httpresp.StatusCode) + sloCorrectionUpdateData := sloCorrectionUpdateResp.GetData() + sloCorrectionAttributes = sloCorrectionUpdateData.GetAttributes() + assert.Equal(sloCorrectionAttributes.GetCategory(), datadog.SLOCORRECTIONCATEGORY_OTHER) httpresp, err = Client(ctx).ServiceLevelObjectiveCorrectionsApi.DeleteSLOCorrection(ctx, sloCorrection.GetId()).Execute() if err != nil { From 62583a32d5d45134905f59c6ec3f2e383c9e0b62 Mon Sep 17 00:00:00 2001 From: Ian Minoso Date: Tue, 12 Jan 2021 17:57:24 -0500 Subject: [PATCH 3/8] Update TestSLOCorrectionsLifecycle.yaml --- .../TestSLOCorrectionsLifecycle.yaml | 62 ++++++++++++++++++- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml index f4a2c7fe7f5..dc7cc1474f2 100644 --- a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml +++ b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml @@ -239,6 +239,64 @@ interactions: status: 200 OK code: 200 duration: "" +- request: + body: | + {"data":{"attributes":{"category":"Other","end":1610453505,"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"timezone":"UTC"},"type":"correction"}} + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - UpdateSLOCorrection + User-Agent: + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + X-Datadog-Parent-Id: + - "8958982086034574439" + X-Datadog-Sampling-Priority: + - "1" + X-Datadog-Trace-Id: + - "3053573243754102975" + url: https://api.datadoghq.com/api/v1/slo/correction/f5939466-54c6-11eb-8ca4-fb307da5438d + method: PATCH + response: + body: '{"data":{"type":"correction","id":"f5939466-54c6-11eb-8ca4-fb307da5438d","attributes":{"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"end":1610453505,"description":"","category":"Other","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Tue, 12 Jan 2021 11:11:46 GMT + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:46 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - ks6TYG2WFSBr2qT+ZTFJB8BB7VWuwPmODDq52A4JjLzCAAitR8HQc9JBq+LHjJu4 + X-Dd-Version: + - "35.3684804" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "12000" + X-Ratelimit-Period: + - "60" + X-Ratelimit-Remaining: + - "11998" + X-Ratelimit-Reset: + - "14" + status: 200 OK + code: 200 + duration: "" - request: body: "" form: {} @@ -250,7 +308,7 @@ interactions: User-Agent: - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) X-Datadog-Parent-Id: - - "8958982086034574439" + - "3518776256192407746" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: @@ -307,7 +365,7 @@ interactions: User-Agent: - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) X-Datadog-Parent-Id: - - "3518776256192407746" + - "95103953129192437546" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: From 8c9dc64580d4cf8914b1591795d693d301cffdd9 Mon Sep 17 00:00:00 2001 From: Ian Minoso Date: Wed, 13 Jan 2021 12:33:15 -0500 Subject: [PATCH 4/8] Update api_service_level_objectives_test.go Properly account for update object --- .../api_service_level_objectives_test.go | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/tests/api/v1/datadog/api_service_level_objectives_test.go b/tests/api/v1/datadog/api_service_level_objectives_test.go index e5be188eb14..3f64430140d 100644 --- a/tests/api/v1/datadog/api_service_level_objectives_test.go +++ b/tests/api/v1/datadog/api_service_level_objectives_test.go @@ -636,23 +636,23 @@ func TestSLOCorrectionsLifecycle(t *testing.T) { slo := sloResp.GetData()[0] defer deleteSLOIfExists(ctx, slo.GetId()) - testSLOCorrectionData := datadog.NewSLOCorrectionRequestData() + testSLOCorrectionCreateData := datadog.NewSLOCorrectionCreateRequestData() now := tests.ClockFromContext(ctx).Now().Unix() - testSLOCorrectionAttributes := datadog.SLOCorrectionRequestAttributes{ + testSLOCorrectionCreateAttributes := datadog.SLOCorrectionCreateRequestAttributes{ Timezone: "UTC", SloId: slo.GetId(), Category: datadog.SLOCORRECTIONCATEGORY_SCHEDULED_MAINTENANCE, Start: now, End: now + 3600, } - testSLOCorrectionData.SetAttributes(testSLOCorrectionAttributes) - testSLOCorrection := datadog.SLOCorrectionRequest{ - Data: testSLOCorrectionData, + testSLOCorrectionCreateData.SetAttributes(testSLOCorrectionCreateAttributes) + testSLOCorrectionCreate := datadog.SLOCorrectionCreateRequest{ + Data: testSLOCorrectionCreateData, } - sloCorrectionResp, httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.CreateSLOCorrection(ctx).Body(testSLOCorrection).Execute() + sloCorrectionResp, httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.CreateSLOCorrection(ctx).Body(testSLOCorrectionCreate).Execute() if err != nil { - t.Fatalf("Error creating SLO Correction %v: Response %s: %v", testSLOCorrection, err.(datadog.GenericOpenAPIError).Body(), err) + t.Fatalf("Error creating SLO Correction %v: Response %s: %v", testSLOCorrectionCreate, err.(datadog.GenericOpenAPIError).Body(), err) } assert.Equal(200, httpresp.StatusCode) sloCorrection := sloCorrectionResp.GetData() @@ -678,15 +678,21 @@ func TestSLOCorrectionsLifecycle(t *testing.T) { assert.Equal(sloCorrectionAttributes.GetTimezone(), "UTC") assert.Equal(sloCorrectionAttributes.GetCategory(), datadog.SLOCORRECTIONCATEGORY_SCHEDULED_MAINTENANCE) - testSLOCorrectionAttributes.SetCategory(datadog.SLOCORRECTIONCATEGORY_OTHER) - testSLOCorrectionData.SetAttributes(testSLOCorrectionAttributes) - testSLOCorrection = datadog.SLOCorrectionRequest{ - Data: testSLOCorrectionData, + testSLOCorrectionUpdateData := datadog.NewSLOCorrectionUpdateRequestData() + testSLOCorrectionUpdateAttributes := datadog.SLOCorrectionUpdateRequestAttributes{ + Timezone: "UTC", + Category: datadog.SLOCORRECTIONCATEGORY_OTHER, + Start: now, + End: now + 3600, + } + testSLOCorrectionUpdateData.SetAttributes(testSLOCorrectionUpdateAttributes) + testSLOCorrectionUpdate := datadog.SLOCorrectionUpdateRequest{ + Data: testSLOCorrectionUpdateData, } - sloCorrectionUpdateResp, httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.UpdateSLOCorrection(ctx, sloCorrection.GetId()).Body(testSLOCorrection).Execute() + sloCorrectionUpdateResp, httpresp, err := Client(ctx).ServiceLevelObjectiveCorrectionsApi.UpdateSLOCorrection(ctx, sloCorrection.GetId()).Body(testSLOCorrectionUpdate).Execute() if err != nil { - t.Fatalf("Error updating SLO correction %v: Response %s: %v", testSLOCorrection, err.(datadog.GenericOpenAPIError).Body(), err) + t.Fatalf("Error updating SLO correction %v: Response %s: %v", testSLOCorrectionUpdate, err.(datadog.GenericOpenAPIError).Body(), err) } assert.Equal(200, httpresp.StatusCode) sloCorrectionUpdateData := sloCorrectionUpdateResp.GetData() From e19f1fac01cebbcb64584ffd316afc3b296a228f Mon Sep 17 00:00:00 2001 From: Ian Minoso Date: Wed, 13 Jan 2021 14:18:37 -0500 Subject: [PATCH 5/8] Update TestSLOCorrectionsLifecycle.freeze --- .../api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze index 2e438de228b..98a5a116ec1 100644 --- a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze +++ b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze @@ -1 +1 @@ -2021-01-12T12:11:45.847554+01:00 \ No newline at end of file +2021-01-13T12:30:52.462007-05:00 From ec03d55efb9604d513a29e40ca480726426b8a2f Mon Sep 17 00:00:00 2001 From: Ian Minoso Date: Wed, 13 Jan 2021 14:19:08 -0500 Subject: [PATCH 6/8] Update TestSLOCorrectionsLifecycle.yaml --- .../TestSLOCorrectionsLifecycle.yaml | 172 +++++++++--------- 1 file changed, 87 insertions(+), 85 deletions(-) diff --git a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml index dc7cc1474f2..583b061a8cb 100644 --- a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml +++ b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"description":"Make sure we don't have too many failed HTTP responses.","name":"go-TestSLOCorrectionsLifecycle-local-1610449905","query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"tags":["app:httpd"],"thresholds":[{"target":95,"timeframe":"7d","warning":98}],"type":"metric"} + {"description":"Make sure we don't have too many failed HTTP responses.","name":"go-TestSLOCorrectionsLifecycle-local-1610559052","query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"tags":["app:httpd"],"thresholds":[{"target":95,"timeframe":"7d","warning":98}],"type":"metric"} form: {} headers: Accept: @@ -13,18 +13,18 @@ interactions: Dd-Operation-Id: - CreateSLO User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) X-Datadog-Parent-Id: - - "8911736583708477838" + - "1532261451180532963" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "3053573243754102975" + - "1924172146344629188" url: https://api.datadoghq.com/api/v1/slo method: POST response: body: '{"data":[{"description":"Make sure we don''t have too many failed HTTP - responses.","monitor_tags":[],"creator":{"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"thresholds":[{"warning":98.0,"warning_display":"98.","target":95.0,"target_display":"95.","timeframe":"7d"}],"type_id":1,"query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","name":"go-TestSLOCorrectionsLifecycle-local-1610449905","created_at":1610449906,"tags":["app:httpd"],"modified_at":1610449906,"type":"metric"}],"error":null}' + responses.","monitor_tags":[],"creator":{"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"thresholds":[{"warning":98.0,"warning_display":"98.","target":95.0,"target_display":"95.","timeframe":"7d"}],"type_id":1,"query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"id":"9a5e03e9ed725ec49aefe21793fc4c9e","name":"go-TestSLOCorrectionsLifecycle-local-1610559052","created_at":1610559052,"tags":["app:httpd"],"modified_at":1610559052,"type":"metric"}],"error":null}' headers: Cache-Control: - no-cache @@ -33,11 +33,11 @@ interactions: Content-Type: - application/json Date: - - Tue, 12 Jan 2021 11:11:46 GMT + - Wed, 13 Jan 2021 17:30:52 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:46 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:52 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -46,9 +46,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - KdWc5RppKH51u1oZ6tf2ghJTVEevh006eS91RDKZLGoax50FN2VjMvek2ayUmkXw + - LeIXOZ//FAgX4PAg4j6Bsh31EU8EFOlq+rcBJ6/UKozJVG3ekjClEE/+uYnXssRC X-Dd-Version: - - "35.3684804" + - "35.3696274" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -56,15 +56,15 @@ interactions: X-Ratelimit-Period: - "60" X-Ratelimit-Remaining: - - "498" + - "499" X-Ratelimit-Reset: - - "14" + - "8" status: 200 OK code: 200 duration: "" - request: body: | - {"data":{"attributes":{"category":"Scheduled Maintenance","end":1610453505,"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"timezone":"UTC"},"type":"correction"}} + {"data":{"attributes":{"category":"Scheduled Maintenance","end":1610562652,"slo_id":"9a5e03e9ed725ec49aefe21793fc4c9e","start":1610559052,"timezone":"UTC"},"type":"correction"}} form: {} headers: Accept: @@ -74,17 +74,17 @@ interactions: Dd-Operation-Id: - CreateSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) X-Datadog-Parent-Id: - - "5451458942116093691" + - "2652527730898852949" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "3053573243754102975" + - "1924172146344629188" url: https://api.datadoghq.com/api/v1/slo/correction method: POST response: - body: '{"data":{"type":"correction","id":"f5939466-54c6-11eb-8ca4-fb307da5438d","attributes":{"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"end":1610453505,"description":"","category":"Scheduled + body: '{"data":{"type":"correction","id":"15ee0bfc-55c5-11eb-8d04-2b444c282a89","attributes":{"slo_id":"9a5e03e9ed725ec49aefe21793fc4c9e","start":1610559052,"end":1610562652,"description":"","category":"Scheduled Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}}' headers: Cache-Control: @@ -94,11 +94,11 @@ interactions: Content-Type: - application/json Date: - - Tue, 12 Jan 2021 11:11:46 GMT + - Wed, 13 Jan 2021 17:30:53 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:46 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:52 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -107,9 +107,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - nHGjqTbGmPRJGWoHEDsaMxmZCicxo5Y/AObJEW+YW63Ub16t9U+JqCkAyvEnf+xI + - +TTazL1HF8qoxYARkG/60PGoq8sbkYkmqeurNry46zV0aHqBZfUrKqxtiyo42NRf X-Dd-Version: - - "35.3684804" + - "35.3696274" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -117,9 +117,9 @@ interactions: X-Ratelimit-Period: - "60" X-Ratelimit-Remaining: - - "11998" + - "11999" X-Ratelimit-Reset: - - "14" + - "8" status: 200 OK code: 200 duration: "" @@ -132,17 +132,17 @@ interactions: Dd-Operation-Id: - ListSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) X-Datadog-Parent-Id: - - "2342602452884712427" + - "1852987965397837934" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "3053573243754102975" + - "1924172146344629188" url: https://api.datadoghq.com/api/v1/slo/correction method: GET response: - body: '{"data":[{"type":"correction","id":"f5939466-54c6-11eb-8ca4-fb307da5438d","attributes":{"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"end":1610453505,"description":"","category":"Scheduled + body: '{"data":[{"type":"correction","id":"15ee0bfc-55c5-11eb-8d04-2b444c282a89","attributes":{"slo_id":"9a5e03e9ed725ec49aefe21793fc4c9e","start":1610559052,"end":1610562652,"description":"","category":"Scheduled Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}]}' headers: Cache-Control: @@ -152,11 +152,11 @@ interactions: Content-Type: - application/json Date: - - Tue, 12 Jan 2021 11:11:46 GMT + - Wed, 13 Jan 2021 17:30:53 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:46 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -165,9 +165,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - tiNEXsvR/PrH3MknQHoRY29RAegY48fFaM1JBTKdmLfVGZaOAOJ9J4IqHffvPV7g + - Y9+v2iJC/5twluKZH+Abk+sCd7+zW2qB+wWhdwPtTfzsXiAGXu1np/KJsw5b93OQ X-Dd-Version: - - "35.3684804" + - "35.3696362" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -175,9 +175,9 @@ interactions: X-Ratelimit-Period: - "60" X-Ratelimit-Remaining: - - "11998" + - "11999" X-Ratelimit-Reset: - - "14" + - "7" status: 200 OK code: 200 duration: "" @@ -190,17 +190,17 @@ interactions: Dd-Operation-Id: - GetSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) X-Datadog-Parent-Id: - - "3005012285325452055" + - "869560918241671499" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "3053573243754102975" - url: https://api.datadoghq.com/api/v1/slo/correction/f5939466-54c6-11eb-8ca4-fb307da5438d + - "1924172146344629188" + url: https://api.datadoghq.com/api/v1/slo/correction/15ee0bfc-55c5-11eb-8d04-2b444c282a89 method: GET response: - body: '{"data":{"type":"correction","id":"f5939466-54c6-11eb-8ca4-fb307da5438d","attributes":{"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"end":1610453505,"description":"","category":"Scheduled + body: '{"data":{"type":"correction","id":"15ee0bfc-55c5-11eb-8d04-2b444c282a89","attributes":{"slo_id":"9a5e03e9ed725ec49aefe21793fc4c9e","start":1610559052,"end":1610562652,"description":"","category":"Scheduled Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}}' headers: Cache-Control: @@ -210,11 +210,11 @@ interactions: Content-Type: - application/json Date: - - Tue, 12 Jan 2021 11:11:46 GMT + - Wed, 13 Jan 2021 17:30:53 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:46 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -223,9 +223,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - ks6TYG2WFSBr2qT+ZTFJB8BB7VWuwPmODDq52A4JjLzCAAitR8HQc9JBq+LHjJu4 + - cTGY5ulPxaRmdZr4S1APOMLAfMePPA3fkzzqqKyRFf/m5ql3XuUZsd87RDo7B7RR X-Dd-Version: - - "35.3684804" + - "35.3696274" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -233,33 +233,35 @@ interactions: X-Ratelimit-Period: - "60" X-Ratelimit-Remaining: - - "11998" + - "11999" X-Ratelimit-Reset: - - "14" + - "7" status: 200 OK code: 200 duration: "" - request: body: | - {"data":{"attributes":{"category":"Other","end":1610453505,"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"timezone":"UTC"},"type":"correction"}} + {"data":{"attributes":{"category":"Other","end":1610562652,"start":1610559052,"timezone":"UTC"},"type":"correction"}} form: {} headers: Accept: - application/json + Content-Type: + - application/json Dd-Operation-Id: - UpdateSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) X-Datadog-Parent-Id: - - "8958982086034574439" + - "4933935623803976864" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "3053573243754102975" - url: https://api.datadoghq.com/api/v1/slo/correction/f5939466-54c6-11eb-8ca4-fb307da5438d + - "1924172146344629188" + url: https://api.datadoghq.com/api/v1/slo/correction/15ee0bfc-55c5-11eb-8d04-2b444c282a89 method: PATCH response: - body: '{"data":{"type":"correction","id":"f5939466-54c6-11eb-8ca4-fb307da5438d","attributes":{"slo_id":"b31fd6b4695a59c4bd3dc492dd8b9ceb","start":1610449905,"end":1610453505,"description":"","category":"Other","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}}' + body: '{"data":{"type":"correction","id":"15ee0bfc-55c5-11eb-8d04-2b444c282a89","attributes":{"slo_id":"9a5e03e9ed725ec49aefe21793fc4c9e","start":1610559052,"end":1610562652,"description":"","category":"Other","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}}' headers: Cache-Control: - no-cache @@ -268,11 +270,11 @@ interactions: Content-Type: - application/json Date: - - Tue, 12 Jan 2021 11:11:46 GMT + - Wed, 13 Jan 2021 17:30:53 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:46 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -281,9 +283,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - ks6TYG2WFSBr2qT+ZTFJB8BB7VWuwPmODDq52A4JjLzCAAitR8HQc9JBq+LHjJu4 + - 2yLQyeuXdHKf2qhVlcnhVSRUgzA6Krta0LEltrGESIMHoX7HWgb/dSrVA+a76Sm3 X-Dd-Version: - - "35.3684804" + - "35.3696274" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -291,9 +293,9 @@ interactions: X-Ratelimit-Period: - "60" X-Ratelimit-Remaining: - - "11998" + - "11999" X-Ratelimit-Reset: - - "14" + - "7" status: 200 OK code: 200 duration: "" @@ -306,14 +308,14 @@ interactions: Dd-Operation-Id: - DeleteSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) X-Datadog-Parent-Id: - - "3518776256192407746" + - "7254192013327308601" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "3053573243754102975" - url: https://api.datadoghq.com/api/v1/slo/correction/f5939466-54c6-11eb-8ca4-fb307da5438d + - "1924172146344629188" + url: https://api.datadoghq.com/api/v1/slo/correction/15ee0bfc-55c5-11eb-8d04-2b444c282a89 method: DELETE response: body: "" @@ -327,20 +329,20 @@ interactions: Content-Type: - application/json Date: - - Tue, 12 Jan 2021 11:11:47 GMT + - Wed, 13 Jan 2021 17:30:53 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:47 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - LuHK+OcIuxuCTL7xVM4sMdR/Gv1H1hu+bgYJvWIAWOVtmiGVhdUVKBuef1C5aMk6 + - 2yLQyeuXdHKf2qhVlcnhVSRUgzA6Krta0LEltrGESIMHoX7HWgb/dSrVA+a76Sm3 X-Dd-Version: - - "35.3684804" + - "35.3696274" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -348,9 +350,9 @@ interactions: X-Ratelimit-Period: - "60" X-Ratelimit-Remaining: - - "11997" + - "11999" X-Ratelimit-Reset: - - "13" + - "7" status: 204 No Content code: 204 duration: "" @@ -363,17 +365,17 @@ interactions: Dd-Operation-Id: - DeleteSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) X-Datadog-Parent-Id: - - "95103953129192437546" + - "1599456528925834623" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "3053573243754102975" - url: https://api.datadoghq.com/api/v1/slo/correction/f5939466-54c6-11eb-8ca4-fb307da5438d + - "1924172146344629188" + url: https://api.datadoghq.com/api/v1/slo/correction/15ee0bfc-55c5-11eb-8d04-2b444c282a89 method: DELETE response: - body: '{"errors": ["slo correction public id f5939466-54c6-11eb-8ca4-fb307da5438d + body: '{"errors": ["slo correction public id 15ee0bfc-55c5-11eb-8d04-2b444c282a89 not found"]}' headers: Cache-Control: @@ -383,7 +385,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 12 Jan 2021 11:11:47 GMT + - Wed, 13 Jan 2021 17:30:53 GMT Pragma: - no-cache Strict-Transport-Security: @@ -393,7 +395,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Version: - - "35.3684804" + - "35.3696362" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -401,9 +403,9 @@ interactions: X-Ratelimit-Period: - "60" X-Ratelimit-Remaining: - - "11996" + - "11998" X-Ratelimit-Reset: - - "13" + - "7" status: 404 Not Found code: 404 duration: "" @@ -416,17 +418,17 @@ interactions: Dd-Operation-Id: - DeleteSLO User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.3; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) X-Datadog-Parent-Id: - - "1233373855551692306" + - "5410977302200710262" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "3053573243754102975" - url: https://api.datadoghq.com/api/v1/slo/b31fd6b4695a59c4bd3dc492dd8b9ceb + - "1924172146344629188" + url: https://api.datadoghq.com/api/v1/slo/9a5e03e9ed725ec49aefe21793fc4c9e method: DELETE response: - body: '{"data":["b31fd6b4695a59c4bd3dc492dd8b9ceb"],"error":null}' + body: '{"data":["9a5e03e9ed725ec49aefe21793fc4c9e"],"error":null}' headers: Cache-Control: - no-cache @@ -435,11 +437,11 @@ interactions: Content-Type: - application/json Date: - - Tue, 12 Jan 2021 11:11:47 GMT + - Wed, 13 Jan 2021 17:30:53 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-Jan-2021 11:11:47 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -448,9 +450,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - V26KHlc/RfdWahgILvghYzp00rgLN6YCNAgg+V0KrlqUWK5TouaimNqGpGYzd/eX + - UYUatcf3IdBEK3ui4JFBsiRpfETkEcKU5oMVtUXXipuDCcAKJWzH92TLEnrmDoLr X-Dd-Version: - - "35.3684804" + - "35.3696362" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -458,9 +460,9 @@ interactions: X-Ratelimit-Period: - "60" X-Ratelimit-Remaining: - - "11998" + - "11999" X-Ratelimit-Reset: - - "13" + - "7" status: 200 OK code: 200 duration: "" From a2905797e534155b400a8299c154d802284e9157 Mon Sep 17 00:00:00 2001 From: Nicholas Muesch Date: Wed, 13 Jan 2021 14:46:06 -0500 Subject: [PATCH 7/8] Update cassette --- .../TestSLOCorrectionsLifecycle.freeze | 2 +- .../TestSLOCorrectionsLifecycle.yaml | 165 +++++++++--------- 2 files changed, 86 insertions(+), 81 deletions(-) diff --git a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze index 98a5a116ec1..3272baf8d2e 100644 --- a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze +++ b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.freeze @@ -1 +1 @@ -2021-01-13T12:30:52.462007-05:00 +2021-01-13T14:43:36.236675-05:00 \ No newline at end of file diff --git a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml index 583b061a8cb..555549e7470 100644 --- a/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml +++ b/tests/api/v1/datadog/cassettes/TestSLOCorrectionsLifecycle.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"description":"Make sure we don't have too many failed HTTP responses.","name":"go-TestSLOCorrectionsLifecycle-local-1610559052","query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"tags":["app:httpd"],"thresholds":[{"target":95,"timeframe":"7d","warning":98}],"type":"metric"} + {"description":"Make sure we don't have too many failed HTTP responses.","name":"go-TestSLOCorrectionsLifecycle-local-1610567016","query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"tags":["app:httpd"],"thresholds":[{"target":95,"timeframe":"7d","warning":98}],"type":"metric"} form: {} headers: Accept: @@ -13,18 +13,19 @@ interactions: Dd-Operation-Id: - CreateSLO User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "1532261451180532963" + - "4105212389770911864" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "1924172146344629188" + - "6686444202667467869" url: https://api.datadoghq.com/api/v1/slo method: POST response: body: '{"data":[{"description":"Make sure we don''t have too many failed HTTP - responses.","monitor_tags":[],"creator":{"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"thresholds":[{"warning":98.0,"warning_display":"98.","target":95.0,"target_display":"95.","timeframe":"7d"}],"type_id":1,"query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"id":"9a5e03e9ed725ec49aefe21793fc4c9e","name":"go-TestSLOCorrectionsLifecycle-local-1610559052","created_at":1610559052,"tags":["app:httpd"],"modified_at":1610559052,"type":"metric"}],"error":null}' + responses.","monitor_tags":[],"creator":{"handle":"nicholas.muesch@datadoghq.com","name":"Nicholas + Muesch","email":"nicholas.muesch@datadoghq.com"},"thresholds":[{"warning":98.0,"warning_display":"98.","target":95.0,"target_display":"95.","timeframe":"7d"}],"type_id":1,"query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"id":"6d06568e2751594da3c2edab0f10440c","name":"go-TestSLOCorrectionsLifecycle-local-1610567016","created_at":1610567016,"tags":["app:httpd"],"modified_at":1610567016,"type":"metric"}],"error":null}' headers: Cache-Control: - no-cache @@ -33,11 +34,11 @@ interactions: Content-Type: - application/json Date: - - Wed, 13 Jan 2021 17:30:52 GMT + - Wed, 13 Jan 2021 19:43:36 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:52 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 19:43:36 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -46,9 +47,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - LeIXOZ//FAgX4PAg4j6Bsh31EU8EFOlq+rcBJ6/UKozJVG3ekjClEE/+uYnXssRC + - hw3ZauSSamfHLo55DFwif1/mO6RiYSc0/libBchlIMnyWX9rK7JgS3Pek5rkz683 X-Dd-Version: - - "35.3696274" + - "35.3697436" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -58,13 +59,13 @@ interactions: X-Ratelimit-Remaining: - "499" X-Ratelimit-Reset: - - "8" + - "24" status: 200 OK code: 200 duration: "" - request: body: | - {"data":{"attributes":{"category":"Scheduled Maintenance","end":1610562652,"slo_id":"9a5e03e9ed725ec49aefe21793fc4c9e","start":1610559052,"timezone":"UTC"},"type":"correction"}} + {"data":{"attributes":{"category":"Scheduled Maintenance","end":1610570616,"slo_id":"6d06568e2751594da3c2edab0f10440c","start":1610567016,"timezone":"UTC"},"type":"correction"}} form: {} headers: Accept: @@ -74,18 +75,19 @@ interactions: Dd-Operation-Id: - CreateSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "2652527730898852949" + - "2931147189663512358" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "1924172146344629188" + - "6686444202667467869" url: https://api.datadoghq.com/api/v1/slo/correction method: POST response: - body: '{"data":{"type":"correction","id":"15ee0bfc-55c5-11eb-8d04-2b444c282a89","attributes":{"slo_id":"9a5e03e9ed725ec49aefe21793fc4c9e","start":1610559052,"end":1610562652,"description":"","category":"Scheduled - Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}}' + body: '{"data":{"type":"correction","id":"a0a9c170-55d7-11eb-8d09-970ec88c244c","attributes":{"slo_id":"6d06568e2751594da3c2edab0f10440c","start":1610567016,"end":1610570616,"description":"","category":"Scheduled + Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"35c75c20-eba0-11e9-a77a-db716d075be2","attributes":{"uuid":"35c75c20-eba0-11e9-a77a-db716d075be2","handle":"nicholas.muesch@datadoghq.com","email":"nicholas.muesch@datadoghq.com","name":"Nicholas + Muesch","icon":"https://secure.gravatar.com/avatar/15c4bba0a667b539709259ef25dfa950?s=48&d=retro"}}}}}}' headers: Cache-Control: - no-cache @@ -94,11 +96,11 @@ interactions: Content-Type: - application/json Date: - - Wed, 13 Jan 2021 17:30:53 GMT + - Wed, 13 Jan 2021 19:43:36 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:52 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 19:43:36 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -107,9 +109,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - +TTazL1HF8qoxYARkG/60PGoq8sbkYkmqeurNry46zV0aHqBZfUrKqxtiyo42NRf + - /waQ67o9EXsAiQILmFHWOTHDJ6E+x7ROC0G8iNmC+2lV58E3PSGYbXj1H62A/c+u X-Dd-Version: - - "35.3696274" + - "35.3697436" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -119,7 +121,7 @@ interactions: X-Ratelimit-Remaining: - "11999" X-Ratelimit-Reset: - - "8" + - "24" status: 200 OK code: 200 duration: "" @@ -132,18 +134,19 @@ interactions: Dd-Operation-Id: - ListSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "1852987965397837934" + - "3035909085476250578" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "1924172146344629188" + - "6686444202667467869" url: https://api.datadoghq.com/api/v1/slo/correction method: GET response: - body: '{"data":[{"type":"correction","id":"15ee0bfc-55c5-11eb-8d04-2b444c282a89","attributes":{"slo_id":"9a5e03e9ed725ec49aefe21793fc4c9e","start":1610559052,"end":1610562652,"description":"","category":"Scheduled - Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}]}' + body: '{"data":[{"type":"correction","id":"a0a9c170-55d7-11eb-8d09-970ec88c244c","attributes":{"slo_id":"6d06568e2751594da3c2edab0f10440c","start":1610567016,"end":1610570616,"description":"","category":"Scheduled + Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"35c75c20-eba0-11e9-a77a-db716d075be2","attributes":{"uuid":"35c75c20-eba0-11e9-a77a-db716d075be2","handle":"nicholas.muesch@datadoghq.com","email":"nicholas.muesch@datadoghq.com","name":"Nicholas + Muesch","icon":"https://secure.gravatar.com/avatar/15c4bba0a667b539709259ef25dfa950?s=48&d=retro"}}}}}]}' headers: Cache-Control: - no-cache @@ -152,11 +155,11 @@ interactions: Content-Type: - application/json Date: - - Wed, 13 Jan 2021 17:30:53 GMT + - Wed, 13 Jan 2021 19:43:36 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:53 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 19:43:36 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -165,9 +168,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - Y9+v2iJC/5twluKZH+Abk+sCd7+zW2qB+wWhdwPtTfzsXiAGXu1np/KJsw5b93OQ + - RKpd63U5fOB9KQENZW/9vNmGmUgGzAVI24Vei0avdDhXQLPqbS5iSkbtN5YHNt1I X-Dd-Version: - - "35.3696362" + - "35.3697436" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -177,7 +180,7 @@ interactions: X-Ratelimit-Remaining: - "11999" X-Ratelimit-Reset: - - "7" + - "24" status: 200 OK code: 200 duration: "" @@ -190,18 +193,19 @@ interactions: Dd-Operation-Id: - GetSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "869560918241671499" + - "8884843314249828893" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "1924172146344629188" - url: https://api.datadoghq.com/api/v1/slo/correction/15ee0bfc-55c5-11eb-8d04-2b444c282a89 + - "6686444202667467869" + url: https://api.datadoghq.com/api/v1/slo/correction/a0a9c170-55d7-11eb-8d09-970ec88c244c method: GET response: - body: '{"data":{"type":"correction","id":"15ee0bfc-55c5-11eb-8d04-2b444c282a89","attributes":{"slo_id":"9a5e03e9ed725ec49aefe21793fc4c9e","start":1610559052,"end":1610562652,"description":"","category":"Scheduled - Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}}' + body: '{"data":{"type":"correction","id":"a0a9c170-55d7-11eb-8d09-970ec88c244c","attributes":{"slo_id":"6d06568e2751594da3c2edab0f10440c","start":1610567016,"end":1610570616,"description":"","category":"Scheduled + Maintenance","timezone":"UTC","creator":{"data":{"type":"users","id":"35c75c20-eba0-11e9-a77a-db716d075be2","attributes":{"uuid":"35c75c20-eba0-11e9-a77a-db716d075be2","handle":"nicholas.muesch@datadoghq.com","email":"nicholas.muesch@datadoghq.com","name":"Nicholas + Muesch","icon":"https://secure.gravatar.com/avatar/15c4bba0a667b539709259ef25dfa950?s=48&d=retro"}}}}}}' headers: Cache-Control: - no-cache @@ -210,11 +214,11 @@ interactions: Content-Type: - application/json Date: - - Wed, 13 Jan 2021 17:30:53 GMT + - Wed, 13 Jan 2021 19:43:36 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:53 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 19:43:36 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -223,9 +227,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - cTGY5ulPxaRmdZr4S1APOMLAfMePPA3fkzzqqKyRFf/m5ql3XuUZsd87RDo7B7RR + - h6yqPaHNwx3ZGZPMs75pO93HC01YoL8B6e/Fb89zqQCmU57u6KTAhksrYQV/dzkY X-Dd-Version: - - "35.3696274" + - "35.3697436" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -235,13 +239,13 @@ interactions: X-Ratelimit-Remaining: - "11999" X-Ratelimit-Reset: - - "7" + - "24" status: 200 OK code: 200 duration: "" - request: body: | - {"data":{"attributes":{"category":"Other","end":1610562652,"start":1610559052,"timezone":"UTC"},"type":"correction"}} + {"data":{"attributes":{"category":"Other","end":1610570616,"start":1610567016,"timezone":"UTC"},"type":"correction"}} form: {} headers: Accept: @@ -251,17 +255,18 @@ interactions: Dd-Operation-Id: - UpdateSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "4933935623803976864" + - "7476580350511876103" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "1924172146344629188" - url: https://api.datadoghq.com/api/v1/slo/correction/15ee0bfc-55c5-11eb-8d04-2b444c282a89 + - "6686444202667467869" + url: https://api.datadoghq.com/api/v1/slo/correction/a0a9c170-55d7-11eb-8d09-970ec88c244c method: PATCH response: - body: '{"data":{"type":"correction","id":"15ee0bfc-55c5-11eb-8d04-2b444c282a89","attributes":{"slo_id":"9a5e03e9ed725ec49aefe21793fc4c9e","start":1610559052,"end":1610562652,"description":"","category":"Other","timezone":"UTC","creator":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}}}}}' + body: '{"data":{"type":"correction","id":"a0a9c170-55d7-11eb-8d09-970ec88c244c","attributes":{"slo_id":"6d06568e2751594da3c2edab0f10440c","start":1610567016,"end":1610570616,"description":"","category":"Other","timezone":"UTC","creator":{"data":{"type":"users","id":"35c75c20-eba0-11e9-a77a-db716d075be2","attributes":{"uuid":"35c75c20-eba0-11e9-a77a-db716d075be2","handle":"nicholas.muesch@datadoghq.com","email":"nicholas.muesch@datadoghq.com","name":"Nicholas + Muesch","icon":"https://secure.gravatar.com/avatar/15c4bba0a667b539709259ef25dfa950?s=48&d=retro"}}}}}}' headers: Cache-Control: - no-cache @@ -270,11 +275,11 @@ interactions: Content-Type: - application/json Date: - - Wed, 13 Jan 2021 17:30:53 GMT + - Wed, 13 Jan 2021 19:43:37 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:53 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 19:43:36 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -283,9 +288,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - 2yLQyeuXdHKf2qhVlcnhVSRUgzA6Krta0LEltrGESIMHoX7HWgb/dSrVA+a76Sm3 + - nHGjqTbGmPRJGWoHEDsaMxmZCicxo5Y/AObJEW+YW63Ub16t9U+JqCkAyvEnf+xI X-Dd-Version: - - "35.3696274" + - "35.3697436" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -295,7 +300,7 @@ interactions: X-Ratelimit-Remaining: - "11999" X-Ratelimit-Reset: - - "7" + - "23" status: 200 OK code: 200 duration: "" @@ -308,14 +313,14 @@ interactions: Dd-Operation-Id: - DeleteSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "7254192013327308601" + - "3514740601638974404" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "1924172146344629188" - url: https://api.datadoghq.com/api/v1/slo/correction/15ee0bfc-55c5-11eb-8d04-2b444c282a89 + - "6686444202667467869" + url: https://api.datadoghq.com/api/v1/slo/correction/a0a9c170-55d7-11eb-8d09-970ec88c244c method: DELETE response: body: "" @@ -329,20 +334,20 @@ interactions: Content-Type: - application/json Date: - - Wed, 13 Jan 2021 17:30:53 GMT + - Wed, 13 Jan 2021 19:43:37 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:53 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 19:43:37 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - 2yLQyeuXdHKf2qhVlcnhVSRUgzA6Krta0LEltrGESIMHoX7HWgb/dSrVA+a76Sm3 + - bCBSaf0t3cWhIJuGOGz9PtbBY7MrMPu1HpZVAposegdxNlFMe/qHi/UbtNAIVmzS X-Dd-Version: - - "35.3696274" + - "35.3697436" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -352,7 +357,7 @@ interactions: X-Ratelimit-Remaining: - "11999" X-Ratelimit-Reset: - - "7" + - "23" status: 204 No Content code: 204 duration: "" @@ -365,17 +370,17 @@ interactions: Dd-Operation-Id: - DeleteSLOCorrection User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "1599456528925834623" + - "3745323702347970856" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "1924172146344629188" - url: https://api.datadoghq.com/api/v1/slo/correction/15ee0bfc-55c5-11eb-8d04-2b444c282a89 + - "6686444202667467869" + url: https://api.datadoghq.com/api/v1/slo/correction/a0a9c170-55d7-11eb-8d09-970ec88c244c method: DELETE response: - body: '{"errors": ["slo correction public id 15ee0bfc-55c5-11eb-8d04-2b444c282a89 + body: '{"errors": ["slo correction public id a0a9c170-55d7-11eb-8d09-970ec88c244c not found"]}' headers: Cache-Control: @@ -385,7 +390,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 13 Jan 2021 17:30:53 GMT + - Wed, 13 Jan 2021 19:43:37 GMT Pragma: - no-cache Strict-Transport-Security: @@ -395,7 +400,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Version: - - "35.3696362" + - "35.3697436" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -405,7 +410,7 @@ interactions: X-Ratelimit-Remaining: - "11998" X-Ratelimit-Reset: - - "7" + - "23" status: 404 Not Found code: 404 duration: "" @@ -418,17 +423,17 @@ interactions: Dd-Operation-Id: - DeleteSLO User-Agent: - - datadog-api-client-go/1.0.0-beta.14+dev (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.14+dev (go go1.15.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "5410977302200710262" + - "3592166501335017179" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "1924172146344629188" - url: https://api.datadoghq.com/api/v1/slo/9a5e03e9ed725ec49aefe21793fc4c9e + - "6686444202667467869" + url: https://api.datadoghq.com/api/v1/slo/6d06568e2751594da3c2edab0f10440c method: DELETE response: - body: '{"data":["9a5e03e9ed725ec49aefe21793fc4c9e"],"error":null}' + body: '{"data":["6d06568e2751594da3c2edab0f10440c"],"error":null}' headers: Cache-Control: - no-cache @@ -437,11 +442,11 @@ interactions: Content-Type: - application/json Date: - - Wed, 13 Jan 2021 17:30:53 GMT + - Wed, 13 Jan 2021 19:43:37 GMT Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 17:30:53 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Wed, 20-Jan-2021 19:43:37 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -450,9 +455,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - UYUatcf3IdBEK3ui4JFBsiRpfETkEcKU5oMVtUXXipuDCcAKJWzH92TLEnrmDoLr + - x0lXQI7rzyICHjQ6egBdIXvv6oH1uc+zPjPKGBnD3VLYo8imKB14VpRl9Uf7xZN/ X-Dd-Version: - - "35.3696362" + - "35.3697436" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -462,7 +467,7 @@ interactions: X-Ratelimit-Remaining: - "11999" X-Ratelimit-Reset: - - "7" + - "23" status: 200 OK code: 200 duration: "" From ba4f0d73fa5c134ad4ec19ad8c9e767be1b2a340 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 13 Jan 2021 20:15:57 +0000 Subject: [PATCH 8/8] Regenerate client from commit fe2e0b5 of spec repo --- .apigentools-info | 8 +- api/v1/datadog/.openapi-generator/FILES | 26 + api/v1/datadog/README.md | 17 + api/v1/datadog/api/openapi.yaml | 509 +++++++++++ ...api_service_level_objective_corrections.go | 809 ++++++++++++++++++ api/v1/datadog/client.go | 3 + api/v1/datadog/docs/SLOCorrectionCategory.md | 17 + .../docs/SLOCorrectionCreateRequest.md | 56 ++ .../SLOCorrectionCreateRequestAttributes.md | 161 ++++ .../docs/SLOCorrectionCreateRequestData.md | 82 ++ .../datadog/docs/SLOCorrectionListResponse.md | 56 ++ .../docs/SLOCorrectionListResponseData.md | 108 +++ api/v1/datadog/docs/SLOCorrectionResponse.md | 56 ++ .../docs/SLOCorrectionResponseAttributes.md | 212 +++++ .../datadog/docs/SLOCorrectionResponseData.md | 108 +++ .../docs/SLOCorrectionUpdateRequest.md | 56 ++ .../SLOCorrectionUpdateRequestAttributes.md | 140 +++ .../docs/SLOCorrectionUpdateRequestData.md | 82 ++ .../ServiceLevelObjectiveCorrectionsApi.md | 428 +++++++++ .../datadog/model_slo_correction_category.go | 111 +++ .../model_slo_correction_create_request.go | 111 +++ ...lo_correction_create_request_attributes.go | 261 ++++++ ...odel_slo_correction_create_request_data.go | 152 ++++ .../model_slo_correction_list_response.go | 112 +++ ...model_slo_correction_list_response_data.go | 189 ++++ .../datadog/model_slo_correction_response.go | 111 +++ ...odel_slo_correction_response_attributes.go | 332 +++++++ .../model_slo_correction_response_data.go | 185 ++++ .../model_slo_correction_update_request.go | 111 +++ ...lo_correction_update_request_attributes.go | 231 +++++ ...odel_slo_correction_update_request_data.go | 152 ++++ tests/api/v1/datadog/features/given.json | 15 +- ...ervice_level_objective_corrections.feature | 84 ++ tests/api/v1/datadog/features/undo.json | 37 + 34 files changed, 5123 insertions(+), 5 deletions(-) create mode 100644 api/v1/datadog/api_service_level_objective_corrections.go create mode 100644 api/v1/datadog/docs/SLOCorrectionCategory.md create mode 100644 api/v1/datadog/docs/SLOCorrectionCreateRequest.md create mode 100644 api/v1/datadog/docs/SLOCorrectionCreateRequestAttributes.md create mode 100644 api/v1/datadog/docs/SLOCorrectionCreateRequestData.md create mode 100644 api/v1/datadog/docs/SLOCorrectionListResponse.md create mode 100644 api/v1/datadog/docs/SLOCorrectionListResponseData.md create mode 100644 api/v1/datadog/docs/SLOCorrectionResponse.md create mode 100644 api/v1/datadog/docs/SLOCorrectionResponseAttributes.md create mode 100644 api/v1/datadog/docs/SLOCorrectionResponseData.md create mode 100644 api/v1/datadog/docs/SLOCorrectionUpdateRequest.md create mode 100644 api/v1/datadog/docs/SLOCorrectionUpdateRequestAttributes.md create mode 100644 api/v1/datadog/docs/SLOCorrectionUpdateRequestData.md create mode 100644 api/v1/datadog/docs/ServiceLevelObjectiveCorrectionsApi.md create mode 100644 api/v1/datadog/model_slo_correction_category.go create mode 100644 api/v1/datadog/model_slo_correction_create_request.go create mode 100644 api/v1/datadog/model_slo_correction_create_request_attributes.go create mode 100644 api/v1/datadog/model_slo_correction_create_request_data.go create mode 100644 api/v1/datadog/model_slo_correction_list_response.go create mode 100644 api/v1/datadog/model_slo_correction_list_response_data.go create mode 100644 api/v1/datadog/model_slo_correction_response.go create mode 100644 api/v1/datadog/model_slo_correction_response_attributes.go create mode 100644 api/v1/datadog/model_slo_correction_response_data.go create mode 100644 api/v1/datadog/model_slo_correction_update_request.go create mode 100644 api/v1/datadog/model_slo_correction_update_request_attributes.go create mode 100644 api/v1/datadog/model_slo_correction_update_request_data.go create mode 100644 tests/api/v1/datadog/features/service_level_objective_corrections.feature diff --git a/.apigentools-info b/.apigentools-info index 0f2bf8e0a74..b8a78222bec 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-01-13 15:26:40.504258", - "spec_repo_commit": "426d7a0" + "regenerated": "2021-01-13 20:15:49.147699", + "spec_repo_commit": "fe2e0b5" }, "v2": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-01-13 15:26:46.218881", - "spec_repo_commit": "426d7a0" + "regenerated": "2021-01-13 20:15:56.218436", + "spec_repo_commit": "fe2e0b5" } } } \ No newline at end of file diff --git a/api/v1/datadog/.openapi-generator/FILES b/api/v1/datadog/.openapi-generator/FILES index c15495a260c..9f8270283ca 100644 --- a/api/v1/datadog/.openapi-generator/FILES +++ b/api/v1/datadog/.openapi-generator/FILES @@ -22,6 +22,7 @@ api_metrics.go api_monitors.go api_organizations.go api_pager_duty_integration.go +api_service_level_objective_corrections.go api_service_level_objectives.go api_snapshots.go api_synthetics.go @@ -258,6 +259,18 @@ docs/QueryValueWidgetRequest.md docs/SLOBulkDeleteResponse.md docs/SLOBulkDeleteResponseData.md docs/SLOBulkDeleteResponseErrors.md +docs/SLOCorrectionCategory.md +docs/SLOCorrectionCreateRequest.md +docs/SLOCorrectionCreateRequestAttributes.md +docs/SLOCorrectionCreateRequestData.md +docs/SLOCorrectionListResponse.md +docs/SLOCorrectionListResponseData.md +docs/SLOCorrectionResponse.md +docs/SLOCorrectionResponseAttributes.md +docs/SLOCorrectionResponseData.md +docs/SLOCorrectionUpdateRequest.md +docs/SLOCorrectionUpdateRequestAttributes.md +docs/SLOCorrectionUpdateRequestData.md docs/SLODeleteResponse.md docs/SLOErrorTimeframe.md docs/SLOHistoryMetrics.md @@ -280,6 +293,7 @@ docs/ScatterPlotWidgetDefinition.md docs/ScatterPlotWidgetDefinitionRequests.md docs/ScatterPlotWidgetDefinitionType.md docs/ServiceLevelObjective.md +docs/ServiceLevelObjectiveCorrectionsApi.md docs/ServiceLevelObjectiveQuery.md docs/ServiceLevelObjectiveRequest.md docs/ServiceLevelObjectivesApi.md @@ -725,6 +739,18 @@ model_service_summary_widget_definition_type.go model_slo_bulk_delete_response.go model_slo_bulk_delete_response_data.go model_slo_bulk_delete_response_errors.go +model_slo_correction_category.go +model_slo_correction_create_request.go +model_slo_correction_create_request_attributes.go +model_slo_correction_create_request_data.go +model_slo_correction_list_response.go +model_slo_correction_list_response_data.go +model_slo_correction_response.go +model_slo_correction_response_attributes.go +model_slo_correction_response_data.go +model_slo_correction_update_request.go +model_slo_correction_update_request_attributes.go +model_slo_correction_update_request_data.go model_slo_delete_response.go model_slo_error_timeframe.go model_slo_history_metrics.go diff --git a/api/v1/datadog/README.md b/api/v1/datadog/README.md index c151d2d01cd..af1564ce1a6 100644 --- a/api/v1/datadog/README.md +++ b/api/v1/datadog/README.md @@ -172,6 +172,11 @@ Class | Method | HTTP request | Description *PagerDutyIntegrationApi* | [**DeletePagerDutyIntegrationService**](docs/PagerDutyIntegrationApi.md#deletepagerdutyintegrationservice) | **Delete** /api/v1/integration/pagerduty/configuration/services/{service_name} | Delete a single service object *PagerDutyIntegrationApi* | [**GetPagerDutyIntegrationService**](docs/PagerDutyIntegrationApi.md#getpagerdutyintegrationservice) | **Get** /api/v1/integration/pagerduty/configuration/services/{service_name} | Get a single service object *PagerDutyIntegrationApi* | [**UpdatePagerDutyIntegrationService**](docs/PagerDutyIntegrationApi.md#updatepagerdutyintegrationservice) | **Put** /api/v1/integration/pagerduty/configuration/services/{service_name} | Update a single service object +*ServiceLevelObjectiveCorrectionsApi* | [**CreateSLOCorrection**](docs/ServiceLevelObjectiveCorrectionsApi.md#createslocorrection) | **Post** /api/v1/slo/correction | Create an SLO correction +*ServiceLevelObjectiveCorrectionsApi* | [**DeleteSLOCorrection**](docs/ServiceLevelObjectiveCorrectionsApi.md#deleteslocorrection) | **Delete** /api/v1/slo/correction/{slo_correction_id} | Delete an SLO Correction +*ServiceLevelObjectiveCorrectionsApi* | [**GetSLOCorrection**](docs/ServiceLevelObjectiveCorrectionsApi.md#getslocorrection) | **Get** /api/v1/slo/correction/{slo_correction_id} | Get an SLO correction for an SLO +*ServiceLevelObjectiveCorrectionsApi* | [**ListSLOCorrection**](docs/ServiceLevelObjectiveCorrectionsApi.md#listslocorrection) | **Get** /api/v1/slo/correction | Get all SLO corrections +*ServiceLevelObjectiveCorrectionsApi* | [**UpdateSLOCorrection**](docs/ServiceLevelObjectiveCorrectionsApi.md#updateslocorrection) | **Patch** /api/v1/slo/correction/{slo_correction_id} | Update an SLO Correction *ServiceLevelObjectivesApi* | [**CheckCanDeleteSLO**](docs/ServiceLevelObjectivesApi.md#checkcandeleteslo) | **Get** /api/v1/slo/can_delete | Check if SLOs can be safely deleted *ServiceLevelObjectivesApi* | [**CreateSLO**](docs/ServiceLevelObjectivesApi.md#createslo) | **Post** /api/v1/slo | Create a SLO object *ServiceLevelObjectivesApi* | [**DeleteSLO**](docs/ServiceLevelObjectivesApi.md#deleteslo) | **Delete** /api/v1/slo/{slo_id} | Delete a SLO @@ -453,6 +458,18 @@ Class | Method | HTTP request | Description - [SLOBulkDeleteResponse](docs/SLOBulkDeleteResponse.md) - [SLOBulkDeleteResponseData](docs/SLOBulkDeleteResponseData.md) - [SLOBulkDeleteResponseErrors](docs/SLOBulkDeleteResponseErrors.md) + - [SLOCorrectionCategory](docs/SLOCorrectionCategory.md) + - [SLOCorrectionCreateRequest](docs/SLOCorrectionCreateRequest.md) + - [SLOCorrectionCreateRequestAttributes](docs/SLOCorrectionCreateRequestAttributes.md) + - [SLOCorrectionCreateRequestData](docs/SLOCorrectionCreateRequestData.md) + - [SLOCorrectionListResponse](docs/SLOCorrectionListResponse.md) + - [SLOCorrectionListResponseData](docs/SLOCorrectionListResponseData.md) + - [SLOCorrectionResponse](docs/SLOCorrectionResponse.md) + - [SLOCorrectionResponseAttributes](docs/SLOCorrectionResponseAttributes.md) + - [SLOCorrectionResponseData](docs/SLOCorrectionResponseData.md) + - [SLOCorrectionUpdateRequest](docs/SLOCorrectionUpdateRequest.md) + - [SLOCorrectionUpdateRequestAttributes](docs/SLOCorrectionUpdateRequestAttributes.md) + - [SLOCorrectionUpdateRequestData](docs/SLOCorrectionUpdateRequestData.md) - [SLODeleteResponse](docs/SLODeleteResponse.md) - [SLOErrorTimeframe](docs/SLOErrorTimeframe.md) - [SLOHistoryMetrics](docs/SLOHistoryMetrics.md) diff --git a/api/v1/datadog/api/openapi.yaml b/api/v1/datadog/api/openapi.yaml index 9ecedb2cef3..c23a5eb94a0 100644 --- a/api/v1/datadog/api/openapi.yaml +++ b/api/v1/datadog/api/openapi.yaml @@ -180,6 +180,12 @@ tags: externalDocs: url: https://docs.datadoghq.com/api/?lang=bash#integration-pagerduty name: PagerDuty Integration +- description: |- + SLO Status Corrections allow you to prevent specific time periods from negatively impacting + your SLO’s status and error budget. You can use Status Corrections for various purposes, such + as removing planned maintenance windows, non-business hours, or other time periods that do + not correspond to genuine issues. + name: Service Level Objective Corrections - description: |- [Service Level Objectives](https://docs.datadoghq.com/monitors/service_level_objectives/#configuration) (or SLOs) are a key part of the site reliability engineering toolkit. @@ -4742,6 +4748,206 @@ paths: - Service Level Objectives x-undo: type: safe + /api/v1/slo/correction: + get: + description: Get all Service Level Objective Corrections + operationId: ListSLOCorrection + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SLOCorrectionListResponse' + description: OK + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Get all SLO corrections + tags: + - Service Level Objective Corrections + x-undo: + type: safe + post: + description: Create an SLO Correction + operationId: CreateSLOCorrection + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SLOCorrectionCreateRequest' + description: Create an SLO Correction + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SLOCorrectionResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Create an SLO correction + tags: + - Service Level Objective Corrections + x-codegen-request-body-name: body + x-given: + correction: + parameters: + - name: body + value: |- + { + "data": { + "id": "1", + "attributes": { + "slo_id": "{{ unique }}", + "start": 1610034200, + "end": 1610034300, + "category": "Other", + "timezone": "UTC", + "description": "Test Correction" + }, + "type": "correction" + } + } + step: there is a valid "correction" in the system + x-undo: + operationId: DeleteSLOCorrection + parameters: + - name: slo_correction_id + source: data.id + type: unsafe + /api/v1/slo/correction/{slo_correction_id}: + delete: + description: Permanently delete the specified SLO Correction object + operationId: DeleteSLOCorrection + parameters: + - description: The ID of the SLO correction object + explode: false + in: path + name: slo_correction_id + required: true + schema: + type: string + style: simple + responses: + "204": + description: OK + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Delete an SLO Correction + tags: + - Service Level Objective Corrections + x-undo: + type: idempotent + get: + description: Get an SLO Correction + operationId: GetSLOCorrection + parameters: + - description: The ID of the SLO correction object + explode: false + in: path + name: slo_correction_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SLOCorrectionResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Get an SLO correction for an SLO + tags: + - Service Level Objective Corrections + x-undo: + type: safe + patch: + description: Update the specified SLO correction object object + operationId: UpdateSLOCorrection + parameters: + - description: The ID of the SLO correction object + explode: false + in: path + name: slo_correction_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SLOCorrectionUpdateRequest' + description: The edited SLO correction object. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SLOCorrectionResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + summary: Update an SLO Correction + tags: + - Service Level Objective Corrections + x-codegen-request-body-name: body + x-undo: + type: idempotent /api/v1/slo/{slo_id}: delete: description: |- @@ -12954,6 +13160,219 @@ components: $ref: '#/components/schemas/SLOBulkDeleteResponse_errors' type: array type: object + SLOCorrectionCategory: + description: Category the SLO correction belongs to + enum: + - Scheduled Maintenance + - Outside Business Hours + - Deployment + - Other + example: Scheduled Maintenance + type: string + x-enum-varnames: + - SCHEDULED_MAINTENANCE + - OUTSIDE_BUSINESS_HOURS + - DEPLOYMENT + - OTHER + SLOCorrectionCreateRequest: + description: An object that defines a correction to be applied to an SLO + example: + data: + attributes: + timezone: UTC + slo_id: sloId + start: 1600000000 + description: description + end: 1600000000 + category: Scheduled Maintenance + type: correction + properties: + data: + $ref: '#/components/schemas/SLOCorrectionCreateRequest_data' + type: object + SLOCorrectionCreateRequestAttributes: + description: The attribute object associated with the SLO correction to be created + example: + timezone: UTC + slo_id: sloId + start: 1600000000 + description: description + end: 1600000000 + category: Scheduled Maintenance + properties: + category: + $ref: '#/components/schemas/SLOCorrectionCategory' + description: + description: Description of the correction being made. + type: string + end: + description: Ending time of the correction in epoch seconds + example: 1600000000 + format: int64 + type: integer + slo_id: + description: ID of the SLO that this correction will be applied to + example: sloId + type: string + start: + description: Starting time of the correction in epoch seconds + example: 1600000000 + format: int64 + type: integer + timezone: + description: Timezone of the timestamps provided + example: UTC + type: string + required: + - category + - end + - slo_id + - start + - timezone + type: object + SLOCorrectionListResponse: + description: A list of SLO correction objects + example: + data: + - attributes: + creator: + name: name + handle: handle + email: email + timezone: timezone + slo_id: slo_id + start: 6 + description: description + end: 0 + category: Scheduled Maintenance + id: id + type: correction + - attributes: + creator: + name: name + handle: handle + email: email + timezone: timezone + slo_id: slo_id + start: 6 + description: description + end: 0 + category: Scheduled Maintenance + id: id + type: correction + properties: + data: + description: The list of of SLO corrections objects + items: + $ref: '#/components/schemas/SLOCorrectionListResponse_data' + type: array + type: object + SLOCorrectionResponse: + description: The response object of an SLO correction + example: + data: + attributes: + creator: + name: name + handle: handle + email: email + timezone: timezone + slo_id: slo_id + start: 6 + description: description + end: 0 + category: Scheduled Maintenance + id: id + type: type + properties: + data: + $ref: '#/components/schemas/SLOCorrectionResponse_data' + type: object + SLOCorrectionResponseAttributes: + description: The attribute object associated with the SLO correction + example: + creator: + name: name + handle: handle + email: email + timezone: timezone + slo_id: slo_id + start: 6 + description: description + end: 0 + category: Scheduled Maintenance + properties: + category: + $ref: '#/components/schemas/SLOCorrectionCategory' + creator: + $ref: '#/components/schemas/Creator' + description: + description: Description of the correction being made. + type: string + end: + description: Ending time of the correction in epoch seconds + format: int64 + type: integer + slo_id: + description: ID of the SLO that this correction will be applied to + type: string + start: + description: Starting time of the correction in epoch seconds + format: int64 + type: integer + timezone: + description: Timezone of the timestamps provided + type: string + type: object + SLOCorrectionUpdateRequest: + description: An object that defines a correction to be applied to an SLO + example: + data: + attributes: + timezone: UTC + start: 1600000000 + description: description + end: 1600000000 + category: Scheduled Maintenance + type: correction + properties: + data: + $ref: '#/components/schemas/SLOCorrectionUpdateRequest_data' + type: object + SLOCorrectionUpdateRequestAttributes: + description: The attribute object associated with the SLO correction to be updated + example: + timezone: UTC + start: 1600000000 + description: description + end: 1600000000 + category: Scheduled Maintenance + properties: + category: + $ref: '#/components/schemas/SLOCorrectionCategory' + description: + description: Description of the correction being made. + type: string + end: + description: Ending time of the correction in epoch seconds + example: 1600000000 + format: int64 + type: integer + start: + description: Starting time of the correction in epoch seconds + example: 1600000000 + format: int64 + type: integer + timezone: + description: Timezone of the timestamps provided + example: UTC + type: string + required: + - category + - end + - start + - timezone + type: object SLODeleteResponse: description: A response list of all service level objective deleted. example: @@ -20997,6 +21416,96 @@ components: - message - timeframe type: object + SLOCorrectionCreateRequest_data: + description: The data object associated with the SLO correction to be created + example: + attributes: + timezone: UTC + slo_id: sloId + start: 1600000000 + description: description + end: 1600000000 + category: Scheduled Maintenance + type: correction + properties: + attributes: + $ref: '#/components/schemas/SLOCorrectionCreateRequestAttributes' + type: + default: correction + description: Should always be set to "correction" + type: string + type: object + SLOCorrectionListResponse_data: + description: The response object of a list of SLO corrections + example: + attributes: + creator: + name: name + handle: handle + email: email + timezone: timezone + slo_id: slo_id + start: 6 + description: description + end: 0 + category: Scheduled Maintenance + id: id + type: correction + properties: + attributes: + $ref: '#/components/schemas/SLOCorrectionResponseAttributes' + id: + description: The ID of the SLO correction + type: string + type: + default: correction + description: Should always be set to "correction" + type: string + type: object + SLOCorrectionResponse_data: + description: The data object associated with the SLO correction + example: + attributes: + creator: + name: name + handle: handle + email: email + timezone: timezone + slo_id: slo_id + start: 6 + description: description + end: 0 + category: Scheduled Maintenance + id: id + type: type + properties: + attributes: + $ref: '#/components/schemas/SLOCorrectionResponseAttributes' + id: + description: The ID of the SLO correction + type: string + type: + description: Should always return "correction" + type: string + type: object + SLOCorrectionUpdateRequest_data: + description: The data object associated with the SLO correction to be updated + example: + attributes: + timezone: UTC + start: 1600000000 + description: description + end: 1600000000 + category: Scheduled Maintenance + type: correction + properties: + attributes: + $ref: '#/components/schemas/SLOCorrectionUpdateRequestAttributes' + type: + default: correction + description: Should always be set to "correction" + type: string + type: object SLOHistoryMetricsSeries_metadata: description: Query metadata. example: {} diff --git a/api/v1/datadog/api_service_level_objective_corrections.go b/api/v1/datadog/api_service_level_objective_corrections.go new file mode 100644 index 00000000000..8d97dc1ab84 --- /dev/null +++ b/api/v1/datadog/api_service_level_objective_corrections.go @@ -0,0 +1,809 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// ServiceLevelObjectiveCorrectionsApiService ServiceLevelObjectiveCorrectionsApi service +type ServiceLevelObjectiveCorrectionsApiService service + +type ApiCreateSLOCorrectionRequest struct { + ctx _context.Context + ApiService *ServiceLevelObjectiveCorrectionsApiService + body *SLOCorrectionCreateRequest +} + +func (r ApiCreateSLOCorrectionRequest) Body(body SLOCorrectionCreateRequest) ApiCreateSLOCorrectionRequest { + r.body = &body + return r +} + +func (r ApiCreateSLOCorrectionRequest) Execute() (SLOCorrectionResponse, *_nethttp.Response, error) { + return r.ApiService.CreateSLOCorrectionExecute(r) +} + +/* + * CreateSLOCorrection Create an SLO correction + * Create an SLO Correction + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCreateSLOCorrectionRequest + */ +func (a *ServiceLevelObjectiveCorrectionsApiService) CreateSLOCorrection(ctx _context.Context) ApiCreateSLOCorrectionRequest { + return ApiCreateSLOCorrectionRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return SLOCorrectionResponse + */ +func (a *ServiceLevelObjectiveCorrectionsApiService) CreateSLOCorrectionExecute(r ApiCreateSLOCorrectionRequest) (SLOCorrectionResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SLOCorrectionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceLevelObjectiveCorrectionsApiService.CreateSLOCorrection") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/slo/correction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + + // Set Operation-ID header for telemetry + localVarHeaderParams["DD-OPERATION-ID"] = "CreateSLOCorrection" + + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v APIErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v APIErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteSLOCorrectionRequest struct { + ctx _context.Context + ApiService *ServiceLevelObjectiveCorrectionsApiService + sloCorrectionId string +} + +func (r ApiDeleteSLOCorrectionRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.DeleteSLOCorrectionExecute(r) +} + +/* + * DeleteSLOCorrection Delete an SLO Correction + * Permanently delete the specified SLO Correction object + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param sloCorrectionId The ID of the SLO correction object + * @return ApiDeleteSLOCorrectionRequest + */ +func (a *ServiceLevelObjectiveCorrectionsApiService) DeleteSLOCorrection(ctx _context.Context, sloCorrectionId string) ApiDeleteSLOCorrectionRequest { + return ApiDeleteSLOCorrectionRequest{ + ApiService: a, + ctx: ctx, + sloCorrectionId: sloCorrectionId, + } +} + +/* + * Execute executes the request + */ +func (a *ServiceLevelObjectiveCorrectionsApiService) DeleteSLOCorrectionExecute(r ApiDeleteSLOCorrectionRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceLevelObjectiveCorrectionsApiService.DeleteSLOCorrection") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/slo/correction/{slo_correction_id}" + localVarPath = strings.Replace(localVarPath, "{"+"slo_correction_id"+"}", _neturl.PathEscape(parameterToString(r.sloCorrectionId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + + // Set Operation-ID header for telemetry + localVarHeaderParams["DD-OPERATION-ID"] = "DeleteSLOCorrection" + + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v APIErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v APIErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetSLOCorrectionRequest struct { + ctx _context.Context + ApiService *ServiceLevelObjectiveCorrectionsApiService + sloCorrectionId string +} + +func (r ApiGetSLOCorrectionRequest) Execute() (SLOCorrectionResponse, *_nethttp.Response, error) { + return r.ApiService.GetSLOCorrectionExecute(r) +} + +/* + * GetSLOCorrection Get an SLO correction for an SLO + * Get an SLO Correction + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param sloCorrectionId The ID of the SLO correction object + * @return ApiGetSLOCorrectionRequest + */ +func (a *ServiceLevelObjectiveCorrectionsApiService) GetSLOCorrection(ctx _context.Context, sloCorrectionId string) ApiGetSLOCorrectionRequest { + return ApiGetSLOCorrectionRequest{ + ApiService: a, + ctx: ctx, + sloCorrectionId: sloCorrectionId, + } +} + +/* + * Execute executes the request + * @return SLOCorrectionResponse + */ +func (a *ServiceLevelObjectiveCorrectionsApiService) GetSLOCorrectionExecute(r ApiGetSLOCorrectionRequest) (SLOCorrectionResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SLOCorrectionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceLevelObjectiveCorrectionsApiService.GetSLOCorrection") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/slo/correction/{slo_correction_id}" + localVarPath = strings.Replace(localVarPath, "{"+"slo_correction_id"+"}", _neturl.PathEscape(parameterToString(r.sloCorrectionId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + + // Set Operation-ID header for telemetry + localVarHeaderParams["DD-OPERATION-ID"] = "GetSLOCorrection" + + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v APIErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v APIErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListSLOCorrectionRequest struct { + ctx _context.Context + ApiService *ServiceLevelObjectiveCorrectionsApiService +} + +func (r ApiListSLOCorrectionRequest) Execute() (SLOCorrectionListResponse, *_nethttp.Response, error) { + return r.ApiService.ListSLOCorrectionExecute(r) +} + +/* + * ListSLOCorrection Get all SLO corrections + * Get all Service Level Objective Corrections + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiListSLOCorrectionRequest + */ +func (a *ServiceLevelObjectiveCorrectionsApiService) ListSLOCorrection(ctx _context.Context) ApiListSLOCorrectionRequest { + return ApiListSLOCorrectionRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return SLOCorrectionListResponse + */ +func (a *ServiceLevelObjectiveCorrectionsApiService) ListSLOCorrectionExecute(r ApiListSLOCorrectionRequest) (SLOCorrectionListResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SLOCorrectionListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceLevelObjectiveCorrectionsApiService.ListSLOCorrection") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/slo/correction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + + // Set Operation-ID header for telemetry + localVarHeaderParams["DD-OPERATION-ID"] = "ListSLOCorrection" + + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v APIErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateSLOCorrectionRequest struct { + ctx _context.Context + ApiService *ServiceLevelObjectiveCorrectionsApiService + sloCorrectionId string + body *SLOCorrectionUpdateRequest +} + +func (r ApiUpdateSLOCorrectionRequest) Body(body SLOCorrectionUpdateRequest) ApiUpdateSLOCorrectionRequest { + r.body = &body + return r +} + +func (r ApiUpdateSLOCorrectionRequest) Execute() (SLOCorrectionResponse, *_nethttp.Response, error) { + return r.ApiService.UpdateSLOCorrectionExecute(r) +} + +/* + * UpdateSLOCorrection Update an SLO Correction + * Update the specified SLO correction object object + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param sloCorrectionId The ID of the SLO correction object + * @return ApiUpdateSLOCorrectionRequest + */ +func (a *ServiceLevelObjectiveCorrectionsApiService) UpdateSLOCorrection(ctx _context.Context, sloCorrectionId string) ApiUpdateSLOCorrectionRequest { + return ApiUpdateSLOCorrectionRequest{ + ApiService: a, + ctx: ctx, + sloCorrectionId: sloCorrectionId, + } +} + +/* + * Execute executes the request + * @return SLOCorrectionResponse + */ +func (a *ServiceLevelObjectiveCorrectionsApiService) UpdateSLOCorrectionExecute(r ApiUpdateSLOCorrectionRequest) (SLOCorrectionResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SLOCorrectionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceLevelObjectiveCorrectionsApiService.UpdateSLOCorrection") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/slo/correction/{slo_correction_id}" + localVarPath = strings.Replace(localVarPath, "{"+"slo_correction_id"+"}", _neturl.PathEscape(parameterToString(r.sloCorrectionId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + + // Set Operation-ID header for telemetry + localVarHeaderParams["DD-OPERATION-ID"] = "UpdateSLOCorrection" + + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["appKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v APIErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v APIErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v APIErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api/v1/datadog/client.go b/api/v1/datadog/client.go index 86485f415a2..f8f8223cce3 100644 --- a/api/v1/datadog/client.go +++ b/api/v1/datadog/client.go @@ -84,6 +84,8 @@ type APIClient struct { PagerDutyIntegrationApi *PagerDutyIntegrationApiService + ServiceLevelObjectiveCorrectionsApi *ServiceLevelObjectiveCorrectionsApiService + ServiceLevelObjectivesApi *ServiceLevelObjectivesApiService SnapshotsApi *SnapshotsApiService @@ -132,6 +134,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.MonitorsApi = (*MonitorsApiService)(&c.common) c.OrganizationsApi = (*OrganizationsApiService)(&c.common) c.PagerDutyIntegrationApi = (*PagerDutyIntegrationApiService)(&c.common) + c.ServiceLevelObjectiveCorrectionsApi = (*ServiceLevelObjectiveCorrectionsApiService)(&c.common) c.ServiceLevelObjectivesApi = (*ServiceLevelObjectivesApiService)(&c.common) c.SnapshotsApi = (*SnapshotsApiService)(&c.common) c.SyntheticsApi = (*SyntheticsApiService)(&c.common) diff --git a/api/v1/datadog/docs/SLOCorrectionCategory.md b/api/v1/datadog/docs/SLOCorrectionCategory.md new file mode 100644 index 00000000000..c72dedbf159 --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionCategory.md @@ -0,0 +1,17 @@ +# SLOCorrectionCategory + +## Enum + + +* `SCHEDULED_MAINTENANCE` (value: `"Scheduled Maintenance"`) + +* `OUTSIDE_BUSINESS_HOURS` (value: `"Outside Business Hours"`) + +* `DEPLOYMENT` (value: `"Deployment"`) + +* `OTHER` (value: `"Other"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionCreateRequest.md b/api/v1/datadog/docs/SLOCorrectionCreateRequest.md new file mode 100644 index 00000000000..0110f569783 --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionCreateRequest.md @@ -0,0 +1,56 @@ +# SLOCorrectionCreateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**SLOCorrectionCreateRequestData**](SLOCorrectionCreateRequest_data.md) | | [optional] + +## Methods + +### NewSLOCorrectionCreateRequest + +`func NewSLOCorrectionCreateRequest() *SLOCorrectionCreateRequest` + +NewSLOCorrectionCreateRequest instantiates a new SLOCorrectionCreateRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionCreateRequestWithDefaults + +`func NewSLOCorrectionCreateRequestWithDefaults() *SLOCorrectionCreateRequest` + +NewSLOCorrectionCreateRequestWithDefaults instantiates a new SLOCorrectionCreateRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *SLOCorrectionCreateRequest) GetData() SLOCorrectionCreateRequestData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *SLOCorrectionCreateRequest) GetDataOk() (*SLOCorrectionCreateRequestData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *SLOCorrectionCreateRequest) SetData(v SLOCorrectionCreateRequestData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *SLOCorrectionCreateRequest) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionCreateRequestAttributes.md b/api/v1/datadog/docs/SLOCorrectionCreateRequestAttributes.md new file mode 100644 index 00000000000..866ac750de6 --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionCreateRequestAttributes.md @@ -0,0 +1,161 @@ +# SLOCorrectionCreateRequestAttributes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Category** | [**SLOCorrectionCategory**](SLOCorrectionCategory.md) | | +**Description** | Pointer to **string** | Description of the correction being made. | [optional] +**End** | **int64** | Ending time of the correction in epoch seconds | +**SloId** | **string** | ID of the SLO that this correction will be applied to | +**Start** | **int64** | Starting time of the correction in epoch seconds | +**Timezone** | **string** | Timezone of the timestamps provided | + +## Methods + +### NewSLOCorrectionCreateRequestAttributes + +`func NewSLOCorrectionCreateRequestAttributes(category SLOCorrectionCategory, end int64, sloId string, start int64, timezone string, ) *SLOCorrectionCreateRequestAttributes` + +NewSLOCorrectionCreateRequestAttributes instantiates a new SLOCorrectionCreateRequestAttributes object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionCreateRequestAttributesWithDefaults + +`func NewSLOCorrectionCreateRequestAttributesWithDefaults() *SLOCorrectionCreateRequestAttributes` + +NewSLOCorrectionCreateRequestAttributesWithDefaults instantiates a new SLOCorrectionCreateRequestAttributes object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCategory + +`func (o *SLOCorrectionCreateRequestAttributes) GetCategory() SLOCorrectionCategory` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *SLOCorrectionCreateRequestAttributes) GetCategoryOk() (*SLOCorrectionCategory, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategory + +`func (o *SLOCorrectionCreateRequestAttributes) SetCategory(v SLOCorrectionCategory)` + +SetCategory sets Category field to given value. + + +### GetDescription + +`func (o *SLOCorrectionCreateRequestAttributes) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *SLOCorrectionCreateRequestAttributes) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *SLOCorrectionCreateRequestAttributes) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *SLOCorrectionCreateRequestAttributes) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetEnd + +`func (o *SLOCorrectionCreateRequestAttributes) GetEnd() int64` + +GetEnd returns the End field if non-nil, zero value otherwise. + +### GetEndOk + +`func (o *SLOCorrectionCreateRequestAttributes) GetEndOk() (*int64, bool)` + +GetEndOk returns a tuple with the End field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnd + +`func (o *SLOCorrectionCreateRequestAttributes) SetEnd(v int64)` + +SetEnd sets End field to given value. + + +### GetSloId + +`func (o *SLOCorrectionCreateRequestAttributes) GetSloId() string` + +GetSloId returns the SloId field if non-nil, zero value otherwise. + +### GetSloIdOk + +`func (o *SLOCorrectionCreateRequestAttributes) GetSloIdOk() (*string, bool)` + +GetSloIdOk returns a tuple with the SloId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSloId + +`func (o *SLOCorrectionCreateRequestAttributes) SetSloId(v string)` + +SetSloId sets SloId field to given value. + + +### GetStart + +`func (o *SLOCorrectionCreateRequestAttributes) GetStart() int64` + +GetStart returns the Start field if non-nil, zero value otherwise. + +### GetStartOk + +`func (o *SLOCorrectionCreateRequestAttributes) GetStartOk() (*int64, bool)` + +GetStartOk returns a tuple with the Start field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStart + +`func (o *SLOCorrectionCreateRequestAttributes) SetStart(v int64)` + +SetStart sets Start field to given value. + + +### GetTimezone + +`func (o *SLOCorrectionCreateRequestAttributes) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *SLOCorrectionCreateRequestAttributes) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *SLOCorrectionCreateRequestAttributes) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionCreateRequestData.md b/api/v1/datadog/docs/SLOCorrectionCreateRequestData.md new file mode 100644 index 00000000000..b0eb6dff65a --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionCreateRequestData.md @@ -0,0 +1,82 @@ +# SLOCorrectionCreateRequestData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | Pointer to [**SLOCorrectionCreateRequestAttributes**](SLOCorrectionCreateRequestAttributes.md) | | [optional] +**Type** | Pointer to **string** | Should always be set to \"correction\" | [optional] [default to "correction"] + +## Methods + +### NewSLOCorrectionCreateRequestData + +`func NewSLOCorrectionCreateRequestData() *SLOCorrectionCreateRequestData` + +NewSLOCorrectionCreateRequestData instantiates a new SLOCorrectionCreateRequestData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionCreateRequestDataWithDefaults + +`func NewSLOCorrectionCreateRequestDataWithDefaults() *SLOCorrectionCreateRequestData` + +NewSLOCorrectionCreateRequestDataWithDefaults instantiates a new SLOCorrectionCreateRequestData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAttributes + +`func (o *SLOCorrectionCreateRequestData) GetAttributes() SLOCorrectionCreateRequestAttributes` + +GetAttributes returns the Attributes field if non-nil, zero value otherwise. + +### GetAttributesOk + +`func (o *SLOCorrectionCreateRequestData) GetAttributesOk() (*SLOCorrectionCreateRequestAttributes, bool)` + +GetAttributesOk returns a tuple with the Attributes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAttributes + +`func (o *SLOCorrectionCreateRequestData) SetAttributes(v SLOCorrectionCreateRequestAttributes)` + +SetAttributes sets Attributes field to given value. + +### HasAttributes + +`func (o *SLOCorrectionCreateRequestData) HasAttributes() bool` + +HasAttributes returns a boolean if a field has been set. + +### GetType + +`func (o *SLOCorrectionCreateRequestData) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SLOCorrectionCreateRequestData) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SLOCorrectionCreateRequestData) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SLOCorrectionCreateRequestData) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionListResponse.md b/api/v1/datadog/docs/SLOCorrectionListResponse.md new file mode 100644 index 00000000000..a46bc6884c4 --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionListResponse.md @@ -0,0 +1,56 @@ +# SLOCorrectionListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**[]SLOCorrectionListResponseData**](SLOCorrectionListResponseData.md) | The list of of SLO corrections objects | [optional] + +## Methods + +### NewSLOCorrectionListResponse + +`func NewSLOCorrectionListResponse() *SLOCorrectionListResponse` + +NewSLOCorrectionListResponse instantiates a new SLOCorrectionListResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionListResponseWithDefaults + +`func NewSLOCorrectionListResponseWithDefaults() *SLOCorrectionListResponse` + +NewSLOCorrectionListResponseWithDefaults instantiates a new SLOCorrectionListResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *SLOCorrectionListResponse) GetData() []SLOCorrectionListResponseData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *SLOCorrectionListResponse) GetDataOk() (*[]SLOCorrectionListResponseData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *SLOCorrectionListResponse) SetData(v []SLOCorrectionListResponseData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *SLOCorrectionListResponse) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionListResponseData.md b/api/v1/datadog/docs/SLOCorrectionListResponseData.md new file mode 100644 index 00000000000..6a35286a065 --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionListResponseData.md @@ -0,0 +1,108 @@ +# SLOCorrectionListResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | Pointer to [**SLOCorrectionResponseAttributes**](SLOCorrectionResponseAttributes.md) | | [optional] +**Id** | Pointer to **string** | The ID of the SLO correction | [optional] +**Type** | Pointer to **string** | Should always be set to \"correction\" | [optional] [default to "correction"] + +## Methods + +### NewSLOCorrectionListResponseData + +`func NewSLOCorrectionListResponseData() *SLOCorrectionListResponseData` + +NewSLOCorrectionListResponseData instantiates a new SLOCorrectionListResponseData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionListResponseDataWithDefaults + +`func NewSLOCorrectionListResponseDataWithDefaults() *SLOCorrectionListResponseData` + +NewSLOCorrectionListResponseDataWithDefaults instantiates a new SLOCorrectionListResponseData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAttributes + +`func (o *SLOCorrectionListResponseData) GetAttributes() SLOCorrectionResponseAttributes` + +GetAttributes returns the Attributes field if non-nil, zero value otherwise. + +### GetAttributesOk + +`func (o *SLOCorrectionListResponseData) GetAttributesOk() (*SLOCorrectionResponseAttributes, bool)` + +GetAttributesOk returns a tuple with the Attributes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAttributes + +`func (o *SLOCorrectionListResponseData) SetAttributes(v SLOCorrectionResponseAttributes)` + +SetAttributes sets Attributes field to given value. + +### HasAttributes + +`func (o *SLOCorrectionListResponseData) HasAttributes() bool` + +HasAttributes returns a boolean if a field has been set. + +### GetId + +`func (o *SLOCorrectionListResponseData) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SLOCorrectionListResponseData) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SLOCorrectionListResponseData) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SLOCorrectionListResponseData) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetType + +`func (o *SLOCorrectionListResponseData) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SLOCorrectionListResponseData) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SLOCorrectionListResponseData) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SLOCorrectionListResponseData) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionResponse.md b/api/v1/datadog/docs/SLOCorrectionResponse.md new file mode 100644 index 00000000000..480171d192d --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionResponse.md @@ -0,0 +1,56 @@ +# SLOCorrectionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**SLOCorrectionResponseData**](SLOCorrectionResponse_data.md) | | [optional] + +## Methods + +### NewSLOCorrectionResponse + +`func NewSLOCorrectionResponse() *SLOCorrectionResponse` + +NewSLOCorrectionResponse instantiates a new SLOCorrectionResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionResponseWithDefaults + +`func NewSLOCorrectionResponseWithDefaults() *SLOCorrectionResponse` + +NewSLOCorrectionResponseWithDefaults instantiates a new SLOCorrectionResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *SLOCorrectionResponse) GetData() SLOCorrectionResponseData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *SLOCorrectionResponse) GetDataOk() (*SLOCorrectionResponseData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *SLOCorrectionResponse) SetData(v SLOCorrectionResponseData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *SLOCorrectionResponse) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionResponseAttributes.md b/api/v1/datadog/docs/SLOCorrectionResponseAttributes.md new file mode 100644 index 00000000000..8b9eae06eb1 --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionResponseAttributes.md @@ -0,0 +1,212 @@ +# SLOCorrectionResponseAttributes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Category** | Pointer to [**SLOCorrectionCategory**](SLOCorrectionCategory.md) | | [optional] +**Creator** | Pointer to [**Creator**](Creator.md) | | [optional] +**Description** | Pointer to **string** | Description of the correction being made. | [optional] +**End** | Pointer to **int64** | Ending time of the correction in epoch seconds | [optional] +**SloId** | Pointer to **string** | ID of the SLO that this correction will be applied to | [optional] +**Start** | Pointer to **int64** | Starting time of the correction in epoch seconds | [optional] +**Timezone** | Pointer to **string** | Timezone of the timestamps provided | [optional] + +## Methods + +### NewSLOCorrectionResponseAttributes + +`func NewSLOCorrectionResponseAttributes() *SLOCorrectionResponseAttributes` + +NewSLOCorrectionResponseAttributes instantiates a new SLOCorrectionResponseAttributes object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionResponseAttributesWithDefaults + +`func NewSLOCorrectionResponseAttributesWithDefaults() *SLOCorrectionResponseAttributes` + +NewSLOCorrectionResponseAttributesWithDefaults instantiates a new SLOCorrectionResponseAttributes object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCategory + +`func (o *SLOCorrectionResponseAttributes) GetCategory() SLOCorrectionCategory` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *SLOCorrectionResponseAttributes) GetCategoryOk() (*SLOCorrectionCategory, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategory + +`func (o *SLOCorrectionResponseAttributes) SetCategory(v SLOCorrectionCategory)` + +SetCategory sets Category field to given value. + +### HasCategory + +`func (o *SLOCorrectionResponseAttributes) HasCategory() bool` + +HasCategory returns a boolean if a field has been set. + +### GetCreator + +`func (o *SLOCorrectionResponseAttributes) GetCreator() Creator` + +GetCreator returns the Creator field if non-nil, zero value otherwise. + +### GetCreatorOk + +`func (o *SLOCorrectionResponseAttributes) GetCreatorOk() (*Creator, bool)` + +GetCreatorOk returns a tuple with the Creator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreator + +`func (o *SLOCorrectionResponseAttributes) SetCreator(v Creator)` + +SetCreator sets Creator field to given value. + +### HasCreator + +`func (o *SLOCorrectionResponseAttributes) HasCreator() bool` + +HasCreator returns a boolean if a field has been set. + +### GetDescription + +`func (o *SLOCorrectionResponseAttributes) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *SLOCorrectionResponseAttributes) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *SLOCorrectionResponseAttributes) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *SLOCorrectionResponseAttributes) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetEnd + +`func (o *SLOCorrectionResponseAttributes) GetEnd() int64` + +GetEnd returns the End field if non-nil, zero value otherwise. + +### GetEndOk + +`func (o *SLOCorrectionResponseAttributes) GetEndOk() (*int64, bool)` + +GetEndOk returns a tuple with the End field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnd + +`func (o *SLOCorrectionResponseAttributes) SetEnd(v int64)` + +SetEnd sets End field to given value. + +### HasEnd + +`func (o *SLOCorrectionResponseAttributes) HasEnd() bool` + +HasEnd returns a boolean if a field has been set. + +### GetSloId + +`func (o *SLOCorrectionResponseAttributes) GetSloId() string` + +GetSloId returns the SloId field if non-nil, zero value otherwise. + +### GetSloIdOk + +`func (o *SLOCorrectionResponseAttributes) GetSloIdOk() (*string, bool)` + +GetSloIdOk returns a tuple with the SloId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSloId + +`func (o *SLOCorrectionResponseAttributes) SetSloId(v string)` + +SetSloId sets SloId field to given value. + +### HasSloId + +`func (o *SLOCorrectionResponseAttributes) HasSloId() bool` + +HasSloId returns a boolean if a field has been set. + +### GetStart + +`func (o *SLOCorrectionResponseAttributes) GetStart() int64` + +GetStart returns the Start field if non-nil, zero value otherwise. + +### GetStartOk + +`func (o *SLOCorrectionResponseAttributes) GetStartOk() (*int64, bool)` + +GetStartOk returns a tuple with the Start field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStart + +`func (o *SLOCorrectionResponseAttributes) SetStart(v int64)` + +SetStart sets Start field to given value. + +### HasStart + +`func (o *SLOCorrectionResponseAttributes) HasStart() bool` + +HasStart returns a boolean if a field has been set. + +### GetTimezone + +`func (o *SLOCorrectionResponseAttributes) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *SLOCorrectionResponseAttributes) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *SLOCorrectionResponseAttributes) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + +### HasTimezone + +`func (o *SLOCorrectionResponseAttributes) HasTimezone() bool` + +HasTimezone returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionResponseData.md b/api/v1/datadog/docs/SLOCorrectionResponseData.md new file mode 100644 index 00000000000..d85221d298a --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionResponseData.md @@ -0,0 +1,108 @@ +# SLOCorrectionResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | Pointer to [**SLOCorrectionResponseAttributes**](SLOCorrectionResponseAttributes.md) | | [optional] +**Id** | Pointer to **string** | The ID of the SLO correction | [optional] +**Type** | Pointer to **string** | Should always return \"correction\" | [optional] + +## Methods + +### NewSLOCorrectionResponseData + +`func NewSLOCorrectionResponseData() *SLOCorrectionResponseData` + +NewSLOCorrectionResponseData instantiates a new SLOCorrectionResponseData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionResponseDataWithDefaults + +`func NewSLOCorrectionResponseDataWithDefaults() *SLOCorrectionResponseData` + +NewSLOCorrectionResponseDataWithDefaults instantiates a new SLOCorrectionResponseData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAttributes + +`func (o *SLOCorrectionResponseData) GetAttributes() SLOCorrectionResponseAttributes` + +GetAttributes returns the Attributes field if non-nil, zero value otherwise. + +### GetAttributesOk + +`func (o *SLOCorrectionResponseData) GetAttributesOk() (*SLOCorrectionResponseAttributes, bool)` + +GetAttributesOk returns a tuple with the Attributes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAttributes + +`func (o *SLOCorrectionResponseData) SetAttributes(v SLOCorrectionResponseAttributes)` + +SetAttributes sets Attributes field to given value. + +### HasAttributes + +`func (o *SLOCorrectionResponseData) HasAttributes() bool` + +HasAttributes returns a boolean if a field has been set. + +### GetId + +`func (o *SLOCorrectionResponseData) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SLOCorrectionResponseData) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SLOCorrectionResponseData) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SLOCorrectionResponseData) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetType + +`func (o *SLOCorrectionResponseData) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SLOCorrectionResponseData) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SLOCorrectionResponseData) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SLOCorrectionResponseData) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionUpdateRequest.md b/api/v1/datadog/docs/SLOCorrectionUpdateRequest.md new file mode 100644 index 00000000000..00bff216a16 --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionUpdateRequest.md @@ -0,0 +1,56 @@ +# SLOCorrectionUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**SLOCorrectionUpdateRequestData**](SLOCorrectionUpdateRequest_data.md) | | [optional] + +## Methods + +### NewSLOCorrectionUpdateRequest + +`func NewSLOCorrectionUpdateRequest() *SLOCorrectionUpdateRequest` + +NewSLOCorrectionUpdateRequest instantiates a new SLOCorrectionUpdateRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionUpdateRequestWithDefaults + +`func NewSLOCorrectionUpdateRequestWithDefaults() *SLOCorrectionUpdateRequest` + +NewSLOCorrectionUpdateRequestWithDefaults instantiates a new SLOCorrectionUpdateRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *SLOCorrectionUpdateRequest) GetData() SLOCorrectionUpdateRequestData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *SLOCorrectionUpdateRequest) GetDataOk() (*SLOCorrectionUpdateRequestData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *SLOCorrectionUpdateRequest) SetData(v SLOCorrectionUpdateRequestData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *SLOCorrectionUpdateRequest) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionUpdateRequestAttributes.md b/api/v1/datadog/docs/SLOCorrectionUpdateRequestAttributes.md new file mode 100644 index 00000000000..913eae41b6e --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionUpdateRequestAttributes.md @@ -0,0 +1,140 @@ +# SLOCorrectionUpdateRequestAttributes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Category** | [**SLOCorrectionCategory**](SLOCorrectionCategory.md) | | +**Description** | Pointer to **string** | Description of the correction being made. | [optional] +**End** | **int64** | Ending time of the correction in epoch seconds | +**Start** | **int64** | Starting time of the correction in epoch seconds | +**Timezone** | **string** | Timezone of the timestamps provided | + +## Methods + +### NewSLOCorrectionUpdateRequestAttributes + +`func NewSLOCorrectionUpdateRequestAttributes(category SLOCorrectionCategory, end int64, start int64, timezone string, ) *SLOCorrectionUpdateRequestAttributes` + +NewSLOCorrectionUpdateRequestAttributes instantiates a new SLOCorrectionUpdateRequestAttributes object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionUpdateRequestAttributesWithDefaults + +`func NewSLOCorrectionUpdateRequestAttributesWithDefaults() *SLOCorrectionUpdateRequestAttributes` + +NewSLOCorrectionUpdateRequestAttributesWithDefaults instantiates a new SLOCorrectionUpdateRequestAttributes object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCategory + +`func (o *SLOCorrectionUpdateRequestAttributes) GetCategory() SLOCorrectionCategory` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *SLOCorrectionUpdateRequestAttributes) GetCategoryOk() (*SLOCorrectionCategory, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategory + +`func (o *SLOCorrectionUpdateRequestAttributes) SetCategory(v SLOCorrectionCategory)` + +SetCategory sets Category field to given value. + + +### GetDescription + +`func (o *SLOCorrectionUpdateRequestAttributes) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *SLOCorrectionUpdateRequestAttributes) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *SLOCorrectionUpdateRequestAttributes) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *SLOCorrectionUpdateRequestAttributes) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetEnd + +`func (o *SLOCorrectionUpdateRequestAttributes) GetEnd() int64` + +GetEnd returns the End field if non-nil, zero value otherwise. + +### GetEndOk + +`func (o *SLOCorrectionUpdateRequestAttributes) GetEndOk() (*int64, bool)` + +GetEndOk returns a tuple with the End field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnd + +`func (o *SLOCorrectionUpdateRequestAttributes) SetEnd(v int64)` + +SetEnd sets End field to given value. + + +### GetStart + +`func (o *SLOCorrectionUpdateRequestAttributes) GetStart() int64` + +GetStart returns the Start field if non-nil, zero value otherwise. + +### GetStartOk + +`func (o *SLOCorrectionUpdateRequestAttributes) GetStartOk() (*int64, bool)` + +GetStartOk returns a tuple with the Start field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStart + +`func (o *SLOCorrectionUpdateRequestAttributes) SetStart(v int64)` + +SetStart sets Start field to given value. + + +### GetTimezone + +`func (o *SLOCorrectionUpdateRequestAttributes) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *SLOCorrectionUpdateRequestAttributes) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *SLOCorrectionUpdateRequestAttributes) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SLOCorrectionUpdateRequestData.md b/api/v1/datadog/docs/SLOCorrectionUpdateRequestData.md new file mode 100644 index 00000000000..f89a42e4068 --- /dev/null +++ b/api/v1/datadog/docs/SLOCorrectionUpdateRequestData.md @@ -0,0 +1,82 @@ +# SLOCorrectionUpdateRequestData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | Pointer to [**SLOCorrectionUpdateRequestAttributes**](SLOCorrectionUpdateRequestAttributes.md) | | [optional] +**Type** | Pointer to **string** | Should always be set to \"correction\" | [optional] [default to "correction"] + +## Methods + +### NewSLOCorrectionUpdateRequestData + +`func NewSLOCorrectionUpdateRequestData() *SLOCorrectionUpdateRequestData` + +NewSLOCorrectionUpdateRequestData instantiates a new SLOCorrectionUpdateRequestData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOCorrectionUpdateRequestDataWithDefaults + +`func NewSLOCorrectionUpdateRequestDataWithDefaults() *SLOCorrectionUpdateRequestData` + +NewSLOCorrectionUpdateRequestDataWithDefaults instantiates a new SLOCorrectionUpdateRequestData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAttributes + +`func (o *SLOCorrectionUpdateRequestData) GetAttributes() SLOCorrectionUpdateRequestAttributes` + +GetAttributes returns the Attributes field if non-nil, zero value otherwise. + +### GetAttributesOk + +`func (o *SLOCorrectionUpdateRequestData) GetAttributesOk() (*SLOCorrectionUpdateRequestAttributes, bool)` + +GetAttributesOk returns a tuple with the Attributes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAttributes + +`func (o *SLOCorrectionUpdateRequestData) SetAttributes(v SLOCorrectionUpdateRequestAttributes)` + +SetAttributes sets Attributes field to given value. + +### HasAttributes + +`func (o *SLOCorrectionUpdateRequestData) HasAttributes() bool` + +HasAttributes returns a boolean if a field has been set. + +### GetType + +`func (o *SLOCorrectionUpdateRequestData) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SLOCorrectionUpdateRequestData) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SLOCorrectionUpdateRequestData) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SLOCorrectionUpdateRequestData) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/ServiceLevelObjectiveCorrectionsApi.md b/api/v1/datadog/docs/ServiceLevelObjectiveCorrectionsApi.md new file mode 100644 index 00000000000..8534db2fcad --- /dev/null +++ b/api/v1/datadog/docs/ServiceLevelObjectiveCorrectionsApi.md @@ -0,0 +1,428 @@ +# \ServiceLevelObjectiveCorrectionsApi + +All URIs are relative to *https://api.datadoghq.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSLOCorrection**](ServiceLevelObjectiveCorrectionsApi.md#CreateSLOCorrection) | **Post** /api/v1/slo/correction | Create an SLO correction +[**DeleteSLOCorrection**](ServiceLevelObjectiveCorrectionsApi.md#DeleteSLOCorrection) | **Delete** /api/v1/slo/correction/{slo_correction_id} | Delete an SLO Correction +[**GetSLOCorrection**](ServiceLevelObjectiveCorrectionsApi.md#GetSLOCorrection) | **Get** /api/v1/slo/correction/{slo_correction_id} | Get an SLO correction for an SLO +[**ListSLOCorrection**](ServiceLevelObjectiveCorrectionsApi.md#ListSLOCorrection) | **Get** /api/v1/slo/correction | Get all SLO corrections +[**UpdateSLOCorrection**](ServiceLevelObjectiveCorrectionsApi.md#UpdateSLOCorrection) | **Patch** /api/v1/slo/correction/{slo_correction_id} | Update an SLO Correction + + + +## CreateSLOCorrection + +> SLOCorrectionResponse CreateSLOCorrection(ctx).Body(body).Execute() + +Create an SLO correction + + + +### Example + +```go +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog" +) + +func main() { + ctx := context.WithValue( + context.Background(), + datadog.ContextAPIKeys, + map[string]datadog.APIKey{ + "apiKeyAuth": { + Key: os.Getenv("DD_CLIENT_API_KEY"), + }, + "appKeyAuth": { + Key: os.Getenv("DD_CLIENT_APP_KEY"), + }, + }, + ) + + body := *datadog.NewSLOCorrectionCreateRequest() // SLOCorrectionCreateRequest | Create an SLO Correction + + configuration := datadog.NewConfiguration() + + api_client := datadog.NewAPIClient(configuration) + resp, r, err := api_client.ServiceLevelObjectiveCorrectionsApi.CreateSLOCorrection(ctx).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceLevelObjectiveCorrectionsApi.CreateSLOCorrection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateSLOCorrection`: SLOCorrectionResponse + response_content, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from ServiceLevelObjectiveCorrectionsApi.CreateSLOCorrection:\n%s\n", response_content) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateSLOCorrectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SLOCorrectionCreateRequest**](SLOCorrectionCreateRequest.md) | Create an SLO Correction | + +### Return type + +[**SLOCorrectionResponse**](SLOCorrectionResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteSLOCorrection + +> DeleteSLOCorrection(ctx, sloCorrectionId).Execute() + +Delete an SLO Correction + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog" +) + +func main() { + ctx := context.WithValue( + context.Background(), + datadog.ContextAPIKeys, + map[string]datadog.APIKey{ + "apiKeyAuth": { + Key: os.Getenv("DD_CLIENT_API_KEY"), + }, + "appKeyAuth": { + Key: os.Getenv("DD_CLIENT_APP_KEY"), + }, + }, + ) + + sloCorrectionId := "sloCorrectionId_example" // string | The ID of the SLO correction object + + configuration := datadog.NewConfiguration() + + api_client := datadog.NewAPIClient(configuration) + r, err := api_client.ServiceLevelObjectiveCorrectionsApi.DeleteSLOCorrection(ctx, sloCorrectionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceLevelObjectiveCorrectionsApi.DeleteSLOCorrection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**sloCorrectionId** | **string** | The ID of the SLO correction object | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteSLOCorrectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetSLOCorrection + +> SLOCorrectionResponse GetSLOCorrection(ctx, sloCorrectionId).Execute() + +Get an SLO correction for an SLO + + + +### Example + +```go +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog" +) + +func main() { + ctx := context.WithValue( + context.Background(), + datadog.ContextAPIKeys, + map[string]datadog.APIKey{ + "apiKeyAuth": { + Key: os.Getenv("DD_CLIENT_API_KEY"), + }, + "appKeyAuth": { + Key: os.Getenv("DD_CLIENT_APP_KEY"), + }, + }, + ) + + sloCorrectionId := "sloCorrectionId_example" // string | The ID of the SLO correction object + + configuration := datadog.NewConfiguration() + + api_client := datadog.NewAPIClient(configuration) + resp, r, err := api_client.ServiceLevelObjectiveCorrectionsApi.GetSLOCorrection(ctx, sloCorrectionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceLevelObjectiveCorrectionsApi.GetSLOCorrection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetSLOCorrection`: SLOCorrectionResponse + response_content, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from ServiceLevelObjectiveCorrectionsApi.GetSLOCorrection:\n%s\n", response_content) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**sloCorrectionId** | **string** | The ID of the SLO correction object | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetSLOCorrectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**SLOCorrectionResponse**](SLOCorrectionResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListSLOCorrection + +> SLOCorrectionListResponse ListSLOCorrection(ctx).Execute() + +Get all SLO corrections + + + +### Example + +```go +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog" +) + +func main() { + ctx := context.WithValue( + context.Background(), + datadog.ContextAPIKeys, + map[string]datadog.APIKey{ + "apiKeyAuth": { + Key: os.Getenv("DD_CLIENT_API_KEY"), + }, + "appKeyAuth": { + Key: os.Getenv("DD_CLIENT_APP_KEY"), + }, + }, + ) + + + configuration := datadog.NewConfiguration() + + api_client := datadog.NewAPIClient(configuration) + resp, r, err := api_client.ServiceLevelObjectiveCorrectionsApi.ListSLOCorrection(ctx).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceLevelObjectiveCorrectionsApi.ListSLOCorrection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListSLOCorrection`: SLOCorrectionListResponse + response_content, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from ServiceLevelObjectiveCorrectionsApi.ListSLOCorrection:\n%s\n", response_content) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiListSLOCorrectionRequest struct via the builder pattern + + +### Return type + +[**SLOCorrectionListResponse**](SLOCorrectionListResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateSLOCorrection + +> SLOCorrectionResponse UpdateSLOCorrection(ctx, sloCorrectionId).Body(body).Execute() + +Update an SLO Correction + + + +### Example + +```go +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog" +) + +func main() { + ctx := context.WithValue( + context.Background(), + datadog.ContextAPIKeys, + map[string]datadog.APIKey{ + "apiKeyAuth": { + Key: os.Getenv("DD_CLIENT_API_KEY"), + }, + "appKeyAuth": { + Key: os.Getenv("DD_CLIENT_APP_KEY"), + }, + }, + ) + + sloCorrectionId := "sloCorrectionId_example" // string | The ID of the SLO correction object + body := *datadog.NewSLOCorrectionUpdateRequest() // SLOCorrectionUpdateRequest | The edited SLO correction object. + + configuration := datadog.NewConfiguration() + + api_client := datadog.NewAPIClient(configuration) + resp, r, err := api_client.ServiceLevelObjectiveCorrectionsApi.UpdateSLOCorrection(ctx, sloCorrectionId).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceLevelObjectiveCorrectionsApi.UpdateSLOCorrection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateSLOCorrection`: SLOCorrectionResponse + response_content, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from ServiceLevelObjectiveCorrectionsApi.UpdateSLOCorrection:\n%s\n", response_content) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**sloCorrectionId** | **string** | The ID of the SLO correction object | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateSLOCorrectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**SLOCorrectionUpdateRequest**](SLOCorrectionUpdateRequest.md) | The edited SLO correction object. | + +### Return type + +[**SLOCorrectionResponse**](SLOCorrectionResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/api/v1/datadog/model_slo_correction_category.go b/api/v1/datadog/model_slo_correction_category.go new file mode 100644 index 00000000000..e1400455344 --- /dev/null +++ b/api/v1/datadog/model_slo_correction_category.go @@ -0,0 +1,111 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" + "fmt" +) + +// SLOCorrectionCategory Category the SLO correction belongs to +type SLOCorrectionCategory string + +// List of SLOCorrectionCategory +const ( + SLOCORRECTIONCATEGORY_SCHEDULED_MAINTENANCE SLOCorrectionCategory = "Scheduled Maintenance" + SLOCORRECTIONCATEGORY_OUTSIDE_BUSINESS_HOURS SLOCorrectionCategory = "Outside Business Hours" + SLOCORRECTIONCATEGORY_DEPLOYMENT SLOCorrectionCategory = "Deployment" + SLOCORRECTIONCATEGORY_OTHER SLOCorrectionCategory = "Other" +) + +var allowedSLOCorrectionCategoryEnumValues = []SLOCorrectionCategory{ + "Scheduled Maintenance", + "Outside Business Hours", + "Deployment", + "Other", +} + +func (v *SLOCorrectionCategory) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SLOCorrectionCategory(value) + for _, existing := range allowedSLOCorrectionCategoryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SLOCorrectionCategory", value) +} + +// NewSLOCorrectionCategoryFromValue returns a pointer to a valid SLOCorrectionCategory +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSLOCorrectionCategoryFromValue(v string) (*SLOCorrectionCategory, error) { + ev := SLOCorrectionCategory(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SLOCorrectionCategory: valid values are %v", v, allowedSLOCorrectionCategoryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SLOCorrectionCategory) IsValid() bool { + for _, existing := range allowedSLOCorrectionCategoryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SLOCorrectionCategory value +func (v SLOCorrectionCategory) Ptr() *SLOCorrectionCategory { + return &v +} + +type NullableSLOCorrectionCategory struct { + value *SLOCorrectionCategory + isSet bool +} + +func (v NullableSLOCorrectionCategory) Get() *SLOCorrectionCategory { + return v.value +} + +func (v *NullableSLOCorrectionCategory) Set(val *SLOCorrectionCategory) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionCategory(val *SLOCorrectionCategory) *NullableSLOCorrectionCategory { + return &NullableSLOCorrectionCategory{value: val, isSet: true} +} + +func (v NullableSLOCorrectionCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_create_request.go b/api/v1/datadog/model_slo_correction_create_request.go new file mode 100644 index 00000000000..30373f5aba9 --- /dev/null +++ b/api/v1/datadog/model_slo_correction_create_request.go @@ -0,0 +1,111 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionCreateRequest An object that defines a correction to be applied to an SLO +type SLOCorrectionCreateRequest struct { + Data *SLOCorrectionCreateRequestData `json:"data,omitempty"` +} + +// NewSLOCorrectionCreateRequest instantiates a new SLOCorrectionCreateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionCreateRequest() *SLOCorrectionCreateRequest { + this := SLOCorrectionCreateRequest{} + return &this +} + +// NewSLOCorrectionCreateRequestWithDefaults instantiates a new SLOCorrectionCreateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionCreateRequestWithDefaults() *SLOCorrectionCreateRequest { + this := SLOCorrectionCreateRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *SLOCorrectionCreateRequest) GetData() SLOCorrectionCreateRequestData { + if o == nil || o.Data == nil { + var ret SLOCorrectionCreateRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequest) GetDataOk() (*SLOCorrectionCreateRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *SLOCorrectionCreateRequest) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given SLOCorrectionCreateRequestData and assigns it to the Data field. +func (o *SLOCorrectionCreateRequest) SetData(v SLOCorrectionCreateRequestData) { + o.Data = &v +} + +func (o SLOCorrectionCreateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionCreateRequest struct { + value *SLOCorrectionCreateRequest + isSet bool +} + +func (v NullableSLOCorrectionCreateRequest) Get() *SLOCorrectionCreateRequest { + return v.value +} + +func (v *NullableSLOCorrectionCreateRequest) Set(val *SLOCorrectionCreateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionCreateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionCreateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionCreateRequest(val *SLOCorrectionCreateRequest) *NullableSLOCorrectionCreateRequest { + return &NullableSLOCorrectionCreateRequest{value: val, isSet: true} +} + +func (v NullableSLOCorrectionCreateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionCreateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_create_request_attributes.go b/api/v1/datadog/model_slo_correction_create_request_attributes.go new file mode 100644 index 00000000000..f1209e4b83a --- /dev/null +++ b/api/v1/datadog/model_slo_correction_create_request_attributes.go @@ -0,0 +1,261 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionCreateRequestAttributes The attribute object associated with the SLO correction to be created +type SLOCorrectionCreateRequestAttributes struct { + Category SLOCorrectionCategory `json:"category"` + // Description of the correction being made. + Description *string `json:"description,omitempty"` + // Ending time of the correction in epoch seconds + End int64 `json:"end"` + // ID of the SLO that this correction will be applied to + SloId string `json:"slo_id"` + // Starting time of the correction in epoch seconds + Start int64 `json:"start"` + // Timezone of the timestamps provided + Timezone string `json:"timezone"` +} + +// NewSLOCorrectionCreateRequestAttributes instantiates a new SLOCorrectionCreateRequestAttributes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionCreateRequestAttributes(category SLOCorrectionCategory, end int64, sloId string, start int64, timezone string) *SLOCorrectionCreateRequestAttributes { + this := SLOCorrectionCreateRequestAttributes{} + this.Category = category + this.End = end + this.SloId = sloId + this.Start = start + this.Timezone = timezone + return &this +} + +// NewSLOCorrectionCreateRequestAttributesWithDefaults instantiates a new SLOCorrectionCreateRequestAttributes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionCreateRequestAttributesWithDefaults() *SLOCorrectionCreateRequestAttributes { + this := SLOCorrectionCreateRequestAttributes{} + return &this +} + +// GetCategory returns the Category field value +func (o *SLOCorrectionCreateRequestAttributes) GetCategory() SLOCorrectionCategory { + if o == nil { + var ret SLOCorrectionCategory + return ret + } + + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequestAttributes) GetCategoryOk() (*SLOCorrectionCategory, bool) { + if o == nil { + return nil, false + } + return &o.Category, true +} + +// SetCategory sets field value +func (o *SLOCorrectionCreateRequestAttributes) SetCategory(v SLOCorrectionCategory) { + o.Category = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SLOCorrectionCreateRequestAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequestAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SLOCorrectionCreateRequestAttributes) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SLOCorrectionCreateRequestAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetEnd returns the End field value +func (o *SLOCorrectionCreateRequestAttributes) GetEnd() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.End +} + +// GetEndOk returns a tuple with the End field value +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequestAttributes) GetEndOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.End, true +} + +// SetEnd sets field value +func (o *SLOCorrectionCreateRequestAttributes) SetEnd(v int64) { + o.End = v +} + +// GetSloId returns the SloId field value +func (o *SLOCorrectionCreateRequestAttributes) GetSloId() string { + if o == nil { + var ret string + return ret + } + + return o.SloId +} + +// GetSloIdOk returns a tuple with the SloId field value +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequestAttributes) GetSloIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SloId, true +} + +// SetSloId sets field value +func (o *SLOCorrectionCreateRequestAttributes) SetSloId(v string) { + o.SloId = v +} + +// GetStart returns the Start field value +func (o *SLOCorrectionCreateRequestAttributes) GetStart() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequestAttributes) GetStartOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value +func (o *SLOCorrectionCreateRequestAttributes) SetStart(v int64) { + o.Start = v +} + +// GetTimezone returns the Timezone field value +func (o *SLOCorrectionCreateRequestAttributes) GetTimezone() string { + if o == nil { + var ret string + return ret + } + + return o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequestAttributes) GetTimezoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Timezone, true +} + +// SetTimezone sets field value +func (o *SLOCorrectionCreateRequestAttributes) SetTimezone(v string) { + o.Timezone = v +} + +func (o SLOCorrectionCreateRequestAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["category"] = o.Category + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if true { + toSerialize["end"] = o.End + } + if true { + toSerialize["slo_id"] = o.SloId + } + if true { + toSerialize["start"] = o.Start + } + if true { + toSerialize["timezone"] = o.Timezone + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionCreateRequestAttributes struct { + value *SLOCorrectionCreateRequestAttributes + isSet bool +} + +func (v NullableSLOCorrectionCreateRequestAttributes) Get() *SLOCorrectionCreateRequestAttributes { + return v.value +} + +func (v *NullableSLOCorrectionCreateRequestAttributes) Set(val *SLOCorrectionCreateRequestAttributes) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionCreateRequestAttributes) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionCreateRequestAttributes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionCreateRequestAttributes(val *SLOCorrectionCreateRequestAttributes) *NullableSLOCorrectionCreateRequestAttributes { + return &NullableSLOCorrectionCreateRequestAttributes{value: val, isSet: true} +} + +func (v NullableSLOCorrectionCreateRequestAttributes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionCreateRequestAttributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_create_request_data.go b/api/v1/datadog/model_slo_correction_create_request_data.go new file mode 100644 index 00000000000..379f9092cb4 --- /dev/null +++ b/api/v1/datadog/model_slo_correction_create_request_data.go @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionCreateRequestData The data object associated with the SLO correction to be created +type SLOCorrectionCreateRequestData struct { + Attributes *SLOCorrectionCreateRequestAttributes `json:"attributes,omitempty"` + // Should always be set to \"correction\" + Type *string `json:"type,omitempty"` +} + +// NewSLOCorrectionCreateRequestData instantiates a new SLOCorrectionCreateRequestData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionCreateRequestData() *SLOCorrectionCreateRequestData { + this := SLOCorrectionCreateRequestData{} + var type_ string = "correction" + this.Type = &type_ + return &this +} + +// NewSLOCorrectionCreateRequestDataWithDefaults instantiates a new SLOCorrectionCreateRequestData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionCreateRequestDataWithDefaults() *SLOCorrectionCreateRequestData { + this := SLOCorrectionCreateRequestData{} + var type_ string = "correction" + this.Type = &type_ + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SLOCorrectionCreateRequestData) GetAttributes() SLOCorrectionCreateRequestAttributes { + if o == nil || o.Attributes == nil { + var ret SLOCorrectionCreateRequestAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequestData) GetAttributesOk() (*SLOCorrectionCreateRequestAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SLOCorrectionCreateRequestData) HasAttributes() bool { + if o != nil && o.Attributes != nil { + return true + } + + return false +} + +// SetAttributes gets a reference to the given SLOCorrectionCreateRequestAttributes and assigns it to the Attributes field. +func (o *SLOCorrectionCreateRequestData) SetAttributes(v SLOCorrectionCreateRequestAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SLOCorrectionCreateRequestData) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionCreateRequestData) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SLOCorrectionCreateRequestData) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SLOCorrectionCreateRequestData) SetType(v string) { + o.Type = &v +} + +func (o SLOCorrectionCreateRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionCreateRequestData struct { + value *SLOCorrectionCreateRequestData + isSet bool +} + +func (v NullableSLOCorrectionCreateRequestData) Get() *SLOCorrectionCreateRequestData { + return v.value +} + +func (v *NullableSLOCorrectionCreateRequestData) Set(val *SLOCorrectionCreateRequestData) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionCreateRequestData) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionCreateRequestData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionCreateRequestData(val *SLOCorrectionCreateRequestData) *NullableSLOCorrectionCreateRequestData { + return &NullableSLOCorrectionCreateRequestData{value: val, isSet: true} +} + +func (v NullableSLOCorrectionCreateRequestData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionCreateRequestData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_list_response.go b/api/v1/datadog/model_slo_correction_list_response.go new file mode 100644 index 00000000000..d0af0604b01 --- /dev/null +++ b/api/v1/datadog/model_slo_correction_list_response.go @@ -0,0 +1,112 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionListResponse A list of SLO correction objects +type SLOCorrectionListResponse struct { + // The list of of SLO corrections objects + Data *[]SLOCorrectionListResponseData `json:"data,omitempty"` +} + +// NewSLOCorrectionListResponse instantiates a new SLOCorrectionListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionListResponse() *SLOCorrectionListResponse { + this := SLOCorrectionListResponse{} + return &this +} + +// NewSLOCorrectionListResponseWithDefaults instantiates a new SLOCorrectionListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionListResponseWithDefaults() *SLOCorrectionListResponse { + this := SLOCorrectionListResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *SLOCorrectionListResponse) GetData() []SLOCorrectionListResponseData { + if o == nil || o.Data == nil { + var ret []SLOCorrectionListResponseData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionListResponse) GetDataOk() (*[]SLOCorrectionListResponseData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *SLOCorrectionListResponse) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given []SLOCorrectionListResponseData and assigns it to the Data field. +func (o *SLOCorrectionListResponse) SetData(v []SLOCorrectionListResponseData) { + o.Data = &v +} + +func (o SLOCorrectionListResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionListResponse struct { + value *SLOCorrectionListResponse + isSet bool +} + +func (v NullableSLOCorrectionListResponse) Get() *SLOCorrectionListResponse { + return v.value +} + +func (v *NullableSLOCorrectionListResponse) Set(val *SLOCorrectionListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionListResponse(val *SLOCorrectionListResponse) *NullableSLOCorrectionListResponse { + return &NullableSLOCorrectionListResponse{value: val, isSet: true} +} + +func (v NullableSLOCorrectionListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_list_response_data.go b/api/v1/datadog/model_slo_correction_list_response_data.go new file mode 100644 index 00000000000..613b3c01d1a --- /dev/null +++ b/api/v1/datadog/model_slo_correction_list_response_data.go @@ -0,0 +1,189 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionListResponseData The response object of a list of SLO corrections +type SLOCorrectionListResponseData struct { + Attributes *SLOCorrectionResponseAttributes `json:"attributes,omitempty"` + // The ID of the SLO correction + Id *string `json:"id,omitempty"` + // Should always be set to \"correction\" + Type *string `json:"type,omitempty"` +} + +// NewSLOCorrectionListResponseData instantiates a new SLOCorrectionListResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionListResponseData() *SLOCorrectionListResponseData { + this := SLOCorrectionListResponseData{} + var type_ string = "correction" + this.Type = &type_ + return &this +} + +// NewSLOCorrectionListResponseDataWithDefaults instantiates a new SLOCorrectionListResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionListResponseDataWithDefaults() *SLOCorrectionListResponseData { + this := SLOCorrectionListResponseData{} + var type_ string = "correction" + this.Type = &type_ + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SLOCorrectionListResponseData) GetAttributes() SLOCorrectionResponseAttributes { + if o == nil || o.Attributes == nil { + var ret SLOCorrectionResponseAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionListResponseData) GetAttributesOk() (*SLOCorrectionResponseAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SLOCorrectionListResponseData) HasAttributes() bool { + if o != nil && o.Attributes != nil { + return true + } + + return false +} + +// SetAttributes gets a reference to the given SLOCorrectionResponseAttributes and assigns it to the Attributes field. +func (o *SLOCorrectionListResponseData) SetAttributes(v SLOCorrectionResponseAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SLOCorrectionListResponseData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionListResponseData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SLOCorrectionListResponseData) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SLOCorrectionListResponseData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SLOCorrectionListResponseData) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionListResponseData) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SLOCorrectionListResponseData) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SLOCorrectionListResponseData) SetType(v string) { + o.Type = &v +} + +func (o SLOCorrectionListResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionListResponseData struct { + value *SLOCorrectionListResponseData + isSet bool +} + +func (v NullableSLOCorrectionListResponseData) Get() *SLOCorrectionListResponseData { + return v.value +} + +func (v *NullableSLOCorrectionListResponseData) Set(val *SLOCorrectionListResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionListResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionListResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionListResponseData(val *SLOCorrectionListResponseData) *NullableSLOCorrectionListResponseData { + return &NullableSLOCorrectionListResponseData{value: val, isSet: true} +} + +func (v NullableSLOCorrectionListResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionListResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_response.go b/api/v1/datadog/model_slo_correction_response.go new file mode 100644 index 00000000000..3b5db87be59 --- /dev/null +++ b/api/v1/datadog/model_slo_correction_response.go @@ -0,0 +1,111 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionResponse The response object of an SLO correction +type SLOCorrectionResponse struct { + Data *SLOCorrectionResponseData `json:"data,omitempty"` +} + +// NewSLOCorrectionResponse instantiates a new SLOCorrectionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionResponse() *SLOCorrectionResponse { + this := SLOCorrectionResponse{} + return &this +} + +// NewSLOCorrectionResponseWithDefaults instantiates a new SLOCorrectionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionResponseWithDefaults() *SLOCorrectionResponse { + this := SLOCorrectionResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *SLOCorrectionResponse) GetData() SLOCorrectionResponseData { + if o == nil || o.Data == nil { + var ret SLOCorrectionResponseData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponse) GetDataOk() (*SLOCorrectionResponseData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *SLOCorrectionResponse) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given SLOCorrectionResponseData and assigns it to the Data field. +func (o *SLOCorrectionResponse) SetData(v SLOCorrectionResponseData) { + o.Data = &v +} + +func (o SLOCorrectionResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionResponse struct { + value *SLOCorrectionResponse + isSet bool +} + +func (v NullableSLOCorrectionResponse) Get() *SLOCorrectionResponse { + return v.value +} + +func (v *NullableSLOCorrectionResponse) Set(val *SLOCorrectionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionResponse(val *SLOCorrectionResponse) *NullableSLOCorrectionResponse { + return &NullableSLOCorrectionResponse{value: val, isSet: true} +} + +func (v NullableSLOCorrectionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_response_attributes.go b/api/v1/datadog/model_slo_correction_response_attributes.go new file mode 100644 index 00000000000..e1cd17a172c --- /dev/null +++ b/api/v1/datadog/model_slo_correction_response_attributes.go @@ -0,0 +1,332 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionResponseAttributes The attribute object associated with the SLO correction +type SLOCorrectionResponseAttributes struct { + Category *SLOCorrectionCategory `json:"category,omitempty"` + Creator *Creator `json:"creator,omitempty"` + // Description of the correction being made. + Description *string `json:"description,omitempty"` + // Ending time of the correction in epoch seconds + End *int64 `json:"end,omitempty"` + // ID of the SLO that this correction will be applied to + SloId *string `json:"slo_id,omitempty"` + // Starting time of the correction in epoch seconds + Start *int64 `json:"start,omitempty"` + // Timezone of the timestamps provided + Timezone *string `json:"timezone,omitempty"` +} + +// NewSLOCorrectionResponseAttributes instantiates a new SLOCorrectionResponseAttributes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionResponseAttributes() *SLOCorrectionResponseAttributes { + this := SLOCorrectionResponseAttributes{} + return &this +} + +// NewSLOCorrectionResponseAttributesWithDefaults instantiates a new SLOCorrectionResponseAttributes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionResponseAttributesWithDefaults() *SLOCorrectionResponseAttributes { + this := SLOCorrectionResponseAttributes{} + return &this +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *SLOCorrectionResponseAttributes) GetCategory() SLOCorrectionCategory { + if o == nil || o.Category == nil { + var ret SLOCorrectionCategory + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseAttributes) GetCategoryOk() (*SLOCorrectionCategory, bool) { + if o == nil || o.Category == nil { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *SLOCorrectionResponseAttributes) HasCategory() bool { + if o != nil && o.Category != nil { + return true + } + + return false +} + +// SetCategory gets a reference to the given SLOCorrectionCategory and assigns it to the Category field. +func (o *SLOCorrectionResponseAttributes) SetCategory(v SLOCorrectionCategory) { + o.Category = &v +} + +// GetCreator returns the Creator field value if set, zero value otherwise. +func (o *SLOCorrectionResponseAttributes) GetCreator() Creator { + if o == nil || o.Creator == nil { + var ret Creator + return ret + } + return *o.Creator +} + +// GetCreatorOk returns a tuple with the Creator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseAttributes) GetCreatorOk() (*Creator, bool) { + if o == nil || o.Creator == nil { + return nil, false + } + return o.Creator, true +} + +// HasCreator returns a boolean if a field has been set. +func (o *SLOCorrectionResponseAttributes) HasCreator() bool { + if o != nil && o.Creator != nil { + return true + } + + return false +} + +// SetCreator gets a reference to the given Creator and assigns it to the Creator field. +func (o *SLOCorrectionResponseAttributes) SetCreator(v Creator) { + o.Creator = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SLOCorrectionResponseAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SLOCorrectionResponseAttributes) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SLOCorrectionResponseAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetEnd returns the End field value if set, zero value otherwise. +func (o *SLOCorrectionResponseAttributes) GetEnd() int64 { + if o == nil || o.End == nil { + var ret int64 + return ret + } + return *o.End +} + +// GetEndOk returns a tuple with the End field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseAttributes) GetEndOk() (*int64, bool) { + if o == nil || o.End == nil { + return nil, false + } + return o.End, true +} + +// HasEnd returns a boolean if a field has been set. +func (o *SLOCorrectionResponseAttributes) HasEnd() bool { + if o != nil && o.End != nil { + return true + } + + return false +} + +// SetEnd gets a reference to the given int64 and assigns it to the End field. +func (o *SLOCorrectionResponseAttributes) SetEnd(v int64) { + o.End = &v +} + +// GetSloId returns the SloId field value if set, zero value otherwise. +func (o *SLOCorrectionResponseAttributes) GetSloId() string { + if o == nil || o.SloId == nil { + var ret string + return ret + } + return *o.SloId +} + +// GetSloIdOk returns a tuple with the SloId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseAttributes) GetSloIdOk() (*string, bool) { + if o == nil || o.SloId == nil { + return nil, false + } + return o.SloId, true +} + +// HasSloId returns a boolean if a field has been set. +func (o *SLOCorrectionResponseAttributes) HasSloId() bool { + if o != nil && o.SloId != nil { + return true + } + + return false +} + +// SetSloId gets a reference to the given string and assigns it to the SloId field. +func (o *SLOCorrectionResponseAttributes) SetSloId(v string) { + o.SloId = &v +} + +// GetStart returns the Start field value if set, zero value otherwise. +func (o *SLOCorrectionResponseAttributes) GetStart() int64 { + if o == nil || o.Start == nil { + var ret int64 + return ret + } + return *o.Start +} + +// GetStartOk returns a tuple with the Start field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseAttributes) GetStartOk() (*int64, bool) { + if o == nil || o.Start == nil { + return nil, false + } + return o.Start, true +} + +// HasStart returns a boolean if a field has been set. +func (o *SLOCorrectionResponseAttributes) HasStart() bool { + if o != nil && o.Start != nil { + return true + } + + return false +} + +// SetStart gets a reference to the given int64 and assigns it to the Start field. +func (o *SLOCorrectionResponseAttributes) SetStart(v int64) { + o.Start = &v +} + +// GetTimezone returns the Timezone field value if set, zero value otherwise. +func (o *SLOCorrectionResponseAttributes) GetTimezone() string { + if o == nil || o.Timezone == nil { + var ret string + return ret + } + return *o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseAttributes) GetTimezoneOk() (*string, bool) { + if o == nil || o.Timezone == nil { + return nil, false + } + return o.Timezone, true +} + +// HasTimezone returns a boolean if a field has been set. +func (o *SLOCorrectionResponseAttributes) HasTimezone() bool { + if o != nil && o.Timezone != nil { + return true + } + + return false +} + +// SetTimezone gets a reference to the given string and assigns it to the Timezone field. +func (o *SLOCorrectionResponseAttributes) SetTimezone(v string) { + o.Timezone = &v +} + +func (o SLOCorrectionResponseAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Category != nil { + toSerialize["category"] = o.Category + } + if o.Creator != nil { + toSerialize["creator"] = o.Creator + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.End != nil { + toSerialize["end"] = o.End + } + if o.SloId != nil { + toSerialize["slo_id"] = o.SloId + } + if o.Start != nil { + toSerialize["start"] = o.Start + } + if o.Timezone != nil { + toSerialize["timezone"] = o.Timezone + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionResponseAttributes struct { + value *SLOCorrectionResponseAttributes + isSet bool +} + +func (v NullableSLOCorrectionResponseAttributes) Get() *SLOCorrectionResponseAttributes { + return v.value +} + +func (v *NullableSLOCorrectionResponseAttributes) Set(val *SLOCorrectionResponseAttributes) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionResponseAttributes) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionResponseAttributes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionResponseAttributes(val *SLOCorrectionResponseAttributes) *NullableSLOCorrectionResponseAttributes { + return &NullableSLOCorrectionResponseAttributes{value: val, isSet: true} +} + +func (v NullableSLOCorrectionResponseAttributes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionResponseAttributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_response_data.go b/api/v1/datadog/model_slo_correction_response_data.go new file mode 100644 index 00000000000..fd79a5289f7 --- /dev/null +++ b/api/v1/datadog/model_slo_correction_response_data.go @@ -0,0 +1,185 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionResponseData The data object associated with the SLO correction +type SLOCorrectionResponseData struct { + Attributes *SLOCorrectionResponseAttributes `json:"attributes,omitempty"` + // The ID of the SLO correction + Id *string `json:"id,omitempty"` + // Should always return \"correction\" + Type *string `json:"type,omitempty"` +} + +// NewSLOCorrectionResponseData instantiates a new SLOCorrectionResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionResponseData() *SLOCorrectionResponseData { + this := SLOCorrectionResponseData{} + return &this +} + +// NewSLOCorrectionResponseDataWithDefaults instantiates a new SLOCorrectionResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionResponseDataWithDefaults() *SLOCorrectionResponseData { + this := SLOCorrectionResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SLOCorrectionResponseData) GetAttributes() SLOCorrectionResponseAttributes { + if o == nil || o.Attributes == nil { + var ret SLOCorrectionResponseAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseData) GetAttributesOk() (*SLOCorrectionResponseAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SLOCorrectionResponseData) HasAttributes() bool { + if o != nil && o.Attributes != nil { + return true + } + + return false +} + +// SetAttributes gets a reference to the given SLOCorrectionResponseAttributes and assigns it to the Attributes field. +func (o *SLOCorrectionResponseData) SetAttributes(v SLOCorrectionResponseAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SLOCorrectionResponseData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SLOCorrectionResponseData) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SLOCorrectionResponseData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SLOCorrectionResponseData) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionResponseData) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SLOCorrectionResponseData) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SLOCorrectionResponseData) SetType(v string) { + o.Type = &v +} + +func (o SLOCorrectionResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionResponseData struct { + value *SLOCorrectionResponseData + isSet bool +} + +func (v NullableSLOCorrectionResponseData) Get() *SLOCorrectionResponseData { + return v.value +} + +func (v *NullableSLOCorrectionResponseData) Set(val *SLOCorrectionResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionResponseData(val *SLOCorrectionResponseData) *NullableSLOCorrectionResponseData { + return &NullableSLOCorrectionResponseData{value: val, isSet: true} +} + +func (v NullableSLOCorrectionResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_update_request.go b/api/v1/datadog/model_slo_correction_update_request.go new file mode 100644 index 00000000000..3740dec9573 --- /dev/null +++ b/api/v1/datadog/model_slo_correction_update_request.go @@ -0,0 +1,111 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionUpdateRequest An object that defines a correction to be applied to an SLO +type SLOCorrectionUpdateRequest struct { + Data *SLOCorrectionUpdateRequestData `json:"data,omitempty"` +} + +// NewSLOCorrectionUpdateRequest instantiates a new SLOCorrectionUpdateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionUpdateRequest() *SLOCorrectionUpdateRequest { + this := SLOCorrectionUpdateRequest{} + return &this +} + +// NewSLOCorrectionUpdateRequestWithDefaults instantiates a new SLOCorrectionUpdateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionUpdateRequestWithDefaults() *SLOCorrectionUpdateRequest { + this := SLOCorrectionUpdateRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *SLOCorrectionUpdateRequest) GetData() SLOCorrectionUpdateRequestData { + if o == nil || o.Data == nil { + var ret SLOCorrectionUpdateRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionUpdateRequest) GetDataOk() (*SLOCorrectionUpdateRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *SLOCorrectionUpdateRequest) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given SLOCorrectionUpdateRequestData and assigns it to the Data field. +func (o *SLOCorrectionUpdateRequest) SetData(v SLOCorrectionUpdateRequestData) { + o.Data = &v +} + +func (o SLOCorrectionUpdateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionUpdateRequest struct { + value *SLOCorrectionUpdateRequest + isSet bool +} + +func (v NullableSLOCorrectionUpdateRequest) Get() *SLOCorrectionUpdateRequest { + return v.value +} + +func (v *NullableSLOCorrectionUpdateRequest) Set(val *SLOCorrectionUpdateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionUpdateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionUpdateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionUpdateRequest(val *SLOCorrectionUpdateRequest) *NullableSLOCorrectionUpdateRequest { + return &NullableSLOCorrectionUpdateRequest{value: val, isSet: true} +} + +func (v NullableSLOCorrectionUpdateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionUpdateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_update_request_attributes.go b/api/v1/datadog/model_slo_correction_update_request_attributes.go new file mode 100644 index 00000000000..9315684bcf5 --- /dev/null +++ b/api/v1/datadog/model_slo_correction_update_request_attributes.go @@ -0,0 +1,231 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionUpdateRequestAttributes The attribute object associated with the SLO correction to be updated +type SLOCorrectionUpdateRequestAttributes struct { + Category SLOCorrectionCategory `json:"category"` + // Description of the correction being made. + Description *string `json:"description,omitempty"` + // Ending time of the correction in epoch seconds + End int64 `json:"end"` + // Starting time of the correction in epoch seconds + Start int64 `json:"start"` + // Timezone of the timestamps provided + Timezone string `json:"timezone"` +} + +// NewSLOCorrectionUpdateRequestAttributes instantiates a new SLOCorrectionUpdateRequestAttributes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionUpdateRequestAttributes(category SLOCorrectionCategory, end int64, start int64, timezone string) *SLOCorrectionUpdateRequestAttributes { + this := SLOCorrectionUpdateRequestAttributes{} + this.Category = category + this.End = end + this.Start = start + this.Timezone = timezone + return &this +} + +// NewSLOCorrectionUpdateRequestAttributesWithDefaults instantiates a new SLOCorrectionUpdateRequestAttributes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionUpdateRequestAttributesWithDefaults() *SLOCorrectionUpdateRequestAttributes { + this := SLOCorrectionUpdateRequestAttributes{} + return &this +} + +// GetCategory returns the Category field value +func (o *SLOCorrectionUpdateRequestAttributes) GetCategory() SLOCorrectionCategory { + if o == nil { + var ret SLOCorrectionCategory + return ret + } + + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *SLOCorrectionUpdateRequestAttributes) GetCategoryOk() (*SLOCorrectionCategory, bool) { + if o == nil { + return nil, false + } + return &o.Category, true +} + +// SetCategory sets field value +func (o *SLOCorrectionUpdateRequestAttributes) SetCategory(v SLOCorrectionCategory) { + o.Category = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SLOCorrectionUpdateRequestAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionUpdateRequestAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SLOCorrectionUpdateRequestAttributes) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SLOCorrectionUpdateRequestAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetEnd returns the End field value +func (o *SLOCorrectionUpdateRequestAttributes) GetEnd() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.End +} + +// GetEndOk returns a tuple with the End field value +// and a boolean to check if the value has been set. +func (o *SLOCorrectionUpdateRequestAttributes) GetEndOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.End, true +} + +// SetEnd sets field value +func (o *SLOCorrectionUpdateRequestAttributes) SetEnd(v int64) { + o.End = v +} + +// GetStart returns the Start field value +func (o *SLOCorrectionUpdateRequestAttributes) GetStart() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *SLOCorrectionUpdateRequestAttributes) GetStartOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value +func (o *SLOCorrectionUpdateRequestAttributes) SetStart(v int64) { + o.Start = v +} + +// GetTimezone returns the Timezone field value +func (o *SLOCorrectionUpdateRequestAttributes) GetTimezone() string { + if o == nil { + var ret string + return ret + } + + return o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value +// and a boolean to check if the value has been set. +func (o *SLOCorrectionUpdateRequestAttributes) GetTimezoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Timezone, true +} + +// SetTimezone sets field value +func (o *SLOCorrectionUpdateRequestAttributes) SetTimezone(v string) { + o.Timezone = v +} + +func (o SLOCorrectionUpdateRequestAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["category"] = o.Category + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if true { + toSerialize["end"] = o.End + } + if true { + toSerialize["start"] = o.Start + } + if true { + toSerialize["timezone"] = o.Timezone + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionUpdateRequestAttributes struct { + value *SLOCorrectionUpdateRequestAttributes + isSet bool +} + +func (v NullableSLOCorrectionUpdateRequestAttributes) Get() *SLOCorrectionUpdateRequestAttributes { + return v.value +} + +func (v *NullableSLOCorrectionUpdateRequestAttributes) Set(val *SLOCorrectionUpdateRequestAttributes) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionUpdateRequestAttributes) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionUpdateRequestAttributes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionUpdateRequestAttributes(val *SLOCorrectionUpdateRequestAttributes) *NullableSLOCorrectionUpdateRequestAttributes { + return &NullableSLOCorrectionUpdateRequestAttributes{value: val, isSet: true} +} + +func (v NullableSLOCorrectionUpdateRequestAttributes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionUpdateRequestAttributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_slo_correction_update_request_data.go b/api/v1/datadog/model_slo_correction_update_request_data.go new file mode 100644 index 00000000000..16f4b4c667f --- /dev/null +++ b/api/v1/datadog/model_slo_correction_update_request_data.go @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOCorrectionUpdateRequestData The data object associated with the SLO correction to be updated +type SLOCorrectionUpdateRequestData struct { + Attributes *SLOCorrectionUpdateRequestAttributes `json:"attributes,omitempty"` + // Should always be set to \"correction\" + Type *string `json:"type,omitempty"` +} + +// NewSLOCorrectionUpdateRequestData instantiates a new SLOCorrectionUpdateRequestData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOCorrectionUpdateRequestData() *SLOCorrectionUpdateRequestData { + this := SLOCorrectionUpdateRequestData{} + var type_ string = "correction" + this.Type = &type_ + return &this +} + +// NewSLOCorrectionUpdateRequestDataWithDefaults instantiates a new SLOCorrectionUpdateRequestData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOCorrectionUpdateRequestDataWithDefaults() *SLOCorrectionUpdateRequestData { + this := SLOCorrectionUpdateRequestData{} + var type_ string = "correction" + this.Type = &type_ + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SLOCorrectionUpdateRequestData) GetAttributes() SLOCorrectionUpdateRequestAttributes { + if o == nil || o.Attributes == nil { + var ret SLOCorrectionUpdateRequestAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionUpdateRequestData) GetAttributesOk() (*SLOCorrectionUpdateRequestAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SLOCorrectionUpdateRequestData) HasAttributes() bool { + if o != nil && o.Attributes != nil { + return true + } + + return false +} + +// SetAttributes gets a reference to the given SLOCorrectionUpdateRequestAttributes and assigns it to the Attributes field. +func (o *SLOCorrectionUpdateRequestData) SetAttributes(v SLOCorrectionUpdateRequestAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SLOCorrectionUpdateRequestData) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOCorrectionUpdateRequestData) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SLOCorrectionUpdateRequestData) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SLOCorrectionUpdateRequestData) SetType(v string) { + o.Type = &v +} + +func (o SLOCorrectionUpdateRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableSLOCorrectionUpdateRequestData struct { + value *SLOCorrectionUpdateRequestData + isSet bool +} + +func (v NullableSLOCorrectionUpdateRequestData) Get() *SLOCorrectionUpdateRequestData { + return v.value +} + +func (v *NullableSLOCorrectionUpdateRequestData) Set(val *SLOCorrectionUpdateRequestData) { + v.value = val + v.isSet = true +} + +func (v NullableSLOCorrectionUpdateRequestData) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOCorrectionUpdateRequestData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOCorrectionUpdateRequestData(val *SLOCorrectionUpdateRequestData) *NullableSLOCorrectionUpdateRequestData { + return &NullableSLOCorrectionUpdateRequestData{value: val, isSet: true} +} + +func (v NullableSLOCorrectionUpdateRequestData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOCorrectionUpdateRequestData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/tests/api/v1/datadog/features/given.json b/tests/api/v1/datadog/features/given.json index fe51488c706..8a2b46b1bbd 100644 --- a/tests/api/v1/datadog/features/given.json +++ b/tests/api/v1/datadog/features/given.json @@ -1 +1,14 @@ -[] +[ + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"id\": \"1\",\n \"attributes\": {\n \"slo_id\": \"{{ unique }}\",\n \"start\": 1610034200,\n \"end\": 1610034300,\n \"category\": \"Other\",\n \"timezone\": \"UTC\",\n \"description\": \"Test Correction\"\n },\n \"type\": \"correction\"\n }\n}" + } + ], + "step": "there is a valid \"correction\" in the system", + "key": "correction", + "tag": "Service Level Objective Corrections", + "operationId": "CreateSLOCorrection" + } +] diff --git a/tests/api/v1/datadog/features/service_level_objective_corrections.feature b/tests/api/v1/datadog/features/service_level_objective_corrections.feature new file mode 100644 index 00000000000..9181df0be7e --- /dev/null +++ b/tests/api/v1/datadog/features/service_level_objective_corrections.feature @@ -0,0 +1,84 @@ +@endpoint(service-level-objective-corrections) +Feature: Service Level Objective Corrections + SLO Status Corrections allow you to prevent specific time periods from + negatively impacting your SLO’s status and error budget. You can use + Status Corrections for various purposes, such as removing planned + maintenance windows, non-business hours, or other time periods that do not + correspond to genuine issues. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ServiceLevelObjectiveCorrections" API + + @generated @skip + Scenario: Get all SLO corrections returns "OK" response + Given new "ListSLOCorrection" request + When the request is sent + Then the response status is 200 OK + + @generated @skip + Scenario: Create an SLO correction returns "OK" response + Given new "CreateSLOCorrection" request + And body {} + When the request is sent + Then the response status is 200 OK + + @generated @skip + Scenario: Delete an SLO Correction returns "OK" response + Given new "DeleteSLOCorrection" request + And request contains "slo_correction_id" parameter from "" + When the request is sent + Then the response status is 204 OK + + @generated @skip + Scenario: Get an SLO correction for an SLO returns "OK" response + Given new "GetSLOCorrection" request + And request contains "slo_correction_id" parameter from "" + When the request is sent + Then the response status is 200 OK + + @generated @skip + Scenario: Update an SLO Correction returns "OK" response + Given new "UpdateSLOCorrection" request + And request contains "slo_correction_id" parameter from "" + And body {} + When the request is sent + Then the response status is 200 OK + + @generated @skip + Scenario: Create an SLO correction returns "Bad Request" response + Given new "CreateSLOCorrection" request + And body {} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip + Scenario: Delete an SLO Correction returns "Not found" response + Given new "DeleteSLOCorrection" request + And request contains "slo_correction_id" parameter from "" + When the request is sent + Then the response status is 404 Not found + + @generated @skip + Scenario: Get an SLO correction for an SLO returns "Bad Request" response + Given new "GetSLOCorrection" request + And request contains "slo_correction_id" parameter from "" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip + Scenario: Update an SLO Correction returns "Bad Request" response + Given new "UpdateSLOCorrection" request + And request contains "slo_correction_id" parameter from "" + And body {} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip + Scenario: Update an SLO Correction returns "Not Found" response + Given new "UpdateSLOCorrection" request + And request contains "slo_correction_id" parameter from "" + And body {} + When the request is sent + Then the response status is 404 Not Found diff --git a/tests/api/v1/datadog/features/undo.json b/tests/api/v1/datadog/features/undo.json index c239b87d567..073f9a2ed97 100644 --- a/tests/api/v1/datadog/features/undo.json +++ b/tests/api/v1/datadog/features/undo.json @@ -676,6 +676,43 @@ "type": "safe" } }, + "ListSLOCorrection": { + "tag": "Service Level Objective Corrections", + "undo": { + "type": "safe" + } + }, + "CreateSLOCorrection": { + "tag": "Service Level Objective Corrections", + "undo": { + "operationId": "DeleteSLOCorrection", + "parameters": [ + { + "name": "slo_correction_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteSLOCorrection": { + "tag": "Service Level Objective Corrections", + "undo": { + "type": "idempotent" + } + }, + "GetSLOCorrection": { + "tag": "Service Level Objective Corrections", + "undo": { + "type": "safe" + } + }, + "UpdateSLOCorrection": { + "tag": "Service Level Objective Corrections", + "undo": { + "type": "idempotent" + } + }, "DeleteSLO": { "tag": "Service Level Objectives", "undo": {