Skip to content

Commit a743421

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8f5dfc7e of spec repo
1 parent 3f2d351 commit a743421

File tree

13 files changed

+660
-4
lines changed

13 files changed

+660
-4
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-07-23 18:14:06.803860",
8-
"spec_repo_commit": "9e027051"
7+
"regenerated": "2024-07-24 16:44:08.580303",
8+
"spec_repo_commit": "8f5dfc7e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-07-23 18:14:06.822753",
13-
"spec_repo_commit": "9e027051"
12+
"regenerated": "2024-07-24 16:44:08.598695",
13+
"spec_repo_commit": "8f5dfc7e"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+92
Original file line numberDiff line numberDiff line change
@@ -11081,6 +11081,37 @@ components:
1108111081
example: /api/v2/scorecard/rules?page%5Blimit%5D=2&page%5Boffset%5D=2&page%5Bsize%5D=2
1108211082
type: string
1108311083
type: object
11084+
ListTagsResponse:
11085+
description: List tags response.
11086+
properties:
11087+
data:
11088+
$ref: '#/components/schemas/ListTagsResponseData'
11089+
type: object
11090+
ListTagsResponseData:
11091+
description: The list tags response data.
11092+
properties:
11093+
attributes:
11094+
$ref: '#/components/schemas/ListTagsResponseDataAttributes'
11095+
id:
11096+
description: The device ID
11097+
example: example:1.2.3.4
11098+
type: string
11099+
type:
11100+
description: The type of the resource. The value should always be tags.
11101+
type: string
11102+
type: object
11103+
ListTagsResponseDataAttributes:
11104+
description: The definition of ListTagsResponseDataAttributes object.
11105+
properties:
11106+
tags:
11107+
description: The list of tags
11108+
example:
11109+
- tag:test
11110+
- tag:testbis
11111+
items:
11112+
type: string
11113+
type: array
11114+
type: object
1108411115
ListTeamsInclude:
1108511116
description: Included related resources optionally requested.
1108611117
enum:
@@ -31079,6 +31110,67 @@ paths:
3107931110
summary: Get the list of interfaces of the device
3108031111
tags:
3108131112
- Network Device Monitoring
31113+
/api/v2/ndm/tags/devices/{device_id}:
31114+
get:
31115+
description: Get the list of tags for a device.
31116+
operationId: ListTags
31117+
parameters:
31118+
- description: The id of the device to fetch.
31119+
example: example:1.2.3.4
31120+
in: path
31121+
name: device_id
31122+
required: true
31123+
schema:
31124+
type: string
31125+
responses:
31126+
'200':
31127+
content:
31128+
application/json:
31129+
schema:
31130+
$ref: '#/components/schemas/ListTagsResponse'
31131+
description: OK
31132+
'403':
31133+
$ref: '#/components/responses/ForbiddenResponse'
31134+
'404':
31135+
$ref: '#/components/responses/NotFoundResponse'
31136+
'429':
31137+
$ref: '#/components/responses/TooManyRequestsResponse'
31138+
summary: Get the list of tags for a device
31139+
tags:
31140+
- Network Device Monitoring
31141+
patch:
31142+
description: Update the tags for a device.
31143+
operationId: UpdateTags
31144+
parameters:
31145+
- description: The id of the device to update tags for.
31146+
example: example:1.2.3.4
31147+
in: path
31148+
name: device_id
31149+
required: true
31150+
schema:
31151+
type: string
31152+
requestBody:
31153+
content:
31154+
application/json:
31155+
schema:
31156+
$ref: '#/components/schemas/ListTagsResponse'
31157+
required: true
31158+
responses:
31159+
'200':
31160+
content:
31161+
application/json:
31162+
schema:
31163+
$ref: '#/components/schemas/ListTagsResponse'
31164+
description: OK
31165+
'403':
31166+
$ref: '#/components/responses/ForbiddenResponse'
31167+
'404':
31168+
$ref: '#/components/responses/NotFoundResponse'
31169+
'429':
31170+
$ref: '#/components/responses/TooManyRequestsResponse'
31171+
summary: Update the tags for a device
31172+
tags:
31173+
- Network Device Monitoring
3108231174
/api/v2/org_configs:
3108331175
get:
3108431176
description: Returns all Org Configs (name, description, and value).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Get the list of tags for a device 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.NetworkDeviceMonitoringApi(configuration);
9+
10+
const params: v2.NetworkDeviceMonitoringApiListTagsRequest = {
11+
deviceId: "device_id",
12+
};
13+
14+
apiInstance
15+
.listTags(params)
16+
.then((data: v2.ListTagsResponse) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Update the tags for a device 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.NetworkDeviceMonitoringApi(configuration);
9+
10+
const params: v2.NetworkDeviceMonitoringApiUpdateTagsRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
tags: ["tag:test", "tag:testbis"],
15+
},
16+
id: "example:1.2.3.4",
17+
},
18+
},
19+
deviceId: "device_id",
20+
};
21+
22+
apiInstance
23+
.updateTags(params)
24+
.then((data: v2.ListTagsResponse) => {
25+
console.log(
26+
"API called successfully. Returned data: " + JSON.stringify(data)
27+
);
28+
})
29+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

