Skip to content

Commit 22e8ac0

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit fc429a6 of spec repo (#4474)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent c25e6c6 commit 22e8ac0

36 files changed

Lines changed: 4003 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 968 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Create a tag policy returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createTagPolicy"] = true;
9+
const apiInstance = new v2.TagPoliciesApi(configuration);
10+
11+
const params: v2.TagPoliciesApiCreateTagPolicyRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
enabled: true,
16+
negated: false,
17+
policyName: "Service tag must be one of api or web",
18+
policyType: "surfacing",
19+
required: true,
20+
scope: "env",
21+
source: "logs",
22+
tagKey: "service",
23+
tagValuePatterns: ["api", "web"],
24+
},
25+
type: "tag_policy",
26+
},
27+
},
28+
};
29+
30+
apiInstance
31+
.createTagPolicy(params)
32+
.then((data: v2.TagPolicyResponse) => {
33+
console.log(
34+
"API called successfully. Returned data: " + JSON.stringify(data)
35+
);
36+
})
37+
.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 tag policy returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteTagPolicy"] = true;
9+
const apiInstance = new v2.TagPoliciesApi(configuration);
10+
11+
const params: v2.TagPoliciesApiDeleteTagPolicyRequest = {
12+
policyId: "policy_id",
13+
};
14+
15+
apiInstance
16+
.deleteTagPolicy(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 a tag policy returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getTagPolicy"] = true;
9+
const apiInstance = new v2.TagPoliciesApi(configuration);
10+
11+
const params: v2.TagPoliciesApiGetTagPolicyRequest = {
12+
policyId: "policy_id",
13+
};
14+
15+
apiInstance
16+
.getTagPolicy(params)
17+
.then((data: v2.TagPolicyResponse) => {
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 a tag policy compliance score returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getTagPolicyScore"] = true;
9+
const apiInstance = new v2.TagPoliciesApi(configuration);
10+
11+
const params: v2.TagPoliciesApiGetTagPolicyScoreRequest = {
12+
policyId: "policy_id",
13+
};
14+
15+
apiInstance
16+
.getTagPolicyScore(params)
17+
.then((data: v2.TagPolicyScoreResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.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 tag policies returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listTagPolicies"] = true;
9+
const apiInstance = new v2.TagPoliciesApi(configuration);
10+
11+
apiInstance
12+
.listTagPolicies()
13+
.then((data: v2.TagPoliciesListResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* Update a tag policy returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.updateTagPolicy"] = true;
9+
const apiInstance = new v2.TagPoliciesApi(configuration);
10+
11+
const params: v2.TagPoliciesApiUpdateTagPolicyRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
policyType: "surfacing",
16+
tagValuePatterns: [],
17+
},
18+
id: "123",
19+
type: "tag_policy",
20+
},
21+
},
22+
policyId: "policy_id",
23+
};
24+
25+
apiInstance
26+
.updateTagPolicy(params)
27+
.then((data: v2.TagPolicyResponse) => {
28+
console.log(
29+
"API called successfully. Returned data: " + JSON.stringify(data)
30+
);
31+
})
32+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16023,6 +16023,96 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
1602316023
},
1602416024
"operationResponseType": "GlobalVariableResponse",
1602516025
},
16026+
"v2.ListTagPolicies": {
16027+
"includeDisabled": {
16028+
"type": "boolean",
16029+
"format": "",
16030+
},
16031+
"includeDeleted": {
16032+
"type": "boolean",
16033+
"format": "",
16034+
},
16035+
"include": {
16036+
"type": "TagPolicyInclude",
16037+
"format": "",
16038+
},
16039+
"filterSource": {
16040+
"type": "TagPolicySource",
16041+
"format": "",
16042+
},
16043+
"tsStart": {
16044+
"type": "number",
16045+
"format": "int64",
16046+
},
16047+
"tsEnd": {
16048+
"type": "number",
16049+
"format": "int64",
16050+
},
16051+
"operationResponseType": "TagPoliciesListResponse",
16052+
},
16053+
"v2.CreateTagPolicy": {
16054+
"body": {
16055+
"type": "TagPolicyCreateRequest",
16056+
"format": "",
16057+
},
16058+
"operationResponseType": "TagPolicyResponse",
16059+
},
16060+
"v2.GetTagPolicy": {
16061+
"policyId": {
16062+
"type": "string",
16063+
"format": "",
16064+
},
16065+
"include": {
16066+
"type": "TagPolicyInclude",
16067+
"format": "",
16068+
},
16069+
"tsStart": {
16070+
"type": "number",
16071+
"format": "int64",
16072+
},
16073+
"tsEnd": {
16074+
"type": "number",
16075+
"format": "int64",
16076+
},
16077+
"operationResponseType": "TagPolicyResponse",
16078+
},
16079+
"v2.DeleteTagPolicy": {
16080+
"policyId": {
16081+
"type": "string",
16082+
"format": "",
16083+
},
16084+
"hardDelete": {
16085+
"type": "boolean",
16086+
"format": "",
16087+
},
16088+
"operationResponseType": "{}",
16089+
},
16090+
"v2.UpdateTagPolicy": {
16091+
"policyId": {
16092+
"type": "string",
16093+
"format": "",
16094+
},
16095+
"body": {
16096+
"type": "TagPolicyUpdateRequest",
16097+
"format": "",
16098+
},
16099+
"operationResponseType": "TagPolicyResponse",
16100+
},
16101+
"v2.GetTagPolicyScore": {
16102+
"policyId": {
16103+
"type": "string",
16104+
"format": "",
16105+
},
16106+
"tsStart": {
16107+
"type": "number",
16108+
"format": "int64",
16109+
},
16110+
"tsEnd": {
16111+
"type": "number",
16112+
"format": "int64",
16113+
},
16114+
"operationResponseType": "TagPolicyScoreResponse",
16115+
},
1602616116
"v2.ListTeams": {
1602716117
"pageNumber": {
1602816118
"type": "number",

0 commit comments

Comments
 (0)