Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "d51e9a8",
"generated": "2025-07-25 13:24:36.914"
"spec_repo_commit": "e4f653f",
"generated": "2025-07-25 14:08:34.729"
}
60 changes: 56 additions & 4 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12478,7 +12478,14 @@ components:
- type
type: object
Dataset:
description: Dataset object.
description: "Dataset object.\n\n### Datasets Constraints\n- **Tag Limit per
Dataset**:\n - Each restricted dataset supports a maximum of 10 key:value
pairs per product.\n\n- **Tag Key Rules per Telemetry Type**:\n - Only one
tag key or attribute may be used to define access within a single telemetry
type.\n - The same or different tag key may be used across different telemetry
types.\n\n- **Tag Value Uniqueness**:\n - Tag values must be unique within
a single dataset.\n - A tag value used in one dataset cannot be reused in
another dataset of the same telemetry type."
properties:
attributes:
$ref: '#/components/schemas/DatasetAttributes'
Expand Down Expand Up @@ -12556,6 +12563,14 @@ components:
required:
- data
type: object
DatasetUpdateRequest:
description: Edit request for a dataset.
properties:
data:
$ref: '#/components/schemas/Dataset'
required:
- data
type: object
Date:
description: Date as Unix timestamp in milliseconds.
example: 1722439510282
Expand Down Expand Up @@ -16083,10 +16098,9 @@ components:
type: array
product:
description: 'Name of the product the dataset is for. Possible values are
''apm'', ''rum'', ''synthetics'',
''apm'', ''rum'',

''metrics'', ''logs'', ''sd_repoinfo'', ''error_tracking'', ''cloud_cost'',
and ''ml_obs''.'
''metrics'', ''logs'', ''error_tracking'', and ''cloud_cost''.'
example: logs
type: string
required:
Expand Down Expand Up @@ -48282,6 +48296,44 @@ paths:
x-permission:
operator: OPEN
permissions: []
put:
description: Edits the dataset associated with the ID.
operationId: UpdateDataset
parameters:
- $ref: '#/components/parameters/DatasetID'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DatasetUpdateRequest'
description: Dataset payload
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DatasetResponseSingle'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Edit a dataset
tags:
- Datasets
x-codegen-request-body-name: body
x-permission:
operator: OPEN
permissions: []
/api/v2/deletion/data/{product}:
post:
description: Creates a data deletion request by providing a query and a timeframe
Expand Down
48 changes: 48 additions & 0 deletions examples/v2/datasets/UpdateDataset.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Edit a dataset returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DatasetsApi;
import com.datadog.api.client.v2.model.Dataset;
import com.datadog.api.client.v2.model.DatasetAttributes;
import com.datadog.api.client.v2.model.DatasetResponseSingle;
import com.datadog.api.client.v2.model.DatasetUpdateRequest;
import com.datadog.api.client.v2.model.FiltersPerProduct;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
DatasetsApi apiInstance = new DatasetsApi(defaultClient);

DatasetUpdateRequest body =
new DatasetUpdateRequest()
.data(
new Dataset()
.attributes(
new DatasetAttributes()
.createdAt(null)
.name("Security Audit Dataset")
.principals(
Collections.singletonList(
"role:86245fce-0a4e-11f0-92bd-da7ad0900002"))
.productFilters(
Collections.singletonList(
new FiltersPerProduct()
.filters(Collections.singletonList("@application.id:ABCD"))
.product("logs"))))
.id("123e4567-e89b-12d3-a456-426614174000")
.type("dataset"));

try {
DatasetResponseSingle result = apiInstance.updateDataset("dataset_id", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DatasetsApi#updateDataset");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
158 changes: 158 additions & 0 deletions src/main/java/com/datadog/api/client/v2/api/DatasetsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.datadog.api.client.v2.model.DatasetCreateRequest;
import com.datadog.api.client.v2.model.DatasetResponseMulti;
import com.datadog.api.client.v2.model.DatasetResponseSingle;
import com.datadog.api.client.v2.model.DatasetUpdateRequest;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.core.GenericType;
import java.util.ArrayList;
Expand Down Expand Up @@ -554,4 +555,161 @@ public CompletableFuture<ApiResponse<DatasetResponseSingle>> getDatasetWithHttpI
false,
new GenericType<DatasetResponseSingle>() {});
}

/**
* Edit a dataset.
*
* <p>See {@link #updateDatasetWithHttpInfo}.
*
* @param datasetId The ID of a defined dataset. (required)
* @param body Dataset payload (required)
* @return DatasetResponseSingle
* @throws ApiException if fails to make API call
*/
public DatasetResponseSingle updateDataset(String datasetId, DatasetUpdateRequest body)
throws ApiException {
return updateDatasetWithHttpInfo(datasetId, body).getData();
}

