Skip to content

Commit 7d559b4

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8b41c5f of spec repo
1 parent 072e71e commit 7d559b4

18 files changed

+464
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33939,6 +33939,25 @@ components:
3393933939
- data
3394033940
- meta
3394133941
type: object
33942+
ListInterfaceTagsResponse:
33943+
description: Response for listing interface tags.
33944+
properties:
33945+
data:
33946+
$ref: '#/components/schemas/ListInterfaceTagsResponseData'
33947+
type: object
33948+
ListInterfaceTagsResponseData:
33949+
description: Response data for listing interface tags.
33950+
properties:
33951+
attributes:
33952+
$ref: '#/components/schemas/ListTagsResponseDataAttributes'
33953+
id:
33954+
description: The interface ID
33955+
example: example:1.2.3.4:1
33956+
type: string
33957+
type:
33958+
description: The resource type. This value should always be `tags`.
33959+
type: string
33960+
type: object
3394233961
ListKindCatalogResponse:
3394333962
description: List kind response.
3394433963
properties:
@@ -86637,6 +86656,67 @@ paths:
8663786656
summary: Update the tags for a device
8663886657
tags:
8663986658
- Network Device Monitoring
86659+
/api/v2/ndm/tags/interfaces/{interface_id}:
86660+
get:
86661+
description: Returns the tags associated with the specified interface.
86662+
operationId: ListInterfaceUserTags
86663+
parameters:
86664+
- description: The ID of the interface for which to retrieve tags.
86665+
example: example:1.2.3.4:1
86666+
in: path
86667+
name: interface_id
86668+
required: true
86669+
schema:
86670+
type: string
86671+
responses:
86672+
'200':
86673+
content:
86674+
application/json:
86675+
schema:
86676+
$ref: '#/components/schemas/ListInterfaceTagsResponse'
86677+
description: OK
86678+
'403':
86679+
$ref: '#/components/responses/ForbiddenResponse'
86680+
'404':
86681+
$ref: '#/components/responses/NotFoundResponse'
86682+
'429':
86683+
$ref: '#/components/responses/TooManyRequestsResponse'
86684+
summary: List tags for an interface
86685+
tags:
86686+
- Network Device Monitoring
86687+
patch:
86688+
description: Updates the tags associated with the specified interface.
86689+
operationId: UpdateInterfaceUserTags
86690+
parameters:
86691+
- description: The ID of the interface for which to update tags.
86692+
example: example:1.2.3.4:1
86693+
in: path
86694+
name: interface_id
86695+
required: true
86696+
schema:
86697+
type: string
86698+
requestBody:
86699+
content:
86700+
application/json:
86701+
schema:
86702+
$ref: '#/components/schemas/ListInterfaceTagsResponse'
86703+
required: true
86704+
responses:
86705+
'200':
86706+
content:
86707+
application/json:
86708+
schema:
86709+
$ref: '#/components/schemas/ListInterfaceTagsResponse'
86710+
description: OK
86711+
'403':
86712+
$ref: '#/components/responses/ForbiddenResponse'
86713+
'404':
86714+
$ref: '#/components/responses/NotFoundResponse'
86715+
'429':
86716+
$ref: '#/components/responses/TooManyRequestsResponse'
86717+
summary: Update the tags for an interface
86718+
tags:
86719+
- Network Device Monitoring
8664086720
/api/v2/network/connections/aggregate:
8664186721
get:
8664286722
description: Get all aggregated connections.

docs/datadog_api_client.v2.model.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14578,6 +14578,20 @@ datadog\_api\_client.v2.model.list\_findings\_response module
1457814578
:members:
1457914579
:show-inheritance:
1458014580

