Skip to content

Commit 294a793

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Split Dataset into separate request and response objects, mark unstable (#816)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 10c382b commit 294a793

File tree

43 files changed

+1365
-193
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1365
-193
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": "ab8171f",
3-
"generated": "2025-07-31 17:38:59.908"
2+
"spec_repo_commit": "672a533",
3+
"generated": "2025-07-31 18:12:52.812"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 84 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13145,31 +13145,33 @@ components:
1314513145
required:
1314613146
- type
1314713147
type: object
13148-
Dataset:
13149-
description: "Dataset object.\n\n### Datasets Constraints\n- **Tag Limit per
13150-
Dataset**:\n - Each restricted dataset supports a maximum of 10 key:value
13151-
pairs per product.\n\n- **Tag Key Rules per Telemetry Type**:\n - Only one
13152-
tag key or attribute may be used to define access within a single telemetry
13153-
type.\n - The same or different tag key may be used across different telemetry
13154-
types.\n\n- **Tag Value Uniqueness**:\n - Tag values must be unique within
13155-
a single dataset.\n - A tag value used in one dataset cannot be reused in
13156-
another dataset of the same telemetry type."
13148+
DatasetAttributesRequest:
13149+
description: Dataset metadata and configurations.
1315713150
properties:
13158-
attributes:
13159-
$ref: '#/components/schemas/DatasetAttributes'
13160-
id:
13161-
description: Unique identifier for the dataset.
13162-
example: 123e4567-e89b-12d3-a456-426614174000
13163-
type: string
13164-
type:
13165-
description: Resource type, always "dataset".
13166-
example: dataset
13151+
name:
13152+
description: Name of the dataset.
13153+
example: Security Audit Dataset
1316713154
type: string
13155+
principals:
13156+
description: List of access principals, formatted as `principal_type:id`.
13157+
Principal can be 'team' or 'role'.
13158+
example:
13159+
- role:94172442-be03-11e9-a77a-3b7612558ac1
13160+
items:
13161+
example: role:94172442-be03-11e9-a77a-3b7612558ac1
13162+
type: string
13163+
type: array
13164+
product_filters:
13165+
description: List of product-specific filters.
13166+
items:
13167+
$ref: '#/components/schemas/FiltersPerProduct'
13168+
type: array
1316813169
required:
13169-
- type
13170-
- attributes
13170+
- name
13171+
- product_filters
13172+
- principals
1317113173
type: object
13172-
DatasetAttributes:
13174+
DatasetAttributesResponse:
1317313175
description: Dataset metadata and configuration(s).
1317413176
properties:
1317513177
created_at:
@@ -13199,43 +13201,76 @@ components:
1319913201
items:
1320013202
$ref: '#/components/schemas/FiltersPerProduct'
1320113203
type: array
13202-
required:
13203-
- name
13204-
- product_filters
13205-
- principals
1320613204
type: object
1320713205
DatasetCreateRequest:
1320813206
description: Create request for a dataset.
1320913207
properties:
1321013208
data:
13211-
$ref: '#/components/schemas/Dataset'
13209+
$ref: '#/components/schemas/DatasetRequest'
1321213210
required:
1321313211
- data
1321413212
type: object
13213+
DatasetRequest:
13214+
description: "**Datasets Object Constraints**\n- **Tag limit per dataset**:\n
13215+
\ - Each restricted dataset supports a maximum of 10 key:value pairs per product.\n\n-
13216+
**Tag key rules per telemetry type**:\n - Only one tag key or attribute may
13217+
be used to define access within a single telemetry type.\n - The same or
13218+
different tag key may be used across different telemetry types.\n\n- **Tag
13219+
value uniqueness**:\n - Tag values must be unique within a single dataset.\n
13220+
\ - A tag value used in one dataset cannot be reused in another dataset of
13221+
the same telemetry type."
13222+
properties:
13223+
attributes:
13224+
$ref: '#/components/schemas/DatasetAttributesRequest'
13225+
type:
13226+
description: Resource type, always "dataset".
13227+
example: dataset
13228+
type: string
13229+
required:
13230+
- type
13231+
- attributes
13232+
type: object
13233+
DatasetResponse:
13234+
description: "**Datasets Object Constraints**\n- **Tag Limit per Dataset**:\n
13235+
\ - Each restricted dataset supports a maximum of 10 key:value pairs per product.\n\n-
13236+
**Tag Key Rules per Telemetry Type**:\n - Only one tag key or attribute may
13237+
be used to define access within a single telemetry type.\n - The same or
13238+
different tag key may be used across different telemetry types.\n\n- **Tag
13239+
Value Uniqueness**:\n - Tag values must be unique within a single dataset.\n
13240+
\ - A tag value used in one dataset cannot be reused in another dataset of
13241+
the same telemetry type."
13242+
properties:
13243+
attributes:
13244+
$ref: '#/components/schemas/DatasetAttributesResponse'
13245+
id:
13246+
description: Unique identifier for the dataset.
13247+
example: 123e4567-e89b-12d3-a456-426614174000
13248+
type: string
13249+
type:
13250+
description: Resource type, always "dataset".
13251+
example: dataset
13252+
type: string
13253+
type: object
1321513254
DatasetResponseMulti:
1321613255
description: Response containing a list of datasets.
1321713256
properties:
1321813257
data:
1321913258
description: The list of datasets returned in response.
1322013259
items:
13221-
$ref: '#/components/schemas/Dataset'
13260+
$ref: '#/components/schemas/DatasetResponse'
1322213261
type: array
13223-
required:
13224-
- data
1322513262
type: object
1322613263
DatasetResponseSingle:
1322713264
description: Response containing a single dataset object.
1322813265
properties:
1322913266
data:
13230-
$ref: '#/components/schemas/Dataset'
13231-
required:
13232-
- data
13267+
$ref: '#/components/schemas/DatasetResponse'
1323313268
type: object
1323413269
DatasetUpdateRequest:
1323513270
description: Edit request for a dataset.
1323613271
properties:
1323713272
data:
13238-
$ref: '#/components/schemas/Dataset'
13273+
$ref: '#/components/schemas/DatasetRequest'
1323913274
required:
1324013275
- data
1324113276
type: object
@@ -49913,6 +49948,9 @@ paths:
4991349948
operator: OR
4991449949
permissions:
4991549950
- user_access_read
49951+
x-unstable: '**Note: Data Access is in preview. If you have any feedback,
49952+
49953+
contact [Datadog support](https://docs.datadoghq.com/help/).**'
4991649954
post:
4991749955
description: Create a dataset with the configurations in the request.
4991849956
operationId: CreateDataset
@@ -49924,7 +49962,7 @@ paths:
4992449962
attributes:
4992549963
name: Test RUM Dataset
4992649964
principals:
49927-
- role:23bacb30-1c59-11f0-a596-da7ad0900002
49965+
- role:94172442-be03-11e9-a77a-3b7612558ac1
4992849966
product_filters:
4992949967
- filters:
4993049968
- '@application.id:application_123'
@@ -49962,6 +50000,9 @@ paths:
4996250000
operator: OR
4996350001
permissions:
4996450002
- user_access_manage
50003+
x-unstable: '**Note: Data Access is in preview. If you have any feedback,
50004+
50005+
contact [Datadog support](https://docs.datadoghq.com/help/).**'
4996550006
/api/v2/datasets/{dataset_id}:
4996650007
delete:
4996750008
description: Deletes the dataset associated with the ID.
@@ -49989,6 +50030,9 @@ paths:
4998950030
x-permission:
4999050031
operator: OPEN
4999150032
permissions: []
50033+
x-unstable: '**Note: Data Access is in preview. If you have any feedback,
50034+
50035+
contact [Datadog support](https://docs.datadoghq.com/help/).**'
4999250036
get:
4999350037
description: Retrieves the dataset associated with the ID.
4999450038
operationId: GetDataset
@@ -50019,6 +50063,9 @@ paths:
5001950063
x-permission:
5002050064
operator: OPEN
5002150065
permissions: []
50066+
x-unstable: '**Note: Data Access is in preview. If you have any feedback,
50067+
50068+
contact [Datadog support](https://docs.datadoghq.com/help/).**'
5002250069
put:
5002350070
description: Edits the dataset associated with the ID.
5002450071
operationId: UpdateDataset
@@ -50057,6 +50104,9 @@ paths:
5005750104
x-permission:
5005850105
operator: OPEN
5005950106
permissions: []
50107+
x-unstable: '**Note: Data Access is in preview. If you have any feedback,
50108+
50109+
contact [Datadog support](https://docs.datadoghq.com/help/).**'
5006050110
/api/v2/deletion/data/{product}:
5006150111
post:
5006250112
description: Creates a data deletion request by providing a query and a timeframe

examples/v2_datasets_CreateDataset.rs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
// Create a dataset returns "OK" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_datasets::DatasetsAPI;
4-
use datadog_api_client::datadogV2::model::Dataset;
5-
use datadog_api_client::datadogV2::model::DatasetAttributes;
4+
use datadog_api_client::datadogV2::model::DatasetAttributesRequest;
65
use datadog_api_client::datadogV2::model::DatasetCreateRequest;
6+
use datadog_api_client::datadogV2::model::DatasetRequest;
77
use datadog_api_client::datadogV2::model::FiltersPerProduct;
88

99
#[tokio::main]
1010
async fn main() {
11-
let body = DatasetCreateRequest::new(
12-
Dataset::new(
13-
DatasetAttributes::new(
14-
"Security Audit Dataset".to_string(),
15-
vec!["role:86245fce-0a4e-11f0-92bd-da7ad0900002".to_string()],
16-
vec![FiltersPerProduct::new(
17-
vec!["@application.id:ABCD".to_string()],
18-
"logs".to_string(),
19-
)],
20-
)
21-
.created_at(None),
22-
"dataset".to_string(),
23-
)
24-
.id("123e4567-e89b-12d3-a456-426614174000".to_string()),
25-
);
26-
let configuration = datadog::Configuration::new();
11+
let body = DatasetCreateRequest::new(DatasetRequest::new(
12+
DatasetAttributesRequest::new(
13+
"Security Audit Dataset".to_string(),
14+
vec!["role:94172442-be03-11e9-a77a-3b7612558ac1".to_string()],
15+
vec![FiltersPerProduct::new(
16+
vec!["@application.id:ABCD".to_string()],
17+
"metrics".to_string(),
18+
)],
19+
),
20+
"dataset".to_string(),
21+
));
22+
let mut configuration = datadog::Configuration::new();
23+
configuration.set_unstable_operation_enabled("v2.CreateDataset", true);
2724
let api = DatasetsAPI::with_config(configuration);
2825
let resp = api.create_dataset(body).await;
2926
if let Ok(value) = resp {

examples/v2_datasets_DeleteDataset.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ use datadog_api_client::datadogV2::api_datasets::DatasetsAPI;
44

55
#[tokio::main]
66
async fn main() {
7-
let configuration = datadog::Configuration::new();
7+
// there is a valid "dataset" in the system
8+
let dataset_data_id = std::env::var("DATASET_DATA_ID").unwrap();
9+
let mut configuration = datadog::Configuration::new();
10+
configuration.set_unstable_operation_enabled("v2.DeleteDataset", true);
811
let api = DatasetsAPI::with_config(configuration);
9-
let resp = api.delete_dataset("dataset_id".to_string()).await;
12+
let resp = api.delete_dataset(dataset_data_id.clone()).await;
1013
if let Ok(value) = resp {
1114
println!("{:#?}", value);
1215
} else {

examples/v2_datasets_GetAllDatasets.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use datadog_api_client::datadogV2::api_datasets::DatasetsAPI;
44

55
#[tokio::main]
66
async fn main() {
7-
let configuration = datadog::Configuration::new();
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.GetAllDatasets", true);
89
let api = DatasetsAPI::with_config(configuration);
910
let resp = api.get_all_datasets().await;
1011
if let Ok(value) = resp {

examples/v2_datasets_GetDataset.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ use datadog_api_client::datadogV2::api_datasets::DatasetsAPI;
44

55
#[tokio::main]
66
async fn main() {
7-
let configuration = datadog::Configuration::new();
7+
// there is a valid "dataset" in the system
8+
let dataset_data_id = std::env::var("DATASET_DATA_ID").unwrap();
9+
let mut configuration = datadog::Configuration::new();
10+
configuration.set_unstable_operation_enabled("v2.GetDataset", true);
811
let api = DatasetsAPI::with_config(configuration);
9-
let resp = api.get_dataset("dataset_id".to_string()).await;
12+
let resp = api.get_dataset(dataset_data_id.clone()).await;
1013
if let Ok(value) = resp {
1114
println!("{:#?}", value);
1215
} else {

examples/v2_datasets_UpdateDataset.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
// Edit a dataset returns "OK" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_datasets::DatasetsAPI;
4-
use datadog_api_client::datadogV2::model::Dataset;
5-
use datadog_api_client::datadogV2::model::DatasetAttributes;
4+
use datadog_api_client::datadogV2::model::DatasetAttributesRequest;
5+
use datadog_api_client::datadogV2::model::DatasetRequest;
66
use datadog_api_client::datadogV2::model::DatasetUpdateRequest;
77
use datadog_api_client::datadogV2::model::FiltersPerProduct;
88

99
#[tokio::main]
1010
async fn main() {
11-
let body = DatasetUpdateRequest::new(
12-
Dataset::new(
13-
DatasetAttributes::new(
14-
"Security Audit Dataset".to_string(),
15-
vec!["role:86245fce-0a4e-11f0-92bd-da7ad0900002".to_string()],
16-
vec![FiltersPerProduct::new(
17-
vec!["@application.id:ABCD".to_string()],
18-
"logs".to_string(),
19-
)],
20-
)
21-
.created_at(None),
22-
"dataset".to_string(),
23-
)
24-
.id("123e4567-e89b-12d3-a456-426614174000".to_string()),
25-
);
26-
let configuration = datadog::Configuration::new();
11+
// there is a valid "dataset" in the system
12+
let dataset_data_id = std::env::var("DATASET_DATA_ID").unwrap();
13+
let body = DatasetUpdateRequest::new(DatasetRequest::new(
14+
DatasetAttributesRequest::new(
15+
"Security Audit Dataset".to_string(),
16+
vec!["role:94172442-be03-11e9-a77a-3b7612558ac1".to_string()],
17+
vec![FiltersPerProduct::new(
18+
vec!["@application.id:1234".to_string()],
19+
"metrics".to_string(),
20+
)],
21+
),
22+
"dataset".to_string(),
23+
));
24+
let mut configuration = datadog::Configuration::new();
25+
configuration.set_unstable_operation_enabled("v2.UpdateDataset", true);
2726
let api = DatasetsAPI::with_config(configuration);
28-
let resp = api.update_dataset("dataset_id".to_string(), body).await;
27+
let resp = api.update_dataset(dataset_data_id.clone(), body).await;
2928
if let Ok(value) = resp {
3029
println!("{:#?}", value);
3130
} else {

src/datadog/configuration.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ impl Default for Configuration {
141141
("v2.list_vulnerable_assets".to_owned(), false),
142142
("v2.mute_findings".to_owned(), false),
143143
("v2.run_historical_job".to_owned(), false),
144+
("v2.create_dataset".to_owned(), false),
145+
("v2.delete_dataset".to_owned(), false),
146+
("v2.get_all_datasets".to_owned(), false),
147+
("v2.get_dataset".to_owned(), false),
148+
("v2.update_dataset".to_owned(), false),
144149
("v2.cancel_data_deletion_request".to_owned(), false),
145150
("v2.create_data_deletion_request".to_owned(), false),
146151
("v2.get_data_deletion_requests".to_owned(), false),

0 commit comments

Comments
 (0)