Skip to content

Commit c54812c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0d784b1 of spec repo
1 parent 24de123 commit c54812c

File tree

13 files changed

+303
-8
lines changed

13 files changed

+303
-8
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "04d09cb",
3-
"generated": "2025-07-23 09:22:38.369"
2+
"spec_repo_commit": "0d784b1",
3+
"generated": "2025-07-23 14:34:08.311"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12478,7 +12478,14 @@ components:
1247812478
- type
1247912479
type: object
1248012480
Dataset:
12481-
description: Dataset object.
12481+
description: "Dataset object.\n\n### Datasets Constraints\n- **Tag Limit per
12482+
Dataset**:\n - Each restricted dataset supports a maximum of 10 key:value
12483+
pairs per product.\n\n- **Tag Key Rules per Telemetry Type**:\n - Only one
12484+
tag key or attribute may be used to define access within a single telemetry
12485+
type.\n - The same or different tag key may be used across different telemetry
12486+
types.\n\n- **Tag Value Uniqueness**:\n - Tag values must be unique within
12487+
a single dataset.\n - A tag value used in one dataset cannot be reused in
12488+
another dataset of the same telemetry type."
1248212489
properties:
1248312490
attributes:
1248412491
$ref: '#/components/schemas/DatasetAttributes'
@@ -12537,6 +12544,14 @@ components:
1253712544
required:
1253812545
- data
1253912546
type: object
12547+
DatasetEditRequest:
12548+
description: Edit request for a dataset.
12549+
properties:
12550+
data:
12551+
$ref: '#/components/schemas/Dataset'
12552+
required:
12553+
- data
12554+
type: object
1254012555
DatasetResponseMulti:
1254112556
description: Response containing a list of datasets.
1254212557
properties:
@@ -16083,10 +16098,9 @@ components:
1608316098
type: array
1608416099
product:
1608516100
description: 'Name of the product the dataset is for. Possible values are
16086-
''apm'', ''rum'', ''synthetics'',
16101+
''apm'', ''rum'',
1608716102

16088-
''metrics'', ''logs'', ''sd_repoinfo'', ''error_tracking'', ''cloud_cost'',
16089-
and ''ml_obs''.'
16103+
''metrics'', ''logs'', ''error_tracking'', and ''cloud_cost''.'
1609016104
example: logs
1609116105
type: string
1609216106
required:
@@ -48271,6 +48285,44 @@ paths:
4827148285
x-permission:
4827248286
operator: OPEN
4827348287
permissions: []
48288+
put:
48289+
description: Edits the dataset associated with the ID.
48290+
operationId: EditDataset
48291+
parameters:
48292+
- $ref: '#/components/parameters/DatasetID'
48293+
requestBody:
48294+
content:
48295+
application/json:
48296+
schema:
48297+
$ref: '#/components/schemas/DatasetEditRequest'
48298+
description: Dataset payload
48299+
required: true
48300+
responses:
48301+
'200':
48302+
content:
48303+
application/json:
48304+
schema:
48305+
$ref: '#/components/schemas/DatasetResponseSingle'
48306+
description: OK
48307+
'400':
48308+
$ref: '#/components/responses/BadRequestResponse'
48309+
'403':
48310+
$ref: '#/components/responses/NotAuthorizedResponse'
48311+
'404':
48312+
$ref: '#/components/responses/NotFoundResponse'
48313+
'429':
48314+
$ref: '#/components/responses/TooManyRequestsResponse'
48315+
security:
48316+
- apiKeyAuth: []
48317+
appKeyAuth: []
48318+
- AuthZ: []
48319+
summary: Edits a dataset
48320+
tags:
48321+
- Datasets
48322+
x-codegen-request-body-name: body
48323+
x-permission:
48324+
operator: OPEN
48325+
permissions: []
4827448326
/api/v2/deletion/data/{product}:
4827548327
post:
4827648328
description: Creates a data deletion request by providing a query and a timeframe

docs/datadog_api_client.v2.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4827,6 +4827,13 @@ datadog\_api\_client.v2.model.dataset\_create\_request module
48274827
:members:
48284828
:show-inheritance:
48294829

