-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathCreatePageFromIncident.rb
More file actions
30 lines (28 loc) · 1021 Bytes
/
CreatePageFromIncident.rb
File metadata and controls
30 lines (28 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Create a page from an incident returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_page_from_incident".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
body = DatadogAPIClient::V2::IncidentCreatePageFromIncidentRequest.new({
data: DatadogAPIClient::V2::IncidentCreatePageFromIncidentData.new({
attributes: DatadogAPIClient::V2::IncidentCreatePageAttributes.new({
description: "Page created for incident response",
services: [
"web-service",
"api-service",
],
tags: [
"urgent",
"production",
],
target: DatadogAPIClient::V2::IncidentPageTarget.new({
identifier: "team-handle",
type: DatadogAPIClient::V2::IncidentPageTargetType::TEAM_HANDLE,
}),
title: "Incident Response Page",
}),
type: DatadogAPIClient::V2::IncidentPageType::PAGE,
}),
})
p api_instance.create_page_from_incident("incident_id", body)