CloudCostManagementAPI

Struct 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, 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

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v2_cloud-cost-management_ListBudgets.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_budgets().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_cloud-cost-management_ListRulesets.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_rulesets().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_cloud-cost-management_ListCostAWSCURConfigs.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_awscur_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_cloud-cost-management_ListArbitraryCostRules.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_arbitrary_cost_rules().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_cloud-cost-management_ListCostAzureUCConfigs.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_azure_uc_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_cloud-cost-management_DeleteCostAWSCURConfig.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_cost_awscur_config(100).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

Source

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?
examples/v2_cloud-cost-management_CreateArbitraryCostRule.rs (line 61)
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}
Source

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

Source

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?
examples/v2_cloud-cost-management_CreateCostAWSCURConfig.rs (line 25)
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}
Source

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.

Source

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?
examples/v2_cloud-cost-management_CreateCostAzureUCConfigs.rs (line 34)
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}
Source

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.

Source

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?
examples/v2_cloud-cost-management_CreateCostGCPUsageCostConfig.rs (line 28)
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}
Source

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.

Source

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?
examples/v2_cloud-cost-management_CreateRuleset.rs (line 44)
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}
Source

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

Source

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

Examples found in repository?
examples/v2_cloud-cost-management_DeleteArbitraryCostRule.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_arbitrary_cost_rule(123456).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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

Source

pub async fn delete_budget( &self, budget_id: String, ) -> Result<(), Error<DeleteBudgetError>>

Delete a budget.

Examples found in repository?
examples/v2_cloud-cost-management_DeleteBudget.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_budget("budget_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn delete_budget_with_http_info( &self, budget_id: String, ) -> Result<ResponseContent<()>, Error<DeleteBudgetError>>

Delete a budget.

Source

pub async fn delete_cost_awscur_config( &self, cloud_account_id: i64, ) -> Result<(), Error<DeleteCostAWSCURConfigError>>

Archive a Cloud Cost Management Account.

Examples found in repository?
examples/v2_cloud-cost-management_DeleteCostAWSCURConfig.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_cost_awscur_config(100).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

pub async fn delete_cost_azure_uc_config( &self, cloud_account_id: i64, ) -> Result<(), Error<DeleteCostAzureUCConfigError>>

Archive a Cloud Cost Management Account.

Examples found in repository?
examples/v2_cloud-cost-management_DeleteCostAzureUCConfig.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_cost_azure_uc_config(100).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

pub async fn delete_cost_gcp_usage_cost_config( &self, cloud_account_id: i64, ) -> Result<(), Error<DeleteCostGCPUsageCostConfigError>>

Archive a Cloud Cost Management account.

Examples found in repository?
examples/v2_cloud-cost-management_DeleteCostGCPUsageCostConfig.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_cost_gcp_usage_cost_config(100).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

pub async fn delete_custom_costs_file( &self, file_id: String, ) -> Result<(), Error<DeleteCustomCostsFileError>>

Delete the specified Custom Costs file.

Examples found in repository?
examples/v2_cloud-cost-management_DeleteCustomCostsFile.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_custom_costs_file("file_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_cloud-cost-management_DeleteCustomCostsFile_372970393.rs (line 10)
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}
Source

pub async fn delete_custom_costs_file_with_http_info( &self, file_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCustomCostsFileError>>

Delete the specified Custom Costs file.

Source

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?
examples/v2_cloud-cost-management_DeleteRuleset.rs (line 10)
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}
Source

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

Source

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

Examples found in repository?
examples/v2_cloud-cost-management_GetArbitraryCostRule.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.get_arbitrary_cost_rule(123456).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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

Source

pub async fn get_budget( &self, budget_id: String, ) -> Result<BudgetWithEntries, Error<GetBudgetError>>

Get a budget.

Examples found in repository?
examples/v2_cloud-cost-management_GetBudget.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.get_budget("budget_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn get_budget_with_http_info( &self, budget_id: String, ) -> Result<ResponseContent<BudgetWithEntries>, Error<GetBudgetError>>

Get a budget.

Source

pub async fn get_cost_awscur_config( &self, cloud_account_id: i64, ) -> Result<AwsCurConfigResponse, Error<GetCostAWSCURConfigError>>

Get a specific AWS CUR config.

Examples found in repository?
examples/v2_cloud-cost-management_GetCostAWSCURConfig.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.get_cost_awscur_config(123456).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

pub async fn get_cost_azure_uc_config( &self, cloud_account_id: i64, ) -> Result<UCConfigPair, Error<GetCostAzureUCConfigError>>

Get a specific Azure config.

Examples found in repository?
examples/v2_cloud-cost-management_GetCostAzureUCConfig.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.get_cost_azure_uc_config(123456).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

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.

Examples found in repository?
examples/v2_cloud-cost-management_GetCostGCPUsageCostConfig.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.get_cost_gcp_usage_cost_config(123456).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

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?
examples/v2_cloud-cost-management_GetCustomCostsFile.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.get_custom_costs_file("file_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_cloud-cost-management_GetCustomCostsFile_1307381576.rs (line 10)
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}
Source

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.

Source

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?
examples/v2_cloud-cost-management_GetRuleset.rs (line 10)
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}
Source

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

Source

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

Examples found in repository?
examples/v2_cloud-cost-management_ListArbitraryCostRules.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_arbitrary_cost_rules().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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

Source

pub async fn list_budgets(&self) -> Result<BudgetArray, Error<ListBudgetsError>>

List budgets.

Examples found in repository?
examples/v2_cloud-cost-management_ListBudgets.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_budgets().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_budgets_with_http_info( &self, ) -> Result<ResponseContent<BudgetArray>, Error<ListBudgetsError>>

List budgets.

Source

pub async fn list_cost_awscur_configs( &self, ) -> Result<AwsCURConfigsResponse, Error<ListCostAWSCURConfigsError>>

List the AWS CUR configs.

Examples found in repository?
examples/v2_cloud-cost-management_ListCostAWSCURConfigs.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_awscur_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_cost_awscur_configs_with_http_info( &self, ) -> Result<ResponseContent<AwsCURConfigsResponse>, Error<ListCostAWSCURConfigsError>>

List the AWS CUR configs.

Source

pub async fn list_cost_azure_uc_configs( &self, ) -> Result<AzureUCConfigsResponse, Error<ListCostAzureUCConfigsError>>

List the Azure configs.

Examples found in repository?
examples/v2_cloud-cost-management_ListCostAzureUCConfigs.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_azure_uc_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_cost_azure_uc_configs_with_http_info( &self, ) -> Result<ResponseContent<AzureUCConfigsResponse>, Error<ListCostAzureUCConfigsError>>

List the Azure configs.

Source

pub async fn list_cost_gcp_usage_cost_configs( &self, ) -> Result<GCPUsageCostConfigsResponse, Error<ListCostGCPUsageCostConfigsError>>

List the Google Cloud Usage Cost configs.

Examples found in repository?
examples/v2_cloud-cost-management_ListCostGCPUsageCostConfigs.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_gcp_usage_cost_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

pub async fn list_custom_costs_files( &self, params: ListCustomCostsFilesOptionalParams, ) -> Result<CustomCostsFileListResponse, Error<ListCustomCostsFilesError>>

List the Custom Costs files.

Examples found in repository?
examples/v2_cloud-cost-management_ListCustomCostsFiles.rs (line 11)
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
Hide additional examples
examples/v2_cloud-cost-management_ListCustomCostsFiles_1968771127.rs (line 11)
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}
Source

