Skip to content

Commit 9e0b322

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

File tree

11 files changed

+519
-9
lines changed

11 files changed

+519
-9
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:24:36.914"
2+
"spec_repo_commit": "e4f653f",
3+
"generated": "2025-07-25 14:08:34.729"
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
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Edit a dataset returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.DatasetsApi;
6+
import com.datadog.api.client.v2.model.Dataset;
7+
import com.datadog.api.client.v2.model.DatasetAttributes;
8+
import com.datadog.api.client.v2.model.DatasetResponseSingle;
9+
import com.datadog.api.client.v2.model.DatasetUpdateRequest;
10+
import com.datadog.api.client.v2.model.FiltersPerProduct;
11+
import java.util.Collections;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
DatasetsApi apiInstance = new DatasetsApi(defaultClient);
17+
18+
DatasetUpdateRequest body =
19+
new DatasetUpdateRequest()
20+
.data(
21+
new Dataset()
22+
.attributes(
23+
new DatasetAttributes()
24+
.createdAt(null)
25+
.name("Security Audit Dataset")
26+
.principals(
27+
Collections.singletonList(
28+
"role:86245fce-0a4e-11f0-92bd-da7ad0900002"))
29+
.productFilters(
30+
Collections.singletonList(
31+
new FiltersPerProduct()
32+
.filters(Collections.singletonList("@application.id:ABCD"))
33+
.product("logs"))))
34+
.id("123e4567-e89b-12d3-a456-426614174000")
35+
.type("dataset"));
36+
37+
try {
38+
DatasetResponseSingle result = apiInstance.updateDataset("dataset_id", body);
39+
System.out.println(result);
40+
} catch (ApiException e) {
41+
System.err.println("Exception when calling DatasetsApi#updateDataset");
42+
System.err.println("Status code: " + e.getCode());
43+
System.err.println("Reason: " + e.getResponseBody());
44+
System.err.println("Response headers: " + e.getResponseHeaders());
45+
e.printStackTrace();
46+
}
47+
}
48+
}

