Skip to content

Commit 05fc11b

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2776a1d of spec repo
1 parent 64364b8 commit 05fc11b

18 files changed

+871
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21602,6 +21602,82 @@ components:
2160221602
- type
2160321603
- attributes
2160421604
type: object
21605+
IncidentCreatePageAttributes:
21606+
description: Attributes for creating a page from an incident.
21607+
properties:
21608+
description:
21609+
description: Description of the page.
21610+
example: Page created for incident response
21611+
nullable: true
21612+
type: string
21613+
services:
21614+
description: List of services associated with the page.
21615+
example:
21616+
- web-service
21617+
- api-service
21618+
items:
21619+
type: string
21620+
nullable: true
21621+
type: array
21622+
tags:
21623+
description: List of tags for the page.
21624+
example:
21625+
- urgent
21626+
- production
21627+
items:
21628+
type: string
21629+
nullable: true
21630+
type: array
21631+
target:
21632+
$ref: '#/components/schemas/IncidentPageTarget'
21633+
title:
21634+
description: Title of the page.
21635+
example: Incident Response Page
21636+
type: string
21637+
required:
21638+
- title
21639+
- target
21640+
type: object
21641+
IncidentCreatePageFromIncidentData:
21642+
description: Data for creating a page from an incident.
21643+
properties:
21644+
attributes:
21645+
$ref: '#/components/schemas/IncidentCreatePageAttributes'
21646+
type:
21647+
$ref: '#/components/schemas/IncidentPageType'
21648+
required:
21649+
- type
21650+
- attributes
21651+
type: object
21652+
IncidentCreatePageFromIncidentRequest:
21653+
description: Request to create a page from an incident.
21654+
properties:
21655+
data:
21656+
$ref: '#/components/schemas/IncidentCreatePageFromIncidentData'
21657+
required:
21658+
- data
21659+
type: object
21660+
IncidentCreatePageResponse:
21661+
description: Response from creating a page from an incident.
21662+
properties:
21663+
data:
21664+
$ref: '#/components/schemas/IncidentCreatePageResponseData'
21665+
required:
21666+
- data
21667+
type: object
21668+
IncidentCreatePageResponseData:
21669+
description: Data from creating a page.
21670+
properties:
21671+
id:
21672+
description: The UUID of the created page.
21673+
example: 00000000-0000-0000-0000-000000000000
21674+
type: string
21675+
type:
21676+
$ref: '#/components/schemas/IncidentPageIdType'
21677+
required:
21678+
- id
21679+
- type
21680+
type: object
2160521681
IncidentCreateRelationships:
2160621682
description: The relationships the incident will have with other resources once
2160721683
created.
@@ -22586,6 +22662,48 @@ components:
2258622662
- id
2258722663
- type
2258822664
type: object
22665+
IncidentPageIdType:
22666+
description: Incident page ID type.
22667+
enum:
22668+
- page_uuid
22669+
example: page_uuid
22670+
type: string
22671+
x-enum-varnames:
22672+
- PAGE_UUID
22673+
IncidentPageTarget:
22674+
description: Target for creating a page from an incident.
22675+
properties:
22676+
identifier:
22677+
description: The identifier of the target (team handle, team UUID, or user
22678+
UUID).
22679+
example: team-handle
22680+
type: string
22681+
type:
22682+
$ref: '#/components/schemas/IncidentPageTargetType'
22683+
required:
22684+
- type
22685+
- identifier
22686+
type: object
22687+
IncidentPageTargetType:
22688+
description: Type of page target for incident pages.
22689+
enum:
22690+
- team_handle
22691+
- team_uuid
22692+
- user_uuid
22693+
example: team_handle
22694+
type: string
22695+
x-enum-varnames:
22696+
- TEAM_HANDLE
22697+
- TEAM_UUID
22698+
- USER_UUID
22699+
IncidentPageType:
22700+
description: Incident page type.
22701+
enum:
22702+
- page
22703+
example: page
22704+
type: string
22705+
x-enum-varnames:
22706+
- PAGE
2258922707
IncidentPostmortemType:
2259022708
default: incident_postmortems
2259122709
description: Incident postmortem resource type.
@@ -50878,6 +50996,7 @@ components:
5087850996
is not required to set downtimes.
5087950997
monitors_read: View monitors.
5088050998
monitors_write: Edit, delete, and resolve individual monitors.
50999+
oncall_page: Create and manage on-call pages.
5088151000
org_connections_read: Read cross organization connections.
5088251001
org_connections_write: Create, edit, and delete cross organization connections.
5088351002
org_management: Edit org configurations, including authentication and
@@ -59667,6 +59786,54 @@ paths:
5966759786
x-unstable: '**Note**: This endpoint is in Preview.
5966859787