pub async fn list_custom_costs_files_with_http_info( &self, params: ListCustomCostsFilesOptionalParams, ) -> Result<ResponseContent<CustomCostsFileListResponse>, Error<ListCustomCostsFilesError>>

List the Custom Costs files.

Source

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

Examples found in repository?
examples/v2_cloud-cost-management_ListRulesets.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_rulesets().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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

Source

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?
examples/v2_cloud-cost-management_ReorderArbitraryCostRules.rs (line 20)
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}
Source

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”}]

Source

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?
examples/v2_cloud-cost-management_ReorderRulesets.rs (line 15)
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}
Source

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

Source

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?
examples/v2_cloud-cost-management_UpdateArbitraryCostRule.rs (line 61)
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}
Source

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

Source

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?
examples/v2_cloud-cost-management_UpdateCostAWSCURConfig.rs (line 17)
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}
Source

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.

Source

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?
examples/v2_cloud-cost-management_UpdateCostAzureUCConfigs.rs (line 17)
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}
Source

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).

Source

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?
examples/v2_cloud-cost-management_UpdateCostGCPUsageCostConfig.rs (line 17)
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}
Source

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).

Source

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?
examples/v2_cloud-cost-management_UpdateRuleset.rs (line 37)
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}
Source

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

Source

pub async fn upload_custom_costs_file( &self, body: Vec<CustomCostsFileLineItem>, ) -> Result<CustomCostsFileUploadResponse, Error<UploadCustomCostsFileError>>

Upload a Custom Costs file.

Examples found in repository?
examples/v2_cloud-cost-management_UploadCustomCostsFile.rs (line 16)
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
Hide additional examples
examples/v2_cloud-cost-management_UploadCustomCostsFile_4125168396.rs (line 19)
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}
Source

pub async fn upload_custom_costs_file_with_http_info( &self, body: Vec<CustomCostsFileLineItem>, ) -> Result<ResponseContent<CustomCostsFileUploadResponse>, Error<UploadCustomCostsFileError>>

Upload a Custom Costs file.

Source

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?
examples/v2_cloud-cost-management_UpsertBudget.rs (line 37)
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}
Source

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.

Source

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?
examples/v2_cloud-cost-management_ValidateQuery.rs (line 19)
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}
Source

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

Source§

fn clone(&self) -> CloudCostManagementAPI

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CloudCostManagementAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CloudCostManagementAPI

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,