src/main/java/com/datadog/api/client/v2/api/DatasetsApi.java

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.datadog.api.client.v2.model.DatasetCreateRequest;
88
import com.datadog.api.client.v2.model.DatasetResponseMulti;
99
import com.datadog.api.client.v2.model.DatasetResponseSingle;
10+
import com.datadog.api.client.v2.model.DatasetUpdateRequest;
1011
import jakarta.ws.rs.client.Invocation;
1112
import jakarta.ws.rs.core.GenericType;
1213
import java.util.ArrayList;
@@ -554,4 +555,161 @@ public CompletableFuture<ApiResponse<DatasetResponseSingle>> getDatasetWithHttpI
554555
false,
555556
new GenericType<DatasetResponseSingle>() {});
556557
}
558+
559+
/**
560+
* Edit a dataset.
561+
*
562+
* <p>See {@link #updateDatasetWithHttpInfo}.
563+
*
564+
* @param datasetId The ID of a defined dataset. (required)
565+
* @param body Dataset payload (required)
566+
* @return DatasetResponseSingle
567+
* @throws ApiException if fails to make API call
568+
*/
569+
public DatasetResponseSingle updateDataset(String datasetId, DatasetUpdateRequest body)
570+
throws ApiException {
571+
return updateDatasetWithHttpInfo(datasetId, body).getData();
572+
}
573+
574+
/**
575+
* Edit a dataset.
576+
*
577+
* <p>See {@link #updateDatasetWithHttpInfoAsync}.
578+
*
579+
* @param datasetId The ID of a defined dataset. (required)
580+
* @param body Dataset payload (required)
581+
* @return CompletableFuture&lt;DatasetResponseSingle&gt;
582+
*/
583+
public CompletableFuture<DatasetResponseSingle> updateDatasetAsync(
584+
String datasetId, DatasetUpdateRequest body) {
585+
return updateDatasetWithHttpInfoAsync(datasetId, body)
586+
.thenApply(
587+
response -> {
588+
return response.getData();
589+
});
590+
}
591+
592+
/**
593+
* Edits the dataset associated with the ID.
594+
*
595+
* @param datasetId The ID of a defined dataset. (required)
596+
* @param body Dataset payload (required)
597+
* @return ApiResponse&lt;DatasetResponseSingle&gt;
598+
* @throws ApiException if fails to make API call
599+
* @http.response.details
600+
* <table border="1">
601+
* <caption>Response details</caption>
602+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
603+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
604+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
605+
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
606+
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
607+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
608+
* </table>
609+
*/
610+
public ApiResponse<DatasetResponseSingle> updateDatasetWithHttpInfo(
611+
String datasetId, DatasetUpdateRequest body) throws ApiException {
612+
Object localVarPostBody = body;
613+
614+
// verify the required parameter 'datasetId' is set
615+
if (datasetId == null) {
616+
throw new ApiException(
617+
400, "Missing the required parameter 'datasetId' when calling updateDataset");
618+
}
619+
620+
// verify the required parameter 'body' is set
621+
if (body == null) {
622+
throw new ApiException(
623+
400, "Missing the required parameter 'body' when calling updateDataset");
624+
}
625+
// create path and map variables
626+
String localVarPath =
627+
"/api/v2/datasets/{dataset_id}"
628+
.replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString()));
629+
630+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
631+
632+
Invocation.Builder builder =
633+
apiClient.createBuilder(
634+
"v2.DatasetsApi.updateDataset",
635+
localVarPath,
636+
new ArrayList<Pair>(),
637+
localVarHeaderParams,
638+
new HashMap<String, String>(),
639+
new String[] {"application/json"},
640+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
641+
return apiClient.invokeAPI(
642+
"PUT",
643+
builder,
644+
localVarHeaderParams,
645+
new String[] {"application/json"},
646+
localVarPostBody,
647+
new HashMap<String, Object>(),
648+
false,
649+
new GenericType<DatasetResponseSingle>() {});
650+
}
651+
652+
/**
653+
* Edit a dataset.
654+
*
655+
* <p>See {@link #updateDatasetWithHttpInfo}.
656+
*
657+
* @param datasetId The ID of a defined dataset. (required)
658+
* @param body Dataset payload (required)
659+
* @return CompletableFuture&lt;ApiResponse&lt;DatasetResponseSingle&gt;&gt;
660+
*/
661+
public CompletableFuture<ApiResponse<DatasetResponseSingle>> updateDatasetWithHttpInfoAsync(
662+
String datasetId, DatasetUpdateRequest body) {
663+
Object localVarPostBody = body;
664+
665+
// verify the required parameter 'datasetId' is set
666+
if (datasetId == null) {
667+
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
668+
result.completeExceptionally(
669+
new ApiException(
670+
400, "Missing the required parameter 'datasetId' when calling updateDataset"));
671+
return result;
672+
}
673+
674+
// verify the required parameter 'body' is set
675+
if (body == null) {
676+
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
677+
result.completeExceptionally(
678+
new ApiException(
679+
400, "Missing the required parameter 'body' when calling updateDataset"));
680+
return result;
681+
}
682+
// create path and map variables
683+
String localVarPath =
684+
"/api/v2/datasets/{dataset_id}"
685+
.replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString()));
686+
687+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
688+
689+
Invocation.Builder builder;
690+
try {
691+
builder =
692+
apiClient.createBuilder(
693+
"v2.DatasetsApi.updateDataset",
694+
localVarPath,
695+
new ArrayList<Pair>(),
696+
localVarHeaderParams,
697+
new HashMap<String, String>(),
698+
new String[] {"application/json"},
699+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
700+
} catch (ApiException ex) {
701+
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
702+
result.completeExceptionally(ex);
703+
return result;
704+
}
705+
return apiClient.invokeAPIAsync(
706+
"PUT",
707+
builder,
708+
localVarHeaderParams,
709+
new String[] {"application/json"},
710+
localVarPostBody,
711+
new HashMap<String, Object>(),
712+
false,
713+
new GenericType<DatasetResponseSingle>() {});
714+
}
557715
}