4830+
datadog\_api\_client.v2.model.dataset\_edit\_request module
4831+
-----------------------------------------------------------
4832+
4833+
.. automodule:: datadog_api_client.v2.model.dataset_edit_request
4834+
:members:
4835+
:show-inheritance:
4836+
48304837
datadog\_api\_client.v2.model.dataset\_response\_multi module
48314838
-------------------------------------------------------------
48324839

examples/v2/datasets/EditDataset.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""
2+
Edits a dataset returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.datasets_api import DatasetsApi
7+
from datadog_api_client.v2.model.dataset import Dataset
8+
from datadog_api_client.v2.model.dataset_attributes import DatasetAttributes
9+
from datadog_api_client.v2.model.dataset_edit_request import DatasetEditRequest
10+
from datadog_api_client.v2.model.filters_per_product import FiltersPerProduct
11+
12+
body = DatasetEditRequest(
13+
data=Dataset(
14+
attributes=DatasetAttributes(
15+
created_at=None,
16+
name="Security Audit Dataset",
17+
principals=[
18+
"role:86245fce-0a4e-11f0-92bd-da7ad0900002",
19+
],
20+
product_filters=[
21+
FiltersPerProduct(
22+
filters=[
23+
"@application.id:ABCD",
24+
],
25+
product="logs",
26+
),
27+
],
28+
),
29+
id="123e4567-e89b-12d3-a456-426614174000",
30+
type="dataset",
31+
),
32+
)
33+
34+
configuration = Configuration()
35+
with ApiClient(configuration) as api_client:
36+
api_instance = DatasetsApi(api_client)
37+
response = api_instance.edit_dataset(dataset_id="dataset_id", body=body)
38+
39+
print(response)

src/datadog_api_client/v2/api/datasets_api.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from datadog_api_client.v2.model.dataset_response_multi import DatasetResponseMulti
1111
from datadog_api_client.v2.model.dataset_response_single import DatasetResponseSingle
1212
from datadog_api_client.v2.model.dataset_create_request import DatasetCreateRequest
13+
from datadog_api_client.v2.model.dataset_edit_request import DatasetEditRequest
1314

1415

1516
class DatasetsApi:
@@ -67,6 +68,32 @@ def __init__(self, api_client=None):
6768
api_client=api_client,
6869
)
6970

