Skip to content

Commit f9ea2ab

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Uncomment edit dataset block, add dataset limitations into endpoint descriptions (#2723)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent bd202eb commit f9ea2ab

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": "d51e9a8",
3-
"generated": "2025-07-25 13:23:28.748"
2+
"spec_repo_commit": "e4f653f",
3+
"generated": "2025-07-25 14:07:32.279"
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'
@@ -12556,6 +12563,14 @@ components:
1255612563
required:
1255712564
- data
1255812565
type: object
12566+
DatasetUpdateRequest:
12567+
description: Edit request for a dataset.
12568+
properties:
12569+
data:
12570+
$ref: '#/components/schemas/Dataset'
12571+
required:
12572+
- data
12573+
type: object
1255912574
Date:
1256012575
description: Date as Unix timestamp in milliseconds.
1256112576
example: 1722439510282
@@ -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:
@@ -48282,6 +48296,44 @@ paths:
4828248296
x-permission:
4828348297
operator: OPEN
4828448298
permissions: []
48299+
put:
48300+
description: Edits the dataset associated with the ID.
48301+
operationId: UpdateDataset
48302+
parameters:
48303+
- $ref: '#/components/parameters/DatasetID'
48304+
requestBody:
48305+
content:
48306+
application/json:
48307+
schema:
48308+
$ref: '#/components/schemas/DatasetUpdateRequest'
48309+
description: Dataset payload
48310+
required: true
48311+
responses:
48312+
'200':
48313+
content:
48314+
application/json:
48315+
schema:
48316+
$ref: '#/components/schemas/DatasetResponseSingle'
48317+
description: OK
48318+
'400':
48319+
$ref: '#/components/responses/BadRequestResponse'
48320+
'403':
48321+
$ref: '#/components/responses/NotAuthorizedResponse'
48322+
'404':
48323+
$ref: '#/components/responses/NotFoundResponse'
48324+
'429':
48325+
$ref: '#/components/responses/TooManyRequestsResponse'
48326+
security:
48327+
- apiKeyAuth: []
48328+
appKeyAuth: []
48329+
- AuthZ: []
48330+
summary: Edit a dataset
48331+
tags:
48332+
- Datasets
48333+
x-codegen-request-body-name: body
48334+
x-permission:
48335+
operator: OPEN
48336+
permissions: []
4828548337
/api/v2/deletion/data/{product}:
4828648338
post:
4828748339
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
@@ -4841,6 +4841,13 @@ datadog\_api\_client.v2.model.dataset\_response\_single module
48414841
:members:
48424842
:show-inheritance:
48434843

4844+
datadog\_api\_client.v2.model.dataset\_update\_request module
4845+
-------------------------------------------------------------
4846+
4847+
.. automodule:: datadog_api_client.v2.model.dataset_update_request
4848+
:members:
4849+
:show-inheritance:
4850+
48444851
datadog\_api\_client.v2.model.delete\_app\_response module
48454852
----------------------------------------------------------
48464853

examples/v2/datasets/UpdateDataset.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""
2+
Edit 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_update_request import DatasetUpdateRequest
10+
from datadog_api_client.v2.model.filters_per_product import FiltersPerProduct
11+
12+
body = DatasetUpdateRequest(
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.update_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_update_request import DatasetUpdateRequest
1314

1415

1516
class DatasetsApi:
@@ -106,6 +107,32 @@ def __init__(self, api_client=None):
106107
api_client=api_client,
107108
)
108109

110+
self._update_dataset_endpoint = _Endpoint(
111+
settings={
112+
"response_type": (DatasetResponseSingle,),
113+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
114+
"endpoint_path": "/api/v2/datasets/{dataset_id}",
115+
"operation_id": "update_dataset",
116+
"http_method": "PUT",
117+
"version": "v2",
118+
},
119+
params_map={
120+
"dataset_id": {
121+
"required": True,
122+
"openapi_types": (str,),
123+
"attribute": "dataset_id",
124+
"location": "path",
125+
},
126+
"body": {
127+
"required": True,
128+
"openapi_types": (DatasetUpdateRequest,),
129+
"location": "body",
130+
},
131+
},
132+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
133+
api_client=api_client,
134+
)
135+
109136
def create_dataset(
110137
self,
111138
body: DatasetCreateRequest,
@@ -168,3 +195,25 @@ def get_dataset(
168195
kwargs["dataset_id"] = dataset_id
169196

170197
return self._get_dataset_endpoint.call_with_http_info(**kwargs)
198+
199+
def update_dataset(
200+
self,
201+
dataset_id: str,
202+
body: DatasetUpdateRequest,
203+
) -> DatasetResponseSingle:
204+
"""Edit a dataset.
205+
206+
Edits the dataset associated with the ID.
207+
208+
:param dataset_id: The ID of a defined dataset.
209+
:type dataset_id: str
210+
:param body: Dataset payload
211+
:type body: DatasetUpdateRequest
212+
:rtype: DatasetResponseSingle
213+
"""
214+
kwargs: Dict[str, Any] = {}
215+
kwargs["dataset_id"] = dataset_id
216+
217+
kwargs["body"] = body
218+
219+
return self._update_dataset_endpoint.call_with_http_info(**kwargs)

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)

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)
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 DatasetUpdateRequest(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/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)