src/main/java/com/datadog/api/client/v2/model/Dataset.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,27 @@
1717
import java.util.Map;
1818
import java.util.Objects;
1919

20-
/** Dataset object. */
20+
/**
21+
* Dataset object.
22+
*
23+
* <h3>Datasets Constraints</h3>
24+
*
25+
* <ul>
26+
* <li><strong>Tag Limit per Dataset</strong>:
27+
* <li>
28+
* <p>Each restricted dataset supports a maximum of 10 key:value pairs per product.
29+
* <li>
30+
* <p><strong>Tag Key Rules per Telemetry Type</strong>:
31+
* <li>Only one tag key or attribute may be used to define access within a single telemetry type.
32+
* <li>
33+
* <p>The same or different tag key may be used across different telemetry types.
34+
* <li>
35+
* <p><strong>Tag Value Uniqueness</strong>:
36+
* <li>Tag values must be unique within a single dataset.
37+
* <li>A tag value used in one dataset cannot be reused in another dataset of the same telemetry
38+
* type.
39+
* </ul>
40+
*/
2141
@JsonPropertyOrder({
2242
Dataset.JSON_PROPERTY_ATTRIBUTES,
2343
Dataset.JSON_PROPERTY_ID,

src/main/java/com/datadog/api/client/v2/model/DatasetCreateRequest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ public DatasetCreateRequest data(Dataset data) {
4444
/**
4545
* Dataset object.
4646
*
47+
* <h3>Datasets Constraints</h3>
48+
*
49+
* <ul>
50+
* <li><strong>Tag Limit per Dataset</strong>:
51+
* <li>
52+
* <p>Each restricted dataset supports a maximum of 10 key:value pairs per product.
53+
* <li>
54+
* <p><strong>Tag Key Rules per Telemetry Type</strong>:
55+
* <li>Only one tag key or attribute may be used to define access within a single telemetry
56+
* type.
57+
* <li>
58+
* <p>The same or different tag key may be used across different telemetry types.
59+
* <li>
60+
* <p><strong>Tag Value Uniqueness</strong>:
61+
* <li>Tag values must be unique within a single dataset.
62+
* <li>A tag value used in one dataset cannot be reused in another dataset of the same telemetry
63+
* type.
64+
* </ul>
65+
*
4766
* @return data
4867
*/
4968
@JsonProperty(JSON_PROPERTY_DATA)

src/main/java/com/datadog/api/client/v2/model/DatasetResponseSingle.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ public DatasetResponseSingle data(Dataset data) {
4444
/**
4545
* Dataset object.
4646
*
47+
* <h3>Datasets Constraints</h3>
48+
*
49+
* <ul>
50+
* <li><strong>Tag Limit per Dataset</strong>:
51+
* <li>
52+
* <p>Each restricted dataset supports a maximum of 10 key:value pairs per product.
53+
* <li>
54+
* <p><strong>Tag Key Rules per Telemetry Type</strong>:
55+
* <li>Only one tag key or attribute may be used to define access within a single telemetry
56+
* type.
57+
* <li>
58+
* <p>The same or different tag key may be used across different telemetry types.
59+
* <li>
60+
* <p><strong>Tag Value Uniqueness</strong>:
61+
* <li>Tag values must be unique within a single dataset.
62+
* <li>A tag value used in one dataset cannot be reused in another dataset of the same telemetry
63+
* type.
64+
* </ul>
65+
*
4766
* @return data
4867
*/
4968
@JsonProperty(JSON_PROPERTY_DATA)

0 commit comments

Comments
 (0)