pub struct ActionsDatastoresAPI { /* private fields */ }
Expand description
Leverage the Actions Datastore API to create, modify, and delete items in datastores owned by your organization.
Implementations§
Source§impl ActionsDatastoresAPI
impl ActionsDatastoresAPI
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 "datastore" in the system
8 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = ActionsDatastoresAPI::with_config(configuration);
11 let resp = api.get_datastore(datastore_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
6async fn main() {
7 // there is a valid "datastore" in the system
8 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = ActionsDatastoresAPI::with_config(configuration);
11 let resp = api.delete_datastore(datastore_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
7async fn main() {
8 // there is a valid "datastore" in the system
9 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
10 let configuration = datadog::Configuration::new();
11 let api = ActionsDatastoresAPI::with_config(configuration);
12 let resp = api
13 .list_datastore_items(
14 datastore_data_id.clone(),
15 ListDatastoreItemsOptionalParams::default(),
16 )
17 .await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
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}
10async fn main() {
11 // there is a valid "datastore" in the system
12 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
13 let body = DeleteAppsDatastoreItemRequest::new().data(
14 DeleteAppsDatastoreItemRequestData::new(DatastoreItemsDataType::ITEMS).attributes(
15 DeleteAppsDatastoreItemRequestDataAttributes::new("test-key".to_string()),
16 ),
17 );
18 let configuration = datadog::Configuration::new();
19 let api = ActionsDatastoresAPI::with_config(configuration);
20 let resp = api
21 .delete_datastore_item(datastore_data_id.clone(), body)
22 .await;
23 if let Ok(value) = resp {
24 println!("{:#?}", value);
25 } else {
26 println!("{:#?}", resp.unwrap_err());
27 }
28}
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn bulk_write_datastore_items(
&self,
datastore_id: String,
body: BulkPutAppsDatastoreItemsRequest,
) -> Result<PutAppsDatastoreItemResponseArray, Error<BulkWriteDatastoreItemsError>>
pub async fn bulk_write_datastore_items( &self, datastore_id: String, body: BulkPutAppsDatastoreItemsRequest, ) -> Result<PutAppsDatastoreItemResponseArray, Error<BulkWriteDatastoreItemsError>>
Creates or replaces multiple items in a datastore by their keys in a single operation.
Examples found in repository?
12async fn main() {
13 // there is a valid "datastore" in the system
14 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
15 let body = BulkPutAppsDatastoreItemsRequest::new().data(
16 BulkPutAppsDatastoreItemsRequestData::new(DatastoreItemsDataType::ITEMS).attributes(
17 BulkPutAppsDatastoreItemsRequestDataAttributes::new(vec![
18 BTreeMap::from([
19 ("id".to_string(), Value::from("cust_3141")),
20 ("name".to_string(), Value::from("Johnathan")),
21 ]),
22 BTreeMap::from([
23 ("id".to_string(), Value::from("cust_3142")),
24 ("name".to_string(), Value::from("Mary")),
25 ]),
26 ]),
27 ),
28 );
29 let configuration = datadog::Configuration::new();
30 let api = ActionsDatastoresAPI::with_config(configuration);
31 let resp = api
32 .bulk_write_datastore_items(datastore_data_id.clone(), body)
33 .await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
Sourcepub async fn bulk_write_datastore_items_with_http_info(
&self,
datastore_id: String,
body: BulkPutAppsDatastoreItemsRequest,
) -> Result<ResponseContent<PutAppsDatastoreItemResponseArray>, Error<BulkWriteDatastoreItemsError>>
pub async fn bulk_write_datastore_items_with_http_info( &self, datastore_id: String, body: BulkPutAppsDatastoreItemsRequest, ) -> Result<ResponseContent<PutAppsDatastoreItemResponseArray>, Error<BulkWriteDatastoreItemsError>>
Creates or replaces multiple items in a datastore by their keys in a single operation.
Sourcepub async fn create_datastore(
&self,
body: CreateAppsDatastoreRequest,
) -> Result<CreateAppsDatastoreResponse, Error<CreateDatastoreError>>
pub async fn create_datastore( &self, body: CreateAppsDatastoreRequest, ) -> Result<CreateAppsDatastoreResponse, Error<CreateDatastoreError>>
Creates a new datastore.
Examples found in repository?
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}
Sourcepub async fn create_datastore_with_http_info(
&self,
body: CreateAppsDatastoreRequest,
) -> Result<ResponseContent<CreateAppsDatastoreResponse>, Error<CreateDatastoreError>>
pub async fn create_datastore_with_http_info( &self, body: CreateAppsDatastoreRequest, ) -> Result<ResponseContent<CreateAppsDatastoreResponse>, Error<CreateDatastoreError>>
Creates a new datastore.
Sourcepub async fn delete_datastore(
&self,
datastore_id: String,
) -> Result<(), Error<DeleteDatastoreError>>
pub async fn delete_datastore( &self, datastore_id: String, ) -> Result<(), Error<DeleteDatastoreError>>
Deletes a datastore by its unique identifier.
Examples found in repository?
6async fn main() {
7 // there is a valid "datastore" in the system
8 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = ActionsDatastoresAPI::with_config(configuration);
11 let resp = api.delete_datastore(datastore_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn delete_datastore_with_http_info(
&self,
datastore_id: String,
) -> Result<ResponseContent<()>, Error<DeleteDatastoreError>>
pub async fn delete_datastore_with_http_info( &self, datastore_id: String, ) -> Result<ResponseContent<()>, Error<DeleteDatastoreError>>
Deletes a datastore by its unique identifier.
Sourcepub async fn delete_datastore_item(
&self,
datastore_id: String,
body: DeleteAppsDatastoreItemRequest,
) -> Result<DeleteAppsDatastoreItemResponse, Error<DeleteDatastoreItemError>>
pub async fn delete_datastore_item( &self, datastore_id: String, body: DeleteAppsDatastoreItemRequest, ) -> Result<DeleteAppsDatastoreItemResponse, Error<DeleteDatastoreItemError>>
Deletes an item from a datastore by its key.
Examples found in repository?
10async fn main() {
11 // there is a valid "datastore" in the system
12 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
13 let body = DeleteAppsDatastoreItemRequest::new().data(
14 DeleteAppsDatastoreItemRequestData::new(DatastoreItemsDataType::ITEMS).attributes(
15 DeleteAppsDatastoreItemRequestDataAttributes::new("test-key".to_string()),
16 ),
17 );
18 let configuration = datadog::Configuration::new();
19 let api = ActionsDatastoresAPI::with_config(configuration);
20 let resp = api
21 .delete_datastore_item(datastore_data_id.clone(), body)
22 .await;
23 if let Ok(value) = resp {
24 println!("{:#?}", value);
25 } else {
26 println!("{:#?}", resp.unwrap_err());
27 }
28}
Sourcepub async fn delete_datastore_item_with_http_info(
&self,
datastore_id: String,
body: DeleteAppsDatastoreItemRequest,
) -> Result<ResponseContent<DeleteAppsDatastoreItemResponse>, Error<DeleteDatastoreItemError>>
pub async fn delete_datastore_item_with_http_info( &self, datastore_id: String, body: DeleteAppsDatastoreItemRequest, ) -> Result<ResponseContent<DeleteAppsDatastoreItemResponse>, Error<DeleteDatastoreItemError>>
Deletes an item from a datastore by its key.
Sourcepub async fn get_datastore(
&self,
datastore_id: String,
) -> Result<Datastore, Error<GetDatastoreError>>
pub async fn get_datastore( &self, datastore_id: String, ) -> Result<Datastore, Error<GetDatastoreError>>
Retrieves a specific datastore by its ID.
Examples found in repository?
6async fn main() {
7 // there is a valid "datastore" in the system
8 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = ActionsDatastoresAPI::with_config(configuration);
11 let resp = api.get_datastore(datastore_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn get_datastore_with_http_info(
&self,
datastore_id: String,
) -> Result<ResponseContent<Datastore>, Error<GetDatastoreError>>
pub async fn get_datastore_with_http_info( &self, datastore_id: String, ) -> Result<ResponseContent<Datastore>, Error<GetDatastoreError>>
Retrieves a specific datastore by its ID.
Sourcepub async fn list_datastore_items(
&self,
datastore_id: String,
params: ListDatastoreItemsOptionalParams,
) -> Result<ItemApiPayloadArray, Error<ListDatastoreItemsError>>
pub async fn list_datastore_items( &self, datastore_id: String, params: ListDatastoreItemsOptionalParams, ) -> Result<ItemApiPayloadArray, Error<ListDatastoreItemsError>>
Lists items from a datastore. You can filter the results by specifying either an item key or a filter query parameter, but not both at the same time. Supports server-side pagination for large datasets.
Examples found in repository?
7async fn main() {
8 // there is a valid "datastore" in the system
9 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
10 let configuration = datadog::Configuration::new();
11 let api = ActionsDatastoresAPI::with_config(configuration);
12 let resp = api
13 .list_datastore_items(
14 datastore_data_id.clone(),
15 ListDatastoreItemsOptionalParams::default(),
16 )
17 .await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
Sourcepub async fn list_datastore_items_with_http_info(
&self,
datastore_id: String,
params: ListDatastoreItemsOptionalParams,
) -> Result<ResponseContent<ItemApiPayloadArray>, Error<ListDatastoreItemsError>>
pub async fn list_datastore_items_with_http_info( &self, datastore_id: String, params: ListDatastoreItemsOptionalParams, ) -> Result<ResponseContent<ItemApiPayloadArray>, Error<ListDatastoreItemsError>>
Lists items from a datastore. You can filter the results by specifying either an item key or a filter query parameter, but not both at the same time. Supports server-side pagination for large datasets.
Sourcepub async fn list_datastores(
&self,
) -> Result<DatastoreArray, Error<ListDatastoresError>>
pub async fn list_datastores( &self, ) -> Result<DatastoreArray, Error<ListDatastoresError>>
Lists all datastores for the organization.
Sourcepub async fn list_datastores_with_http_info(
&self,
) -> Result<ResponseContent<DatastoreArray>, Error<ListDatastoresError>>
pub async fn list_datastores_with_http_info( &self, ) -> Result<ResponseContent<DatastoreArray>, Error<ListDatastoresError>>
Lists all datastores for the organization.
Sourcepub async fn update_datastore(
&self,
datastore_id: String,
body: UpdateAppsDatastoreRequest,
) -> Result<Datastore, Error<UpdateDatastoreError>>
pub async fn update_datastore( &self, datastore_id: String, body: UpdateAppsDatastoreRequest, ) -> Result<Datastore, Error<UpdateDatastoreError>>
Updates an existing datastore’s attributes.
Examples found in repository?
10async fn main() {
11 // there is a valid "datastore" in the system
12 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
13 let body = UpdateAppsDatastoreRequest::new().data(
14 UpdateAppsDatastoreRequestData::new(DatastoreDataType::DATASTORES)
15 .attributes(
16 UpdateAppsDatastoreRequestDataAttributes::new().name("updated name".to_string()),
17 )
18 .id(datastore_data_id.clone()),
19 );
20 let configuration = datadog::Configuration::new();
21 let api = ActionsDatastoresAPI::with_config(configuration);
22 let resp = api.update_datastore(datastore_data_id.clone(), body).await;
23 if let Ok(value) = resp {
24 println!("{:#?}", value);
25 } else {
26 println!("{:#?}", resp.unwrap_err());
27 }
28}
Sourcepub async fn update_datastore_with_http_info(
&self,
datastore_id: String,
body: UpdateAppsDatastoreRequest,
) -> Result<ResponseContent<Datastore>, Error<UpdateDatastoreError>>
pub async fn update_datastore_with_http_info( &self, datastore_id: String, body: UpdateAppsDatastoreRequest, ) -> Result<ResponseContent<Datastore>, Error<UpdateDatastoreError>>
Updates an existing datastore’s attributes.
Sourcepub async fn update_datastore_item(
&self,
datastore_id: String,
body: UpdateAppsDatastoreItemRequest,
) -> Result<ItemApiPayload, Error<UpdateDatastoreItemError>>
pub async fn update_datastore_item( &self, datastore_id: String, body: UpdateAppsDatastoreItemRequest, ) -> Result<ItemApiPayload, Error<UpdateDatastoreItemError>>
Partially updates an item in a datastore by its key.
Examples found in repository?
11async fn main() {
12 // there is a valid "datastore" in the system
13 let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
14 let body = UpdateAppsDatastoreItemRequest::new().data(
15 UpdateAppsDatastoreItemRequestData::new(UpdateAppsDatastoreItemRequestDataType::ITEMS)
16 .attributes(UpdateAppsDatastoreItemRequestDataAttributes::new(
17 UpdateAppsDatastoreItemRequestDataAttributesItemChanges::new(),
18 "test-key".to_string(),
19 )),
20 );
21 let configuration = datadog::Configuration::new();
22 let api = ActionsDatastoresAPI::with_config(configuration);
23 let resp = api
24 .update_datastore_item(datastore_data_id.clone(), body)
25 .await;
26 if let Ok(value) = resp {
27 println!("{:#?}", value);
28 } else {
29 println!("{:#?}", resp.unwrap_err());
30 }
31}
Sourcepub async fn update_datastore_item_with_http_info(
&self,
datastore_id: String,
body: UpdateAppsDatastoreItemRequest,
) -> Result<ResponseContent<ItemApiPayload>, Error<UpdateDatastoreItemError>>
pub async fn update_datastore_item_with_http_info( &self, datastore_id: String, body: UpdateAppsDatastoreItemRequest, ) -> Result<ResponseContent<ItemApiPayload>, Error<UpdateDatastoreItemError>>
Partially updates an item in a datastore by its key.
Trait Implementations§
Source§impl Clone for ActionsDatastoresAPI
impl Clone for ActionsDatastoresAPI
Source§fn clone(&self) -> ActionsDatastoresAPI
fn clone(&self) -> ActionsDatastoresAPI
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more