Skip to content

Commit 953c0d2

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a3c20084 of spec repo
1 parent fce1eac commit 953c0d2

22 files changed

+964
-6
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
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-26 19:06:12.147951",
8-
"spec_repo_commit": "44cf4afe"
7+
"regenerated": "2024-07-29 14:10:25.732198",
8+
"spec_repo_commit": "a3c20084"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-07-26 19:06:12.165858",
13-
"spec_repo_commit": "44cf4afe"
12+
"regenerated": "2024-07-29 14:10:25.762359",
13+
"spec_repo_commit": "a3c20084"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11316,6 +11316,37 @@ components:
1131611316
example: /api/v2/scorecard/rules?page%5Blimit%5D=2&page%5Boffset%5D=2&page%5Bsize%5D=2
1131711317
type: string
1131811318
type: object
11319+
ListTagsResponse:
11320+
description: List tags response.
11321+
properties:
11322+
data:
11323+
$ref: '#/components/schemas/ListTagsResponseData'
11324+
type: object
11325+
ListTagsResponseData:
11326+
description: The list tags response data.
11327+
properties:
11328+
attributes:
11329+
$ref: '#/components/schemas/ListTagsResponseDataAttributes'
11330+
id:
11331+
description: The device ID
11332+
example: example:1.2.3.4
11333+
type: string
11334+
type:
11335+
description: The type of the resource. The value should always be tags.
11336+
type: string
11337+
type: object
11338+
ListTagsResponseDataAttributes:
11339+
description: The definition of ListTagsResponseDataAttributes object.
11340+
properties:
11341+
tags:
11342+
description: The list of tags
11343+
example:
11344+
- tag:test
11345+
- tag:testbis
11346+
items:
11347+
type: string
11348+
type: array
11349+
type: object
1131911350
ListTeamsInclude:
1132011351
description: Included related resources optionally requested.
1132111352
enum:
@@ -31426,6 +31457,67 @@ paths:
3142631457
summary: Get the list of interfaces of the device
3142731458
tags:
3142831459
- Network Device Monitoring
31460+
/api/v2/ndm/tags/devices/{device_id}:
31461+
get:
31462+
description: Get the list of tags for a device.
31463+
operationId: ListTags
31464+
parameters:
31465+
- description: The id of the device to fetch.
31466+
example: example:1.2.3.4
31467+
in: path
31468+
name: device_id
31469+
required: true
31470+
schema:
31471+
type: string
31472+
responses:
31473+
'200':
31474+
content:
31475+
application/json:
31476+
schema:
31477+
$ref: '#/components/schemas/ListTagsResponse'
31478+
description: OK
31479+
'403':
31480+
$ref: '#/components/responses/ForbiddenResponse'
31481+
'404':
31482+
$ref: '#/components/responses/NotFoundResponse'
31483+
'429':
31484+
$ref: '#/components/responses/TooManyRequestsResponse'
31485+
summary: Get the list of tags for a device
31486+
tags:
31487+
- Network Device Monitoring
31488+
patch:
31489+
description: Update the tags for a device.
31490+
operationId: UpdateTags
31491+
parameters:
31492+
- description: The id of the device to update tags for.
31493+
example: example:1.2.3.4
31494+
in: path
31495+
name: device_id
31496+
required: true
31497+
schema:
31498+
type: string
31499+
requestBody:
31500+
content:
31501+
application/json:
31502+
schema:
31503+
$ref: '#/components/schemas/ListTagsResponse'
31504+
required: true
31505+
responses:
31506+
'200':
31507+
content:
31508+
application/json:
31509+
schema:
31510+
$ref: '#/components/schemas/ListTagsResponse'
31511+
description: OK
31512+
'403':
31513+
$ref: '#/components/responses/ForbiddenResponse'
31514+
'404':
31515+
$ref: '#/components/responses/NotFoundResponse'
31516+
'429':
31517+
$ref: '#/components/responses/TooManyRequestsResponse'
31518+
summary: Update the tags for a device
31519+
tags:
31520+
- Network Device Monitoring
3142931521
/api/v2/org_configs:
3143031522
get:
3143131523
description: Returns all Org Configs (name, description, and value).
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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.list_tags("default_device".to_string()).await;
10+
if let Ok(value) = resp {
11+
println!("{:#?}", value);
12+
} else {
13+
println!("{:#?}", resp.unwrap_err());
14+
}
15+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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.update_tags("default_device".to_string(), body).await;
22+
if let Ok(value) = resp {
23+
println!("{:#?}", value);
24+
} else {
25+
println!("{:#?}", resp.unwrap_err());
26+
}
27+
}

0 commit comments

Comments
 (0)