14581+
datadog\_api\_client.v2.model.list\_interface\_tags\_response module
14582+
--------------------------------------------------------------------
14583+
14584+
.. automodule:: datadog_api_client.v2.model.list_interface_tags_response
14585+
:members:
14586+
:show-inheritance:
14587+
14588+
datadog\_api\_client.v2.model.list\_interface\_tags\_response\_data module
14589+
--------------------------------------------------------------------------
14590+
14591+
.. automodule:: datadog_api_client.v2.model.list_interface_tags_response_data
14592+
:members:
14593+
:show-inheritance:
14594+
1458114595
datadog\_api\_client.v2.model.list\_kind\_catalog\_response module
1458214596
------------------------------------------------------------------
1458314597

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
List tags for an interface returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.network_device_monitoring_api import NetworkDeviceMonitoringApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = NetworkDeviceMonitoringApi(api_client)
11+
response = api_instance.list_interface_user_tags(
12+
interface_id="example:1.2.3.4:1",
13+
)
14+
15+
print(response)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
Update the tags for an interface returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.network_device_monitoring_api import NetworkDeviceMonitoringApi
7+
from datadog_api_client.v2.model.list_interface_tags_response import ListInterfaceTagsResponse
8+
from datadog_api_client.v2.model.list_interface_tags_response_data import ListInterfaceTagsResponseData
9+
from datadog_api_client.v2.model.list_tags_response_data_attributes import ListTagsResponseDataAttributes
10+
11+
body = ListInterfaceTagsResponse(
12+
data=ListInterfaceTagsResponseData(
13+
attributes=ListTagsResponseDataAttributes(
14+
tags=[
15+
"tag:test",
16+
"tag:testbis",
17+
],
18+
),
19+
id="example:1.2.3.4:1",
20+
type="tags",
21+
),
22+
)
23+
24+
configuration = Configuration()
25+
with ApiClient(configuration) as api_client:
26+
api_instance = NetworkDeviceMonitoringApi(api_client)
27+
response = api_instance.update_interface_user_tags(interface_id="example:1.2.3.4:1", body=body)
28+
29+
print(response)

src/datadog_api_client/v2/api/network_device_monitoring_api.py

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from datadog_api_client.v2.model.get_device_response import GetDeviceResponse
2020
from datadog_api_client.v2.model.get_interfaces_response import GetInterfacesResponse
2121
from datadog_api_client.v2.model.list_tags_response import ListTagsResponse
22+
from datadog_api_client.v2.model.list_interface_tags_response import ListInterfaceTagsResponse
2223

2324

2425
class NetworkDeviceMonitoringApi:
@@ -142,6 +143,29 @@ def __init__(self, api_client=None):
142143
api_client=api_client,
143144
)
144145

