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 Google Cloud. 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_GetCostAWSCURConfig.rs
- examples/v2_cloud-cost-management_GetArbitraryCostRule.rs
- examples/v2_cloud-cost-management_DeleteCostAzureUCConfig.rs
- examples/v2_cloud-cost-management_GetCostAzureUCConfig.rs
- examples/v2_cloud-cost-management_DeleteArbitraryCostRule.rs
- examples/v2_cloud-cost-management_ListCostGCPUsageCostConfigs.rs
- examples/v2_cloud-cost-management_GetBudget.rs
- examples/v2_cloud-cost-management_DeleteBudget.rs
- examples/v2_cloud-cost-management_DeleteCostGCPUsageCostConfig.rs
- examples/v2_cloud-cost-management_GetCostGCPUsageCostConfig.rs
- examples/v2_cloud-cost-management_GetCustomCostsFile.rs
- examples/v2_cloud-cost-management_DeleteCustomCostsFile.rs
- examples/v2_cloud-cost-management_GetRuleset.rs
- examples/v2_cloud-cost-management_DeleteRuleset.rs
- examples/v2_cloud-cost-management_ListCustomCostsFiles.rs
- examples/v2_cloud-cost-management_ListCustomCostsFiles_1968771127.rs
- examples/v2_cloud-cost-management_GetCustomCostsFile_1307381576.rs
- examples/v2_cloud-cost-management_DeleteCustomCostsFile_372970393.rs
- examples/v2_cloud-cost-management_ReorderRulesets.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_ValidateQuery.rs
- examples/v2_cloud-cost-management_UploadCustomCostsFile.rs
- examples/v2_cloud-cost-management_ReorderArbitraryCostRules.rs
- examples/v2_cloud-cost-management_UploadCustomCostsFile_4125168396.rs
- examples/v2_cloud-cost-management_CreateCostAWSCURConfig.rs
- examples/v2_cloud-cost-management_CreateCostGCPUsageCostConfig.rs
- examples/v2_cloud-cost-management_UpdateRuleset.rs
- examples/v2_cloud-cost-management_CreateCostAzureUCConfigs.rs
- examples/v2_cloud-cost-management_UpsertBudget.rs
- examples/v2_cloud-cost-management_CreateRuleset.rs
- examples/v2_cloud-cost-management_CreateArbitraryCostRule.rs
- examples/v2_cloud-cost-management_UpdateArbitraryCostRule.rs
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_arbitrary_cost_rule(
&self,
body: ArbitraryCostUpsertRequest,
) -> Result<ArbitraryRuleResponse, Error<CreateArbitraryCostRuleError>>
pub async fn create_arbitrary_cost_rule( &self, body: ArbitraryCostUpsertRequest, ) -> Result<ArbitraryRuleResponse, Error<CreateArbitraryCostRuleError>>
Create a new arbitrary cost rule with the specified filters and allocation strategy.
Strategy Methods:
- PROPORTIONAL/EVEN: Allocates costs proportionally/evenly based on existing costs. Requires: granularity, allocated_by_tag_keys. Optional: based_on_costs, allocated_by_filters, evaluate_grouped_by_tag_keys, evaluate_grouped_by_filters.
- PROPORTIONAL_TIMESERIES/EVEN_TIMESERIES: Allocates based on timeseries data. Requires: granularity, based_on_timeseries. Optional: evaluate_grouped_by_tag_keys.
- PERCENT: Allocates fixed percentages to specific tags. Requires: allocated_by (array of percentage allocations).
Filter Conditions:
- Use value for single-value conditions: “is”, “is not”, “contains”, “does not contain”, “=”, “!=”, “like”, “not like”, “is all values”, “is untagged”
- Use values for multi-value conditions: “in”, “not in”
- Cannot use both value and values simultaneously.
Supported operators: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like
Examples found in repository?
13async fn main() {
14 let body = ArbitraryCostUpsertRequest::new().data(
15 ArbitraryCostUpsertRequestData::new(
16 ArbitraryCostUpsertRequestDataType::UPSERT_ARBITRARY_RULE,
17 )
18 .attributes(
19 ArbitraryCostUpsertRequestDataAttributes::new(
20 vec![
21 ArbitraryCostUpsertRequestDataAttributesCostsToAllocateItems::new(
22 "is".to_string(),
23 "account_id".to_string(),
24 )
25 .value("123456789".to_string())
26 .values(Some(vec![])),
27 ArbitraryCostUpsertRequestDataAttributesCostsToAllocateItems::new(
28 "in".to_string(),
29 "environment".to_string(),
30 )
31 .value("".to_string())
32 .values(Some(vec!["production".to_string(), "staging".to_string()])),
33 ],
34 vec!["aws".to_string(), "gcp".to_string()],
35 "example-arbitrary-cost-rule".to_string(),
36 ArbitraryCostUpsertRequestDataAttributesStrategy::new("proportional".to_string())
37 .allocated_by_tag_keys(vec!["team".to_string(), "environment".to_string()])
38 .based_on_costs(vec![
39 ArbitraryCostUpsertRequestDataAttributesStrategyBasedOnCostsItems::new(
40 "is".to_string(),
41 "service".to_string(),
42 )
43 .value("web-api".to_string())
44 .values(Some(vec![])),
45 ArbitraryCostUpsertRequestDataAttributesStrategyBasedOnCostsItems::new(
46 "not in".to_string(),
47 "team".to_string(),
48 )
49 .value("".to_string())
50 .values(Some(vec!["legacy".to_string(), "deprecated".to_string()])),
51 ])
52 .granularity("daily".to_string()),
53 "shared".to_string(),
54 )
55 .enabled(true)
56 .order_id(1),
57 ),
58 );
59 let configuration = datadog::Configuration::new();
60 let api = CloudCostManagementAPI::with_config(configuration);
61 let resp = api.create_arbitrary_cost_rule(body).await;
62 if let Ok(value) = resp {
63 println!("{:#?}", value);
64 } else {
65 println!("{:#?}", resp.unwrap_err());
66 }
67}
Sourcepub async fn create_arbitrary_cost_rule_with_http_info(
&self,
body: ArbitraryCostUpsertRequest,
) -> Result<ResponseContent<ArbitraryRuleResponse>, Error<CreateArbitraryCostRuleError>>
pub async fn create_arbitrary_cost_rule_with_http_info( &self, body: ArbitraryCostUpsertRequest, ) -> Result<ResponseContent<ArbitraryRuleResponse>, Error<CreateArbitraryCostRuleError>>
Create a new arbitrary cost rule with the specified filters and allocation strategy.
Strategy Methods:
- PROPORTIONAL/EVEN: Allocates costs proportionally/evenly based on existing costs. Requires: granularity, allocated_by_tag_keys. Optional: based_on_costs, allocated_by_filters, evaluate_grouped_by_tag_keys, evaluate_grouped_by_filters.
- PROPORTIONAL_TIMESERIES/EVEN_TIMESERIES: Allocates based on timeseries data. Requires: granularity, based_on_timeseries. Optional: evaluate_grouped_by_tag_keys.
- PERCENT: Allocates fixed percentages to specific tags. Requires: allocated_by (array of percentage allocations).
Filter Conditions:
- Use value for single-value conditions: “is”, “is not”, “contains”, “does not contain”, “=”, “!=”, “like”, “not like”, “is all values”, “is untagged”
- Use values for multi-value conditions: “in”, “not in”
- Cannot use both value and values simultaneously.
Supported operators: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like
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(
12 AwsCURConfigPostData::new(AwsCURConfigPostRequestType::AWS_CUR_CONFIG_POST_REQUEST)
13 .attributes(
14 AwsCURConfigPostRequestAttributes::new(
15 "123456789123".to_string(),
16 "dd-cost-bucket".to_string(),
17 "dd-report-name".to_string(),
18 "dd-report-prefix".to_string(),
19 )
20 .bucket_region("us-east-1".to_string()),
21 ),
22 );
23 let configuration = datadog::Configuration::new();
24 let api = CloudCostManagementAPI::with_config(configuration);
25 let resp = api.create_cost_awscur_config(body).await;
26 if let Ok(value) = resp {
27 println!("{:#?}", value);
28 } else {
29 println!("{:#?}", resp.unwrap_err());
30 }
31}
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(
13 AzureUCConfigPostData::new(AzureUCConfigPostRequestType::AZURE_UC_CONFIG_POST_REQUEST)
14 .attributes(AzureUCConfigPostRequestAttributes::new(
15 "1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
16 BillConfig::new(
17 "dd-actual-export".to_string(),
18 "dd-export-path".to_string(),
19 "dd-storage-account".to_string(),
20 "dd-storage-container".to_string(),
21 ),
22 BillConfig::new(
23 "dd-actual-export".to_string(),
24 "dd-export-path".to_string(),
25 "dd-storage-account".to_string(),
26 "dd-storage-container".to_string(),
27 ),
28 "1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
29 "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
30 )),
31 );
32 let configuration = datadog::Configuration::new();
33 let api = CloudCostManagementAPI::with_config(configuration);
34 let resp = api.create_cost_azure_uc_configs(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
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 Google Cloud Usage Cost config.
Examples found in repository?
10async fn main() {
11 let body = GCPUsageCostConfigPostRequest::new(
12 GCPUsageCostConfigPostData::new(
13 GCPUsageCostConfigPostRequestType::GCP_USAGE_COST_CONFIG_POST_REQUEST,
14 )
15 .attributes(
16 GCPUsageCostConfigPostRequestAttributes::new(
17 "123456_A123BC_12AB34".to_string(),
18 "dd-cost-bucket".to_string(),
19 "billing".to_string(),
20 "dd-cloud-cost-report".to_string(),
21 "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com".to_string(),
22 )
23 .export_prefix("datadog_cloud_cost_usage_export".to_string()),
24 ),
25 );
26 let configuration = datadog::Configuration::new();
27 let api = CloudCostManagementAPI::with_config(configuration);
28 let resp = api.create_cost_gcp_usage_cost_config(body).await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
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 Google Cloud Usage Cost config.
Sourcepub async fn create_ruleset(
&self,
body: CreateRulesetRequest,
) -> Result<RulesetResp, Error<CreateRulesetError>>
pub async fn create_ruleset( &self, body: CreateRulesetRequest, ) -> Result<RulesetResp, Error<CreateRulesetError>>
Create a new tag pipeline ruleset with the specified rules and configuration
Examples found in repository?
13async fn main() {
14 let body = CreateRulesetRequest::new().data(
15 CreateRulesetRequestData::new(CreateRulesetRequestDataType::CREATE_RULESET)
16 .attributes(
17 CreateRulesetRequestDataAttributes::new(vec![
18 CreateRulesetRequestDataAttributesRulesItems::new(
19 true,
20 "Add Cost Center Tag".to_string(),
21 )
22 .mapping(None)
23 .query(Some(
24 CreateRulesetRequestDataAttributesRulesItemsQuery::new(
25 Some(
26 CreateRulesetRequestDataAttributesRulesItemsQueryAddition::new(
27 "cost_center".to_string(),
28 "engineering".to_string(),
29 ),
30 ),
31 true,
32 r#"account_id:"123456789" AND service:"web-api""#.to_string(),
33 )
34 .case_insensitivity(false),
35 ))
36 .reference_table(None),
37 ])
38 .enabled(true),
39 )
40 .id("New Ruleset".to_string()),
41 );
42 let configuration = datadog::Configuration::new();
43 let api = CloudCostManagementAPI::with_config(configuration);
44 let resp = api.create_ruleset(body).await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
Sourcepub async fn create_ruleset_with_http_info(
&self,
body: CreateRulesetRequest,
) -> Result<ResponseContent<RulesetResp>, Error<CreateRulesetError>>
pub async fn create_ruleset_with_http_info( &self, body: CreateRulesetRequest, ) -> Result<ResponseContent<RulesetResp>, Error<CreateRulesetError>>
Create a new tag pipeline ruleset with the specified rules and configuration
Sourcepub async fn delete_arbitrary_cost_rule(
&self,
rule_id: i64,
) -> Result<(), Error<DeleteArbitraryCostRuleError>>
pub async fn delete_arbitrary_cost_rule( &self, rule_id: i64, ) -> Result<(), Error<DeleteArbitraryCostRuleError>>
Delete an arbitrary cost rule - Delete an existing arbitrary cost rule by its ID
Sourcepub async fn delete_arbitrary_cost_rule_with_http_info(
&self,
rule_id: i64,
) -> Result<ResponseContent<()>, Error<DeleteArbitraryCostRuleError>>
pub async fn delete_arbitrary_cost_rule_with_http_info( &self, rule_id: i64, ) -> Result<ResponseContent<()>, Error<DeleteArbitraryCostRuleError>>
Delete an arbitrary cost rule - Delete an existing arbitrary cost rule by its ID
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: i64,
) -> Result<(), Error<DeleteCostAWSCURConfigError>>
pub async fn delete_cost_awscur_config( &self, cloud_account_id: i64, ) -> Result<(), Error<DeleteCostAWSCURConfigError>>
Archive a Cloud Cost Management Account.
Sourcepub async fn delete_cost_awscur_config_with_http_info(
&self,
cloud_account_id: i64,
) -> Result<ResponseContent<()>, Error<DeleteCostAWSCURConfigError>>
pub async fn delete_cost_awscur_config_with_http_info( &self, cloud_account_id: i64, ) -> Result<ResponseContent<()>, Error<DeleteCostAWSCURConfigError>>
Archive a Cloud Cost Management Account.
Sourcepub async fn delete_cost_azure_uc_config(
&self,
cloud_account_id: i64,
) -> Result<(), Error<DeleteCostAzureUCConfigError>>
pub async fn delete_cost_azure_uc_config( &self, cloud_account_id: i64, ) -> Result<(), Error<DeleteCostAzureUCConfigError>>
Archive a Cloud Cost Management Account.
Sourcepub async fn delete_cost_azure_uc_config_with_http_info(
&self,
cloud_account_id: i64,
) -> Result<ResponseContent<()>, Error<DeleteCostAzureUCConfigError>>
pub async fn delete_cost_azure_uc_config_with_http_info( &self, cloud_account_id: i64, ) -> Result<ResponseContent<()>, Error<DeleteCostAzureUCConfigError>>
Archive a Cloud Cost Management Account.
Sourcepub async fn delete_cost_gcp_usage_cost_config(
&self,
cloud_account_id: i64,
) -> Result<(), Error<DeleteCostGCPUsageCostConfigError>>
pub async fn delete_cost_gcp_usage_cost_config( &self, cloud_account_id: i64, ) -> Result<(), Error<DeleteCostGCPUsageCostConfigError>>
Archive a Cloud Cost Management account.
Sourcepub async fn delete_cost_gcp_usage_cost_config_with_http_info(
&self,
cloud_account_id: i64,
) -> Result<ResponseContent<()>, Error<DeleteCostGCPUsageCostConfigError>>
pub async fn delete_cost_gcp_usage_cost_config_with_http_info( &self, cloud_account_id: i64, ) -> 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 delete_ruleset(
&self,
ruleset_id: String,
) -> Result<(), Error<DeleteRulesetError>>
pub async fn delete_ruleset( &self, ruleset_id: String, ) -> Result<(), Error<DeleteRulesetError>>
Delete a tag pipeline ruleset - Delete an existing tag pipeline ruleset by its ID
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_ruleset("1c5dae14-237d-4b9a-a515-aa55b3939142".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_ruleset_with_http_info(
&self,
ruleset_id: String,
) -> Result<ResponseContent<()>, Error<DeleteRulesetError>>
pub async fn delete_ruleset_with_http_info( &self, ruleset_id: String, ) -> Result<ResponseContent<()>, Error<DeleteRulesetError>>
Delete a tag pipeline ruleset - Delete an existing tag pipeline ruleset by its ID
Sourcepub async fn get_arbitrary_cost_rule(
&self,
rule_id: i64,
) -> Result<ArbitraryRuleResponse, Error<GetArbitraryCostRuleError>>
pub async fn get_arbitrary_cost_rule( &self, rule_id: i64, ) -> Result<ArbitraryRuleResponse, Error<GetArbitraryCostRuleError>>
Get a specific arbitrary cost rule - Retrieve a specific arbitrary cost rule by its ID
Sourcepub async fn get_arbitrary_cost_rule_with_http_info(
&self,
rule_id: i64,
) -> Result<ResponseContent<ArbitraryRuleResponse>, Error<GetArbitraryCostRuleError>>
pub async fn get_arbitrary_cost_rule_with_http_info( &self, rule_id: i64, ) -> Result<ResponseContent<ArbitraryRuleResponse>, Error<GetArbitraryCostRuleError>>
Get a specific arbitrary cost rule - Retrieve a specific arbitrary cost rule by its ID
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_cost_awscur_config(
&self,
cloud_account_id: i64,
) -> Result<AwsCurConfigResponse, Error<GetCostAWSCURConfigError>>
pub async fn get_cost_awscur_config( &self, cloud_account_id: i64, ) -> Result<AwsCurConfigResponse, Error<GetCostAWSCURConfigError>>
Get a specific AWS CUR config.
Sourcepub async fn get_cost_awscur_config_with_http_info(
&self,
cloud_account_id: i64,
) -> Result<ResponseContent<AwsCurConfigResponse>, Error<GetCostAWSCURConfigError>>
pub async fn get_cost_awscur_config_with_http_info( &self, cloud_account_id: i64, ) -> Result<ResponseContent<AwsCurConfigResponse>, Error<GetCostAWSCURConfigError>>
Get a specific AWS CUR config.
Sourcepub async fn get_cost_azure_uc_config(
&self,
cloud_account_id: i64,
) -> Result<UCConfigPair, Error<GetCostAzureUCConfigError>>
pub async fn get_cost_azure_uc_config( &self, cloud_account_id: i64, ) -> Result<UCConfigPair, Error<GetCostAzureUCConfigError>>
Get a specific Azure config.
Sourcepub async fn get_cost_azure_uc_config_with_http_info(
&self,
cloud_account_id: i64,
) -> Result<ResponseContent<UCConfigPair>, Error<GetCostAzureUCConfigError>>
pub async fn get_cost_azure_uc_config_with_http_info( &self, cloud_account_id: i64, ) -> Result<ResponseContent<UCConfigPair>, Error<GetCostAzureUCConfigError>>
Get a specific Azure config.
Sourcepub async fn get_cost_gcp_usage_cost_config(
&self,
cloud_account_id: i64,
) -> Result<GcpUcConfigResponse, Error<GetCostGCPUsageCostConfigError>>
pub async fn get_cost_gcp_usage_cost_config( &self, cloud_account_id: i64, ) -> Result<GcpUcConfigResponse, Error<GetCostGCPUsageCostConfigError>>
Get a specific Google Cloud Usage Cost config.
Sourcepub async fn get_cost_gcp_usage_cost_config_with_http_info(
&self,
cloud_account_id: i64,
) -> Result<ResponseContent<GcpUcConfigResponse>, Error<GetCostGCPUsageCostConfigError>>
pub async fn get_cost_gcp_usage_cost_config_with_http_info( &self, cloud_account_id: i64, ) -> Result<ResponseContent<GcpUcConfigResponse>, Error<GetCostGCPUsageCostConfigError>>
Get a specific Google Cloud Usage Cost config.
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 get_ruleset(
&self,
ruleset_id: String,
) -> Result<RulesetResp, Error<GetRulesetError>>
pub async fn get_ruleset( &self, ruleset_id: String, ) -> Result<RulesetResp, Error<GetRulesetError>>
Get a specific tag pipeline ruleset - Retrieve a specific tag pipeline ruleset by its ID
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 .get_ruleset("da0e30e2-615d-4dae-9a22-38cf86a87dde".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_ruleset_with_http_info(
&self,
ruleset_id: String,
) -> Result<ResponseContent<RulesetResp>, Error<GetRulesetError>>
pub async fn get_ruleset_with_http_info( &self, ruleset_id: String, ) -> Result<ResponseContent<RulesetResp>, Error<GetRulesetError>>
Get a specific tag pipeline ruleset - Retrieve a specific tag pipeline ruleset by its ID
Sourcepub async fn list_arbitrary_cost_rules(
&self,
) -> Result<ArbitraryRuleResponseArray, Error<ListArbitraryCostRulesError>>
pub async fn list_arbitrary_cost_rules( &self, ) -> Result<ArbitraryRuleResponseArray, Error<ListArbitraryCostRulesError>>
List all arbitrary cost rules - Retrieve a list of all arbitrary cost rules for the organization
Sourcepub async fn list_arbitrary_cost_rules_with_http_info(
&self,
) -> Result<ResponseContent<ArbitraryRuleResponseArray>, Error<ListArbitraryCostRulesError>>
pub async fn list_arbitrary_cost_rules_with_http_info( &self, ) -> Result<ResponseContent<ArbitraryRuleResponseArray>, Error<ListArbitraryCostRulesError>>
List all arbitrary cost rules - Retrieve a list of all arbitrary cost rules for the organization
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 Google Cloud 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 Google Cloud Usage Cost configs.
Sourcepub async fn list_custom_costs_files(
&self,
params: ListCustomCostsFilesOptionalParams,
) -> Result<CustomCostsFileListResponse, Error<ListCustomCostsFilesError>>
pub async fn list_custom_costs_files( &self, params: ListCustomCostsFilesOptionalParams, ) -> Result<CustomCostsFileListResponse, Error<ListCustomCostsFilesError>>
List the Custom Costs files.
Examples found in repository?
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = CloudCostManagementAPI::with_config(configuration);
10 let resp = api
11 .list_custom_costs_files(ListCustomCostsFilesOptionalParams::default())
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
More examples
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = CloudCostManagementAPI::with_config(configuration);
10 let resp = api
11 .list_custom_costs_files(ListCustomCostsFilesOptionalParams::default())
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
Sourcepub async fn list_custom_costs_files_with_http_info(
&self,
params: ListCustomCostsFilesOptionalParams,
) -> Result<ResponseContent<CustomCostsFileListResponse>, Error<ListCustomCostsFilesError>>
pub async fn list_custom_costs_files_with_http_info( &self, params: ListCustomCostsFilesOptionalParams, ) -> Result<ResponseContent<CustomCostsFileListResponse>, Error<ListCustomCostsFilesError>>
List the Custom Costs files.
Sourcepub async fn list_rulesets(
&self,
) -> Result<RulesetRespArray, Error<ListRulesetsError>>
pub async fn list_rulesets( &self, ) -> Result<RulesetRespArray, Error<ListRulesetsError>>
List all tag pipeline rulesets - Retrieve a list of all tag pipeline rulesets for the organization
Sourcepub async fn list_rulesets_with_http_info(
&self,
) -> Result<ResponseContent<RulesetRespArray>, Error<ListRulesetsError>>
pub async fn list_rulesets_with_http_info( &self, ) -> Result<ResponseContent<RulesetRespArray>, Error<ListRulesetsError>>
List all tag pipeline rulesets - Retrieve a list of all tag pipeline rulesets for the organization
Sourcepub async fn reorder_arbitrary_cost_rules(
&self,
body: ReorderRuleResourceArray,
) -> Result<(), Error<ReorderArbitraryCostRulesError>>
pub async fn reorder_arbitrary_cost_rules( &self, body: ReorderRuleResourceArray, ) -> Result<(), Error<ReorderArbitraryCostRulesError>>
Reorder arbitrary cost rules - Change the execution order of arbitrary cost rules.
Important: You must provide the complete list of all rule IDs in the desired execution order. The API will reorder ALL rules according to the provided sequence.
Rules are executed in the order specified, with lower indices (earlier in the array) having higher priority.
Example: If you have rules with IDs [123, 456, 789] and want to change order from 123→456→789 to 456→123→789, send: [{“id”: “456”}, {“id”: “123”}, {“id”: “789”}]
Examples found in repository?
9async fn main() {
10 let body = ReorderRuleResourceArray::new(vec![
11 ReorderRuleResourceData::new(ReorderRuleResourceDataType::ARBITRARY_RULE)
12 .id("456".to_string()),
13 ReorderRuleResourceData::new(ReorderRuleResourceDataType::ARBITRARY_RULE)
14 .id("123".to_string()),
15 ReorderRuleResourceData::new(ReorderRuleResourceDataType::ARBITRARY_RULE)
16 .id("789".to_string()),
17 ]);
18 let configuration = datadog::Configuration::new();
19 let api = CloudCostManagementAPI::with_config(configuration);
20 let resp = api.reorder_arbitrary_cost_rules(body).await;
21 if let Ok(value) = resp {
22 println!("{:#?}", value);
23 } else {
24 println!("{:#?}", resp.unwrap_err());
25 }
26}
Sourcepub async fn reorder_arbitrary_cost_rules_with_http_info(
&self,
body: ReorderRuleResourceArray,
) -> Result<ResponseContent<()>, Error<ReorderArbitraryCostRulesError>>
pub async fn reorder_arbitrary_cost_rules_with_http_info( &self, body: ReorderRuleResourceArray, ) -> Result<ResponseContent<()>, Error<ReorderArbitraryCostRulesError>>
Reorder arbitrary cost rules - Change the execution order of arbitrary cost rules.
Important: You must provide the complete list of all rule IDs in the desired execution order. The API will reorder ALL rules according to the provided sequence.
Rules are executed in the order specified, with lower indices (earlier in the array) having higher priority.
Example: If you have rules with IDs [123, 456, 789] and want to change order from 123→456→789 to 456→123→789, send: [{“id”: “456”}, {“id”: “123”}, {“id”: “789”}]
Sourcepub async fn reorder_rulesets(
&self,
body: ReorderRulesetResourceArray,
) -> Result<(), Error<ReorderRulesetsError>>
pub async fn reorder_rulesets( &self, body: ReorderRulesetResourceArray, ) -> Result<(), Error<ReorderRulesetsError>>
Reorder tag pipeline rulesets - Change the execution order of tag pipeline rulesets
Examples found in repository?
9async fn main() {
10 let body = ReorderRulesetResourceArray::new(vec![ReorderRulesetResourceData::new(
11 ReorderRulesetResourceDataType::RULESET,
12 )]);
13 let configuration = datadog::Configuration::new();
14 let api = CloudCostManagementAPI::with_config(configuration);
15 let resp = api.reorder_rulesets(body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
Sourcepub async fn reorder_rulesets_with_http_info(
&self,
body: ReorderRulesetResourceArray,
) -> Result<ResponseContent<()>, Error<ReorderRulesetsError>>
pub async fn reorder_rulesets_with_http_info( &self, body: ReorderRulesetResourceArray, ) -> Result<ResponseContent<()>, Error<ReorderRulesetsError>>
Reorder tag pipeline rulesets - Change the execution order of tag pipeline rulesets
Sourcepub async fn update_arbitrary_cost_rule(
&self,
rule_id: i64,
body: ArbitraryCostUpsertRequest,
) -> Result<ArbitraryRuleResponse, Error<UpdateArbitraryCostRuleError>>
pub async fn update_arbitrary_cost_rule( &self, rule_id: i64, body: ArbitraryCostUpsertRequest, ) -> Result<ArbitraryRuleResponse, Error<UpdateArbitraryCostRuleError>>
Update an existing arbitrary cost rule with new filters and allocation strategy.
Strategy Methods:
- PROPORTIONAL/EVEN: Allocates costs proportionally/evenly based on existing costs. Requires: granularity, allocated_by_tag_keys. Optional: based_on_costs, allocated_by_filters, evaluate_grouped_by_tag_keys, evaluate_grouped_by_filters.
- PROPORTIONAL_TIMESERIES/EVEN_TIMESERIES: Allocates based on timeseries data. Requires: granularity, based_on_timeseries. Optional: evaluate_grouped_by_tag_keys.
- PERCENT: Allocates fixed percentages to specific tags. Requires: allocated_by (array of percentage allocations).
- USAGE_METRIC: Allocates based on usage metrics (implementation varies).
Filter Conditions:
- Use value for single-value conditions: “is”, “is not”, “contains”, “does not contain”, “=”, “!=”, “like”, “not like”, “is all values”, “is untagged”
- Use values for multi-value conditions: “in”, “not in”
- Cannot use both value and values simultaneously.
Supported operators: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like
Examples found in repository?
13async fn main() {
14 let body = ArbitraryCostUpsertRequest::new().data(
15 ArbitraryCostUpsertRequestData::new(
16 ArbitraryCostUpsertRequestDataType::UPSERT_ARBITRARY_RULE,
17 )
18 .attributes(
19 ArbitraryCostUpsertRequestDataAttributes::new(
20 vec![
21 ArbitraryCostUpsertRequestDataAttributesCostsToAllocateItems::new(
22 "is".to_string(),
23 "account_id".to_string(),
24 )
25 .value("123456789".to_string())
26 .values(Some(vec![])),
27 ArbitraryCostUpsertRequestDataAttributesCostsToAllocateItems::new(
28 "in".to_string(),
29 "environment".to_string(),
30 )
31 .value("".to_string())
32 .values(Some(vec!["production".to_string(), "staging".to_string()])),
33 ],
34 vec!["aws".to_string(), "gcp".to_string()],
35 "example-arbitrary-cost-rule".to_string(),
36 ArbitraryCostUpsertRequestDataAttributesStrategy::new("proportional".to_string())
37 .allocated_by_tag_keys(vec!["team".to_string(), "environment".to_string()])
38 .based_on_costs(vec![
39 ArbitraryCostUpsertRequestDataAttributesStrategyBasedOnCostsItems::new(
40 "is".to_string(),
41 "service".to_string(),
42 )
43 .value("web-api".to_string())
44 .values(Some(vec![])),
45 ArbitraryCostUpsertRequestDataAttributesStrategyBasedOnCostsItems::new(
46 "not in".to_string(),
47 "team".to_string(),
48 )
49 .value("".to_string())
50 .values(Some(vec!["legacy".to_string(), "deprecated".to_string()])),
51 ])
52 .granularity("daily".to_string()),
53 "shared".to_string(),
54 )
55 .enabled(true)
56 .order_id(1),
57 ),
58 );
59 let configuration = datadog::Configuration::new();
60 let api = CloudCostManagementAPI::with_config(configuration);
61 let resp = api.update_arbitrary_cost_rule(123456, body).await;
62 if let Ok(value) = resp {
63 println!("{:#?}", value);
64 } else {
65 println!("{:#?}", resp.unwrap_err());
66 }
67}
Sourcepub async fn update_arbitrary_cost_rule_with_http_info(
&self,
rule_id: i64,
body: ArbitraryCostUpsertRequest,
) -> Result<ResponseContent<ArbitraryRuleResponse>, Error<UpdateArbitraryCostRuleError>>
pub async fn update_arbitrary_cost_rule_with_http_info( &self, rule_id: i64, body: ArbitraryCostUpsertRequest, ) -> Result<ResponseContent<ArbitraryRuleResponse>, Error<UpdateArbitraryCostRuleError>>
Update an existing arbitrary cost rule with new filters and allocation strategy.
Strategy Methods:
- PROPORTIONAL/EVEN: Allocates costs proportionally/evenly based on existing costs. Requires: granularity, allocated_by_tag_keys. Optional: based_on_costs, allocated_by_filters, evaluate_grouped_by_tag_keys, evaluate_grouped_by_filters.
- PROPORTIONAL_TIMESERIES/EVEN_TIMESERIES: Allocates based on timeseries data. Requires: granularity, based_on_timeseries. Optional: evaluate_grouped_by_tag_keys.
- PERCENT: Allocates fixed percentages to specific tags. Requires: allocated_by (array of percentage allocations).
- USAGE_METRIC: Allocates based on usage metrics (implementation varies).
Filter Conditions:
- Use value for single-value conditions: “is”, “is not”, “contains”, “does not contain”, “=”, “!=”, “like”, “not like”, “is all values”, “is untagged”
- Use values for multi-value conditions: “in”, “not in”
- Cannot use both value and values simultaneously.
Supported operators: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like
Sourcepub async fn update_cost_awscur_config(
&self,
cloud_account_id: i64,
body: AwsCURConfigPatchRequest,
) -> Result<AwsCURConfigsResponse, Error<UpdateCostAWSCURConfigError>>
pub async fn update_cost_awscur_config( &self, cloud_account_id: i64, 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, 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: i64,
body: AwsCURConfigPatchRequest,
) -> Result<ResponseContent<AwsCURConfigsResponse>, Error<UpdateCostAWSCURConfigError>>
pub async fn update_cost_awscur_config_with_http_info( &self, cloud_account_id: i64, 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: i64,
body: AzureUCConfigPatchRequest,
) -> Result<AzureUCConfigPairsResponse, Error<UpdateCostAzureUCConfigsError>>
pub async fn update_cost_azure_uc_configs( &self, cloud_account_id: i64, 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(
12 AzureUCConfigPatchData::new(AzureUCConfigPatchRequestType::AZURE_UC_CONFIG_PATCH_REQUEST)
13 .attributes(AzureUCConfigPatchRequestAttributes::new(true)),
14 );
15 let configuration = datadog::Configuration::new();
16 let api = CloudCostManagementAPI::with_config(configuration);
17 let resp = api.update_cost_azure_uc_configs(100, 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_azure_uc_configs_with_http_info(
&self,
cloud_account_id: i64,
body: AzureUCConfigPatchRequest,
) -> Result<ResponseContent<AzureUCConfigPairsResponse>, Error<UpdateCostAzureUCConfigsError>>
pub async fn update_cost_azure_uc_configs_with_http_info( &self, cloud_account_id: i64, 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: i64,
body: GCPUsageCostConfigPatchRequest,
) -> Result<GCPUsageCostConfigResponse, Error<UpdateCostGCPUsageCostConfigError>>
pub async fn update_cost_gcp_usage_cost_config( &self, cloud_account_id: i64, body: GCPUsageCostConfigPatchRequest, ) -> Result<GCPUsageCostConfigResponse, Error<UpdateCostGCPUsageCostConfigError>>
Update the status of an Google Cloud 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.update_cost_gcp_usage_cost_config(100, 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_gcp_usage_cost_config_with_http_info(
&self,
cloud_account_id: i64,
body: GCPUsageCostConfigPatchRequest,
) -> Result<ResponseContent<GCPUsageCostConfigResponse>, Error<UpdateCostGCPUsageCostConfigError>>
pub async fn update_cost_gcp_usage_cost_config_with_http_info( &self, cloud_account_id: i64, body: GCPUsageCostConfigPatchRequest, ) -> Result<ResponseContent<GCPUsageCostConfigResponse>, Error<UpdateCostGCPUsageCostConfigError>>
Update the status of an Google Cloud Usage Cost config (active/archived).
Sourcepub async fn update_ruleset(
&self,
ruleset_id: String,
body: UpdateRulesetRequest,
) -> Result<RulesetResp, Error<UpdateRulesetError>>
pub async fn update_ruleset( &self, ruleset_id: String, body: UpdateRulesetRequest, ) -> Result<RulesetResp, Error<UpdateRulesetError>>
Update a tag pipeline ruleset - Update an existing tag pipeline ruleset with new rules and configuration
Examples found in repository?
12async fn main() {
13 let body = UpdateRulesetRequest::new().data(
14 UpdateRulesetRequestData::new(UpdateRulesetRequestDataType::UPDATE_RULESET).attributes(
15 UpdateRulesetRequestDataAttributes::new(
16 true,
17 vec![UpdateRulesetRequestDataAttributesRulesItems::new(
18 true,
19 "Account Name Mapping".to_string(),
20 )
21 .mapping(Some(
22 UpdateRulesetRequestDataAttributesRulesItemsMapping::new(
23 "team_owner".to_string(),
24 true,
25 vec!["account_name".to_string(), "account_id".to_string()],
26 ),
27 ))
28 .query(None)
29 .reference_table(None)],
30 )
31 .last_version(3601919),
32 ),
33 );
34 let configuration = datadog::Configuration::new();
35 let api = CloudCostManagementAPI::with_config(configuration);
36 let resp = api
37 .update_ruleset("1c5dae14-237d-4b9a-a515-aa55b3939142".to_string(), body)
38 .await;
39 if let Ok(value) = resp {
40 println!("{:#?}", value);
41 } else {
42 println!("{:#?}", resp.unwrap_err());
43 }
44}
Sourcepub async fn update_ruleset_with_http_info(
&self,
ruleset_id: String,
body: UpdateRulesetRequest,
) -> Result<ResponseContent<RulesetResp>, Error<UpdateRulesetError>>
pub async fn update_ruleset_with_http_info( &self, ruleset_id: String, body: UpdateRulesetRequest, ) -> Result<ResponseContent<RulesetResp>, Error<UpdateRulesetError>>
Update a tag pipeline ruleset - Update an existing tag pipeline ruleset with new rules and configuration
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.
Sourcepub async fn validate_query(
&self,
body: RulesValidateQueryRequest,
) -> Result<RulesValidateQueryResponse, Error<ValidateQueryError>>
pub async fn validate_query( &self, body: RulesValidateQueryRequest, ) -> Result<RulesValidateQueryResponse, Error<ValidateQueryError>>
Validate a tag pipeline query - Validate the syntax and structure of a tag pipeline query
Examples found in repository?
10async fn main() {
11 let body = RulesValidateQueryRequest::new().data(
12 RulesValidateQueryRequestData::new(RulesValidateQueryRequestDataType::VALIDATE_QUERY)
13 .attributes(RulesValidateQueryRequestDataAttributes::new(
14 "example:query AND test:true".to_string(),
15 )),
16 );
17 let configuration = datadog::Configuration::new();
18 let api = CloudCostManagementAPI::with_config(configuration);
19 let resp = api.validate_query(body).await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
Sourcepub async fn validate_query_with_http_info(
&self,
body: RulesValidateQueryRequest,
) -> Result<ResponseContent<RulesValidateQueryResponse>, Error<ValidateQueryError>>
pub async fn validate_query_with_http_info( &self, body: RulesValidateQueryRequest, ) -> Result<ResponseContent<RulesValidateQueryResponse>, Error<ValidateQueryError>>
Validate a tag pipeline query - Validate the syntax and structure of a tag pipeline query
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