Skip to content

Commit 7b80adf

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

45 files changed

Lines changed: 4451 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: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
@endpoint(servicenow-integration) @endpoint(servicenow-integration-v2)
2+
Feature: ServiceNow Integration
3+
Manage your ServiceNow Integration. ServiceNow is a cloud-based platform
4+
that helps organizations manage digital workflows for enterprise
5+
operations.
6+
7+
Background:
8+
Given a valid "apiKeyAuth" key in the system
9+
And a valid "appKeyAuth" key in the system
10+
And an instance of "ServiceNowIntegration" API
11+
12+
@generated @skip @team:Datadog/collaboration-integrations
13+
Scenario: Create ServiceNow template returns "Bad Request" response
14+
Given operation "CreateServiceNowTemplate" enabled
15+
And new "CreateServiceNowTemplate" request
16+
And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "software", "priority": "1"}, "handle_name": "incident-template", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}}
17+
When the request is sent
18+
Then the response status is 400 Bad Request
19+
20+
@generated @skip @team:Datadog/collaboration-integrations
21+
Scenario: Create ServiceNow template returns "Created" response
22+
Given operation "CreateServiceNowTemplate" enabled
23+
And new "CreateServiceNowTemplate" request
24+
And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "software", "priority": "1"}, "handle_name": "incident-template", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}}
25+
When the request is sent
26+
Then the response status is 201 Created
27+
28+
@generated @skip @team:Datadog/collaboration-integrations
29+
Scenario: Delete ServiceNow template returns "Bad Request" response
30+
Given operation "DeleteServiceNowTemplate" enabled
31+
And new "DeleteServiceNowTemplate" request
32+
And request contains "template_id" parameter from "REPLACE.ME"
33+
When the request is sent
34+
Then the response status is 400 Bad Request
35+
36+
@generated @skip @team:Datadog/collaboration-integrations
37+
Scenario: Delete ServiceNow template returns "Not Found" response
38+
Given operation "DeleteServiceNowTemplate" enabled
39+
And new "DeleteServiceNowTemplate" request
40+
And request contains "template_id" parameter from "REPLACE.ME"
41+
When the request is sent
42+
Then the response status is 404 Not Found
43+
44+
@generated @skip @team:Datadog/collaboration-integrations
45+
Scenario: Delete ServiceNow template returns "OK" response
46+
Given operation "DeleteServiceNowTemplate" enabled
47+
And new "DeleteServiceNowTemplate" request
48+
And request contains "template_id" parameter from "REPLACE.ME"
49+
When the request is sent
50+
Then the response status is 200 OK
51+
52+
@generated @skip @team:Datadog/collaboration-integrations
53+
Scenario: Get ServiceNow template returns "Bad Request" response
54+
Given operation "GetServiceNowTemplate" enabled
55+
And new "GetServiceNowTemplate" request
56+
And request contains "template_id" parameter from "REPLACE.ME"
57+
When the request is sent
58+
Then the response status is 400 Bad Request
59+
60+
@generated @skip @team:Datadog/collaboration-integrations
61+
Scenario: Get ServiceNow template returns "Not Found" response
62+
Given operation "GetServiceNowTemplate" enabled
63+
And new "GetServiceNowTemplate" request
64+
And request contains "template_id" parameter from "REPLACE.ME"
65+
When the request is sent
66+
Then the response status is 404 Not Found
67+
68+
@generated @skip @team:Datadog/collaboration-integrations
69+
Scenario: Get ServiceNow template returns "OK" response
70+
Given operation "GetServiceNowTemplate" enabled
71+
And new "GetServiceNowTemplate" request
72+
And request contains "template_id" parameter from "REPLACE.ME"
73+
When the request is sent
74+
Then the response status is 200 OK
75+
76+
@generated @skip @team:Datadog/collaboration-integrations
77+
Scenario: List ServiceNow assignment groups returns "Bad Request" response
78+
Given operation "ListServiceNowAssignmentGroups" enabled
79+
And new "ListServiceNowAssignmentGroups" request
80+
And request contains "instance_id" parameter from "REPLACE.ME"
81+
When the request is sent
82+
Then the response status is 400 Bad Request
83+
84+
@generated @skip @team:Datadog/collaboration-integrations
85+
Scenario: List ServiceNow assignment groups returns "Not Found" response
86+
Given operation "ListServiceNowAssignmentGroups" enabled
87+
And new "ListServiceNowAssignmentGroups" request
88+
And request contains "instance_id" parameter from "REPLACE.ME"
89+
When the request is sent
90+
Then the response status is 404 Not Found
91+
92+
@generated @skip @team:Datadog/collaboration-integrations
93+
Scenario: List ServiceNow assignment groups returns "OK" response
94+
Given operation "ListServiceNowAssignmentGroups" enabled
95+
And new "ListServiceNowAssignmentGroups" request
96+
And request contains "instance_id" parameter from "REPLACE.ME"
97+
When the request is sent
98+
Then the response status is 200 OK
99+
100+
@generated @skip @team:Datadog/collaboration-integrations
101+
Scenario: List ServiceNow business services returns "Bad Request" response
102+
Given operation "ListServiceNowBusinessServices" enabled
103+
And new "ListServiceNowBusinessServices" request
104+
And request contains "instance_id" parameter from "REPLACE.ME"
105+
When the request is sent
106+
Then the response status is 400 Bad Request
107+
108+
@generated @skip @team:Datadog/collaboration-integrations
109+
Scenario: List ServiceNow business services returns "Not Found" response
110+
Given operation "ListServiceNowBusinessServices" enabled
111+
And new "ListServiceNowBusinessServices" request
112+
And request contains "instance_id" parameter from "REPLACE.ME"
113+
When the request is sent
114+
Then the response status is 404 Not Found
115+
116+
@generated @skip @team:Datadog/collaboration-integrations
117+
Scenario: List ServiceNow business services returns "OK" response
118+
Given operation "ListServiceNowBusinessServices" enabled
119+
And new "ListServiceNowBusinessServices" request
120+
And request contains "instance_id" parameter from "REPLACE.ME"
121+
When the request is sent
122+
Then the response status is 200 OK
123+
124+
@generated @skip @team:Datadog/collaboration-integrations
125+
Scenario: List ServiceNow instances returns "Not Found" response
126+
Given operation "ListServiceNowInstances" enabled
127+
And new "ListServiceNowInstances" request
128+
When the request is sent
129+
Then the response status is 404 Not Found
130+
131+
@generated @skip @team:Datadog/collaboration-integrations
132+
Scenario: List ServiceNow instances returns "OK" response
133+
Given operation "ListServiceNowInstances" enabled
134+
And new "ListServiceNowInstances" request
135+
When the request is sent
136+
Then the response status is 200 OK
137+
138+
@generated @skip @team:Datadog/collaboration-integrations
139+
Scenario: List ServiceNow templates returns "OK" response
140+
Given operation "ListServiceNowTemplates" enabled
141+
And new "ListServiceNowTemplates" request
142+
When the request is sent
143+
Then the response status is 200 OK
144+
145+
@generated @skip @team:Datadog/collaboration-integrations
146+
Scenario: List ServiceNow users returns "Bad Request" response
147+
Given operation "ListServiceNowUsers" enabled
148+
And new "ListServiceNowUsers" request
149+
And request contains "instance_id" parameter from "REPLACE.ME"
150+
When the request is sent
151+
Then the response status is 400 Bad Request
152+
153+
@generated @skip @team:Datadog/collaboration-integrations
154+
Scenario: List ServiceNow users returns "Not Found" response
155+
Given operation "ListServiceNowUsers" enabled
156+
And new "ListServiceNowUsers" request
157+
And request contains "instance_id" parameter from "REPLACE.ME"
158+
When the request is sent
159+
Then the response status is 404 Not Found
160+
161+
@generated @skip @team:Datadog/collaboration-integrations
162+
Scenario: List ServiceNow users returns "OK" response
163+
Given operation "ListServiceNowUsers" enabled
164+
And new "ListServiceNowUsers" request
165+
And request contains "instance_id" parameter from "REPLACE.ME"
166+
When the request is sent
167+
Then the response status is 200 OK
168+
169+
@generated @skip @team:Datadog/collaboration-integrations
170+
Scenario: Update ServiceNow template returns "Bad Request" response
171+
Given operation "UpdateServiceNowTemplate" enabled
172+
And new "UpdateServiceNowTemplate" request
173+
And request contains "template_id" parameter from "REPLACE.ME"
174+
And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "hardware", "priority": "2"}, "handle_name": "incident-template-updated", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}}
175+
When the request is sent
176+
Then the response status is 400 Bad Request
177+
178+
@generated @skip @team:Datadog/collaboration-integrations
179+
Scenario: Update ServiceNow template returns "Not Found" response
180+
Given operation "UpdateServiceNowTemplate" enabled
181+
And new "UpdateServiceNowTemplate" request
182+
And request contains "template_id" parameter from "REPLACE.ME"
183+
And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "hardware", "priority": "2"}, "handle_name": "incident-template-updated", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}}
184+
When the request is sent
185+
Then the response status is 404 Not Found
186+
187+
@generated @skip @team:Datadog/collaboration-integrations
188+
Scenario: Update ServiceNow template returns "OK" response
189+
Given operation "UpdateServiceNowTemplate" enabled
190+
And new "UpdateServiceNowTemplate" request
191+
And request contains "template_id" parameter from "REPLACE.ME"
192+
And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "hardware", "priority": "2"}, "handle_name": "incident-template-updated", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}}
193+
When the request is sent
194+
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,6 +2231,67 @@
22312231
"type": "idempotent"
22322232
}
22332233
},
2234+
"ListServiceNowAssignmentGroups": {
2235+
"tag": "ServiceNow Integration",
2236+
"undo": {
2237+
"type": "safe"
2238+
}
2239+
},
2240+
"ListServiceNowBusinessServices": {
2241+
"tag": "ServiceNow Integration",
2242+
"undo": {
2243+
"type": "safe"
2244+
}
2245+
},
2246+
"ListServiceNowTemplates": {
2247+
"tag": "ServiceNow Integration",
2248+
"undo": {
2249+
"type": "safe"
2250+
}
2251+
},
2252+
"CreateServiceNowTemplate": {
2253+
"tag": "ServiceNow Integration",
2254+
"undo": {
2255+
"operationId": "DeleteServiceNowTemplate",
2256+
"parameters": [
2257+
{
2258+
"name": "template_id",
2259+
"source": "<RESPONSE_PATH>"
2260+
}
2261+
],
2262+
"type": "unsafe"
2263+
}
2264+
},
2265+
"DeleteServiceNowTemplate": {
2266+
"tag": "ServiceNow Integration",
2267+
"undo": {
2268+
"type": "idempotent"
2269+
}
2270+
},
2271+
"GetServiceNowTemplate": {
2272+
"tag": "ServiceNow Integration",
2273+
"undo": {
2274+
"type": "safe"
2275+
}
2276+
},
2277+
"UpdateServiceNowTemplate": {
2278+
"tag": "ServiceNow Integration",
2279+
"undo": {
2280+
"type": "idempotent"
2281+
}
2282+
},
2283+
"ListServiceNowInstances": {
2284+
"tag": "ServiceNow Integration",
2285+
"undo": {
2286+
"type": "safe"
2287+
}
2288+
},
2289+
"ListServiceNowUsers": {
2290+
"tag": "ServiceNow Integration",
2291+
"undo": {
2292+
"type": "safe"
2293+
}
2294+
},
22342295
"ListCloudflareAccounts": {
22352296
"tag": "Cloudflare Integration",
22362297
"undo": {

packages/datadog-api-client/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ apiInstance
435435
| Service Level Objective Corrections | @datadog/datadog-api-client-service-level-objective-corrections | [README.md](../../services/service-level-objective-corrections/README.md) |
436436
| Service Level Objectives | @datadog/datadog-api-client-service-level-objectives | [README.md](../../services/service-level-objectives/README.md) |
437437
| Service Scorecards | @datadog/datadog-api-client-service-scorecards | [README.md](../../services/service-scorecards/README.md) |
438+
| ServiceNow Integration | @datadog/datadog-api-client-service-now-integration | [README.md](../../services/service-now-integration/README.md) |
438439
| Slack Integration | @datadog/datadog-api-client-slack-integration | [README.md](../../services/slack-integration/README.md) |
439440
| Snapshots | @datadog/datadog-api-client-snapshots | [README.md](../../services/snapshots/README.md) |
440441
| Software Catalog | @datadog/datadog-api-client-software-catalog | [README.md](../../services/software-catalog/README.md) |

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6646,6 +6646,65 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
66466646
},
66476647
operationResponseType: "OpsgenieServiceResponse",
66486648
},
6649+
"ServiceNowIntegrationApi.V2.ListServiceNowAssignmentGroups": {
6650+
instanceId: {
6651+
type: "string",
6652+
format: "uuid",
6653+
},
6654+
operationResponseType: "ServiceNowAssignmentGroupsResponse",
6655+
},
6656+
"ServiceNowIntegrationApi.V2.ListServiceNowBusinessServices": {
6657+
instanceId: {
6658+
type: "string",
6659+
format: "uuid",
6660+
},
6661+
operationResponseType: "ServiceNowBusinessServicesResponse",
6662+
},
6663+
"ServiceNowIntegrationApi.V2.ListServiceNowTemplates": {
6664+
operationResponseType: "ServiceNowTemplatesResponse",
6665+
},
6666+
"ServiceNowIntegrationApi.V2.CreateServiceNowTemplate": {
6667+
body: {
6668+
type: "ServiceNowTemplateCreateRequest",
6669+
format: "",
6670+
},
6671+
operationResponseType: "ServiceNowTemplateResponse",
6672+
},
6673+
"ServiceNowIntegrationApi.V2.GetServiceNowTemplate": {
6674+
templateId: {
6675+
type: "string",
6676+
format: "uuid",
6677+
},
6678+
operationResponseType: "ServiceNowTemplateResponse",
6679+
},
6680+
"ServiceNowIntegrationApi.V2.UpdateServiceNowTemplate": {
6681+
templateId: {
6682+
type: "string",
6683+
format: "uuid",
6684+
},
6685+
body: {
6686+
type: "ServiceNowTemplateUpdateRequest",
6687+
format: "",
6688+
},
6689+
operationResponseType: "ServiceNowTemplateResponse",
6690+
},
6691+
"ServiceNowIntegrationApi.V2.DeleteServiceNowTemplate": {
6692+
templateId: {
6693+
type: "string",
6694+
format: "uuid",
6695+
},
6696+
operationResponseType: "{}",
6697+
},
6698+
"ServiceNowIntegrationApi.V2.ListServiceNowInstances": {
6699+
operationResponseType: "ServiceNowInstancesResponse",
6700+
},
6701+
"ServiceNowIntegrationApi.V2.ListServiceNowUsers": {
6702+
instanceId: {
6703+
type: "string",
6704+
format: "uuid",
6705+
},
6706+
operationResponseType: "ServiceNowUsersResponse",
6707+
},
66496708
"CloudflareIntegrationApi.V2.ListCloudflareAccounts": {
66506709
operationResponseType: "CloudflareAccountsResponse",
66516710
},
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# @datadog/datadog-api-client-service-now-integration
2+
3+
## Description
4+
5+
Manage your ServiceNow Integration. ServiceNow is a cloud-based platform that helps organizations manage digital workflows for enterprise operations.
6+
7+
## Navigation
8+
9+
- [Installation](#installation)
10+
- [Getting Started](#getting-started)
11+
12+
## Installation
13+
14+
```sh
15+
# NPM
16+
npm install @datadog/datadog-api-client-service-now-integration
17+
# Yarn
18+
yarn add @datadog/datadog-api-client-service-now-integration
19+
```
20+
21+
## Getting Started
22+
```ts
23+
import { createConfiguration } from "@datadog/datadog-api-client";
24+
import { ServiceNowIntegrationApiV2 } from "@datadog/datadog-api-client-service-now-integration";
25+
import { v2 } from "@datadog/datadog-api-client-service-now-integration";
26+
27+
const configuration = createConfiguration();
28+
// Enable unstable operations
29+
const configurationOpts = {
30+
unstableOperations: {
31+
"ServiceNowIntegrationApi.v2.listServiceNowAssignmentGroups": true
32+
}
33+
}
34+
35+
const configuration = createConfiguration(configurationOpts);
36+
const apiInstance = new ServiceNowIntegrationApiV2(configuration);
37+
const params = {/* parameters */};
38+
39+
apiInstance.listServiceNowAssignmentGroups(params).then((data) => {
40+
console.log("API called successfully. Returned data: " + JSON.stringify(data));
41+
}).catch((error) => {
42+
console.error("Error calling API: " + error);
43+
});
44+
```

0 commit comments

Comments
 (0)