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, Azure, and GCP. 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_GetBudget.rs
- examples/v2_cloud-cost-management_DeleteBudget.rs
- examples/v2_cloud-cost-management_DeleteCostAWSCURConfig.rs
- 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_DeleteCostGCPUsageCostConfig.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_UpdateCostGCPUsageCostConfig.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_CreateCostGCPUsageCostConfig.rs
- examples/v2_cloud-cost-management_CreateCostAzureUCConfigs.rs
- examples/v2_cloud-cost-management_UpsertBudget.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?
10async fn main() {
11 let body = AwsCURConfigPostRequest::new(AwsCURConfigPostData::new(
12 AwsCURConfigPostRequestAttributes::new(
13 "123456789123".to_string(),
14 "dd-cost-bucket".to_string(),
15 "dd-report-name".to_string(),
16 "dd-report-prefix".to_string(),
17 )
18 .bucket_region("us-east-1".to_string()),
19 AwsCURConfigPostRequestType::AWS_CUR_CONFIG_POST_REQUEST,
20 ));
21 let configuration = datadog::Configuration::new();
22 let api = CloudCostManagementAPI::with_config(configuration);
23 let resp = api.create_cost_awscur_config(body).await;
24 if let Ok(value) = resp {
25 println!("{:#?}", value);
26 } else {
27 println!("{:#?}", resp.unwrap_err());
28 }
29}
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?
11async fn main() {
12 let body = AzureUCConfigPostRequest::new(AzureUCConfigPostData::new(
13 AzureUCConfigPostRequestAttributes::new(
14 "1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
15 BillConfig::new(
16 "dd-actual-export".to_string(),
17 "dd-export-path".to_string(),
18 "dd-storage-account".to_string(),
19 "dd-storage-container".to_string(),
20 ),
21 BillConfig::new(
22 "dd-actual-export".to_string(),
23 "dd-export-path".to_string(),
24 "dd-storage-account".to_string(),
25 "dd-storage-container".to_string(),
26 ),
27 "1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
28 "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
29 )
30 .is_enabled(true),
31 AzureUCConfigPostRequestType::AZURE_UC_CONFIG_POST_REQUEST,
32 ));
33 let configuration = datadog::Configuration::new();
34 let api = CloudCostManagementAPI::with_config(configuration);
35 let resp = api.create_cost_azure_uc_configs(body).await;
36 if let Ok(value) = resp {
37 println!("{:#?}", value);
38 } else {
39 println!("{:#?}", resp.unwrap_err());
40 }
41}
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 create_cost_gcp_usage_cost_config(
&self,
body: GCPUsageCostConfigPostRequest,
) -> Result<GCPUsageCostConfigResponse, Error<CreateCostGCPUsageCostConfigError>>
pub async fn create_cost_gcp_usage_cost_config( &self, body: GCPUsageCostConfigPostRequest, ) -> Result<GCPUsageCostConfigResponse, Error<CreateCostGCPUsageCostConfigError>>
Create a Cloud Cost Management account for an GCP Usage Cost config.
Examples found in repository?
10async fn main() {
11 let body = GCPUsageCostConfigPostRequest::new(GCPUsageCostConfigPostData::new(
12 GCPUsageCostConfigPostRequestAttributes::new(
13 "123456_A123BC_12AB34".to_string(),
14 "dd-cost-bucket".to_string(),
15 "billing".to_string(),
16 "dd-cloud-cost-report".to_string(),
17 "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com".to_string(),
18 )
19 .export_prefix("datadog_cloud_cost_usage_export".to_string()),
20 GCPUsageCostConfigPostRequestType::GCP_USAGE_COST_CONFIG_POST_REQUEST,
21 ));
22 let configuration = datadog::Configuration::new();
23 let api = CloudCostManagementAPI::with_config(configuration);
24 let resp = api.create_cost_gcp_usage_cost_config(body).await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
Sourcepub async fn create_cost_gcp_usage_cost_config_with_http_info(
&self,
body: GCPUsageCostConfigPostRequest,
) -> Result<ResponseContent<GCPUsageCostConfigResponse>, Error<CreateCostGCPUsageCostConfigError>>
pub async fn create_cost_gcp_usage_cost_config_with_http_info( &self, body: GCPUsageCostConfigPostRequest, ) -> Result<ResponseContent<GCPUsageCostConfigResponse>, Error<CreateCostGCPUsageCostConfigError>>
Create a Cloud Cost Management account for an GCP Usage Cost config.
Sourcepub async fn delete_budget(
&self,
budget_id: String,
) -> Result<(), Error<DeleteBudgetError>>
pub async fn delete_budget( &self, budget_id: String, ) -> Result<(), Error<DeleteBudgetError>>
Delete a budget.
Sourcepub async fn delete_budget_with_http_info(
&self,
budget_id: String,
) -> Result<ResponseContent<()>, Error<DeleteBudgetError>>
pub async fn delete_budget_with_http_info( &self, budget_id: String, ) -> Result<ResponseContent<()>, Error<DeleteBudgetError>>
Delete a budget.
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_cost_gcp_usage_cost_config(
&self,
cloud_account_id: String,
) -> Result<(), Error<DeleteCostGCPUsageCostConfigError>>
pub async fn delete_cost_gcp_usage_cost_config( &self, cloud_account_id: String, ) -> Result<(), Error<DeleteCostGCPUsageCostConfigError>>
Archive a Cloud Cost Management account.
Examples found in repository?
6async fn main() {
7 let configuration = datadog::Configuration::new();
8 let api = CloudCostManagementAPI::with_config(configuration);
9 let resp = api
10 .delete_cost_gcp_usage_cost_config("100".to_string())
11 .await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn delete_cost_gcp_usage_cost_config_with_http_info(
&self,
cloud_account_id: String,
) -> Result<ResponseContent<()>, Error<DeleteCostGCPUsageCostConfigError>>
pub async fn delete_cost_gcp_usage_cost_config_with_http_info( &self, cloud_account_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCostGCPUsageCostConfigError>>
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
6async fn main() {
7 let configuration = datadog::Configuration::new();
8 let api = CloudCostManagementAPI::with_config(configuration);
9 let resp = api
10 .delete_custom_costs_file("9d055d22-a838-4e9f-bc34-a4f9ab66280c".to_string())
11 .await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
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_budget(
&self,
budget_id: String,
) -> Result<BudgetWithEntries, Error<GetBudgetError>>
pub async fn get_budget( &self, budget_id: String, ) -> Result<BudgetWithEntries, Error<GetBudgetError>>
Get a budget.
Sourcepub async fn get_budget_with_http_info(
&self,
budget_id: String,
) -> Result<ResponseContent<BudgetWithEntries>, Error<GetBudgetError>>
pub async fn get_budget_with_http_info( &self, budget_id: String, ) -> Result<ResponseContent<BudgetWithEntries>, Error<GetBudgetError>>
Get a budget.
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
6async fn main() {
7 let configuration = datadog::Configuration::new();
8 let api = CloudCostManagementAPI::with_config(configuration);
9 let resp = api
10 .get_custom_costs_file("9d055d22-a838-4e9f-bc34-a4f9ab66280c".to_string())
11 .await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
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.
Sourcepub async fn list_budgets(&self) -> Result<BudgetArray, Error<ListBudgetsError>>
pub async fn list_budgets(&self) -> Result<BudgetArray, Error<ListBudgetsError>>
List budgets.
Sourcepub async fn list_budgets_with_http_info(
&self,
) -> Result<ResponseContent<BudgetArray>, Error<ListBudgetsError>>
pub async fn list_budgets_with_http_info( &self, ) -> Result<ResponseContent<BudgetArray>, Error<ListBudgetsError>>
List budgets.
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_cost_gcp_usage_cost_configs(
&self,
) -> Result<GCPUsageCostConfigsResponse, Error<ListCostGCPUsageCostConfigsError>>
pub async fn list_cost_gcp_usage_cost_configs( &self, ) -> Result<GCPUsageCostConfigsResponse, Error<ListCostGCPUsageCostConfigsError>>
List the GCP Usage Cost configs.
Sourcepub async fn list_cost_gcp_usage_cost_configs_with_http_info(
&self,
) -> Result<ResponseContent<GCPUsageCostConfigsResponse>, Error<ListCostGCPUsageCostConfigsError>>
pub async fn list_cost_gcp_usage_cost_configs_with_http_info( &self, ) -> Result<ResponseContent<GCPUsageCostConfigsResponse>, Error<ListCostGCPUsageCostConfigsError>>
List the GCP Usage Cost 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 (active/archived) and/or account filtering configuration of an AWS CUR config.
Examples found in repository?
10async fn main() {
11 let body = AwsCURConfigPatchRequest::new(AwsCURConfigPatchData::new(
12 AwsCURConfigPatchRequestAttributes::new().is_enabled(true),
13 AwsCURConfigPatchRequestType::AWS_CUR_CONFIG_PATCH_REQUEST,
14 ));
15 let configuration = datadog::Configuration::new();
16 let api = CloudCostManagementAPI::with_config(configuration);
17 let resp = api.update_cost_awscur_config("100".to_string(), body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
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 (active/archived) and/or account filtering configuration of an AWS CUR config.
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?
10async fn main() {
11 let body = AzureUCConfigPatchRequest::new(AzureUCConfigPatchData::new(
12 AzureUCConfigPatchRequestAttributes::new(true),
13 AzureUCConfigPatchRequestType::AZURE_UC_CONFIG_PATCH_REQUEST,
14 ));
15 let configuration = datadog::Configuration::new();
16 let api = CloudCostManagementAPI::with_config(configuration);
17 let resp = api
18 .update_cost_azure_uc_configs("100".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
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 update_cost_gcp_usage_cost_config(
&self,
cloud_account_id: String,
body: GCPUsageCostConfigPatchRequest,
) -> Result<GCPUsageCostConfigResponse, Error<UpdateCostGCPUsageCostConfigError>>
pub async fn update_cost_gcp_usage_cost_config( &self, cloud_account_id: String, body: GCPUsageCostConfigPatchRequest, ) -> Result<GCPUsageCostConfigResponse, Error<UpdateCostGCPUsageCostConfigError>>
Update the status of an GCP Usage Cost config (active/archived).
Examples found in repository?
10async fn main() {
11 let body = GCPUsageCostConfigPatchRequest::new(GCPUsageCostConfigPatchData::new(
12 GCPUsageCostConfigPatchRequestAttributes::new(true),
13 GCPUsageCostConfigPatchRequestType::GCP_USAGE_COST_CONFIG_PATCH_REQUEST,
14 ));
15 let configuration = datadog::Configuration::new();
16 let api = CloudCostManagementAPI::with_config(configuration);
17 let resp = api
18 .update_cost_gcp_usage_cost_config("100".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
Sourcepub async fn update_cost_gcp_usage_cost_config_with_http_info(
&self,
cloud_account_id: String,
body: GCPUsageCostConfigPatchRequest,
) -> Result<ResponseContent<GCPUsageCostConfigResponse>, Error<UpdateCostGCPUsageCostConfigError>>
pub async fn update_cost_gcp_usage_cost_config_with_http_info( &self, cloud_account_id: String, body: GCPUsageCostConfigPatchRequest, ) -> Result<ResponseContent<GCPUsageCostConfigResponse>, Error<UpdateCostGCPUsageCostConfigError>>
Update the status of an GCP Usage Cost 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?
7async fn main() {
8 let body = vec![CustomCostsFileLineItem::new()
9 .billed_cost(100.5 as f64)
10 .billing_currency("USD".to_string())
11 .charge_description("Monthly usage charge for my service".to_string())
12 .charge_period_end("2023-02-28".to_string())
13 .charge_period_start("2023-02-01".to_string())];
14 let configuration = datadog::Configuration::new();
15 let api = CloudCostManagementAPI::with_config(configuration);
16 let resp = api.upload_custom_costs_file(body).await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
More examples
8async fn main() {
9 let body = vec![CustomCostsFileLineItem::new()
10 .billed_cost(250.0 as f64)
11 .billing_currency("USD".to_string())
12 .charge_description("my_description".to_string())
13 .charge_period_end("2023-06-06".to_string())
14 .charge_period_start("2023-05-06".to_string())
15 .provider_name("my_provider".to_string())
16 .tags(BTreeMap::from([("key".to_string(), "value".to_string())]))];
17 let configuration = datadog::Configuration::new();
18 let api = CloudCostManagementAPI::with_config(configuration);
19 let resp = api.upload_custom_costs_file(body).await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
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.
Sourcepub async fn upsert_budget(
&self,
body: BudgetWithEntries,
) -> Result<BudgetWithEntries, Error<UpsertBudgetError>>
pub async fn upsert_budget( &self, body: BudgetWithEntries, ) -> Result<BudgetWithEntries, Error<UpsertBudgetError>>
Create a new budget or update an existing one.
Examples found in repository?
11async fn main() {
12 let body = BudgetWithEntries::new().data(
13 BudgetWithEntriesData::new()
14 .attributes(
15 BudgetAttributes::new()
16 .created_at(1738258683590)
17 .created_by("00000000-0a0a-0a0a-aaa0-00000000000a".to_string())
18 .end_month(202502)
19 .entries(vec![BudgetEntry::new()
20 .amount(500.0 as f64)
21 .month(202501)
22 .tag_filters(vec![TagFilter::new()
23 .tag_key("service".to_string())
24 .tag_value("ec2".to_string())])])
25 .metrics_query("aws.cost.amortized{service:ec2} by {service}".to_string())
26 .name("my budget".to_string())
27 .org_id(123)
28 .start_month(202501)
29 .total_amount(1000.0 as f64)
30 .updated_at(1738258683590)
31 .updated_by("00000000-0a0a-0a0a-aaa0-00000000000a".to_string()),
32 )
33 .id("00000000-0a0a-0a0a-aaa0-00000000000a".to_string()),
34 );
35 let configuration = datadog::Configuration::new();
36 let api = CloudCostManagementAPI::with_config(configuration);
37 let resp = api.upsert_budget(body).await;
38 if let Ok(value) = resp {
39 println!("{:#?}", value);
40 } else {
41 println!("{:#?}", resp.unwrap_err());
42 }
43}
Sourcepub async fn upsert_budget_with_http_info(
&self,
body: BudgetWithEntries,
) -> Result<ResponseContent<BudgetWithEntries>, Error<UpsertBudgetError>>
pub async fn upsert_budget_with_http_info( &self, body: BudgetWithEntries, ) -> Result<ResponseContent<BudgetWithEntries>, Error<UpsertBudgetError>>
Create a new budget or update an existing one.
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 more