Data Access Controls in Datadog is a feature that allows administrators and access managers to regulate
access to sensitive data. By defining Restricted Datasets, you can ensure that only specific teams or roles can
view certain types of telemetry (for example, logs, traces, metrics, and RUM data).
Each restricted dataset supports a maximum of 10 key:value pairs per product.
Tag key rules per telemetry type:
Only one tag key or attribute may be used to define access within a single telemetry type.
The same or different tag key may be used across different telemetry types.
Tag value uniqueness:
Tag values must be unique within a single dataset.
A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
attributes [required]
object
Dataset metadata and configurations.
name [required]
string
Name of the dataset.
principals [required]
[string]
List of access principals, formatted as principal_type:id. Principal can be 'team' or 'role'.
product_filters [required]
[object]
List of product-specific filters.
filters [required]
[string]
Defines the list of tag-based filters used to restrict access to telemetry data for a specific product.
These filters act as access control rules. Each filter must follow the tag query syntax used by
Datadog (such as @tag.key:value), and only one tag or attribute may be used to define the access strategy
per telemetry type.
product [required]
string
Name of the product the dataset is for. Possible values are 'apm', 'rum',
'metrics', 'logs', 'error_tracking', and 'cloud_cost'.
type [required]
enum
Resource type, always set to dataset.
Allowed enum values: dataset
Each restricted dataset supports a maximum of 10 key:value pairs per product.
Tag Key Rules per Telemetry Type:
Only one tag key or attribute may be used to define access within a single telemetry type.
The same or different tag key may be used across different telemetry types.
Tag Value Uniqueness:
Tag values must be unique within a single dataset.
A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
attributes
object
Dataset metadata and configuration(s).
created_at
date-time
Timestamp when the dataset was created.
created_by
uuid
Unique ID of the user who created the dataset.
name
string
Name of the dataset.
principals
[string]
List of access principals, formatted as principal_type:id. Principal can be 'team' or 'role'.
product_filters
[object]
List of product-specific filters.
filters [required]
[string]
Defines the list of tag-based filters used to restrict access to telemetry data for a specific product.
These filters act as access control rules. Each filter must follow the tag query syntax used by
Datadog (such as @tag.key:value), and only one tag or attribute may be used to define the access strategy
per telemetry type.
product [required]
string
Name of the product the dataset is for. Possible values are 'apm', 'rum',
'metrics', 'logs', 'error_tracking', and 'cloud_cost'.
id
string
Unique identifier for the dataset.
type
enum
Resource type, always set to dataset.
Allowed enum values: dataset
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create a dataset returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createDataset"]=true;constapiInstance=newv2.DatasetsApi(configuration);constparams: v2.DatasetsApiCreateDatasetRequest={body:{data:{attributes:{name:"Security Audit Dataset",principals:["role:94172442-be03-11e9-a77a-3b7612558ac1"],productFilters:[{filters:["@application.id:ABCD"],product:"metrics",},],},type:"dataset",},},};apiInstance.createDataset(params).then((data: v2.DatasetResponseSingle)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Each restricted dataset supports a maximum of 10 key:value pairs per product.
Tag Key Rules per Telemetry Type:
Only one tag key or attribute may be used to define access within a single telemetry type.
The same or different tag key may be used across different telemetry types.
Tag Value Uniqueness:
Tag values must be unique within a single dataset.
A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
attributes
object
Dataset metadata and configuration(s).
created_at
date-time
Timestamp when the dataset was created.
created_by
uuid
Unique ID of the user who created the dataset.
name
string
Name of the dataset.
principals
[string]
List of access principals, formatted as principal_type:id. Principal can be 'team' or 'role'.
product_filters
[object]
List of product-specific filters.
filters [required]
[string]
Defines the list of tag-based filters used to restrict access to telemetry data for a specific product.
These filters act as access control rules. Each filter must follow the tag query syntax used by
Datadog (such as @tag.key:value), and only one tag or attribute may be used to define the access strategy
per telemetry type.
product [required]
string
Name of the product the dataset is for. Possible values are 'apm', 'rum',
'metrics', 'logs', 'error_tracking', and 'cloud_cost'.
id
string
Unique identifier for the dataset.
type
enum
Resource type, always set to dataset.
Allowed enum values: dataset
"""
Get a single dataset by ID returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.datasets_apiimportDatasetsApi# there is a valid "dataset" in the systemDATASET_DATA_ID=environ["DATASET_DATA_ID"]configuration=Configuration()configuration.unstable_operations["get_dataset"]=TruewithApiClient(configuration)asapi_client:api_instance=DatasetsApi(api_client)response=api_instance.get_dataset(dataset_id=DATASET_DATA_ID,)print(response)
# Get a single dataset by ID returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_dataset".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DatasetsAPI.new# there is a valid "dataset" in the systemDATASET_DATA_ID=ENV["DATASET_DATA_ID"]papi_instance.get_dataset(DATASET_DATA_ID)
// Get a single dataset by ID returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "dataset" in the system
DatasetDataID:=os.Getenv("DATASET_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetDataset",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDatasetsApi(apiClient)resp,r,err:=api.GetDataset(ctx,DatasetDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DatasetsApi.GetDataset`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DatasetsApi.GetDataset`:\n%s\n",responseContent)}
// Get a single dataset by ID returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DatasetsApi;importcom.datadog.api.client.v2.model.DatasetResponseSingle;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getDataset",true);DatasetsApiapiInstance=newDatasetsApi(defaultClient);// there is a valid "dataset" in the systemStringDATASET_DATA_ID=System.getenv("DATASET_DATA_ID");try{DatasetResponseSingleresult=apiInstance.getDataset(DATASET_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DatasetsApi#getDataset");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a single dataset by ID returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_datasets::DatasetsAPI;#[tokio::main]asyncfnmain(){// there is a valid "dataset" in the system
letdataset_data_id=std::env::var("DATASET_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetDataset",true);letapi=DatasetsAPI::with_config(configuration);letresp=api.get_dataset(dataset_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get a single dataset by ID returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getDataset"]=true;constapiInstance=newv2.DatasetsApi(configuration);// there is a valid "dataset" in the system
constDATASET_DATA_ID=process.env.DATASET_DATA_IDasstring;constparams: v2.DatasetsApiGetDatasetRequest={datasetId: DATASET_DATA_ID,};apiInstance.getDataset(params).then((data: v2.DatasetResponseSingle)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
List of access principals, formatted as principal_type:id. Principal can be 'team' or 'role'.
product_filters
[object]
List of product-specific filters.
filters [required]
[string]
Defines the list of tag-based filters used to restrict access to telemetry data for a specific product.
These filters act as access control rules. Each filter must follow the tag query syntax used by
Datadog (such as @tag.key:value), and only one tag or attribute may be used to define the access strategy
per telemetry type.
product [required]
string
Name of the product the dataset is for. Possible values are 'apm', 'rum',
'metrics', 'logs', 'error_tracking', and 'cloud_cost'.
id
string
Unique identifier for the dataset.
type
enum
Resource type, always set to dataset.
Allowed enum values: dataset
"""
Get all datasets returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.datasets_apiimportDatasetsApiconfiguration=Configuration()configuration.unstable_operations["get_all_datasets"]=TruewithApiClient(configuration)asapi_client:api_instance=DatasetsApi(api_client)response=api_instance.get_all_datasets()print(response)
# Get all datasets returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.get_all_datasets".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DatasetsAPI.newpapi_instance.get_all_datasets()
// Get all datasets returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.GetAllDatasets",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDatasetsApi(apiClient)resp,r,err:=api.GetAllDatasets(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DatasetsApi.GetAllDatasets`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DatasetsApi.GetAllDatasets`:\n%s\n",responseContent)}
// Get all datasets returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DatasetsApi;importcom.datadog.api.client.v2.model.DatasetResponseMulti;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.getAllDatasets",true);DatasetsApiapiInstance=newDatasetsApi(defaultClient);try{DatasetResponseMultiresult=apiInstance.getAllDatasets();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DatasetsApi#getAllDatasets");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get all datasets returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_datasets::DatasetsAPI;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.GetAllDatasets",true);letapi=DatasetsAPI::with_config(configuration);letresp=api.get_all_datasets().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get all datasets returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.getAllDatasets"]=true;constapiInstance=newv2.DatasetsApi(configuration);apiInstance.getAllDatasets().then((data: v2.DatasetResponseMulti)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Each restricted dataset supports a maximum of 10 key:value pairs per product.
Tag key rules per telemetry type:
Only one tag key or attribute may be used to define access within a single telemetry type.
The same or different tag key may be used across different telemetry types.
Tag value uniqueness:
Tag values must be unique within a single dataset.
A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
attributes [required]
object
Dataset metadata and configurations.
name [required]
string
Name of the dataset.
principals [required]
[string]
List of access principals, formatted as principal_type:id. Principal can be 'team' or 'role'.
product_filters [required]
[object]
List of product-specific filters.
filters [required]
[string]
Defines the list of tag-based filters used to restrict access to telemetry data for a specific product.
These filters act as access control rules. Each filter must follow the tag query syntax used by
Datadog (such as @tag.key:value), and only one tag or attribute may be used to define the access strategy
per telemetry type.
product [required]
string
Name of the product the dataset is for. Possible values are 'apm', 'rum',
'metrics', 'logs', 'error_tracking', and 'cloud_cost'.
type [required]
enum
Resource type, always set to dataset.
Allowed enum values: dataset
Each restricted dataset supports a maximum of 10 key:value pairs per product.
Tag Key Rules per Telemetry Type:
Only one tag key or attribute may be used to define access within a single telemetry type.
The same or different tag key may be used across different telemetry types.
Tag Value Uniqueness:
Tag values must be unique within a single dataset.
A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
attributes
object
Dataset metadata and configuration(s).
created_at
date-time
Timestamp when the dataset was created.
created_by
uuid
Unique ID of the user who created the dataset.
name
string
Name of the dataset.
principals
[string]
List of access principals, formatted as principal_type:id. Principal can be 'team' or 'role'.
product_filters
[object]
List of product-specific filters.
filters [required]
[string]
Defines the list of tag-based filters used to restrict access to telemetry data for a specific product.
These filters act as access control rules. Each filter must follow the tag query syntax used by
Datadog (such as @tag.key:value), and only one tag or attribute may be used to define the access strategy
per telemetry type.
product [required]
string
Name of the product the dataset is for. Possible values are 'apm', 'rum',
'metrics', 'logs', 'error_tracking', and 'cloud_cost'.
id
string
Unique identifier for the dataset.
type
enum
Resource type, always set to dataset.
Allowed enum values: dataset
// Edit a dataset returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "dataset" in the system
DatasetDataID:=os.Getenv("DATASET_DATA_ID")body:=datadogV2.DatasetUpdateRequest{Data:datadogV2.DatasetRequest{Attributes:datadogV2.DatasetAttributesRequest{Name:"Security Audit Dataset",Principals:[]string{"role:94172442-be03-11e9-a77a-3b7612558ac1",},ProductFilters:[]datadogV2.FiltersPerProduct{{Filters:[]string{"@application.id:1234",},Product:"metrics",},},},Type:"dataset",},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateDataset",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDatasetsApi(apiClient)resp,r,err:=api.UpdateDataset(ctx,DatasetDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DatasetsApi.UpdateDataset`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DatasetsApi.UpdateDataset`:\n%s\n",responseContent)}
// Edit a dataset returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DatasetsApi;importcom.datadog.api.client.v2.model.DatasetAttributesRequest;importcom.datadog.api.client.v2.model.DatasetRequest;importcom.datadog.api.client.v2.model.DatasetResponseSingle;importcom.datadog.api.client.v2.model.DatasetUpdateRequest;importcom.datadog.api.client.v2.model.FiltersPerProduct;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.updateDataset",true);DatasetsApiapiInstance=newDatasetsApi(defaultClient);// there is a valid "dataset" in the systemStringDATASET_DATA_ID=System.getenv("DATASET_DATA_ID");DatasetUpdateRequestbody=newDatasetUpdateRequest().data(newDatasetRequest().attributes(newDatasetAttributesRequest().name("Security Audit Dataset").principals(Collections.singletonList("role:94172442-be03-11e9-a77a-3b7612558ac1")).productFilters(Collections.singletonList(newFiltersPerProduct().filters(Collections.singletonList("@application.id:1234")).product("metrics")))).type("dataset"));try{DatasetResponseSingleresult=apiInstance.updateDataset(DATASET_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){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();}}}
"""
Edit a dataset returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.datasets_apiimportDatasetsApifromdatadog_api_client.v2.model.dataset_attributes_requestimportDatasetAttributesRequestfromdatadog_api_client.v2.model.dataset_requestimportDatasetRequestfromdatadog_api_client.v2.model.dataset_update_requestimportDatasetUpdateRequestfromdatadog_api_client.v2.model.filters_per_productimportFiltersPerProduct# there is a valid "dataset" in the systemDATASET_DATA_ID=environ["DATASET_DATA_ID"]body=DatasetUpdateRequest(data=DatasetRequest(attributes=DatasetAttributesRequest(name="Security Audit Dataset",principals=["role:94172442-be03-11e9-a77a-3b7612558ac1",],product_filters=[FiltersPerProduct(filters=["@application.id:1234",],product="metrics",),],),type="dataset",),)configuration=Configuration()configuration.unstable_operations["update_dataset"]=TruewithApiClient(configuration)asapi_client:api_instance=DatasetsApi(api_client)response=api_instance.update_dataset(dataset_id=DATASET_DATA_ID,body=body)print(response)
# Edit a dataset returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_dataset".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DatasetsAPI.new# there is a valid "dataset" in the systemDATASET_DATA_ID=ENV["DATASET_DATA_ID"]body=DatadogAPIClient::V2::DatasetUpdateRequest.new({data:DatadogAPIClient::V2::DatasetRequest.new({attributes:DatadogAPIClient::V2::DatasetAttributesRequest.new({name:"Security Audit Dataset",principals:["role:94172442-be03-11e9-a77a-3b7612558ac1",],product_filters:[DatadogAPIClient::V2::FiltersPerProduct.new({filters:["@application.id:1234",],product:"metrics",}),],}),type:"dataset",}),})papi_instance.update_dataset(DATASET_DATA_ID,body)
// Edit a dataset returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_datasets::DatasetsAPI;usedatadog_api_client::datadogV2::model::DatasetAttributesRequest;usedatadog_api_client::datadogV2::model::DatasetRequest;usedatadog_api_client::datadogV2::model::DatasetUpdateRequest;usedatadog_api_client::datadogV2::model::FiltersPerProduct;#[tokio::main]asyncfnmain(){// there is a valid "dataset" in the system
letdataset_data_id=std::env::var("DATASET_DATA_ID").unwrap();letbody=DatasetUpdateRequest::new(DatasetRequest::new(DatasetAttributesRequest::new("Security Audit Dataset".to_string(),vec!["role:94172442-be03-11e9-a77a-3b7612558ac1".to_string()],vec![FiltersPerProduct::new(vec!["@application.id:1234".to_string()],"metrics".to_string(),)],),"dataset".to_string(),));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateDataset",true);letapi=DatasetsAPI::with_config(configuration);letresp=api.update_dataset(dataset_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Edit a dataset returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateDataset"]=true;constapiInstance=newv2.DatasetsApi(configuration);// there is a valid "dataset" in the system
constDATASET_DATA_ID=process.env.DATASET_DATA_IDasstring;constparams: v2.DatasetsApiUpdateDatasetRequest={body:{data:{attributes:{name:"Security Audit Dataset",principals:["role:94172442-be03-11e9-a77a-3b7612558ac1"],productFilters:[{filters:["@application.id:1234"],product:"metrics",},],},type:"dataset",},},datasetId: DATASET_DATA_ID,};apiInstance.updateDataset(params).then((data: v2.DatasetResponseSingle)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete a dataset returns "No Content" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.datasets_apiimportDatasetsApi# there is a valid "dataset" in the systemDATASET_DATA_ID=environ["DATASET_DATA_ID"]configuration=Configuration()configuration.unstable_operations["delete_dataset"]=TruewithApiClient(configuration)asapi_client:api_instance=DatasetsApi(api_client)api_instance.delete_dataset(dataset_id=DATASET_DATA_ID,)
# Delete a dataset returns "No Content" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.delete_dataset".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DatasetsAPI.new# there is a valid "dataset" in the systemDATASET_DATA_ID=ENV["DATASET_DATA_ID"]api_instance.delete_dataset(DATASET_DATA_ID)
// Delete a dataset returns "No Content" response
packagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "dataset" in the system
DatasetDataID:=os.Getenv("DATASET_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.DeleteDataset",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDatasetsApi(apiClient)r,err:=api.DeleteDataset(ctx,DatasetDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DatasetsApi.DeleteDataset`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete a dataset returns "No Content" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.DatasetsApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.deleteDataset",true);DatasetsApiapiInstance=newDatasetsApi(defaultClient);// there is a valid "dataset" in the systemStringDATASET_DATA_ID=System.getenv("DATASET_DATA_ID");try{apiInstance.deleteDataset(DATASET_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling DatasetsApi#deleteDataset");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete a dataset returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_datasets::DatasetsAPI;#[tokio::main]asyncfnmain(){// there is a valid "dataset" in the system
letdataset_data_id=std::env::var("DATASET_DATA_ID").unwrap();letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.DeleteDataset",true);letapi=DatasetsAPI::with_config(configuration);letresp=api.delete_dataset(dataset_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete a dataset returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.deleteDataset"]=true;constapiInstance=newv2.DatasetsApi(configuration);// there is a valid "dataset" in the system
constDATASET_DATA_ID=process.env.DATASET_DATA_IDasstring;constparams: v2.DatasetsApiDeleteDatasetRequest={datasetId: DATASET_DATA_ID,};apiInstance.deleteDataset(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));