Skip to content

Commit a0aef05

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add backfilled degradation and maintenance endpoints to Status Pages (DataDog#3273)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 75a82e8 commit a0aef05

27 files changed

Lines changed: 2755 additions & 6 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 414 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-05-04T14:30:13.862Z

cassettes/features/v2/status_pages/Create-backfilled-degradation-returns-Created-response.yml

Lines changed: 88 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-05-04T14:30:17.282Z

cassettes/features/v2/status_pages/Create-backfilled-maintenance-returns-Created-response.yml

Lines changed: 71 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Create backfilled degradation returns "Created" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::StatusPagesAPI.new
5+
6+
# there is a valid "status_page" in the system
7+
STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID = ENV["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID"]
8+
STATUS_PAGE_DATA_ID = ENV["STATUS_PAGE_DATA_ID"]
9+
10+
body = DatadogAPIClient::V2::CreateBackfilledDegradationRequest.new({
11+
data: DatadogAPIClient::V2::CreateBackfilledDegradationRequestData.new({
12+
attributes: DatadogAPIClient::V2::CreateBackfilledDegradationRequestDataAttributes.new({
13+
title: "Past API Outage",
14+
updates: [
15+
DatadogAPIClient::V2::CreateBackfilledDegradationRequestDataAttributesUpdatesItems.new({
16+
components_affected: [
17+
DatadogAPIClient::V2::CreateDegradationRequestDataAttributesComponentsAffectedItems.new({
18+
id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID,
19+
status: DatadogAPIClient::V2::StatusPagesComponentDataAttributesStatus::DEGRADED,
20+
}),
21+
],
22+
description: "We detected elevated error rates in the API.",
23+
started_at: (Time.now + -1 * 3600),
24+
status: DatadogAPIClient::V2::CreateDegradationRequestDataAttributesStatus::INVESTIGATING,
25+
}),
26+
DatadogAPIClient::V2::CreateBackfilledDegradationRequestDataAttributesUpdatesItems.new({
27+
components_affected: [
28+
DatadogAPIClient::V2::CreateDegradationRequestDataAttributesComponentsAffectedItems.new({
29+
id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID,
30+
status: DatadogAPIClient::V2::StatusPagesComponentDataAttributesStatus::DEGRADED,
31+
}),
32+
],
33+
description: "Root cause identified as a misconfigured deployment.",
34+
started_at: (Time.now + -30 * 60),
35+
status: DatadogAPIClient::V2::CreateDegradationRequestDataAttributesStatus::IDENTIFIED,
36+
}),
37+
DatadogAPIClient::V2::CreateBackfilledDegradationRequestDataAttributesUpdatesItems.new({
38+
components_affected: [
39+
DatadogAPIClient::V2::CreateDegradationRequestDataAttributesComponentsAffectedItems.new({
40+
id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID,
41+
status: DatadogAPIClient::V2::StatusPagesComponentDataAttributesStatus::OPERATIONAL,
42+
}),
43+
],
44+
description: "The issue has been resolved and API is operating normally.",
45+
started_at: Time.now,
46+
status: DatadogAPIClient::V2::CreateDegradationRequestDataAttributesStatus::RESOLVED,
47+
}),
48+
],
49+
}),
50+
type: DatadogAPIClient::V2::PatchDegradationRequestDataType::DEGRADATIONS,
51+
}),
52+
})
53+
p api_instance.create_backfilled_degradation(STATUS_PAGE_DATA_ID, body)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Create backfilled maintenance returns "Created" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::StatusPagesAPI.new
5+
6+
# there is a valid "status_page" in the system
7+
STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID = ENV["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID"]
8+
STATUS_PAGE_DATA_ID = ENV["STATUS_PAGE_DATA_ID"]
9+
10+
body = DatadogAPIClient::V2::CreateBackfilledMaintenanceRequest.new({
11+
data: DatadogAPIClient::V2::CreateBackfilledMaintenanceRequestData.new({
12+
attributes: DatadogAPIClient::V2::CreateBackfilledMaintenanceRequestDataAttributes.new({
13+
title: "Past Database Maintenance",
14+
updates: [
15+
DatadogAPIClient::V2::CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.new({
16+
components_affected: [
17+
DatadogAPIClient::V2::CreateMaintenanceRequestDataAttributesComponentsAffectedItems.new({
18+
id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID,
19+
status: DatadogAPIClient::V2::PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::MAINTENANCE,
20+
}),
21+
],
22+
description: "Database maintenance is in progress.",
23+
started_at: (Time.now + -1 * 3600),
24+
status: DatadogAPIClient::V2::CreateMaintenanceRequestDataAttributesUpdatesItemsStatus::IN_PROGRESS,
25+
}),
26+
DatadogAPIClient::V2::CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.new({
27+
components_affected: [
28+
DatadogAPIClient::V2::CreateMaintenanceRequestDataAttributesComponentsAffectedItems.new({
29+
id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID,
30+
status: DatadogAPIClient::V2::PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL,
31+
}),
32+
],
33+
description: "Database maintenance has been completed successfully.",
34+
started_at: Time.now,
35+
status: DatadogAPIClient::V2::CreateMaintenanceRequestDataAttributesUpdatesItemsStatus::COMPLETED,
36+
}),
37+
],
38+
}),
39+
type: DatadogAPIClient::V2::PatchMaintenanceRequestDataType::MAINTENANCES,
40+
}),
41+
})
42+
p api_instance.create_backfilled_maintenance(STATUS_PAGE_DATA_ID, body)

features/scenarios_model_mapping.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4291,6 +4291,11 @@
42914291
"include" => "String",
42924292
"body" => "CreateDegradationRequest",
42934293
},
4294+
"v2.CreateBackfilledDegradation" => {
4295+
"include" => "String",
4296+
"page_id" => "UUID",
4297+
"body" => "CreateBackfilledDegradationRequest",
4298+
},
42944299
"v2.DeleteDegradation" => {
42954300
"page_id" => "UUID",
42964301
"degradation_id" => "UUID",
@@ -4313,6 +4318,11 @@
43134318
"include" => "String",
43144319
"body" => "CreateMaintenanceRequest",
43154320
},
4321+
"v2.CreateBackfilledMaintenance" => {
4322+
"include" => "String",
4323+
"page_id" => "UUID",
4324+
"body" => "CreateBackfilledMaintenanceRequest",
4325+
},
43164326
"v2.GetMaintenance" => {
43174327
"page_id" => "UUID",
43184328
"maintenance_id" => "UUID",

features/v2/status_pages.feature

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ Feature: Status Pages
1010
And a valid "appKeyAuth" key in the system
1111
And an instance of "StatusPages" API
1212

13+
@team:DataDog/incident-app
14+
Scenario: Create backfilled degradation returns "Created" response
15+
Given there is a valid "status_page" in the system
16+
And new "CreateBackfilledDegradation" request
17+
And request contains "page_id" parameter from "status_page.data.id"
18+
And body with value {"data": {"attributes": {"title": "Past API Outage", "updates": [{"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "degraded"}], "description": "We detected elevated error rates in the API.", "started_at": "{{ timeISO('now - 1h') }}", "status": "investigating"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "degraded"}], "description": "Root cause identified as a misconfigured deployment.", "started_at": "{{ timeISO('now - 30m') }}", "status": "identified"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "operational"}], "description": "The issue has been resolved and API is operating normally.", "started_at": "{{ timeISO('now') }}", "status": "resolved"}]}, "type": "degradations"}}
19+
When the request is sent
20+
Then the response status is 201 Created
21+
And the response "data.attributes.title" is equal to "Past API Outage"
22+
23+
@team:DataDog/incident-app
24+
Scenario: Create backfilled maintenance returns "Created" response
25+
Given there is a valid "status_page" in the system
26+
And new "CreateBackfilledMaintenance" request
27+
And request contains "page_id" parameter from "status_page.data.id"
28+
And body with value {"data": {"attributes": {"title": "Past Database Maintenance", "updates": [{"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "maintenance"}], "description": "Database maintenance is in progress.", "started_at": "{{ timeISO('now - 1h') }}", "status": "in_progress"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "operational"}], "description": "Database maintenance has been completed successfully.", "started_at": "{{ timeISO('now') }}", "status": "completed"}]}, "type": "maintenances"}}
29+
When the request is sent
30+
Then the response status is 201 Created
31+
And the response "data.attributes.title" is equal to "Past Database Maintenance"
32+
1333
@team:DataDog/incident-app
1434
Scenario: Create component returns "Created" response
1535
Given there is a valid "status_page" in the system

0 commit comments

Comments
 (0)