Skip to content

Commit 1797638

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Documentation for new device tags endpoints (#213)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 208d49b commit 1797638

23 files changed

+980
-7
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-08-02 13:53:52.585382",
8-
"spec_repo_commit": "74b2ffcb"
7+
"regenerated": "2024-08-05 16:35:00.098725",
8+
"spec_repo_commit": "578f6c8c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-08-02 13:53:52.602958",
13-
"spec_repo_commit": "74b2ffcb"
12+
"regenerated": "2024-08-05 16:35:00.118153",
13+
"spec_repo_commit": "578f6c8c"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+92
Original file line numberDiff line numberDiff line change
@@ -11330,6 +11330,37 @@ components:
1133011330
example: /api/v2/scorecard/rules?page%5Blimit%5D=2&page%5Boffset%5D=2&page%5Bsize%5D=2
1133111331
type: string
1133211332
type: object
11333+
ListTagsResponse:
11334+
description: List tags response.
11335+
properties:
11336+
data:
11337+
$ref: '#/components/schemas/ListTagsResponseData'
11338+
type: object
11339+
ListTagsResponseData:
11340+
description: The list tags response data.
11341+
properties:
11342+
attributes:
11343+
$ref: '#/components/schemas/ListTagsResponseDataAttributes'
11344+
id:
11345+
description: The device ID
11346+
example: example:1.2.3.4
11347+
type: string
11348+
type:
11349+
description: The type of the resource. The value should always be tags.
11350+
type: string
11351+
type: object
11352+
ListTagsResponseDataAttributes:
11353+
description: The definition of ListTagsResponseDataAttributes object.
11354+
properties:
11355+
tags:
11356+
description: The list of tags
11357+
example:
11358+
- tag:test
11359+
- tag:testbis
11360+
items:
11361+
type: string
11362+
type: array
11363+
type: object
1133311364
ListTeamsInclude:
1133411365
description: Included related resources optionally requested.
1133511366
enum:
@@ -31582,6 +31613,67 @@ paths:
3158231613
summary: Get the list of interfaces of the device
3158331614
tags:
3158431615
- Network Device Monitoring
31616+
/api/v2/ndm/tags/devices/{device_id}:
31617+
get:
31618+
description: Get the list of tags for a device.
31619+
operationId: ListDeviceUserTags
31620+
parameters:
31621+
- description: The id of the device to fetch tags for.
31622+
example: example:1.2.3.4
31623+
in: path
31624+
name: device_id
31625+
required: true
31626+
schema:
31627+
type: string
31628+
responses:
31629+
'200':
31630+
content:
31631+
application/json:
31632+
schema:
31633+
$ref: '#/components/schemas/ListTagsResponse'
31634+
description: OK
31635+
'403':
31636+
$ref: '#/components/responses/ForbiddenResponse'
31637+
'404':
31638+
$ref: '#/components/responses/NotFoundResponse'
31639+
'429':
31640+
$ref: '#/components/responses/TooManyRequestsResponse'
31641+
summary: Get the list of tags for a device
31642+
tags:
31643+
- Network Device Monitoring
31644+
patch:
31645+
description: Update the tags for a device.
31646+
operationId: UpdateDeviceUserTags
31647+
parameters:
31648+
- description: The id of the device to update tags for.
31649+
example: example:1.2.3.4
31650+
in: path
31651+
name: device_id
31652+
required: true
31653+
schema:
31654+
type: string
31655+
requestBody:
31656+
content:
31657+
application/json:
31658+
schema:
31659+
$ref: '#/components/schemas/ListTagsResponse'
31660+
required: true
31661+
responses:
31662+
'200':
31663+
content:
31664+
application/json:
31665+
schema:
31666+
$ref: '#/components/schemas/ListTagsResponse'
31667+
description: OK
31668+
'403':
31669+
$ref: '#/components/responses/ForbiddenResponse'
31670+
'404':
31671+
$ref: '#/components/responses/NotFoundResponse'
31672+
'429':
31673+
$ref: '#/components/responses/TooManyRequestsResponse'
31674+
summary: Update the tags for a device
31675+
tags:
31676+
- Network Device Monitoring
3158531677
/api/v2/org_configs:
3158631678
get:
3158731679
description: Returns all Org Configs (name, description, and value).

LICENSE-3rdparty.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ windows_x86_64_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Mic
151151
windows_x86_64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
152152
windows_x86_64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
153153
winreg,https://github.com/gentoo90/winreg-rs,MIT,Igor Shaula <gentoo90@gmail.com>
154-
zerocopy,https://github.com/google/zerocopy,BSD-2-Clause,Joshua Liebow-Feeser <joshlf@google.com>
154+
zerocopy,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,Joshua Liebow-Feeser <joshlf@google.com>
155155
zstd,https://github.com/gyscos/zstd-rs,MIT,Alexandre Bury <alexandre.bury@gmail.com>
156156
zstd-safe,https://github.com/gyscos/zstd-rs,MIT OR Apache-2.0,Alexandre Bury <alexandre.bury@gmail.com>
157157
zstd-sys,https://github.com/gyscos/zstd-rs,MIT OR Apache-2.0,Alexandre Bury <alexandre.bury@gmail.com>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Get the list of tags for a device returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_network_device_monitoring::NetworkDeviceMonitoringAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let configuration = datadog::Configuration::new();
8+
let api = NetworkDeviceMonitoringAPI::with_config(configuration);
9+
let resp = api
10+
.list_device_user_tags("default_device".to_string())
11+
.await;
12+
if let Ok(value) = resp {
13+
println!("{:#?}", value);
14+
} else {
15+
println!("{:#?}", resp.unwrap_err());
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Update the tags for a device returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_network_device_monitoring::NetworkDeviceMonitoringAPI;
4+
use datadog_api_client::datadogV2::model::ListTagsResponse;
5+
use datadog_api_client::datadogV2::model::ListTagsResponseData;
6+
use datadog_api_client::datadogV2::model::ListTagsResponseDataAttributes;
7+
8+
#[tokio::main]
9+
async fn main() {
10+
let body = ListTagsResponse::new().data(
11+
ListTagsResponseData::new()
12+
.attributes(
13+
ListTagsResponseDataAttributes::new()
14+
.tags(vec!["tag:test".to_string(), "tag:testbis".to_string()]),
15+
)
16+
.id("default_device".to_string())
17+
.type_("tags".to_string()),
18+
);
19+
let configuration = datadog::Configuration::new();
20+
let api = NetworkDeviceMonitoringAPI::with_config(configuration);
21+
let resp = api
22+
.update_device_user_tags("default_device".to_string(), body)
23+
.await;
24+
if let Ok(value) = resp {
25+
println!("{:#?}", value);
26+
} else {
27+
println!("{:#?}", resp.unwrap_err());
28+
}
29+
}

0 commit comments

Comments
 (0)