71+
self._edit_dataset_endpoint = _Endpoint(
72+
settings={
73+
"response_type": (DatasetResponseSingle,),
74+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
75+
"endpoint_path": "/api/v2/datasets/{dataset_id}",
76+
"operation_id": "edit_dataset",
77+
"http_method": "PUT",
78+
"version": "v2",
79+
},
80+
params_map={
81+
"dataset_id": {
82+
"required": True,
83+
"openapi_types": (str,),
84+
"attribute": "dataset_id",
85+
"location": "path",
86+
},
87+
"body": {
88+
"required": True,
89+
"openapi_types": (DatasetEditRequest,),
90+
"location": "body",
91+
},
92+
},
93+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
94+
api_client=api_client,
95+
)
96+
7097
self._get_all_datasets_endpoint = _Endpoint(
7198
settings={
7299
"response_type": (DatasetResponseMulti,),
@@ -140,6 +167,28 @@ def delete_dataset(
140167

141168
return self._delete_dataset_endpoint.call_with_http_info(**kwargs)
142169

170+
def edit_dataset(
171+
self,
172+
dataset_id: str,
173+
body: DatasetEditRequest,
174+
) -> DatasetResponseSingle:
175+
"""Edits a dataset.
176+
177+
Edits the dataset associated with the ID.
178+
179+
:param dataset_id: The ID of a defined dataset.
180+
:type dataset_id: str
181+
:param body: Dataset payload
182+
:type body: DatasetEditRequest
183+
:rtype: DatasetResponseSingle
184+
"""
185+
kwargs: Dict[str, Any] = {}
186+
kwargs["dataset_id"] = dataset_id
187+
188+
kwargs["body"] = body
189+
190+
return self._edit_dataset_endpoint.call_with_http_info(**kwargs)
191+
143192
def get_all_datasets(
144193
self,
145194
) -> DatasetResponseMulti:

src/datadog_api_client/v2/model/dataset.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ def __init__(self_, attributes: DatasetAttributes, type: str, id: Union[str, Uns
3838
"""
3939
Dataset object.
4040
41+
**Datasets Constraints**
42+
43+
*
44+
**Tag Limit per Dataset** :
45+
46+
* Each restricted dataset supports a maximum of 10 key:value pairs per product.
47+
48+
*
49+
**Tag Key Rules per Telemetry Type** :
50+
51+
* Only one tag key or attribute may be used to define access within a single telemetry type.
52+
* The same or different tag key may be used across different telemetry types.
53+
54+
*
55+
**Tag Value Uniqueness** :
56+
57+
* Tag values must be unique within a single dataset.
58+
* A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
59+
4160
:param attributes: Dataset metadata and configuration(s).
4261
:type attributes: DatasetAttributes
4362

src/datadog_api_client/v2/model/dataset_create_request.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,25 @@ def __init__(self_, data: Dataset, **kwargs):
3333
Create request for a dataset.
3434
3535
:param data: Dataset object.
36+
37+
**Datasets Constraints**
38+
39+
*
40+
**Tag Limit per Dataset** :
41+
42+
* Each restricted dataset supports a maximum of 10 key:value pairs per product.
43+
44+
*
45+
**Tag Key Rules per Telemetry Type** :
46+
47+
* Only one tag key or attribute may be used to define access within a single telemetry type.
48+
* The same or different tag key may be used across different telemetry types.
49+
50+
*
51+
**Tag Value Uniqueness** :
52+
53+
* Tag values must be unique within a single dataset.
54+
* A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
3655
:type data: Dataset
3756
"""
3857
super().__init__(kwargs)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
if TYPE_CHECKING:
15+
from datadog_api_client.v2.model.dataset import Dataset
16+
17+
18+
class DatasetEditRequest(ModelNormal):
19+
@cached_property
20+
def openapi_types(_):
21+
from datadog_api_client.v2.model.dataset import Dataset
22+
23+
return {
24+
"data": (Dataset,),
25+
}
26+
27+
attribute_map = {
28+
"data": "data",
29+
}
30+
31+
def __init__(self_, data: Dataset, **kwargs):
32+
"""
33+
Edit request for a dataset.
34+
35+
:param data: Dataset object.
36+
37+
**Datasets Constraints**
38+
39+
*
40+
**Tag Limit per Dataset** :
41+
42+
* Each restricted dataset supports a maximum of 10 key:value pairs per product.
43+
44+
*
45+
**Tag Key Rules per Telemetry Type** :
46+
47+
* Only one tag key or attribute may be used to define access within a single telemetry type.
48+
* The same or different tag key may be used across different telemetry types.
49+
50+
*
51+
**Tag Value Uniqueness** :
52+
53+
* Tag values must be unique within a single dataset.
54+
* A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
55+
:type data: Dataset
56+
"""
57+
super().__init__(kwargs)
58+
59+
self_.data = data

src/datadog_api_client/v2/model/dataset_response_single.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,25 @@ def __init__(self_, data: Dataset, **kwargs):
3333
Response containing a single dataset object.
3434
3535
:param data: Dataset object.
36+
37+
**Datasets Constraints**
38+
39+
*
40+
**Tag Limit per Dataset** :
41+
42+
* Each restricted dataset supports a maximum of 10 key:value pairs per product.
43+
44+
*
45+
**Tag Key Rules per Telemetry Type** :
46+
47+
* Only one tag key or attribute may be used to define access within a single telemetry type.
48+
* The same or different tag key may be used across different telemetry types.
49+
50+
*
51+
**Tag Value Uniqueness** :
52+
53+
* Tag values must be unique within a single dataset.
54+
* A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
3655
:type data: Dataset
3756
"""
3857
super().__init__(kwargs)

src/datadog_api_client/v2/model/filters_per_product.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def __init__(self_, filters: List[str], product: str, **kwargs):
3434
per telemetry type.
3535
:type filters: [str]
3636
37-
:param product: Name of the product the dataset is for. Possible values are 'apm', 'rum', 'synthetics',
38-
'metrics', 'logs', 'sd_repoinfo', 'error_tracking', 'cloud_cost', and 'ml_obs'.
37+
:param product: Name of the product the dataset is for. Possible values are 'apm', 'rum',
38+
'metrics', 'logs', 'error_tracking', and 'cloud_cost'.
3939
:type product: str
4040
"""
4141
super().__init__(kwargs)

0 commit comments

Comments
 (0)