pub struct DatasetsAPI { /* private fields */ }
Expand description
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).
Implementations§
Source§impl DatasetsAPI
impl DatasetsAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
6async fn main() {
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);
11 let api = DatasetsAPI::with_config(configuration);
12 let resp = api.get_dataset(dataset_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
6async fn main() {
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);
11 let api = DatasetsAPI::with_config(configuration);
12 let resp = api.delete_dataset(dataset_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
10async fn main() {
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);
24 let api = DatasetsAPI::with_config(configuration);
25 let resp = api.create_dataset(body).await;
26 if let Ok(value) = resp {
27 println!("{:#?}", value);
28 } else {
29 println!("{:#?}", resp.unwrap_err());
30 }
31}
10async fn main() {
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);
26 let api = DatasetsAPI::with_config(configuration);
27 let resp = api.update_dataset(dataset_data_id.clone(), body).await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_dataset(
&self,
body: DatasetCreateRequest,
) -> Result<DatasetResponseSingle, Error<CreateDatasetError>>
pub async fn create_dataset( &self, body: DatasetCreateRequest, ) -> Result<DatasetResponseSingle, Error<CreateDatasetError>>
Create a dataset with the configurations in the request.
Examples found in repository?
10async fn main() {
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);
24 let api = DatasetsAPI::with_config(configuration);
25 let resp = api.create_dataset(body).await;
26 if let Ok(value) = resp {
27 println!("{:#?}", value);
28 } else {
29 println!("{:#?}", resp.unwrap_err());
30 }
31}
Sourcepub async fn create_dataset_with_http_info(
&self,
body: DatasetCreateRequest,
) -> Result<ResponseContent<DatasetResponseSingle>, Error<CreateDatasetError>>
pub async fn create_dataset_with_http_info( &self, body: DatasetCreateRequest, ) -> Result<ResponseContent<DatasetResponseSingle>, Error<CreateDatasetError>>
Create a dataset with the configurations in the request.
Sourcepub async fn delete_dataset(
&self,
dataset_id: String,
) -> Result<(), Error<DeleteDatasetError>>
pub async fn delete_dataset( &self, dataset_id: String, ) -> Result<(), Error<DeleteDatasetError>>
Deletes the dataset associated with the ID.
Examples found in repository?
6async fn main() {
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);
11 let api = DatasetsAPI::with_config(configuration);
12 let resp = api.delete_dataset(dataset_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
Sourcepub async fn delete_dataset_with_http_info(
&self,
dataset_id: String,
) -> Result<ResponseContent<()>, Error<DeleteDatasetError>>
pub async fn delete_dataset_with_http_info( &self, dataset_id: String, ) -> Result<ResponseContent<()>, Error<DeleteDatasetError>>
Deletes the dataset associated with the ID.
Sourcepub async fn get_all_datasets(
&self,
) -> Result<DatasetResponseMulti, Error<GetAllDatasetsError>>
pub async fn get_all_datasets( &self, ) -> Result<DatasetResponseMulti, Error<GetAllDatasetsError>>
Get all datasets that have been configured for an organization.
Sourcepub async fn get_all_datasets_with_http_info(
&self,
) -> Result<ResponseContent<DatasetResponseMulti>, Error<GetAllDatasetsError>>
pub async fn get_all_datasets_with_http_info( &self, ) -> Result<ResponseContent<DatasetResponseMulti>, Error<GetAllDatasetsError>>
Get all datasets that have been configured for an organization.
Sourcepub async fn get_dataset(
&self,
dataset_id: String,
) -> Result<DatasetResponseSingle, Error<GetDatasetError>>
pub async fn get_dataset( &self, dataset_id: String, ) -> Result<DatasetResponseSingle, Error<GetDatasetError>>
Retrieves the dataset associated with the ID.
Examples found in repository?
6async fn main() {
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);
11 let api = DatasetsAPI::with_config(configuration);
12 let resp = api.get_dataset(dataset_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
Sourcepub async fn get_dataset_with_http_info(
&self,
dataset_id: String,
) -> Result<ResponseContent<DatasetResponseSingle>, Error<GetDatasetError>>
pub async fn get_dataset_with_http_info( &self, dataset_id: String, ) -> Result<ResponseContent<DatasetResponseSingle>, Error<GetDatasetError>>
Retrieves the dataset associated with the ID.
Sourcepub async fn update_dataset(
&self,
dataset_id: String,
body: DatasetUpdateRequest,
) -> Result<DatasetResponseSingle, Error<UpdateDatasetError>>
pub async fn update_dataset( &self, dataset_id: String, body: DatasetUpdateRequest, ) -> Result<DatasetResponseSingle, Error<UpdateDatasetError>>
Edits the dataset associated with the ID.
Examples found in repository?
10async fn main() {
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);
26 let api = DatasetsAPI::with_config(configuration);
27 let resp = api.update_dataset(dataset_data_id.clone(), body).await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}
Sourcepub async fn update_dataset_with_http_info(
&self,
dataset_id: String,
body: DatasetUpdateRequest,
) -> Result<ResponseContent<DatasetResponseSingle>, Error<UpdateDatasetError>>
pub async fn update_dataset_with_http_info( &self, dataset_id: String, body: DatasetUpdateRequest, ) -> Result<ResponseContent<DatasetResponseSingle>, Error<UpdateDatasetError>>
Edits the dataset associated with the ID.
Trait Implementations§
Source§impl Clone for DatasetsAPI
impl Clone for DatasetsAPI
Source§fn clone(&self) -> DatasetsAPI
fn clone(&self) -> DatasetsAPI
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more