/**
* Edit a dataset.
*
* <p>See {@link #updateDatasetWithHttpInfoAsync}.
*
* @param datasetId The ID of a defined dataset. (required)
* @param body Dataset payload (required)
* @return CompletableFuture&lt;DatasetResponseSingle&gt;
*/
public CompletableFuture<DatasetResponseSingle> updateDatasetAsync(
String datasetId, DatasetUpdateRequest body) {
return updateDatasetWithHttpInfoAsync(datasetId, body)
.thenApply(
response -> {
return response.getData();
});
}

/**
* Edits the dataset associated with the ID.
*
* @param datasetId The ID of a defined dataset. (required)
* @param body Dataset payload (required)
* @return ApiResponse&lt;DatasetResponseSingle&gt;
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<DatasetResponseSingle> updateDatasetWithHttpInfo(
String datasetId, DatasetUpdateRequest body) throws ApiException {
Object localVarPostBody = body;

// verify the required parameter 'datasetId' is set
if (datasetId == null) {
throw new ApiException(
400, "Missing the required parameter 'datasetId' when calling updateDataset");
}

// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400, "Missing the required parameter 'body' when calling updateDataset");
}
// create path and map variables
String localVarPath =
"/api/v2/datasets/{dataset_id}"
.replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString()));

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder =
apiClient.createBuilder(
"v2.DatasetsApi.updateDataset",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"PUT",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<DatasetResponseSingle>() {});
}

/**
* Edit a dataset.
*
* <p>See {@link #updateDatasetWithHttpInfo}.
*
* @param datasetId The ID of a defined dataset. (required)
* @param body Dataset payload (required)
* @return CompletableFuture&lt;ApiResponse&lt;DatasetResponseSingle&gt;&gt;
*/
public CompletableFuture<ApiResponse<DatasetResponseSingle>> updateDatasetWithHttpInfoAsync(
String datasetId, DatasetUpdateRequest body) {
Object localVarPostBody = body;

// verify the required parameter 'datasetId' is set
if (datasetId == null) {
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'datasetId' when calling updateDataset"));
return result;
}

// verify the required parameter 'body' is set
if (body == null) {
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'body' when calling updateDataset"));
return result;
}
// create path and map variables
String localVarPath =
"/api/v2/datasets/{dataset_id}"
.replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString()));

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.DatasetsApi.updateDataset",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"PUT",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<DatasetResponseSingle>() {});
}
}
22 changes: 21 additions & 1 deletion src/main/java/com/datadog/api/client/v2/model/Dataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,27 @@
import java.util.Map;
import java.util.Objects;

/** Dataset object. */
/**
* Dataset object.
*
* <h3>Datasets Constraints</h3>
*
* <ul>
* <li><strong>Tag Limit per Dataset</strong>:
* <li>
* <p>Each restricted dataset supports a maximum of 10 key:value pairs per product.
* <li>
* <p><strong>Tag Key Rules per Telemetry Type</strong>:
* <li>Only one tag key or attribute may be used to define access within a single telemetry type.
* <li>
* <p>The same or different tag key may be used across different telemetry types.
* <li>
* <p><strong>Tag Value Uniqueness</strong>:
* <li>Tag values must be unique within a single dataset.
* <li>A tag value used in one dataset cannot be reused in another dataset of the same telemetry
* type.
* </ul>
*/
@JsonPropertyOrder({
Dataset.JSON_PROPERTY_ATTRIBUTES,
Dataset.JSON_PROPERTY_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ public DatasetCreateRequest data(Dataset data) {
/**
* Dataset object.
*
* <h3>Datasets Constraints</h3>
*
* <ul>
* <li><strong>Tag Limit per Dataset</strong>:
* <li>
* <p>Each restricted dataset supports a maximum of 10 key:value pairs per product.
* <li>
* <p><strong>Tag Key Rules per Telemetry Type</strong>:
* <li>Only one tag key or attribute may be used to define access within a single telemetry
* type.
* <li>
* <p>The same or different tag key may be used across different telemetry types.
* <li>
* <p><strong>Tag Value Uniqueness</strong>:
* <li>Tag values must be unique within a single dataset.
* <li>A tag value used in one dataset cannot be reused in another dataset of the same telemetry
* type.
* </ul>
*
* @return data
*/
@JsonProperty(JSON_PROPERTY_DATA)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ public DatasetResponseSingle data(Dataset data) {
/**
* Dataset object.
*
* <h3>Datasets Constraints</h3>
*
* <ul>
* <li><strong>Tag Limit per Dataset</strong>:
* <li>
* <p>Each restricted dataset supports a maximum of 10 key:value pairs per product.
* <li>
* <p><strong>Tag Key Rules per Telemetry Type</strong>:
* <li>Only one tag key or attribute may be used to define access within a single telemetry
* type.
* <li>
* <p>The same or different tag key may be used across different telemetry types.
* <li>
* <p><strong>Tag Value Uniqueness</strong>:
* <li>Tag values must be unique within a single dataset.
* <li>A tag value used in one dataset cannot be reused in another dataset of the same telemetry
* type.
* </ul>
*
* @return data
*/
@JsonProperty(JSON_PROPERTY_DATA)
Expand Down
Loading