Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,997 changes: 5,997 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions examples/v2/incidents/BatchCreateIncidentRuleExecutionStates.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Batch create incident rule execution states returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.batchCreateIncidentRuleExecutionStates"] =
true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiBatchCreateIncidentRuleExecutionStatesRequest = {
body: {
data: {
attributes: {
rules: [
{
lastExecutedAt: new Date(2024, 1, 1, 0, 0, 0, 0),
ruleUuid: "00000000-0000-0000-0000-000000000000",
},
],
},
type: "incident_rule_execution_states",
},
},
incidentId: "incident_id",
};

apiInstance
.batchCreateIncidentRuleExecutionStates(params)
.then((data: v2.IncidentRuleExecutionStatesResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
36 changes: 36 additions & 0 deletions examples/v2/incidents/BatchUpdateIncidentRuleExecutionStates.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Batch update incident rule execution states returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.batchUpdateIncidentRuleExecutionStates"] =
true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiBatchUpdateIncidentRuleExecutionStatesRequest = {
body: {
data: {
attributes: {
rules: [
{
lastExecutedAt: new Date(2024, 1, 1, 0, 0, 0, 0),
ruleUuid: "00000000-0000-0000-0000-000000000000",
},
],
},
type: "incident_rule_execution_states",
},
},
incidentId: "incident_id",
};

apiInstance
.batchUpdateIncidentRuleExecutionStates(params)
.then((data: v2.IncidentRuleExecutionStatesResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
43 changes: 43 additions & 0 deletions examples/v2/incidents/CreateIncidentCommunication.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* Create an incident communication returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentCommunication"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentCommunicationRequest = {
body: {
data: {
attributes: {
communicationType: "manual",
content: {
groupingKey: "update-1",
handles: [
{
createdAt: "2024-01-01T00:00:00.000Z",
displayName: "#incidents-channel",
handle: "@slack-incidents-channel",
},
],
message: "Incident update for INC-123.",
status: 0,
subject: "Incident INC-123: Update",
},
},
type: "communication",
},
},
incidentId: "incident_id",
};

apiInstance
.createIncidentCommunication(params)
.then((data: v2.IncidentCommunicationResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
22 changes: 22 additions & 0 deletions examples/v2/incidents/CreateIncidentGoogleMeetSpace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Create an incident Google Meet space returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentGoogleMeetSpace"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentGoogleMeetSpaceRequest = {
incidentId: "incident_id",
};

apiInstance
.createIncidentGoogleMeetSpace(params)
.then((data: v2.IncidentGoogleMeetIntegrationResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
33 changes: 33 additions & 0 deletions examples/v2/incidents/CreateIncidentJiraIssue.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Create an incident Jira issue returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentJiraIssue"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentJiraIssueRequest = {
body: {
data: {
attributes: {
accountId: "123456",
issueTypeId: "10001",
projectId: "10000",
templateId: "00000000-0000-0000-0000-000000000000",
},
type: "incident_jira_issues",
},
},
incidentId: "incident_id",
};

apiInstance
.createIncidentJiraIssue(params)
.then((data: v2.IncidentJiraIssueIntegrationResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
52 changes: 52 additions & 0 deletions examples/v2/incidents/CreateIncidentJiraTemplate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Create an incident Jira template returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentJiraTemplate"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentJiraTemplateRequest = {
body: {
data: {
attributes: {
accountId: "123456",
fieldConfigurations: [
{
incidentField: "title",
jiraFieldKey: "summary",
jiraFieldType: "string",
syncDirection: "bidirectional",
},
],
isDefault: false,
issueId: "10001",
name: "Default Jira Template",
projectId: "10000",
projectKey: "INC",
syncEnabled: true,
type: "jira",
},
relationships: {
incidentType: {
data: {
id: "00000000-0000-0000-0000-000000000000",
type: "incident_types",
},
},
},
type: "incidents_jira_templates",
},
},
};

apiInstance
.createIncidentJiraTemplate(params)
.then((data: v2.IncidentJiraTemplateResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
23 changes: 23 additions & 0 deletions examples/v2/incidents/CreateIncidentMSTeamsOnlineMeeting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Create an incident Microsoft Teams online meeting returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentMSTeamsOnlineMeeting"] =
true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentMSTeamsOnlineMeetingRequest = {
incidentId: "incident_id",
};

apiInstance
.createIncidentMSTeamsOnlineMeeting(params)
.then((data: v2.IncidentMSTeamsIntegrationResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Create an incident Microsoft Teams configuration returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations[
"v2.createIncidentMicrosoftTeamsConfiguration"
] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentMicrosoftTeamsConfigurationRequest =
{
body: {
data: {
attributes: {
manualMeetingCreation: false,
postMeetingSummary: true,
},
type: "microsoft_teams_configurations",
},
},
};

apiInstance
.createIncidentMicrosoftTeamsConfiguration(params)
.then((data: v2.IncidentMicrosoftTeamsConfigurationResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
49 changes: 49 additions & 0 deletions examples/v2/incidents/CreateIncidentRoleAssignment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Create an incident role assignment returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentRoleAssignment"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentRoleAssignmentRequest = {
body: {
data: {
attributes: {
role: "commander",
},
relationships: {
reservedRole: {
data: {
id: "00000000-0000-0000-0000-000000000000",
type: "incident_reserved_roles",
},
},
responder: {
data: {
id: "00000000-0000-0000-0000-000000000000",
type: "users",
},
},
userDefinedRole: {
data: {
id: "00000000-0000-0000-0000-000000000000",
type: "incident_reserved_roles",
},
},
},
type: "incident_role_assignments",
},
},
};

apiInstance
.createIncidentRoleAssignment(params)
.then((data: v2.IncidentRoleAssignmentResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
36 changes: 36 additions & 0 deletions examples/v2/incidents/CreateIncidentStatusPageNotice.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Publish an incident status page notice returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentStatusPageNotice"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentStatusPageNoticeRequest = {
body: {
data: {
attributes: {
components: {
component_1: "degraded_performance",
},
message: "We are investigating reports of elevated error rates.",
status: "investigating",
title: "Service degradation detected.",
},
type: "incident_integrations",
},
},
incidentId: "incident_id",
statuspageId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
};

apiInstance
.createIncidentStatusPageNotice(params)
.then((data: v2.IncidentStatusPageNoticeIntegrationResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Loading
Loading