v2_actions_datastores_CreateDatastore/
v2_actions-datastores_CreateDatastore.rs1use datadog_api_client::datadog;
3use datadog_api_client::datadogV2::api_actions_datastores::ActionsDatastoresAPI;
4use datadog_api_client::datadogV2::model::CreateAppsDatastoreRequest;
5use datadog_api_client::datadogV2::model::CreateAppsDatastoreRequestData;
6use datadog_api_client::datadogV2::model::CreateAppsDatastoreRequestDataAttributes;
7use datadog_api_client::datadogV2::model::DatastoreDataType;
8
9#[tokio::main]
10async fn main() {
11 let body = CreateAppsDatastoreRequest::new().data(
12 CreateAppsDatastoreRequestData::new(DatastoreDataType::DATASTORES).attributes(
13 CreateAppsDatastoreRequestDataAttributes::new(
14 "datastore-name".to_string(),
15 "primaryKey".to_string(),
16 ),
17 ),
18 );
19 let configuration = datadog::Configuration::new();
20 let api = ActionsDatastoresAPI::with_config(configuration);
21 let resp = api.create_datastore(body).await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}