146+
self._list_interface_user_tags_endpoint = _Endpoint(
147+
settings={
148+
"response_type": (ListInterfaceTagsResponse,),
149+
"auth": ["apiKeyAuth", "appKeyAuth"],
150+
"endpoint_path": "/api/v2/ndm/tags/interfaces/{interface_id}",
151+
"operation_id": "list_interface_user_tags",
152+
"http_method": "GET",
153+
"version": "v2",
154+
},
155+
params_map={
156+
"interface_id": {
157+
"required": True,
158+
"openapi_types": (str,),
159+
"attribute": "interface_id",
160+
"location": "path",
161+
},
162+
},
163+
headers_map={
164+
"accept": ["application/json"],
165+
},
166+
api_client=api_client,
167+
)
168+
145169
self._update_device_user_tags_endpoint = _Endpoint(
146170
settings={
147171
"response_type": (ListTagsResponse,),
@@ -168,6 +192,32 @@ def __init__(self, api_client=None):
168192
api_client=api_client,
169193
)
170194

195+
self._update_interface_user_tags_endpoint = _Endpoint(
196+
settings={
197+
"response_type": (ListInterfaceTagsResponse,),
198+
"auth": ["apiKeyAuth", "appKeyAuth"],
199+
"endpoint_path": "/api/v2/ndm/tags/interfaces/{interface_id}",
200+
"operation_id": "update_interface_user_tags",
201+
"http_method": "PATCH",
202+
"version": "v2",
203+
},
204+
params_map={
205+
"interface_id": {
206+
"required": True,
207+
"openapi_types": (str,),
208+
"attribute": "interface_id",
209+
"location": "path",
210+
},
211+
"body": {
212+
"required": True,
213+
"openapi_types": (ListInterfaceTagsResponse,),
214+
"location": "body",
215+
},
216+
},
217+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
218+
api_client=api_client,
219+
)
220+
171221
def get_device(
172222
self,
173223
device_id: str,
@@ -312,6 +362,23 @@ def list_device_user_tags(
312362

313363
return self._list_device_user_tags_endpoint.call_with_http_info(**kwargs)
314364

365+
def list_interface_user_tags(
366+
self,
367+
interface_id: str,
368+
) -> ListInterfaceTagsResponse:
369+
"""List tags for an interface.
370+
371+
Returns the tags associated with the specified interface.
372+
373+
:param interface_id: The ID of the interface for which to retrieve tags.
374+
:type interface_id: str
375+
:rtype: ListInterfaceTagsResponse
376+
"""
377+
kwargs: Dict[str, Any] = {}
378+
kwargs["interface_id"] = interface_id
379+
380+
return self._list_interface_user_tags_endpoint.call_with_http_info(**kwargs)
381+
315382
def update_device_user_tags(
316383
self,
317384
device_id: str,
@@ -332,3 +399,24 @@ def update_device_user_tags(
332399
kwargs["body"] = body
333400

334401
return self._update_device_user_tags_endpoint.call_with_http_info(**kwargs)
402+
403+
def update_interface_user_tags(
404+
self,
405+
interface_id: str,
406+
body: ListInterfaceTagsResponse,
407+
) -> ListInterfaceTagsResponse:
408+
"""Update the tags for an interface.
409+
410+
Updates the tags associated with the specified interface.
411+
412+
:param interface_id: The ID of the interface for which to update tags.
413+
:type interface_id: str
414+
:type body: ListInterfaceTagsResponse
415+
:rtype: ListInterfaceTagsResponse
416+
"""
417+
kwargs: Dict[str, Any] = {}
418+
kwargs["interface_id"] = interface_id
419+
420+
kwargs["body"] = body
421+
422+
return self._update_interface_user_tags_endpoint.call_with_http_info(**kwargs)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.list_interface_tags_response_data import ListInterfaceTagsResponseData
18+
19+
20+
class ListInterfaceTagsResponse(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.list_interface_tags_response_data import ListInterfaceTagsResponseData
24+
25+
return {
26+
"data": (ListInterfaceTagsResponseData,),
27+
}
28+
29+
attribute_map = {
30+
"data": "data",
31+
}
32+
33+
def __init__(self_, data: Union[ListInterfaceTagsResponseData, UnsetType] = unset, **kwargs):
34+
"""
35+
Response for listing interface tags.
36+
37+
:param data: Response data for listing interface tags.
38+
:type data: ListInterfaceTagsResponseData, optional
39+
"""
40+
if data is not unset:
41+
kwargs["data"] = data
42+
super().__init__(kwargs)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.list_tags_response_data_attributes import ListTagsResponseDataAttributes
18+
19+
20+
class ListInterfaceTagsResponseData(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.list_tags_response_data_attributes import ListTagsResponseDataAttributes
24+
25+
return {
26+
"attributes": (ListTagsResponseDataAttributes,),
27+
"id": (str,),
28+
"type": (str,),
29+
}
30+
31+
attribute_map = {
32+
"attributes": "attributes",
33+
"id": "id",
34+
"type": "type",
35+
}
36+
37+
def __init__(
38+
self_,
39+
attributes: Union[ListTagsResponseDataAttributes, UnsetType] = unset,
40+
id: Union[str, UnsetType] = unset,
41+
type: Union[str, UnsetType] = unset,
42+
**kwargs,
43+
):
44+
"""
45+
Response data for listing interface tags.
46+
47+
:param attributes: The definition of ListTagsResponseDataAttributes object.
48+
:type attributes: ListTagsResponseDataAttributes, optional
49+
50+
:param id: The interface ID
51+
:type id: str, optional
52+
53+
:param type: The resource type. This value should always be ``tags``.
54+
:type type: str, optional
55+
"""
56+
if attributes is not unset:
57+
kwargs["attributes"] = attributes
58+
if id is not unset:
59+
kwargs["id"] = id
60+
if type is not unset:
61+
kwargs["type"] = type
62+
super().__init__(kwargs)

0 commit comments

Comments
 (0)