Skip to content

Documentation for new device tags endpoints #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-02 13:53:52.585382",
"spec_repo_commit": "74b2ffcb"
"regenerated": "2024-08-05 16:35:00.098725",
"spec_repo_commit": "578f6c8c"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-02 13:53:52.602958",
"spec_repo_commit": "74b2ffcb"
"regenerated": "2024-08-05 16:35:00.118153",
"spec_repo_commit": "578f6c8c"
}
}
}
92 changes: 92 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11330,6 +11330,37 @@ components:
example: /api/v2/scorecard/rules?page%5Blimit%5D=2&page%5Boffset%5D=2&page%5Bsize%5D=2
type: string
type: object
ListTagsResponse:
description: List tags response.
properties:
data:
$ref: '#/components/schemas/ListTagsResponseData'
type: object
ListTagsResponseData:
description: The list tags response data.
properties:
attributes:
$ref: '#/components/schemas/ListTagsResponseDataAttributes'
id:
description: The device ID
example: example:1.2.3.4
type: string
type:
description: The type of the resource. The value should always be tags.
type: string
type: object
ListTagsResponseDataAttributes:
description: The definition of ListTagsResponseDataAttributes object.
properties:
tags:
description: The list of tags
example:
- tag:test
- tag:testbis
items:
type: string
type: array
type: object
ListTeamsInclude:
description: Included related resources optionally requested.
enum:
Expand Down Expand Up @@ -31582,6 +31613,67 @@ paths:
summary: Get the list of interfaces of the device
tags:
- Network Device Monitoring
/api/v2/ndm/tags/devices/{device_id}:
get:
description: Get the list of tags for a device.
operationId: ListDeviceUserTags
parameters:
- description: The id of the device to fetch tags for.
example: example:1.2.3.4
in: path
name: device_id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ListTagsResponse'
description: OK
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get the list of tags for a device
tags:
- Network Device Monitoring
patch:
description: Update the tags for a device.
operationId: UpdateDeviceUserTags
parameters:
- description: The id of the device to update tags for.
example: example:1.2.3.4
in: path
name: device_id
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ListTagsResponse'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ListTagsResponse'
description: OK
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Update the tags for a device
tags:
- Network Device Monitoring
/api/v2/org_configs:
get:
description: Returns all Org Configs (name, description, and value).
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ windows_x86_64_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Mic
windows_x86_64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows_x86_64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
winreg,https://github.com/gentoo90/winreg-rs,MIT,Igor Shaula <gentoo90@gmail.com>
zerocopy,https://github.com/google/zerocopy,BSD-2-Clause,Joshua Liebow-Feeser <joshlf@google.com>
zerocopy,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,Joshua Liebow-Feeser <joshlf@google.com>
zstd,https://github.com/gyscos/zstd-rs,MIT,Alexandre Bury <alexandre.bury@gmail.com>
zstd-safe,https://github.com/gyscos/zstd-rs,MIT OR Apache-2.0,Alexandre Bury <alexandre.bury@gmail.com>
zstd-sys,https://github.com/gyscos/zstd-rs,MIT OR Apache-2.0,Alexandre Bury <alexandre.bury@gmail.com>
17 changes: 17 additions & 0 deletions examples/v2_network-device-monitoring_ListDeviceUserTags.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Get the list of tags for a device returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_network_device_monitoring::NetworkDeviceMonitoringAPI;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = NetworkDeviceMonitoringAPI::with_config(configuration);
let resp = api
.list_device_user_tags("default_device".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
29 changes: 29 additions & 0 deletions examples/v2_network-device-monitoring_UpdateDeviceUserTags.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Update the tags for a device returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_network_device_monitoring::NetworkDeviceMonitoringAPI;
use datadog_api_client::datadogV2::model::ListTagsResponse;
use datadog_api_client::datadogV2::model::ListTagsResponseData;
use datadog_api_client::datadogV2::model::ListTagsResponseDataAttributes;

#[tokio::main]
async fn main() {
let body = ListTagsResponse::new().data(
ListTagsResponseData::new()
.attributes(
ListTagsResponseDataAttributes::new()
.tags(vec!["tag:test".to_string(), "tag:testbis".to_string()]),
)
.id("default_device".to_string())
.type_("tags".to_string()),
);
let configuration = datadog::Configuration::new();
let api = NetworkDeviceMonitoringAPI::with_config(configuration);
let resp = api
.update_device_user_tags("default_device".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Loading
Loading