Skip to content

Commit d7ccc0c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
document v2 stable mcnulty-web-py3 endpoints (#3821)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f18487c commit d7ccc0c

File tree

66 files changed

+6672
-68
lines changed

Some content is hidden

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

66 files changed

+6672
-68
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 1287 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Get parent tests for a subtest 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.SyntheticsApiGetApiMultistepSubtestParentsRequest = {
11+
publicId: "public_id",
12+
};
13+
14+
apiInstance
15+
.getApiMultistepSubtestParents(params)
16+
.then((data: v2.SyntheticsApiMultistepParentTestsResponse) => {
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 available subtests for a multistep test 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.SyntheticsApiGetApiMultistepSubtestsRequest = {
11+
publicId: "public_id",
12+
};
13+
14+
apiInstance
15+
.getApiMultistepSubtests(params)
16+
.then((data: v2.SyntheticsApiMultistepSubtestsResponse) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.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 a specific version of a test 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.SyntheticsApiGetSyntheticsTestVersionRequest = {
11+
publicId: "public_id",
12+
versionNumber: 9223372036854775807,
13+
};
14+
15+
apiInstance
16+
.getSyntheticsTestVersion(params)
17+
.then((data: v2.SyntheticsTestVersionResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.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 parent suites for a test 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.SyntheticsApiGetTestParentSuitesRequest = {
11+
publicId: "public_id",
12+
};
13+
14+
apiInstance
15+
.getTestParentSuites(params)
16+
.then((data: v2.SyntheticsTestParentSuitesResponse) => {
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 version history of a test 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.SyntheticsApiListSyntheticsTestVersionsRequest = {
11+
publicId: "public_id",
12+
};
13+
14+
apiInstance
15+
.listSyntheticsTestVersions(params)
16+
.then((data: v2.SyntheticsTestVersionHistoryResponse) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Patch a test suite 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.SyntheticsApiPatchTestSuiteRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
jsonPatch: [
15+
{
16+
op: "add",
17+
path: "/name",
18+
},
19+
],
20+
},
21+
type: "suites_json_patch",
22+
},
23+
},
24+
publicId: "123-abc-456",
25+
};
26+
27+
apiInstance
28+
.patchTestSuite(params)
29+
.then((data: v2.SyntheticsSuiteResponse) => {
30+
console.log(
31+
"API called successfully. Returned data: " + JSON.stringify(data)
32+
);
33+
})
34+
.catch((error: any) => console.error(error));
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Create a widget 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.WidgetsApi(configuration);
9+
10+
const params: v2.WidgetsApiCreateWidgetRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
definition: {
15+
title: "My Widget",
16+
type: "bar_chart",
17+
},
18+
tags: [],
19+
},
20+
type: "widgets",
21+
},
22+
},
23+
experienceType: "ccm_reports",
24+
};
25+
26+
apiInstance
27+
.createWidget(params)
28+
.then((data: v2.WidgetResponse) => {
29+
console.log(
30+
"API called successfully. Returned data: " + JSON.stringify(data)
31+
);
32+
})
33+
.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 a widget 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.WidgetsApi(configuration);
9+
10+
const params: v2.WidgetsApiDeleteWidgetRequest = {
11+
experienceType: "ccm_reports",
12+
uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
13+
};
14+
15+
apiInstance
16+
.deleteWidget(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));

examples/v2/widgets/GetWidget.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get a widget 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.WidgetsApi(configuration);
9+
10+
const params: v2.WidgetsApiGetWidgetRequest = {
11+
experienceType: "ccm_reports",
12+
uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
13+
};
14+
15+
apiInstance
16+
.getWidget(params)
17+
.then((data: v2.WidgetResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)