Skip to content

Commit 1fcccec

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI documentation for Synthetics downtime endpoints (#3991)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 542ee26 commit 1fcccec

29 files changed

Lines changed: 3683 additions & 63 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 949 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Add a test to a Synthetics downtime returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SyntheticsApi(configuration);
9+
10+
const params: v2.SyntheticsApiAddTestToSyntheticsDowntimeRequest = {
11+
downtimeId: "00000000-0000-0000-0000-000000000001",
12+
testId: "abc-def-123",
13+
};
14+
15+
apiInstance
16+
.addTestToSyntheticsDowntime(params)
17+
.then((data: v2.SyntheticsDowntimeResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* Create a Synthetics downtime returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SyntheticsApi(configuration);
9+
10+
const params: v2.SyntheticsApiCreateSyntheticsDowntimeRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
isEnabled: true,
15+
name: "Weekly maintenance",
16+
testIds: ["abc-def-123"],
17+
timeSlots: [
18+
{
19+
duration: 3600,
20+
start: {
21+
day: 15,
22+
hour: 10,
23+
minute: 30,
24+
month: 1,
25+
year: 2024,
26+
},
27+
timezone: "Europe/Paris",
28+
},
29+
],
30+
},
31+
type: "downtime",
32+
},
33+
},
34+
};
35+
36+
apiInstance
37+
.createSyntheticsDowntime(params)
38+
.then((data: v2.SyntheticsDowntimeResponse) => {
39+
console.log(
40+
"API called successfully. Returned data: " + JSON.stringify(data)
41+
);
42+
})
43+
.catch((error: any) => console.error(error));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Delete a Synthetics downtime returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SyntheticsApi(configuration);
9+
10+
const params: v2.SyntheticsApiDeleteSyntheticsDowntimeRequest = {
11+
downtimeId: "00000000-0000-0000-0000-000000000001",
12+
};
13+
14+
apiInstance
15+
.deleteSyntheticsDowntime(params)
16+
.then((data: any) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Get a Synthetics downtime returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SyntheticsApi(configuration);
9+
10+
const params: v2.SyntheticsApiGetSyntheticsDowntimeRequest = {
11+
downtimeId: "00000000-0000-0000-0000-000000000001",
12+
};
13+
14+
apiInstance
15+
.getSyntheticsDowntime(params)
16+
.then((data: v2.SyntheticsDowntimeResponse) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* List Synthetics downtimes returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SyntheticsApi(configuration);
9+
10+
apiInstance
11+
.listSyntheticsDowntimes()
12+
.then((data: v2.SyntheticsDowntimesResponse) => {
13+
console.log(
14+
"API called successfully. Returned data: " + JSON.stringify(data)
15+
);
16+
})
17+
.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+
* Remove a test from a Synthetics downtime returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SyntheticsApi(configuration);
9+
10+
const params: v2.SyntheticsApiRemoveTestFromSyntheticsDowntimeRequest = {
11+
downtimeId: "00000000-0000-0000-0000-000000000001",
12+
testId: "abc-def-123",
13+
};
14+
15+
apiInstance
16+
.removeTestFromSyntheticsDowntime(params)
17+
.then((data: v2.SyntheticsDowntimeResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Update a Synthetics downtime returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SyntheticsApi(configuration);
9+
10+
const params: v2.SyntheticsApiUpdateSyntheticsDowntimeRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
isEnabled: true,
15+
name: "Weekly maintenance",
16+
testIds: ["abc-def-123"],
17+
timeSlots: [
18+
{
19+
duration: 3600,
20+
start: {
21+
day: 15,
22+
hour: 10,
23+
minute: 30,
24+
month: 1,
25+
year: 2024,
26+
},
27+
timezone: "Europe/Paris",
28+
},
29+
],
30+
},
31+
type: "downtime",
32+
},
33+
},
34+
downtimeId: "00000000-0000-0000-0000-000000000001",
35+
};
36+
37+
apiInstance
38+
.updateSyntheticsDowntime(params)
39+
.then((data: v2.SyntheticsDowntimeResponse) => {
40+
console.log(
41+
"API called successfully. Returned data: " + JSON.stringify(data)
42+
);
43+
})
44+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12163,6 +12163,71 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
1216312163
},
1216412164
"operationResponseType": "SyntheticsApiMultistepParentTestsResponse",
1216512165
},
12166+
"v2.ListSyntheticsDowntimes": {
12167+
"filterTestIds": {
12168+
"type": "string",
12169+
"format": "",
12170+
},
12171+
"filterActive": {
12172+
"type": "string",
12173+
"format": "",
12174+
},
12175+
"operationResponseType": "SyntheticsDowntimesResponse",
12176+
},
12177+
"v2.CreateSyntheticsDowntime": {
12178+
"body": {
12179+
"type": "SyntheticsDowntimeRequest",
12180+
"format": "",
12181+
},
12182+
"operationResponseType": "SyntheticsDowntimeResponse",
12183+
},
12184+
"v2.GetSyntheticsDowntime": {
12185+
"downtimeId": {
12186+
"type": "string",
12187+
"format": "",
12188+
},
12189+
"operationResponseType": "SyntheticsDowntimeResponse",
12190+
},
12191+
"v2.UpdateSyntheticsDowntime": {
12192+
"downtimeId": {
12193+
"type": "string",
12194+
"format": "",
12195+
},
12196+
"body": {
12197+
"type": "SyntheticsDowntimeRequest",
12198+
"format": "",
12199+
},
12200+
"operationResponseType": "SyntheticsDowntimeResponse",
12201+
},
12202+
"v2.DeleteSyntheticsDowntime": {
12203+
"downtimeId": {
12204+
"type": "string",
12205+
"format": "",
12206+
},
12207+
"operationResponseType": "{}",
12208+
},
12209+
"v2.AddTestToSyntheticsDowntime": {
12210+
"downtimeId": {
12211+
"type": "string",
12212+
"format": "",
12213+
},
12214+
"testId": {
12215+
"type": "string",
12216+
"format": "",
12217+
},
12218+
"operationResponseType": "SyntheticsDowntimeResponse",
12219+
},
12220+
"v2.RemoveTestFromSyntheticsDowntime": {
12221+
"downtimeId": {
12222+
"type": "string",
12223+
"format": "",
12224+
},
12225+
"testId": {
12226+
"type": "string",
12227+
"format": "",
12228+
},
12229+
"operationResponseType": "SyntheticsDowntimeResponse",
12230+
},
1216612231
"v2.GetOnDemandConcurrencyCap": {
1216712232
"operationResponseType": "OnDemandConcurrencyCapResponse",
1216812233
},

0 commit comments

Comments
 (0)