Struct datadog_api_client::datadogV2::api::api_cloud_cost_management::CloudCostManagementAPI
source · pub struct CloudCostManagementAPI { /* private fields */ }Expand description
The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS and Azure. You can query your cost data by using the Metrics endpoint and the cloud_cost data source. For more information, see the Cloud Cost Management documentation.
Implementations§
source§impl CloudCostManagementAPI
impl CloudCostManagementAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
- examples/v2_cloud-cost-management_GetCustomCostsFile.rs
- examples/v2_cloud-cost-management_DeleteCostAzureUCConfig.rs
- examples/v2_cloud-cost-management_DeleteCustomCostsFile.rs
- examples/v2_cloud-cost-management_ListAWSRelatedAccounts.rs
- examples/v2_cloud-cost-management_GetCustomCostsFile_1307381576.rs
- examples/v2_cloud-cost-management_DeleteCustomCostsFile_372970393.rs
- examples/v2_cloud-cost-management_UpdateCostAWSCURConfig.rs
- examples/v2_cloud-cost-management_UpdateCostAzureUCConfigs.rs
- examples/v2_cloud-cost-management_UploadCustomCostsFile.rs
- examples/v2_cloud-cost-management_CreateCostAWSCURConfig.rs
- examples/v2_cloud-cost-management_UploadCustomCostsFile_4125168396.rs
- examples/v2_cloud-cost-management_CreateCostAzureUCConfigs.rs
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
sourcepub async fn create_cost_awscur_config(
&self,
body: AwsCURConfigPostRequest,
) -> Result<AwsCURConfigResponse, Error<CreateCostAWSCURConfigError>>
pub async fn create_cost_awscur_config( &self, body: AwsCURConfigPostRequest, ) -> Result<AwsCURConfigResponse, Error<CreateCostAWSCURConfigError>>
Create a Cloud Cost Management account for an AWS CUR config.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
async fn main() {
let body = AwsCURConfigPostRequest::new(AwsCURConfigPostData::new(
AwsCURConfigPostRequestAttributes::new(
"123456789123".to_string(),
"dd-cost-bucket".to_string(),
"dd-report-name".to_string(),
"dd-report-prefix".to_string(),
)
.bucket_region("us-east-1".to_string()),
AwsCURConfigPostRequestType::AWS_CUR_CONFIG_POST_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.create_cost_awscur_config(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn create_cost_awscur_config_with_http_info(
&self,
body: AwsCURConfigPostRequest,
) -> Result<ResponseContent<AwsCURConfigResponse>, Error<CreateCostAWSCURConfigError>>
pub async fn create_cost_awscur_config_with_http_info( &self, body: AwsCURConfigPostRequest, ) -> Result<ResponseContent<AwsCURConfigResponse>, Error<CreateCostAWSCURConfigError>>
Create a Cloud Cost Management account for an AWS CUR config.
sourcepub async fn create_cost_azure_uc_configs(
&self,
body: AzureUCConfigPostRequest,
) -> Result<AzureUCConfigPairsResponse, Error<CreateCostAzureUCConfigsError>>
pub async fn create_cost_azure_uc_configs( &self, body: AzureUCConfigPostRequest, ) -> Result<AzureUCConfigPairsResponse, Error<CreateCostAzureUCConfigsError>>
Create a Cloud Cost Management account for an Azure config.
Examples found in repository?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
async fn main() {
let body = AzureUCConfigPostRequest::new(AzureUCConfigPostData::new(
AzureUCConfigPostRequestAttributes::new(
"1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
BillConfig::new(
"dd-actual-export".to_string(),
"dd-export-path".to_string(),
"dd-storage-account".to_string(),
"dd-storage-container".to_string(),
),
BillConfig::new(
"dd-actual-export".to_string(),
"dd-export-path".to_string(),
"dd-storage-account".to_string(),
"dd-storage-container".to_string(),
),
"1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
"subscriptions/1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
)
.is_enabled(true),
AzureUCConfigPostRequestType::AZURE_UC_CONFIG_POST_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.create_cost_azure_uc_configs(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn create_cost_azure_uc_configs_with_http_info(
&self,
body: AzureUCConfigPostRequest,
) -> Result<ResponseContent<AzureUCConfigPairsResponse>, Error<CreateCostAzureUCConfigsError>>
pub async fn create_cost_azure_uc_configs_with_http_info( &self, body: AzureUCConfigPostRequest, ) -> Result<ResponseContent<AzureUCConfigPairsResponse>, Error<CreateCostAzureUCConfigsError>>
Create a Cloud Cost Management account for an Azure config.
sourcepub async fn delete_cost_awscur_config(
&self,
cloud_account_id: String,
) -> Result<(), Error<DeleteCostAWSCURConfigError>>
pub async fn delete_cost_awscur_config( &self, cloud_account_id: String, ) -> Result<(), Error<DeleteCostAWSCURConfigError>>
Archive a Cloud Cost Management Account.
sourcepub async fn delete_cost_awscur_config_with_http_info(
&self,
cloud_account_id: String,
) -> Result<ResponseContent<()>, Error<DeleteCostAWSCURConfigError>>
pub async fn delete_cost_awscur_config_with_http_info( &self, cloud_account_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCostAWSCURConfigError>>
Archive a Cloud Cost Management Account.
sourcepub async fn delete_cost_azure_uc_config(
&self,
cloud_account_id: String,
) -> Result<(), Error<DeleteCostAzureUCConfigError>>
pub async fn delete_cost_azure_uc_config( &self, cloud_account_id: String, ) -> Result<(), Error<DeleteCostAzureUCConfigError>>
Archive a Cloud Cost Management Account.
sourcepub async fn delete_cost_azure_uc_config_with_http_info(
&self,
cloud_account_id: String,
) -> Result<ResponseContent<()>, Error<DeleteCostAzureUCConfigError>>
pub async fn delete_cost_azure_uc_config_with_http_info( &self, cloud_account_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCostAzureUCConfigError>>
Archive a Cloud Cost Management Account.
sourcepub async fn delete_custom_costs_file(
&self,
file_id: String,
) -> Result<(), Error<DeleteCustomCostsFileError>>
pub async fn delete_custom_costs_file( &self, file_id: String, ) -> Result<(), Error<DeleteCustomCostsFileError>>
Delete the specified Custom Costs file.
Examples found in repository?
More examples
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api
.delete_custom_costs_file("9d055d22-a838-4e9f-bc34-a4f9ab66280c".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn delete_custom_costs_file_with_http_info(
&self,
file_id: String,
) -> Result<ResponseContent<()>, Error<DeleteCustomCostsFileError>>
pub async fn delete_custom_costs_file_with_http_info( &self, file_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCustomCostsFileError>>
Delete the specified Custom Costs file.
sourcepub async fn get_cloud_cost_activity(
&self,
) -> Result<CloudCostActivityResponse, Error<GetCloudCostActivityError>>
pub async fn get_cloud_cost_activity( &self, ) -> Result<CloudCostActivityResponse, Error<GetCloudCostActivityError>>
Get the Cloud Cost Management activity.
sourcepub async fn get_cloud_cost_activity_with_http_info(
&self,
) -> Result<ResponseContent<CloudCostActivityResponse>, Error<GetCloudCostActivityError>>
pub async fn get_cloud_cost_activity_with_http_info( &self, ) -> Result<ResponseContent<CloudCostActivityResponse>, Error<GetCloudCostActivityError>>
Get the Cloud Cost Management activity.
sourcepub async fn get_custom_costs_file(
&self,
file_id: String,
) -> Result<CustomCostsFileGetResponse, Error<GetCustomCostsFileError>>
pub async fn get_custom_costs_file( &self, file_id: String, ) -> Result<CustomCostsFileGetResponse, Error<GetCustomCostsFileError>>
Fetch the specified Custom Costs file.
Examples found in repository?
More examples
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api
.get_custom_costs_file("9d055d22-a838-4e9f-bc34-a4f9ab66280c".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn get_custom_costs_file_with_http_info(
&self,
file_id: String,
) -> Result<ResponseContent<CustomCostsFileGetResponse>, Error<GetCustomCostsFileError>>
pub async fn get_custom_costs_file_with_http_info( &self, file_id: String, ) -> Result<ResponseContent<CustomCostsFileGetResponse>, Error<GetCustomCostsFileError>>
Fetch the specified Custom Costs file.
List the AWS accounts in an organization by calling ‘organizations:ListAccounts’ from the specified management account.
Examples found in repository?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api
.list_aws_related_accounts("123456789123".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}List the AWS accounts in an organization by calling ‘organizations:ListAccounts’ from the specified management account.
sourcepub async fn list_cost_awscur_configs(
&self,
) -> Result<AwsCURConfigsResponse, Error<ListCostAWSCURConfigsError>>
pub async fn list_cost_awscur_configs( &self, ) -> Result<AwsCURConfigsResponse, Error<ListCostAWSCURConfigsError>>
List the AWS CUR configs.
sourcepub async fn list_cost_awscur_configs_with_http_info(
&self,
) -> Result<ResponseContent<AwsCURConfigsResponse>, Error<ListCostAWSCURConfigsError>>
pub async fn list_cost_awscur_configs_with_http_info( &self, ) -> Result<ResponseContent<AwsCURConfigsResponse>, Error<ListCostAWSCURConfigsError>>
List the AWS CUR configs.
sourcepub async fn list_cost_azure_uc_configs(
&self,
) -> Result<AzureUCConfigsResponse, Error<ListCostAzureUCConfigsError>>
pub async fn list_cost_azure_uc_configs( &self, ) -> Result<AzureUCConfigsResponse, Error<ListCostAzureUCConfigsError>>
List the Azure configs.
sourcepub async fn list_cost_azure_uc_configs_with_http_info(
&self,
) -> Result<ResponseContent<AzureUCConfigsResponse>, Error<ListCostAzureUCConfigsError>>
pub async fn list_cost_azure_uc_configs_with_http_info( &self, ) -> Result<ResponseContent<AzureUCConfigsResponse>, Error<ListCostAzureUCConfigsError>>
List the Azure configs.
sourcepub async fn list_custom_costs_files(
&self,
) -> Result<CustomCostsFileListResponse, Error<ListCustomCostsFilesError>>
pub async fn list_custom_costs_files( &self, ) -> Result<CustomCostsFileListResponse, Error<ListCustomCostsFilesError>>
List the Custom Costs files.
Examples found in repository?
More examples
sourcepub async fn list_custom_costs_files_with_http_info(
&self,
) -> Result<ResponseContent<CustomCostsFileListResponse>, Error<ListCustomCostsFilesError>>
pub async fn list_custom_costs_files_with_http_info( &self, ) -> Result<ResponseContent<CustomCostsFileListResponse>, Error<ListCustomCostsFilesError>>
List the Custom Costs files.
sourcepub async fn update_cost_awscur_config(
&self,
cloud_account_id: String,
body: AwsCURConfigPatchRequest,
) -> Result<AwsCURConfigsResponse, Error<UpdateCostAWSCURConfigError>>
pub async fn update_cost_awscur_config( &self, cloud_account_id: String, body: AwsCURConfigPatchRequest, ) -> Result<AwsCURConfigsResponse, Error<UpdateCostAWSCURConfigError>>
Update the status of an AWS CUR config (active/archived).
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23
async fn main() {
let body = AwsCURConfigPatchRequest::new(AwsCURConfigPatchData::new(
AwsCURConfigPatchRequestAttributes::new(true),
AwsCURConfigPatchRequestType::AWS_CUR_CONFIG_PATCH_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.update_cost_awscur_config("100".to_string(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_cost_awscur_config_with_http_info(
&self,
cloud_account_id: String,
body: AwsCURConfigPatchRequest,
) -> Result<ResponseContent<AwsCURConfigsResponse>, Error<UpdateCostAWSCURConfigError>>
pub async fn update_cost_awscur_config_with_http_info( &self, cloud_account_id: String, body: AwsCURConfigPatchRequest, ) -> Result<ResponseContent<AwsCURConfigsResponse>, Error<UpdateCostAWSCURConfigError>>
Update the status of an AWS CUR config (active/archived).
sourcepub async fn update_cost_azure_uc_configs(
&self,
cloud_account_id: String,
body: AzureUCConfigPatchRequest,
) -> Result<AzureUCConfigPairsResponse, Error<UpdateCostAzureUCConfigsError>>
pub async fn update_cost_azure_uc_configs( &self, cloud_account_id: String, body: AzureUCConfigPatchRequest, ) -> Result<AzureUCConfigPairsResponse, Error<UpdateCostAzureUCConfigsError>>
Update the status of an Azure config (active/archived).
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = AzureUCConfigPatchRequest::new(AzureUCConfigPatchData::new(
AzureUCConfigPatchRequestAttributes::new(true),
AzureUCConfigPatchRequestType::AZURE_UC_CONFIG_PATCH_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api
.update_cost_azure_uc_configs("100".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_cost_azure_uc_configs_with_http_info(
&self,
cloud_account_id: String,
body: AzureUCConfigPatchRequest,
) -> Result<ResponseContent<AzureUCConfigPairsResponse>, Error<UpdateCostAzureUCConfigsError>>
pub async fn update_cost_azure_uc_configs_with_http_info( &self, cloud_account_id: String, body: AzureUCConfigPatchRequest, ) -> Result<ResponseContent<AzureUCConfigPairsResponse>, Error<UpdateCostAzureUCConfigsError>>
Update the status of an Azure config (active/archived).
sourcepub async fn upload_custom_costs_file(
&self,
body: Vec<CustomCostsFileLineItem>,
) -> Result<CustomCostsFileUploadResponse, Error<UploadCustomCostsFileError>>
pub async fn upload_custom_costs_file( &self, body: Vec<CustomCostsFileLineItem>, ) -> Result<CustomCostsFileUploadResponse, Error<UploadCustomCostsFileError>>
Upload a Custom Costs file.
Examples found in repository?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let body = vec![CustomCostsFileLineItem::new()
.billed_cost(100.5 as f64)
.billing_currency("USD".to_string())
.charge_description("Monthly usage charge for my service".to_string())
.charge_period_end("2023-02-28".to_string())
.charge_period_start("2023-02-01".to_string())];
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.upload_custom_costs_file(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}More examples
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = vec![CustomCostsFileLineItem::new()
.billed_cost(250.0 as f64)
.billing_currency("USD".to_string())
.charge_description("my_description".to_string())
.charge_period_end("2023-06-06".to_string())
.charge_period_start("2023-05-06".to_string())
.provider_name("my_provider".to_string())
.tags(BTreeMap::from([("key".to_string(), "value".to_string())]))];
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.upload_custom_costs_file(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn upload_custom_costs_file_with_http_info(
&self,
body: Vec<CustomCostsFileLineItem>,
) -> Result<ResponseContent<CustomCostsFileUploadResponse>, Error<UploadCustomCostsFileError>>
pub async fn upload_custom_costs_file_with_http_info( &self, body: Vec<CustomCostsFileLineItem>, ) -> Result<ResponseContent<CustomCostsFileUploadResponse>, Error<UploadCustomCostsFileError>>
Upload a Custom Costs file.
Trait Implementations§
source§impl Clone for CloudCostManagementAPI
impl Clone for CloudCostManagementAPI
source§fn clone(&self) -> CloudCostManagementAPI
fn clone(&self) -> CloudCostManagementAPI
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for CloudCostManagementAPI
impl Debug for CloudCostManagementAPI
Auto Trait Implementations§
impl Freeze for CloudCostManagementAPI
impl !RefUnwindSafe for CloudCostManagementAPI
impl Send for CloudCostManagementAPI
impl Sync for CloudCostManagementAPI
impl Unpin for CloudCostManagementAPI
impl !UnwindSafe for CloudCostManagementAPI
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)