Skip to content

Commit ca08201

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI specification for ServiceNow integration (#3330)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 41687d1 commit ca08201

44 files changed

Lines changed: 4397 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/schemas/v2/openapi.yaml

Lines changed: 767 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Create ServiceNow template returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createServiceNowTemplate"] = true;
9+
const apiInstance = new v2.ServiceNowIntegrationApi(configuration);
10+
11+
const params: v2.ServiceNowIntegrationApiCreateServiceNowTemplateRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
assignmentGroupId: "65b3341b-0680-47f9-a6d4-134db45c603e",
16+
businessServiceId: "65b3341b-0680-47f9-a6d4-134db45c603e",
17+
fieldsMapping: {
18+
category: "software",
19+
priority: "1",
20+
},
21+
handleName: "incident-template",
22+
instanceId: "65b3341b-0680-47f9-a6d4-134db45c603e",
23+
servicenowTablename: "incident",
24+
userId: "65b3341b-0680-47f9-a6d4-134db45c603e",
25+
},
26+
type: "servicenow_templates",
27+
},
28+
},
29+
};
30+
31+
apiInstance
32+
.createServiceNowTemplate(params)
33+
.then((data: v2.ServiceNowTemplateResponse) => {
34+
console.log(
35+
"API called successfully. Returned data: " + JSON.stringify(data)
36+
);
37+
})
38+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Delete ServiceNow template returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteServiceNowTemplate"] = true;
9+
const apiInstance = new v2.ServiceNowIntegrationApi(configuration);
10+
11+
const params: v2.ServiceNowIntegrationApiDeleteServiceNowTemplateRequest = {
12+
templateId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
13+
};
14+
15+
apiInstance
16+
.deleteServiceNowTemplate(params)
17+
.then((data: any) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get ServiceNow template returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getServiceNowTemplate"] = true;
9+
const apiInstance = new v2.ServiceNowIntegrationApi(configuration);
10+
11+
const params: v2.ServiceNowIntegrationApiGetServiceNowTemplateRequest = {
12+
templateId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
13+
};
14+
15+
apiInstance
16+
.getServiceNowTemplate(params)
17+
.then((data: v2.ServiceNowTemplateResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* List ServiceNow assignment groups returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listServiceNowAssignmentGroups"] = true;
9+
const apiInstance = new v2.ServiceNowIntegrationApi(configuration);
10+
11+
const params: v2.ServiceNowIntegrationApiListServiceNowAssignmentGroupsRequest =
12+
{
13+
instanceId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
14+
};
15+
16+
apiInstance
17+
.listServiceNowAssignmentGroups(params)
18+
.then((data: v2.ServiceNowAssignmentGroupsResponse) => {
19+
console.log(
20+
"API called successfully. Returned data: " + JSON.stringify(data)
21+
);
22+
})
23+
.catch((error: any) => console.error(error));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* List ServiceNow business services returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listServiceNowBusinessServices"] = true;
9+
const apiInstance = new v2.ServiceNowIntegrationApi(configuration);
10+
11+
const params: v2.ServiceNowIntegrationApiListServiceNowBusinessServicesRequest =
12+
{
13+
instanceId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
14+
};
15+
16+
apiInstance
17+
.listServiceNowBusinessServices(params)
18+
.then((data: v2.ServiceNowBusinessServicesResponse) => {
19+
console.log(
20+
"API called successfully. Returned data: " + JSON.stringify(data)
21+
);
22+
})
23+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* List ServiceNow instances returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listServiceNowInstances"] = true;
9+
const apiInstance = new v2.ServiceNowIntegrationApi(configuration);
10+
11+
apiInstance
12+
.listServiceNowInstances()
13+
.then((data: v2.ServiceNowInstancesResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* List ServiceNow templates returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listServiceNowTemplates"] = true;
9+
const apiInstance = new v2.ServiceNowIntegrationApi(configuration);
10+
11+
apiInstance
12+
.listServiceNowTemplates()
13+
.then((data: v2.ServiceNowTemplatesResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* List ServiceNow users returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listServiceNowUsers"] = true;
9+
const apiInstance = new v2.ServiceNowIntegrationApi(configuration);
10+
11+
const params: v2.ServiceNowIntegrationApiListServiceNowUsersRequest = {
12+
instanceId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
13+
};
14+
15+
apiInstance
16+
.listServiceNowUsers(params)
17+
.then((data: v2.ServiceNowUsersResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Update ServiceNow template returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.updateServiceNowTemplate"] = true;
9+
const apiInstance = new v2.ServiceNowIntegrationApi(configuration);
10+
11+
const params: v2.ServiceNowIntegrationApiUpdateServiceNowTemplateRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
assignmentGroupId: "65b3341b-0680-47f9-a6d4-134db45c603e",
16+
businessServiceId: "65b3341b-0680-47f9-a6d4-134db45c603e",
17+
fieldsMapping: {
18+
category: "hardware",
19+
priority: "2",
20+
},
21+
handleName: "incident-template-updated",
22+
instanceId: "65b3341b-0680-47f9-a6d4-134db45c603e",
23+
servicenowTablename: "incident",
24+
userId: "65b3341b-0680-47f9-a6d4-134db45c603e",
25+
},
26+
type: "servicenow_templates",
27+
},
28+
},
29+
templateId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
30+
};
31+
32+
apiInstance
33+
.updateServiceNowTemplate(params)
34+
.then((data: v2.ServiceNowTemplateResponse) => {
35+
console.log(
36+
"API called successfully. Returned data: " + JSON.stringify(data)
37+
);
38+
})
39+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)