5966959788
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
59789+
/api/v2/incidents/{incident_id}/page:
59790+
post:
59791+
description: Create a page from an incident.
59792+
operationId: CreatePageFromIncident
59793+
parameters:
59794+
- $ref: '#/components/parameters/IncidentIDPathParameter'
59795+
requestBody:
59796+
content:
59797+
application/json:
59798+
schema:
59799+
$ref: '#/components/schemas/IncidentCreatePageFromIncidentRequest'
59800+
description: Page creation request payload.
59801+
required: true
59802+
responses:
59803+
'200':
59804+
content:
59805+
application/json:
59806+
schema:
59807+
$ref: '#/components/schemas/IncidentCreatePageResponse'
59808+
description: OK
59809+
'400':
59810+
$ref: '#/components/responses/BadRequestResponse'
59811+
'401':
59812+
$ref: '#/components/responses/UnauthorizedResponse'
59813+
'403':
59814+
$ref: '#/components/responses/ForbiddenResponse'
59815+
'404':
59816+
$ref: '#/components/responses/NotFoundResponse'
59817+
'429':
59818+
$ref: '#/components/responses/TooManyRequestsResponse'
59819+
security:
59820+
- apiKeyAuth: []
59821+
appKeyAuth: []
59822+
- AuthZ:
59823+
- incident_read
59824+
- oncall_page
59825+
summary: Create a page from an incident
59826+
tags:
59827+
- Incidents
59828+
x-codegen-request-body-name: body
59829+
x-permission:
59830+
operator: AND
59831+
permissions:
59832+
- incident_read
59833+
- oncall_page
59834+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
59835+
59836+
contact [Datadog support](https://docs.datadoghq.com/help/).'
5967059837
/api/v2/incidents/{incident_id}/relationships/integrations:
5967159838
get:
5967259839
description: Get all integration metadata for an incident.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Create a page from an incident returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createPageFromIncident"] = true;
9+
const apiInstance = new v2.IncidentsApi(configuration);
10+
11+
const params: v2.IncidentsApiCreatePageFromIncidentRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
description: "Page created for incident response",
16+
services: ["web-service", "api-service"],
17+
tags: ["urgent", "production"],
18+
target: {
19+
identifier: "team-handle",
20+
type: "team_handle",
21+
},
22+
title: "Incident Response Page",
23+
},
24+
type: "page",
25+
},
26+
},
27+
incidentId: "incident_id",
28+
};
29+
30+
apiInstance
31+
.createPageFromIncident(params)
32+
.then((data: v2.IncidentCreatePageResponse) => {
33+
console.log(
34+
"API called successfully. Returned data: " + JSON.stringify(data)
35+
);
36+
})
37+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5530,6 +5530,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
55305530
},
55315531
"operationResponseType": "{}",
55325532
},
5533+
"v2.CreatePageFromIncident": {
5534+
"incidentId": {
5535+
"type": "string",
5536+
"format": "",
5537+
},
5538+
"body": {
5539+
"type": "IncidentCreatePageFromIncidentRequest",
5540+
"format": "",
5541+
},
5542+
"operationResponseType": "IncidentCreatePageResponse",
5543+
},
55335544
"v2.ListIncidentIntegrations": {
55345545
"incidentId": {
55355546
"type": "string",

features/v2/incidents.feature

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,33 @@ Feature: Incidents
2121
When the request is sent
2222
Then the response status is 200 OK
2323

24+
@generated @skip @team:DataDog/incident-app
25+
Scenario: Create a page from an incident returns "Bad Request" response
26+
Given operation "CreatePageFromIncident" enabled
27+
And new "CreatePageFromIncident" request
28+
And request contains "incident_id" parameter from "REPLACE.ME"
29+
And body with value {"data": {"attributes": {"description": "Page created for incident response", "services": ["web-service", "api-service"], "tags": ["urgent", "production"], "target": {"identifier": "team-handle", "type": "team_handle"}, "title": "Incident Response Page"}, "type": "page"}}
30+
When the request is sent
31+
Then the response status is 400 Bad Request
32+
33+
@generated @skip @team:DataDog/incident-app
34+
Scenario: Create a page from an incident returns "Not Found" response
35+
Given operation "CreatePageFromIncident" enabled
36+
And new "CreatePageFromIncident" request
37+
And request contains "incident_id" parameter from "REPLACE.ME"
38+
And body with value {"data": {"attributes": {"description": "Page created for incident response", "services": ["web-service", "api-service"], "tags": ["urgent", "production"], "target": {"identifier": "team-handle", "type": "team_handle"}, "title": "Incident Response Page"}, "type": "page"}}
39+
When the request is sent
40+
Then the response status is 404 Not Found
41+
42+
@generated @skip @team:DataDog/incident-app
43+
Scenario: Create a page from an incident returns "OK" response
44+
Given operation "CreatePageFromIncident" enabled
45+
And new "CreatePageFromIncident" request
46+
And request contains "incident_id" parameter from "REPLACE.ME"
47+
And body with value {"data": {"attributes": {"description": "Page created for incident response", "services": ["web-service", "api-service"], "tags": ["urgent", "production"], "target": {"identifier": "team-handle", "type": "team_handle"}, "title": "Incident Response Page"}, "type": "page"}}
48+
When the request is sent
49+
Then the response status is 200 OK
50+
2451
@team:DataDog/incident-app
2552
Scenario: Create an incident attachment returns "OK" response
2653
Given operation "UpdateIncidentAttachments" enabled

features/v2/undo.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,13 @@
14231423
"type": "idempotent"
14241424
}
14251425
},
1426+
"CreatePageFromIncident": {
1427+
"tag": "Incidents",
1428+
"undo": {
1429+
"parameters": [],
1430+
"type": "unsafe"
1431+
}
1432+
},
14261433
"ListIncidentIntegrations": {
14271434
"tag": "Incidents",
14281435
"undo": {

packages/datadog-api-client-common/configuration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ export function createConfiguration(
260260
"v2.createIncidentNotificationTemplate": false,
261261
"v2.createIncidentTodo": false,
262262
"v2.createIncidentType": false,
263+
"v2.createPageFromIncident": false,
263264
"v2.deleteIncident": false,
264265
"v2.deleteIncidentImpact": false,
265266
"v2.deleteIncidentIntegration": false,

0 commit comments

Comments
 (0)