+18
Original file line numberDiff line numberDiff line change
@@ -4349,6 +4349,24 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
43494349
},
43504350
"operationResponseType": "GetInterfacesResponse",
43514351
},
4352+
"v2.ListTags": {
4353+
"deviceId": {
4354+
"type": "string",
4355+
"format": "",
4356+
},
4357+
"operationResponseType": "ListTagsResponse",
4358+
},
4359+
"v2.UpdateTags": {
4360+
"deviceId": {
4361+
"type": "string",
4362+
"format": "",
4363+
},
4364+
"body": {
4365+
"type": "ListTagsResponse",
4366+
"format": "",
4367+
},
4368+
"operationResponseType": "ListTagsResponse",
4369+
},
43524370
"v2.ListOrgConfigs": {
43534371
"operationResponseType": "OrgConfigListResponse",
43544372
},

features/v2/network_device_monitoring.feature

+30
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,33 @@ Feature: Network Device Monitoring
9797
And the response "data[1].attributes.alias" is equal to "interface_999"
9898
And the response "data[1].attributes.index" is equal to 999
9999
And the response "data[1].attributes.status" is equal to "down"
100+
101+
@generated @skip @team:DataDog/network-device-monitoring
102+
Scenario: Get the list of tags for a device returns "Not Found" response
103+
Given new "ListTags" request
104+
And request contains "device_id" parameter from "REPLACE.ME"
105+
When the request is sent
106+
Then the response status is 404 Not Found
107+
108+
@generated @skip @team:DataDog/network-device-monitoring
109+
Scenario: Get the list of tags for a device returns "OK" response
110+
Given new "ListTags" request
111+
And request contains "device_id" parameter from "REPLACE.ME"
112+
When the request is sent
113+
Then the response status is 200 OK
114+
115+
@generated @skip @team:DataDog/network-device-monitoring
116+
Scenario: Update the tags for a device returns "Not Found" response
117+
Given new "UpdateTags" request
118+
And request contains "device_id" parameter from "REPLACE.ME"
119+
And body with value {"data": {"attributes": {"tags": ["tag:test", "tag:testbis"]}, "id": "example:1.2.3.4"}}
120+
When the request is sent
121+
Then the response status is 404 Not Found
122+
123+
@generated @skip @team:DataDog/network-device-monitoring
124+
Scenario: Update the tags for a device returns "OK" response
125+
Given new "UpdateTags" request
126+
And request contains "device_id" parameter from "REPLACE.ME"
127+
And body with value {"data": {"attributes": {"tags": ["tag:test", "tag:testbis"]}, "id": "example:1.2.3.4"}}
128+
When the request is sent
129+
Then the response status is 200 OK

features/v2/undo.json

+12
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,18 @@
13151315
"type": "safe"
13161316
}
13171317
},
1318+
"ListTags": {
1319+
"tag": "Network Device Monitoring",
1320+
"undo": {
1321+
"type": "safe"
1322+
}
1323+
},
1324+
"UpdateTags": {
1325+
"tag": "Network Device Monitoring",
1326+
"undo": {
1327+
"type": "unsafe"
1328+
}
1329+
},
13181330
"ListOrgConfigs": {
13191331
"tag": "Organizations",
13201332
"undo": {

0 commit comments

Comments
 (0)