pub struct Client { /* private fields */ }
Expand description
Client for AWS Cost Explorer Service
Client for invoking operations on AWS Cost Explorer Service. Each operation on AWS Cost Explorer Service is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_costexplorer::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Builder
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_costexplorer::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateCostCategoryDefinition
operation has
a Client::create_cost_category_definition
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_cost_category_definition()
.name("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
Source§impl Client
impl Client
Sourcepub fn create_anomaly_monitor(&self) -> CreateAnomalyMonitorFluentBuilder
pub fn create_anomaly_monitor(&self) -> CreateAnomalyMonitorFluentBuilder
Constructs a fluent builder for the CreateAnomalyMonitor
operation.
- The fluent builder is configurable:
anomaly_monitor(AnomalyMonitor)
/set_anomaly_monitor(Option<AnomalyMonitor>)
:
required: trueThe cost anomaly detection monitor object that you want to create.
resource_tags(ResourceTag)
/set_resource_tags(Option<Vec::<ResourceTag>>)
:
required: falseAn optional list of tags to associate with the specified
AnomalyMonitor
. You can use resource tags to control access to yourmonitor
using IAM policies.Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags:
-
Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for Amazon Web Services use
-
The maximum length of a key is 128 characters
-
The maximum length of a value is 256 characters
-
Keys and values can only contain alphanumeric characters, spaces, and any of the following:
_.:/=+@-
-
Keys and values are case sensitive
-
Keys and values are trimmed for any leading or trailing whitespaces
-
Don’t use
aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
-
- On success, responds with
CreateAnomalyMonitorOutput
with field(s):monitor_arn(String)
:The unique identifier of your newly created cost anomaly detection monitor.
- On failure, responds with
SdkError<CreateAnomalyMonitorError>
Source§impl Client
impl Client
Sourcepub fn create_anomaly_subscription(
&self,
) -> CreateAnomalySubscriptionFluentBuilder
pub fn create_anomaly_subscription( &self, ) -> CreateAnomalySubscriptionFluentBuilder
Constructs a fluent builder for the CreateAnomalySubscription
operation.
- The fluent builder is configurable:
anomaly_subscription(AnomalySubscription)
/set_anomaly_subscription(Option<AnomalySubscription>)
:
required: trueThe cost anomaly subscription object that you want to create.
resource_tags(ResourceTag)
/set_resource_tags(Option<Vec::<ResourceTag>>)
:
required: falseAn optional list of tags to associate with the specified
AnomalySubscription
. You can use resource tags to control access to yoursubscription
using IAM policies.Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags:
-
Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for Amazon Web Services use
-
The maximum length of a key is 128 characters
-
The maximum length of a value is 256 characters
-
Keys and values can only contain alphanumeric characters, spaces, and any of the following:
_.:/=+@-
-
Keys and values are case sensitive
-
Keys and values are trimmed for any leading or trailing whitespaces
-
Don’t use
aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
-
- On success, responds with
CreateAnomalySubscriptionOutput
with field(s):subscription_arn(String)
:The unique identifier of your newly created cost anomaly subscription.
- On failure, responds with
SdkError<CreateAnomalySubscriptionError>
Source§impl Client
impl Client
Sourcepub fn create_cost_category_definition(
&self,
) -> CreateCostCategoryDefinitionFluentBuilder
pub fn create_cost_category_definition( &self, ) -> CreateCostCategoryDefinitionFluentBuilder
Constructs a fluent builder for the CreateCostCategoryDefinition
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe unique name of the Cost Category.
effective_start(impl Into<String>)
/set_effective_start(Option<String>)
:
required: falseThe Cost Category’s effective start date. It can only be a billing start date (first day of the month). If the date isn’t provided, it’s the first day of the current month. Dates can’t be before the previous twelve months, or in the future.
rule_version(CostCategoryRuleVersion)
/set_rule_version(Option<CostCategoryRuleVersion>)
:
required: trueThe rule schema version in this particular Cost Category.
rules(CostCategoryRule)
/set_rules(Option<Vec::<CostCategoryRule>>)
:
required: trueThe Cost Category rules used to categorize costs. For more information, see CostCategoryRule.
default_value(impl Into<String>)
/set_default_value(Option<String>)
:
required: falseThe default value for the cost category.
split_charge_rules(CostCategorySplitChargeRule)
/set_split_charge_rules(Option<Vec::<CostCategorySplitChargeRule>>)
:
required: falseThe split charge rules used to allocate your charges between your Cost Category values.
resource_tags(ResourceTag)
/set_resource_tags(Option<Vec::<ResourceTag>>)
:
required: falseAn optional list of tags to associate with the specified
CostCategory
. You can use resource tags to control access to yourcost category
using IAM policies.Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags:
-
Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for Amazon Web Services use
-
The maximum length of a key is 128 characters
-
The maximum length of a value is 256 characters
-
Keys and values can only contain alphanumeric characters, spaces, and any of the following:
_.:/=+@-
-
Keys and values are case sensitive
-
Keys and values are trimmed for any leading or trailing whitespaces
-
Don’t use
aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
-
- On success, responds with
CreateCostCategoryDefinitionOutput
with field(s):cost_category_arn(Option<String>)
:The unique identifier for your newly created Cost Category.
effective_start(Option<String>)
:The Cost Category’s effective start date. It can only be a billing start date (first day of the month).
- On failure, responds with
SdkError<CreateCostCategoryDefinitionError>
Source§impl Client
impl Client
Sourcepub fn delete_anomaly_monitor(&self) -> DeleteAnomalyMonitorFluentBuilder
pub fn delete_anomaly_monitor(&self) -> DeleteAnomalyMonitorFluentBuilder
Constructs a fluent builder for the DeleteAnomalyMonitor
operation.
- The fluent builder is configurable:
monitor_arn(impl Into<String>)
/set_monitor_arn(Option<String>)
:
required: trueThe unique identifier of the cost anomaly monitor that you want to delete.
- On success, responds with
DeleteAnomalyMonitorOutput
- On failure, responds with
SdkError<DeleteAnomalyMonitorError>
Source§impl Client
impl Client
Sourcepub fn delete_anomaly_subscription(
&self,
) -> DeleteAnomalySubscriptionFluentBuilder
pub fn delete_anomaly_subscription( &self, ) -> DeleteAnomalySubscriptionFluentBuilder
Constructs a fluent builder for the DeleteAnomalySubscription
operation.
- The fluent builder is configurable:
subscription_arn(impl Into<String>)
/set_subscription_arn(Option<String>)
:
required: trueThe unique identifier of the cost anomaly subscription that you want to delete.
- On success, responds with
DeleteAnomalySubscriptionOutput
- On failure, responds with
SdkError<DeleteAnomalySubscriptionError>
Source§impl Client
impl Client
Sourcepub fn delete_cost_category_definition(
&self,
) -> DeleteCostCategoryDefinitionFluentBuilder
pub fn delete_cost_category_definition( &self, ) -> DeleteCostCategoryDefinitionFluentBuilder
Constructs a fluent builder for the DeleteCostCategoryDefinition
operation.
- The fluent builder is configurable:
cost_category_arn(impl Into<String>)
/set_cost_category_arn(Option<String>)
:
required: trueThe unique identifier for your Cost Category.
- On success, responds with
DeleteCostCategoryDefinitionOutput
with field(s):cost_category_arn(Option<String>)
:The unique identifier for your Cost Category.
effective_end(Option<String>)
:The effective end date of the Cost Category as a result of deleting it. No costs after this date is categorized by the deleted Cost Category.
- On failure, responds with
SdkError<DeleteCostCategoryDefinitionError>
Source§impl Client
impl Client
Sourcepub fn describe_cost_category_definition(
&self,
) -> DescribeCostCategoryDefinitionFluentBuilder
pub fn describe_cost_category_definition( &self, ) -> DescribeCostCategoryDefinitionFluentBuilder
Constructs a fluent builder for the DescribeCostCategoryDefinition
operation.
- The fluent builder is configurable:
cost_category_arn(impl Into<String>)
/set_cost_category_arn(Option<String>)
:
required: trueThe unique identifier for your Cost Category.
effective_on(impl Into<String>)
/set_effective_on(Option<String>)
:
required: falseThe date when the Cost Category was effective.
- On success, responds with
DescribeCostCategoryDefinitionOutput
with field(s):cost_category(Option<CostCategory>)
:The structure of Cost Categories. This includes detailed metadata and the set of rules for the
CostCategory
object.
- On failure, responds with
SdkError<DescribeCostCategoryDefinitionError>
Source§impl Client
impl Client
Sourcepub fn get_anomalies(&self) -> GetAnomaliesFluentBuilder
pub fn get_anomalies(&self) -> GetAnomaliesFluentBuilder
Constructs a fluent builder for the GetAnomalies
operation.
- The fluent builder is configurable:
monitor_arn(impl Into<String>)
/set_monitor_arn(Option<String>)
:
required: falseRetrieves all of the cost anomalies detected for a specific cost anomaly monitor Amazon Resource Name (ARN).
date_interval(AnomalyDateInterval)
/set_date_interval(Option<AnomalyDateInterval>)
:
required: trueAssigns the start and end dates for retrieving cost anomalies. The returned anomaly object will have an
AnomalyEndDate
in the specified time range.feedback(AnomalyFeedbackType)
/set_feedback(Option<AnomalyFeedbackType>)
:
required: falseFilters anomaly results by the feedback field on the anomaly object.
total_impact(TotalImpactFilter)
/set_total_impact(Option<TotalImpactFilter>)
:
required: falseFilters anomaly results by the total impact field on the anomaly object. For example, you can filter anomalies
GREATER_THAN 200.00
to retrieve anomalies, with an estimated dollar impact greater than 200.next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe number of entries a paginated response contains.
- On success, responds with
GetAnomaliesOutput
with field(s):anomalies(Vec::<Anomaly>)
:A list of cost anomalies.
next_page_token(Option<String>)
:The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<GetAnomaliesError>
Source§impl Client
impl Client
Sourcepub fn get_anomaly_monitors(&self) -> GetAnomalyMonitorsFluentBuilder
pub fn get_anomaly_monitors(&self) -> GetAnomalyMonitorsFluentBuilder
Constructs a fluent builder for the GetAnomalyMonitors
operation.
- The fluent builder is configurable:
monitor_arn_list(impl Into<String>)
/set_monitor_arn_list(Option<Vec::<String>>)
:
required: falseA list of cost anomaly monitor ARNs.
next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe number of entries that a paginated response contains.
- On success, responds with
GetAnomalyMonitorsOutput
with field(s):anomaly_monitors(Vec::<AnomalyMonitor>)
:A list of cost anomaly monitors that includes the detailed metadata for each monitor.
next_page_token(Option<String>)
:The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<GetAnomalyMonitorsError>
Source§impl Client
impl Client
Sourcepub fn get_anomaly_subscriptions(&self) -> GetAnomalySubscriptionsFluentBuilder
pub fn get_anomaly_subscriptions(&self) -> GetAnomalySubscriptionsFluentBuilder
Constructs a fluent builder for the GetAnomalySubscriptions
operation.
- The fluent builder is configurable:
subscription_arn_list(impl Into<String>)
/set_subscription_arn_list(Option<Vec::<String>>)
:
required: falseA list of cost anomaly subscription ARNs.
monitor_arn(impl Into<String>)
/set_monitor_arn(Option<String>)
:
required: falseCost anomaly monitor ARNs.
next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe number of entries a paginated response contains.
- On success, responds with
GetAnomalySubscriptionsOutput
with field(s):anomaly_subscriptions(Vec::<AnomalySubscription>)
:A list of cost anomaly subscriptions that includes the detailed metadata for each one.
next_page_token(Option<String>)
:The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<GetAnomalySubscriptionsError>
Source§impl Client
impl Client
Sourcepub fn get_approximate_usage_records(
&self,
) -> GetApproximateUsageRecordsFluentBuilder
pub fn get_approximate_usage_records( &self, ) -> GetApproximateUsageRecordsFluentBuilder
Constructs a fluent builder for the GetApproximateUsageRecords
operation.
- The fluent builder is configurable:
granularity(Granularity)
/set_granularity(Option<Granularity>)
:
required: trueHow granular you want the data to be. You can enable data at hourly or daily granularity.
services(impl Into<String>)
/set_services(Option<Vec::<String>>)
:
required: falseThe service metadata for the service or services you want to query. If not specified, all elements are returned.
approximation_dimension(ApproximationDimension)
/set_approximation_dimension(Option<ApproximationDimension>)
:
required: trueThe service to evaluate for the usage records. You can choose resource-level data at daily granularity, or hourly granularity with or without resource-level data.
- On success, responds with
GetApproximateUsageRecordsOutput
with field(s):services(Option<HashMap::<String, i64>>)
:The service metadata for the service or services in the response.
total_records(i64)
:The total number of usage records for all services in the services list.
lookback_period(Option<DateInterval>)
:The lookback period that’s used for the estimation.
- On failure, responds with
SdkError<GetApproximateUsageRecordsError>
Source§impl Client
impl Client
Sourcepub fn get_commitment_purchase_analysis(
&self,
) -> GetCommitmentPurchaseAnalysisFluentBuilder
pub fn get_commitment_purchase_analysis( &self, ) -> GetCommitmentPurchaseAnalysisFluentBuilder
Constructs a fluent builder for the GetCommitmentPurchaseAnalysis
operation.
- The fluent builder is configurable:
analysis_id(impl Into<String>)
/set_analysis_id(Option<String>)
:
required: trueThe analysis ID that’s associated with the commitment purchase analysis.
- On success, responds with
GetCommitmentPurchaseAnalysisOutput
with field(s):estimated_completion_time(String)
:The estimated time for when the analysis will complete.
analysis_completion_time(Option<String>)
:The completion time of the analysis.
analysis_started_time(String)
:The start time of the analysis.
analysis_id(String)
:The analysis ID that’s associated with the commitment purchase analysis.
analysis_status(AnalysisStatus)
:The status of the analysis.
error_code(Option<ErrorCode>)
:The error code used for the analysis.
analysis_details(Option<AnalysisDetails>)
:Details about the analysis.
commitment_purchase_analysis_configuration(Option<CommitmentPurchaseAnalysisConfiguration>)
:The configuration for the commitment purchase analysis.
- On failure, responds with
SdkError<GetCommitmentPurchaseAnalysisError>
Source§impl Client
impl Client
Sourcepub fn get_cost_and_usage(&self) -> GetCostAndUsageFluentBuilder
pub fn get_cost_and_usage(&self) -> GetCostAndUsageFluentBuilder
Constructs a fluent builder for the GetCostAndUsage
operation.
- The fluent builder is configurable:
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueSets the start date and end date for retrieving Amazon Web Services costs. The start date is inclusive, but the end date is exclusive. For example, if
start
is2017-01-01
andend
is2017-05-01
, then the cost and usage data is retrieved from2017-01-01
up to and including2017-04-30
but not including2017-05-01
.granularity(Granularity)
/set_granularity(Option<Granularity>)
:
required: trueSets the Amazon Web Services cost granularity to
MONTHLY
orDAILY
, orHOURLY
. IfGranularity
isn’t set, the response object doesn’t include theGranularity
, eitherMONTHLY
orDAILY
, orHOURLY
.filter(Expression)
/set_filter(Option<Expression>)
:
required: falseFilters Amazon Web Services costs by different dimensions. For example, you can specify
SERVICE
andLINKED_ACCOUNT
and get the costs that are associated with that account’s usage of that service. You can nestExpression
objects to define any combination of dimension filters. For more information, see Expression.Valid values for
MatchOptions
forDimensions
areEQUALS
andCASE_SENSITIVE
.Valid values for
MatchOptions
forCostCategories
andTags
areEQUALS
,ABSENT
, andCASE_SENSITIVE
. Default values areEQUALS
andCASE_SENSITIVE
.metrics(impl Into<String>)
/set_metrics(Option<Vec::<String>>)
:
required: trueWhich metrics are returned in the query. For more information about blended and unblended rates, see Why does the “blended” annotation appear on some line items in my bill?.
Valid values are
AmortizedCost
,BlendedCost
,NetAmortizedCost
,NetUnblendedCost
,NormalizedUsageAmount
,UnblendedCost
, andUsageQuantity
.If you return the
UsageQuantity
metric, the service aggregates all usage numbers without taking into account the units. For example, if you aggregateusageQuantity
across all of Amazon EC2, the results aren’t meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for example, hours and GB). To get more meaningfulUsageQuantity
metrics, filter byUsageType
orUsageTypeGroups
.Metrics
is required forGetCostAndUsage
requests.group_by(GroupDefinition)
/set_group_by(Option<Vec::<GroupDefinition>>)
:
required: falseYou can group Amazon Web Services costs using up to two different groups, either dimensions, tag keys, cost categories, or any two group by types.
Valid values for the
DIMENSION
type areAZ
,INSTANCE_TYPE
,LEGAL_ENTITY_NAME
,INVOICING_ENTITY
,LINKED_ACCOUNT
,OPERATION
,PLATFORM
,PURCHASE_TYPE
,SERVICE
,TENANCY
,RECORD_TYPE
, andUSAGE_TYPE
.When you group by the
TAG
type and include a valid tag key, you get all tag values, including empty strings.billing_view_arn(impl Into<String>)
/set_billing_view_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.
next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On success, responds with
GetCostAndUsageOutput
with field(s):next_page_token(Option<String>)
:The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
group_definitions(Option<Vec::<GroupDefinition>>)
:The groups that are specified by the
Filter
orGroupBy
parameters in the request.results_by_time(Option<Vec::<ResultByTime>>)
:The time period that’s covered by the results in the response.
dimension_value_attributes(Option<Vec::<DimensionValuesWithAttributes>>)
:The attributes that apply to a specific dimension value. For example, if the value is a linked account, the attribute is that account name.
- On failure, responds with
SdkError<GetCostAndUsageError>
Source§impl Client
impl Client
Sourcepub fn get_cost_and_usage_with_resources(
&self,
) -> GetCostAndUsageWithResourcesFluentBuilder
pub fn get_cost_and_usage_with_resources( &self, ) -> GetCostAndUsageWithResourcesFluentBuilder
Constructs a fluent builder for the GetCostAndUsageWithResources
operation.
- The fluent builder is configurable:
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueSets the start and end dates for retrieving Amazon Web Services costs. The range must be within the last 14 days (the start date cannot be earlier than 14 days ago). The start date is inclusive, but the end date is exclusive. For example, if
start
is2017-01-01
andend
is2017-05-01
, then the cost and usage data is retrieved from2017-01-01
up to and including2017-04-30
but not including2017-05-01
.granularity(Granularity)
/set_granularity(Option<Granularity>)
:
required: trueSets the Amazon Web Services cost granularity to
MONTHLY
,DAILY
, orHOURLY
. IfGranularity
isn’t set, the response object doesn’t include theGranularity
,MONTHLY
,DAILY
, orHOURLY
.filter(Expression)
/set_filter(Option<Expression>)
:
required: trueFilters Amazon Web Services costs by different dimensions. For example, you can specify
SERVICE
andLINKED_ACCOUNT
and get the costs that are associated with that account’s usage of that service. You can nestExpression
objects to define any combination of dimension filters. For more information, see Expression.The
GetCostAndUsageWithResources
operation requires that you either group by or filter by aResourceId
. It requires the Expression“SERVICE = Amazon Elastic Compute Cloud - Compute”
in the filter.Valid values for
MatchOptions
forDimensions
areEQUALS
andCASE_SENSITIVE
.Valid values for
MatchOptions
forCostCategories
andTags
areEQUALS
,ABSENT
, andCASE_SENSITIVE
. Default values areEQUALS
andCASE_SENSITIVE
.metrics(impl Into<String>)
/set_metrics(Option<Vec::<String>>)
:
required: falseWhich metrics are returned in the query. For more information about blended and unblended rates, see Why does the “blended” annotation appear on some line items in my bill?.
Valid values are
AmortizedCost
,BlendedCost
,NetAmortizedCost
,NetUnblendedCost
,NormalizedUsageAmount
,UnblendedCost
, andUsageQuantity
.If you return the
UsageQuantity
metric, the service aggregates all usage numbers without taking the units into account. For example, if you aggregateusageQuantity
across all of Amazon EC2, the results aren’t meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for example, hour or GB). To get more meaningfulUsageQuantity
metrics, filter byUsageType
orUsageTypeGroups
.Metrics
is required forGetCostAndUsageWithResources
requests.group_by(GroupDefinition)
/set_group_by(Option<Vec::<GroupDefinition>>)
:
required: falseYou can group Amazon Web Services costs using up to two different groups:
DIMENSION
,TAG
,COST_CATEGORY
.billing_view_arn(impl Into<String>)
/set_billing_view_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.
next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On success, responds with
GetCostAndUsageWithResourcesOutput
with field(s):next_page_token(Option<String>)
:The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
group_definitions(Option<Vec::<GroupDefinition>>)
:The groups that are specified by the
Filter
orGroupBy
parameters in the request.results_by_time(Option<Vec::<ResultByTime>>)
:The time period that’s covered by the results in the response.
dimension_value_attributes(Option<Vec::<DimensionValuesWithAttributes>>)
:The attributes that apply to a specific dimension value. For example, if the value is a linked account, the attribute is that account name.
- On failure, responds with
SdkError<GetCostAndUsageWithResourcesError>
Source§impl Client
impl Client
Sourcepub fn get_cost_categories(&self) -> GetCostCategoriesFluentBuilder
pub fn get_cost_categories(&self) -> GetCostCategoriesFluentBuilder
Constructs a fluent builder for the GetCostCategories
operation.
- The fluent builder is configurable:
search_string(impl Into<String>)
/set_search_string(Option<String>)
:
required: falseThe value that you want to search the filter values for.
If you don’t specify a
CostCategoryName
,SearchString
is used to filter Cost Category names that match theSearchString
pattern. If you specify aCostCategoryName
,SearchString
is used to filter Cost Category values that match theSearchString
pattern.time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueThe time period of the request.
cost_category_name(impl Into<String>)
/set_cost_category_name(Option<String>)
:
required: falseThe unique name of the Cost Category.
filter(Expression)
/set_filter(Option<Expression>)
:
required: falseUse
Expression
to filter in various Cost Explorer APIs.Not all
Expression
types are supported in each API. Refer to the documentation for each specific API to see what is supported.There are two patterns:
-
Simple dimension values.
-
There are three types of simple dimension values:
CostCategories
,Tags
, andDimensions
.-
Specify the
CostCategories
field to define a filter that acts on Cost Categories. -
Specify the
Tags
field to define a filter that acts on Cost Allocation Tags. -
Specify the
Dimensions
field to define a filter that acts on theDimensionValues
.
-
-
For each filter type, you can set the dimension name and values for the filters that you plan to use.
-
For example, you can filter for
REGION==us-east-1 OR REGION==us-west-1
. ForGetRightsizingRecommendation
, the Region is a full name (for example,REGION==US East (N. Virginia)
. -
The corresponding
Expression
for this example is as follows:{ “Dimensions”: { “Key”: “REGION”, “Values”: [ “us-east-1”, “us-west-1” ] } }
-
As shown in the previous example, lists of dimension values are combined with
OR
when applying the filter.
-
-
You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
-
For example, you can filter for linked account names that start with “a”.
-
The corresponding
Expression
for this example is as follows:{ “Dimensions”: { “Key”: “LINKED_ACCOUNT_NAME”, “MatchOptions”: [ “STARTS_WITH” ], “Values”: [ “a” ] } }
-
-
-
Compound
Expression
types with logical operations.-
You can use multiple
Expression
types and the logical operatorsAND/OR/NOT
to create a list of one or moreExpression
objects. By doing this, you can filter by more advanced options. -
For example, you can filter by
((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)
. -
The corresponding
Expression
for this example is as follows:{ “And”: [ {“Or”: [ {“Dimensions”: { “Key”: “REGION”, “Values”: [ “us-east-1”, “us-west-1” ] }}, {“Tags”: { “Key”: “TagName”, “Values”: [“Value1”] } } ]}, {“Not”: {“Dimensions”: { “Key”: “USAGE_TYPE”, “Values”: [“DataTransfer”] }}} ] }
Because each
Expression
can have only one operator, the service returns an error if more than one is specified. The following example shows anExpression
object that creates an error:{ “And”: [ … ], “Dimensions”: { “Key”: “USAGE_TYPE”, “Values”: [ “DataTransfer” ] } }
The following is an example of the corresponding error message:
“Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories”
-
For the
GetRightsizingRecommendation
action, a combination of OR and NOT isn’t supported. OR isn’t supported between different dimensions, or dimensions and tags. NOT operators aren’t supported. Dimensions are also limited toLINKED_ACCOUNT
,REGION
, orRIGHTSIZING_TYPE
.For the
GetReservationPurchaseRecommendation
action, only NOT is supported. AND and OR aren’t supported. Dimensions are limited toLINKED_ACCOUNT
.-
sort_by(SortDefinition)
/set_sort_by(Option<Vec::<SortDefinition>>)
:
required: falseThe value that you sort the data by.
The key represents the cost and usage metrics. The following values are supported:
-
BlendedCost
-
UnblendedCost
-
AmortizedCost
-
NetAmortizedCost
-
NetUnblendedCost
-
UsageQuantity
-
NormalizedUsageAmount
The supported key values for the
SortOrder
value areASCENDING
andDESCENDING
.When you use the
SortBy
value, theNextPageToken
andSearchString
key values aren’t supported.-
billing_view_arn(impl Into<String>)
/set_billing_view_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThis field is only used when the
SortBy
value is provided in the request.The maximum number of objects that are returned for this request. If
MaxResults
isn’t specified with theSortBy
value, the request returns 1000 results as the default value for this parameter.For
GetCostCategories
, MaxResults has an upper quota of 1000.next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseIf the number of objects that are still available for retrieval exceeds the quota, Amazon Web Services returns a NextPageToken value in the response. To retrieve the next batch of objects, provide the NextPageToken from the previous call in your next request.
- On success, responds with
GetCostCategoriesOutput
with field(s):next_page_token(Option<String>)
:If the number of objects that are still available for retrieval exceeds the quota, Amazon Web Services returns a NextPageToken value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request.
cost_category_names(Option<Vec::<String>>)
:The names of the Cost Categories.
cost_category_values(Option<Vec::<String>>)
:The Cost Category values.
If the
CostCategoryName
key isn’t specified in the request, theCostCategoryValues
fields aren’t returned.return_size(i32)
:The number of objects that are returned.
total_size(i32)
:The total number of objects.
- On failure, responds with
SdkError<GetCostCategoriesError>
Source§impl Client
impl Client
Sourcepub fn get_cost_forecast(&self) -> GetCostForecastFluentBuilder
pub fn get_cost_forecast(&self) -> GetCostForecastFluentBuilder
Constructs a fluent builder for the GetCostForecast
operation.
- The fluent builder is configurable:
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueThe period of time that you want the forecast to cover. The start date must be equal to or no later than the current date to avoid a validation error.
metric(Metric)
/set_metric(Option<Metric>)
:
required: trueWhich metric Cost Explorer uses to create your forecast. For more information about blended and unblended rates, see Why does the “blended” annotation appear on some line items in my bill?.
Valid values for a
GetCostForecast
call are the following:-
AMORTIZED_COST
-
BLENDED_COST
-
NET_AMORTIZED_COST
-
NET_UNBLENDED_COST
-
UNBLENDED_COST
-
granularity(Granularity)
/set_granularity(Option<Granularity>)
:
required: trueHow granular you want the forecast to be. You can get 3 months of
DAILY
forecasts or 12 months ofMONTHLY
forecasts.The
GetCostForecast
operation supports onlyDAILY
andMONTHLY
granularities.filter(Expression)
/set_filter(Option<Expression>)
:
required: falseThe filters that you want to use to filter your forecast. The
GetCostForecast
API supports filtering by the following dimensions:-
AZ
-
INSTANCE_TYPE
-
LINKED_ACCOUNT
-
LINKED_ACCOUNT_NAME
-
OPERATION
-
PURCHASE_TYPE
-
REGION
-
SERVICE
-
USAGE_TYPE
-
USAGE_TYPE_GROUP
-
RECORD_TYPE
-
OPERATING_SYSTEM
-
TENANCY
-
SCOPE
-
PLATFORM
-
SUBSCRIPTION_ID
-
LEGAL_ENTITY_NAME
-
DEPLOYMENT_OPTION
-
DATABASE_ENGINE
-
INSTANCE_TYPE_FAMILY
-
BILLING_ENTITY
-
RESERVATION_ID
-
SAVINGS_PLAN_ARN
-
billing_view_arn(impl Into<String>)
/set_billing_view_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.
prediction_interval_level(i32)
/set_prediction_interval_level(Option<i32>)
:
required: falseCost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals.
- On success, responds with
GetCostForecastOutput
with field(s):total(Option<MetricValue>)
:How much you are forecasted to spend over the forecast period, in
USD
.forecast_results_by_time(Option<Vec::<ForecastResult>>)
:The forecasts for your query, in order. For
DAILY
forecasts, this is a list of days. ForMONTHLY
forecasts, this is a list of months.
- On failure, responds with
SdkError<GetCostForecastError>
Source§impl Client
impl Client
Sourcepub fn get_dimension_values(&self) -> GetDimensionValuesFluentBuilder
pub fn get_dimension_values(&self) -> GetDimensionValuesFluentBuilder
Constructs a fluent builder for the GetDimensionValues
operation.
- The fluent builder is configurable:
search_string(impl Into<String>)
/set_search_string(Option<String>)
:
required: falseThe value that you want to search the filter values for.
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueThe start date and end date for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if
start
is2017-01-01
andend
is2017-05-01
, then the cost and usage data is retrieved from2017-01-01
up to and including2017-04-30
but not including2017-05-01
.dimension(Dimension)
/set_dimension(Option<Dimension>)
:
required: trueThe name of the dimension. Each
Dimension
is available for a differentContext
. For more information, seeContext
.LINK_ACCOUNT_NAME
andSERVICE_CODE
can only be used in CostCategoryRule.context(Context)
/set_context(Option<Context>)
:
required: falseThe context for the call to
GetDimensionValues
. This can beRESERVATIONS
orCOST_AND_USAGE
. The default value isCOST_AND_USAGE
. If the context is set toRESERVATIONS
, the resulting dimension values can be used in theGetReservationUtilization
operation. If the context is set toCOST_AND_USAGE
, the resulting dimension values can be used in theGetCostAndUsage
operation.If you set the context to
COST_AND_USAGE
, you can use the following dimensions for searching:-
AZ - The Availability Zone. An example is
us-east-1a
. -
BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:
- Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services services.
- AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that’s an acting reseller for Amazon Web Services services in India.
- Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.
-
CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
-
DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are
SingleAZ
andMultiAZ
. -
DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.
-
INSTANCE_TYPE - The type of Amazon EC2 instance. An example is
m4.xlarge
. -
INSTANCE_TYPE_FAMILY - A family of instance types optimized to fit different use cases. Examples are
Compute Optimized
(for example,C4
,C5
,C6g
, andC7g
),Memory Optimization
(for example,R4
,R5n
,R5b
, andR6g
). -
INVOICING_ENTITY - The name of the entity that issues the Amazon Web Services invoice.
-
LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web Services services, such as Amazon Web Services.
-
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
OPERATING_SYSTEM - The operating system. Examples are Windows or Linux.
-
OPERATION - The action performed. Examples include
RunInstance
andCreateBucket
. -
PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
-
PURCHASE_TYPE - The reservation type of the purchase that this usage is related to. Examples include On-Demand Instances and Standard Reserved Instances.
-
RESERVATION_ID - The unique identifier for an Amazon Web Services Reservation Instance.
-
SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.
-
SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute).
-
SERVICE - The Amazon Web Services service such as Amazon DynamoDB.
-
TENANCY - The tenancy of a resource. Examples are shared or dedicated.
-
USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the
GetDimensionValues
operation includes a unit attribute. Examples include GB and Hrs. -
USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.
-
REGION - The Amazon Web Services Region.
-
RECORD_TYPE - The different types of charges such as Reserved Instance (RI) fees, usage costs, tax refunds, and credits.
-
RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service.
If you set the context to
RESERVATIONS
, you can use the following dimensions for searching:-
AZ - The Availability Zone. An example is
us-east-1a
. -
CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
-
DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are
SingleAZ
andMultiAZ
. -
INSTANCE_TYPE - The type of Amazon EC2 instance. An example is
m4.xlarge
. -
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
-
REGION - The Amazon Web Services Region.
-
SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.
-
TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).
-
TENANCY - The tenancy of a resource. Examples are shared or dedicated.
If you set the context to
SAVINGS_PLANS
, you can use the following dimensions for searching:-
SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute)
-
PAYMENT_OPTION - The payment option for the given Savings Plans (for example, All Upfront)
-
REGION - The Amazon Web Services Region.
-
INSTANCE_TYPE_FAMILY - The family of instances (For example,
m5
) -
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.
-
filter(Expression)
/set_filter(Option<Expression>)
:
required: falseUse
Expression
to filter in various Cost Explorer APIs.Not all
Expression
types are supported in each API. Refer to the documentation for each specific API to see what is supported.There are two patterns:
-
Simple dimension values.
-
There are three types of simple dimension values:
CostCategories
,Tags
, andDimensions
.-
Specify the
CostCategories
field to define a filter that acts on Cost Categories. -
Specify the
Tags
field to define a filter that acts on Cost Allocation Tags. -
Specify the
Dimensions
field to define a filter that acts on theDimensionValues
.
-
-
For each filter type, you can set the dimension name and values for the filters that you plan to use.
-
For example, you can filter for
REGION==us-east-1 OR REGION==us-west-1
. ForGetRightsizingRecommendation
, the Region is a full name (for example,REGION==US East (N. Virginia)
. -
The corresponding
Expression
for this example is as follows:{ “Dimensions”: { “Key”: “REGION”, “Values”: [ “us-east-1”, “us-west-1” ] } }
-
As shown in the previous example, lists of dimension values are combined with
OR
when applying the filter.
-
-
You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
-
For example, you can filter for linked account names that start with “a”.
-
The corresponding
Expression
for this example is as follows:{ “Dimensions”: { “Key”: “LINKED_ACCOUNT_NAME”, “MatchOptions”: [ “STARTS_WITH” ], “Values”: [ “a” ] } }
-
-
-
Compound
Expression
types with logical operations.-
You can use multiple
Expression
types and the logical operatorsAND/OR/NOT
to create a list of one or moreExpression
objects. By doing this, you can filter by more advanced options. -
For example, you can filter by
((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)
. -
The corresponding
Expression
for this example is as follows:{ “And”: [ {“Or”: [ {“Dimensions”: { “Key”: “REGION”, “Values”: [ “us-east-1”, “us-west-1” ] }}, {“Tags”: { “Key”: “TagName”, “Values”: [“Value1”] } } ]}, {“Not”: {“Dimensions”: { “Key”: “USAGE_TYPE”, “Values”: [“DataTransfer”] }}} ] }
Because each
Expression
can have only one operator, the service returns an error if more than one is specified. The following example shows anExpression
object that creates an error:{ “And”: [ … ], “Dimensions”: { “Key”: “USAGE_TYPE”, “Values”: [ “DataTransfer” ] } }
The following is an example of the corresponding error message:
“Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories”
-
For the
GetRightsizingRecommendation
action, a combination of OR and NOT isn’t supported. OR isn’t supported between different dimensions, or dimensions and tags. NOT operators aren’t supported. Dimensions are also limited toLINKED_ACCOUNT
,REGION
, orRIGHTSIZING_TYPE
.For the
GetReservationPurchaseRecommendation
action, only NOT is supported. AND and OR aren’t supported. Dimensions are limited toLINKED_ACCOUNT
.-
sort_by(SortDefinition)
/set_sort_by(Option<Vec::<SortDefinition>>)
:
required: falseThe value that you want to sort the data by.
The key represents cost and usage metrics. The following values are supported:
-
BlendedCost
-
UnblendedCost
-
AmortizedCost
-
NetAmortizedCost
-
NetUnblendedCost
-
UsageQuantity
-
NormalizedUsageAmount
The supported values for the
SortOrder
key areASCENDING
orDESCENDING
.When you specify a
SortBy
paramater, the context must beCOST_AND_USAGE
. Further, when usingSortBy
,NextPageToken
andSearchString
aren’t supported.-
billing_view_arn(impl Into<String>)
/set_billing_view_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThis field is only used when SortBy is provided in the request. The maximum number of objects that are returned for this request. If MaxResults isn’t specified with SortBy, the request returns 1000 results as the default value for this parameter.
For
GetDimensionValues
, MaxResults has an upper limit of 1000.next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On success, responds with
GetDimensionValuesOutput
with field(s):dimension_values(Vec::<DimensionValuesWithAttributes>)
:The filters that you used to filter your request. Some dimensions are available only for a specific context.
If you set the context to
COST_AND_USAGE
, you can use the following dimensions for searching:-
AZ - The Availability Zone. An example is
us-east-1a
. -
DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.
-
INSTANCE_TYPE - The type of Amazon EC2 instance. An example is
m4.xlarge
. -
LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web Services services, such as Amazon Web Services.
-
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
OPERATING_SYSTEM - The operating system. Examples are Windows or Linux.
-
OPERATION - The action performed. Examples include
RunInstance
andCreateBucket
. -
PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
-
PURCHASE_TYPE - The reservation type of the purchase to which this usage is related. Examples include On-Demand Instances and Standard Reserved Instances.
-
SERVICE - The Amazon Web Services service such as Amazon DynamoDB.
-
USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the
GetDimensionValues
operation includes a unit attribute. Examples include GB and Hrs. -
USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.
-
RECORD_TYPE - The different types of charges such as RI fees, usage costs, tax refunds, and credits.
-
RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service. You can opt-in by enabling
Hourly
andResource Level Data
in Cost Management Console preferences.
If you set the context to
RESERVATIONS
, you can use the following dimensions for searching:-
AZ - The Availability Zone. An example is
us-east-1a
. -
CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
-
DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are
SingleAZ
andMultiAZ
. -
INSTANCE_TYPE - The type of Amazon EC2 instance. An example is
m4.xlarge
. -
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
-
REGION - The Amazon Web Services Region.
-
SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.
-
TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).
-
TENANCY - The tenancy of a resource. Examples are shared or dedicated.
If you set the context to
SAVINGS_PLANS
, you can use the following dimensions for searching:-
SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute)
-
PAYMENT_OPTION - Payment option for the given Savings Plans (for example, All Upfront)
-
REGION - The Amazon Web Services Region.
-
INSTANCE_TYPE_FAMILY - The family of instances (For example,
m5
) -
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
SAVINGS_PLAN_ARN - The unique identifier for your Savings Plan
-
return_size(i32)
:The number of results that Amazon Web Services returned at one time.
total_size(i32)
:The total number of search results.
next_page_token(Option<String>)
:The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<GetDimensionValuesError>
Source§impl Client
impl Client
Sourcepub fn get_reservation_coverage(&self) -> GetReservationCoverageFluentBuilder
pub fn get_reservation_coverage(&self) -> GetReservationCoverageFluentBuilder
Constructs a fluent builder for the GetReservationCoverage
operation.
- The fluent builder is configurable:
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueThe start and end dates of the period that you want to retrieve data about reservation coverage for. You can retrieve data for a maximum of 13 months: the last 12 months and the current month. The start date is inclusive, but the end date is exclusive. For example, if
start
is2017-01-01
andend
is2017-05-01
, then the cost and usage data is retrieved from2017-01-01
up to and including2017-04-30
but not including2017-05-01
.group_by(GroupDefinition)
/set_group_by(Option<Vec::<GroupDefinition>>)
:
required: falseYou can group the data by the following attributes:
-
AZ
-
CACHE_ENGINE
-
DATABASE_ENGINE
-
DEPLOYMENT_OPTION
-
INSTANCE_TYPE
-
INVOICING_ENTITY
-
LINKED_ACCOUNT
-
OPERATING_SYSTEM
-
PLATFORM
-
REGION
-
TENANCY
-
granularity(Granularity)
/set_granularity(Option<Granularity>)
:
required: falseThe granularity of the Amazon Web Services cost data for the reservation. Valid values are
MONTHLY
andDAILY
.If
GroupBy
is set,Granularity
can’t be set. IfGranularity
isn’t set, the response object doesn’t includeGranularity
, eitherMONTHLY
orDAILY
.The
GetReservationCoverage
operation supports onlyDAILY
andMONTHLY
granularities.filter(Expression)
/set_filter(Option<Expression>)
:
required: falseFilters utilization data by dimensions. You can filter by the following dimensions:
-
AZ
-
CACHE_ENGINE
-
DATABASE_ENGINE
-
DEPLOYMENT_OPTION
-
INSTANCE_TYPE
-
LINKED_ACCOUNT
-
OPERATING_SYSTEM
-
PLATFORM
-
REGION
-
SERVICE
-
TAG
-
TENANCY
GetReservationCoverage
uses the same Expression object as the other operations, but onlyAND
is supported among each dimension. You can nest only one level deep. If there are multiple values for a dimension, they are OR’d together.If you don’t provide a
SERVICE
filter, Cost Explorer defaults to EC2.Cost category is also supported.
-
metrics(impl Into<String>)
/set_metrics(Option<Vec::<String>>)
:
required: falseThe measurement that you want your reservation coverage reported in.
Valid values are
Hour
,Unit
, andCost
. You can use multiple values in a request.next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
sort_by(SortDefinition)
/set_sort_by(Option<SortDefinition>)
:
required: falseThe value by which you want to sort the data.
The following values are supported for
Key
:-
OnDemandCost
-
CoverageHoursPercentage
-
OnDemandHours
-
ReservedHours
-
TotalRunningHours
-
CoverageNormalizedUnitsPercentage
-
OnDemandNormalizedUnits
-
ReservedNormalizedUnits
-
TotalRunningNormalizedUnits
-
Time
Supported values for
SortOrder
areASCENDING
orDESCENDING
.-
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of objects that you returned for this request. If more objects are available, in the response, Amazon Web Services provides a NextPageToken value that you can use in a subsequent call to get the next batch of objects.
- On success, responds with
GetReservationCoverageOutput
with field(s):coverages_by_time(Vec::<CoverageByTime>)
:The amount of time that your reservations covered.
total(Option<Coverage>)
:The total amount of instance usage that a reservation covered.
next_page_token(Option<String>)
:The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<GetReservationCoverageError>
Source§impl Client
impl Client
Sourcepub fn get_reservation_purchase_recommendation(
&self,
) -> GetReservationPurchaseRecommendationFluentBuilder
pub fn get_reservation_purchase_recommendation( &self, ) -> GetReservationPurchaseRecommendationFluentBuilder
Constructs a fluent builder for the GetReservationPurchaseRecommendation
operation.
- The fluent builder is configurable:
account_id(impl Into<String>)
/set_account_id(Option<String>)
:
required: falseThe account ID that’s associated with the recommendation.
service(impl Into<String>)
/set_service(Option<String>)
:
required: trueThe specific service that you want recommendations for.
filter(Expression)
/set_filter(Option<Expression>)
:
required: falseUse
Expression
to filter in various Cost Explorer APIs.Not all
Expression
types are supported in each API. Refer to the documentation for each specific API to see what is supported.There are two patterns:
-
Simple dimension values.
-
There are three types of simple dimension values:
CostCategories
,Tags
, andDimensions
.-
Specify the
CostCategories
field to define a filter that acts on Cost Categories. -
Specify the
Tags
field to define a filter that acts on Cost Allocation Tags. -
Specify the
Dimensions
field to define a filter that acts on theDimensionValues
.
-
-
For each filter type, you can set the dimension name and values for the filters that you plan to use.
-
For example, you can filter for
REGION==us-east-1 OR REGION==us-west-1
. ForGetRightsizingRecommendation
, the Region is a full name (for example,REGION==US East (N. Virginia)
. -
The corresponding
Expression
for this example is as follows:{ “Dimensions”: { “Key”: “REGION”, “Values”: [ “us-east-1”, “us-west-1” ] } }
-
As shown in the previous example, lists of dimension values are combined with
OR
when applying the filter.
-
-
You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
-
For example, you can filter for linked account names that start with “a”.
-
The corresponding
Expression
for this example is as follows:{ “Dimensions”: { “Key”: “LINKED_ACCOUNT_NAME”, “MatchOptions”: [ “STARTS_WITH” ], “Values”: [ “a” ] } }
-
-
-
Compound
Expression
types with logical operations.-
You can use multiple
Expression
types and the logical operatorsAND/OR/NOT
to create a list of one or moreExpression
objects. By doing this, you can filter by more advanced options. -
For example, you can filter by
((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)
. -
The corresponding
Expression
for this example is as follows:{ “And”: [ {“Or”: [ {“Dimensions”: { “Key”: “REGION”, “Values”: [ “us-east-1”, “us-west-1” ] }}, {“Tags”: { “Key”: “TagName”, “Values”: [“Value1”] } } ]}, {“Not”: {“Dimensions”: { “Key”: “USAGE_TYPE”, “Values”: [“DataTransfer”] }}} ] }
Because each
Expression
can have only one operator, the service returns an error if more than one is specified. The following example shows anExpression
object that creates an error:{ “And”: [ … ], “Dimensions”: { “Key”: “USAGE_TYPE”, “Values”: [ “DataTransfer” ] } }
The following is an example of the corresponding error message:
“Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories”
-
For the
GetRightsizingRecommendation
action, a combination of OR and NOT isn’t supported. OR isn’t supported between different dimensions, or dimensions and tags. NOT operators aren’t supported. Dimensions are also limited toLINKED_ACCOUNT
,REGION
, orRIGHTSIZING_TYPE
.For the
GetReservationPurchaseRecommendation
action, only NOT is supported. AND and OR aren’t supported. Dimensions are limited toLINKED_ACCOUNT
.-
account_scope(AccountScope)
/set_account_scope(Option<AccountScope>)
:
required: falseThe account scope that you want your recommendations for. Amazon Web Services calculates recommendations including the management account and member accounts if the value is set to
PAYER
. If the value isLINKED
, recommendations are calculated for individual member accounts only.lookback_period_in_days(LookbackPeriodInDays)
/set_lookback_period_in_days(Option<LookbackPeriodInDays>)
:
required: falseThe number of previous days that you want Amazon Web Services to consider when it calculates your recommendations.
term_in_years(TermInYears)
/set_term_in_years(Option<TermInYears>)
:
required: falseThe reservation term that you want recommendations for.
payment_option(PaymentOption)
/set_payment_option(Option<PaymentOption>)
:
required: falseThe reservation purchase option that you want recommendations for.
service_specification(ServiceSpecification)
/set_service_specification(Option<ServiceSpecification>)
:
required: falseThe hardware specifications for the service instances that you want recommendations for, such as standard or convertible Amazon EC2 instances.
page_size(i32)
/set_page_size(Option<i32>)
:
required: falseThe number of recommendations that you want returned in a single response object.
next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe pagination token that indicates the next set of results that you want to retrieve.
- On success, responds with
GetReservationPurchaseRecommendationOutput
with field(s):metadata(Option<ReservationPurchaseRecommendationMetadata>)
:Information about this specific recommendation call, such as the time stamp for when Cost Explorer generated this recommendation.
recommendations(Option<Vec::<ReservationPurchaseRecommendation>>)
:Recommendations for reservations to purchase.
next_page_token(Option<String>)
:The pagination token for the next set of retrievable results.
- On failure, responds with
SdkError<GetReservationPurchaseRecommendationError>
Source§impl Client
impl Client
Sourcepub fn get_reservation_utilization(
&self,
) -> GetReservationUtilizationFluentBuilder
pub fn get_reservation_utilization( &self, ) -> GetReservationUtilizationFluentBuilder
Constructs a fluent builder for the GetReservationUtilization
operation.
- The fluent builder is configurable:
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueSets the start and end dates for retrieving Reserved Instance (RI) utilization. The start date is inclusive, but the end date is exclusive. For example, if
start
is2017-01-01
andend
is2017-05-01
, then the cost and usage data is retrieved from2017-01-01
up to and including2017-04-30
but not including2017-05-01
.group_by(GroupDefinition)
/set_group_by(Option<Vec::<GroupDefinition>>)
:
required: falseGroups only by
SUBSCRIPTION_ID
. Metadata is included.granularity(Granularity)
/set_granularity(Option<Granularity>)
:
required: falseIf
GroupBy
is set,Granularity
can’t be set. IfGranularity
isn’t set, the response object doesn’t includeGranularity
, eitherMONTHLY
orDAILY
. If bothGroupBy
andGranularity
aren’t set,GetReservationUtilization
defaults toDAILY
.The
GetReservationUtilization
operation supports onlyDAILY
andMONTHLY
granularities.filter(Expression)
/set_filter(Option<Expression>)
:
required: falseFilters utilization data by dimensions. You can filter by the following dimensions:
-
AZ
-
CACHE_ENGINE
-
DEPLOYMENT_OPTION
-
INSTANCE_TYPE
-
LINKED_ACCOUNT
-
OPERATING_SYSTEM
-
PLATFORM
-
REGION
-
SERVICE
If not specified, the
SERVICE
filter defaults to Amazon Elastic Compute Cloud - Compute. Supported values forSERVICE
are Amazon Elastic Compute Cloud - Compute, Amazon Relational Database Service, Amazon ElastiCache, Amazon Redshift, and Amazon Elasticsearch Service. The value for theSERVICE
filter should not exceed “1”. -
SCOPE
-
TENANCY
GetReservationUtilization
uses the same Expression object as the other operations, but onlyAND
is supported among each dimension, and nesting is supported up to only one level deep. If there are multiple values for a dimension, they are OR’d together.-
sort_by(SortDefinition)
/set_sort_by(Option<SortDefinition>)
:
required: falseThe value that you want to sort the data by.
The following values are supported for
Key
:-
UtilizationPercentage
-
UtilizationPercentageInUnits
-
PurchasedHours
-
PurchasedUnits
-
TotalActualHours
-
TotalActualUnits
-
UnusedHours
-
UnusedUnits
-
OnDemandCostOfRIHoursUsed
-
NetRISavings
-
TotalPotentialRISavings
-
AmortizedUpfrontFee
-
AmortizedRecurringFee
-
TotalAmortizedFee
-
RICostForUnusedHours
-
RealizedSavings
-
UnrealizedSavings
The supported values for
SortOrder
areASCENDING
andDESCENDING
.-
next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of objects that you returned for this request. If more objects are available, in the response, Amazon Web Services provides a NextPageToken value that you can use in a subsequent call to get the next batch of objects.
- On success, responds with
GetReservationUtilizationOutput
with field(s):utilizations_by_time(Vec::<UtilizationByTime>)
:The amount of time that you used your Reserved Instances (RIs).
total(Option<ReservationAggregates>)
:The total amount of time that you used your Reserved Instances (RIs).
next_page_token(Option<String>)
:The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<GetReservationUtilizationError>
Source§impl Client
impl Client
Sourcepub fn get_rightsizing_recommendation(
&self,
) -> GetRightsizingRecommendationFluentBuilder
pub fn get_rightsizing_recommendation( &self, ) -> GetRightsizingRecommendationFluentBuilder
Constructs a fluent builder for the GetRightsizingRecommendation
operation.
- The fluent builder is configurable:
filter(Expression)
/set_filter(Option<Expression>)
:
required: falseUse
Expression
to filter in various Cost Explorer APIs.Not all
Expression
types are supported in each API. Refer to the documentation for each specific API to see what is supported.There are two patterns:
-
Simple dimension values.
-
There are three types of simple dimension values:
CostCategories
,Tags
, andDimensions
.-
Specify the
CostCategories
field to define a filter that acts on Cost Categories. -
Specify the
Tags
field to define a filter that acts on Cost Allocation Tags. -
Specify the
Dimensions
field to define a filter that acts on theDimensionValues
.
-
-
For each filter type, you can set the dimension name and values for the filters that you plan to use.
-
For example, you can filter for
REGION==us-east-1 OR REGION==us-west-1
. ForGetRightsizingRecommendation
, the Region is a full name (for example,REGION==US East (N. Virginia)
. -
The corresponding
Expression
for this example is as follows:{ “Dimensions”: { “Key”: “REGION”, “Values”: [ “us-east-1”, “us-west-1” ] } }
-
As shown in the previous example, lists of dimension values are combined with
OR
when applying the filter.
-
-
You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
-
For example, you can filter for linked account names that start with “a”.
-
The corresponding
Expression
for this example is as follows:{ “Dimensions”: { “Key”: “LINKED_ACCOUNT_NAME”, “MatchOptions”: [ “STARTS_WITH” ], “Values”: [ “a” ] } }
-
-
-
Compound
Expression
types with logical operations.-
You can use multiple
Expression
types and the logical operatorsAND/OR/NOT
to create a list of one or moreExpression
objects. By doing this, you can filter by more advanced options. -
For example, you can filter by
((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)
. -
The corresponding
Expression
for this example is as follows:{ “And”: [ {“Or”: [ {“Dimensions”: { “Key”: “REGION”, “Values”: [ “us-east-1”, “us-west-1” ] }}, {“Tags”: { “Key”: “TagName”, “Values”: [“Value1”] } } ]}, {“Not”: {“Dimensions”: { “Key”: “USAGE_TYPE”, “Values”: [“DataTransfer”] }}} ] }
Because each
Expression
can have only one operator, the service returns an error if more than one is specified. The following example shows anExpression
object that creates an error:{ “And”: [ … ], “Dimensions”: { “Key”: “USAGE_TYPE”, “Values”: [ “DataTransfer” ] } }
The following is an example of the corresponding error message:
“Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories”
-
For the
GetRightsizingRecommendation
action, a combination of OR and NOT isn’t supported. OR isn’t supported between different dimensions, or dimensions and tags. NOT operators aren’t supported. Dimensions are also limited toLINKED_ACCOUNT
,REGION
, orRIGHTSIZING_TYPE
.For the
GetReservationPurchaseRecommendation
action, only NOT is supported. AND and OR aren’t supported. Dimensions are limited toLINKED_ACCOUNT
.-
configuration(RightsizingRecommendationConfiguration)
/set_configuration(Option<RightsizingRecommendationConfiguration>)
:
required: falseYou can use Configuration to customize recommendations across two attributes. You can choose to view recommendations for instances within the same instance families or across different instance families. You can also choose to view your estimated savings that are associated with recommendations with consideration of existing Savings Plans or RI benefits, or neither.
service(impl Into<String>)
/set_service(Option<String>)
:
required: trueThe specific service that you want recommendations for. The only valid value for
GetRightsizingRecommendation
is “AmazonEC2
”.page_size(i32)
/set_page_size(Option<i32>)
:
required: falseThe number of recommendations that you want returned in a single response object.
next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe pagination token that indicates the next set of results that you want to retrieve.
- On success, responds with
GetRightsizingRecommendationOutput
with field(s):metadata(Option<RightsizingRecommendationMetadata>)
:Information regarding this specific recommendation set.
summary(Option<RightsizingRecommendationSummary>)
:Summary of this recommendation set.
rightsizing_recommendations(Option<Vec::<RightsizingRecommendation>>)
:Recommendations to rightsize resources.
next_page_token(Option<String>)
:The token to retrieve the next set of results.
configuration(Option<RightsizingRecommendationConfiguration>)
:You can use Configuration to customize recommendations across two attributes. You can choose to view recommendations for instances within the same instance families or across different instance families. You can also choose to view your estimated savings that are associated with recommendations with consideration of existing Savings Plans or RI benefits, or neither.
- On failure, responds with
SdkError<GetRightsizingRecommendationError>
Source§impl Client
impl Client
Sourcepub fn get_savings_plan_purchase_recommendation_details(
&self,
) -> GetSavingsPlanPurchaseRecommendationDetailsFluentBuilder
pub fn get_savings_plan_purchase_recommendation_details( &self, ) -> GetSavingsPlanPurchaseRecommendationDetailsFluentBuilder
Constructs a fluent builder for the GetSavingsPlanPurchaseRecommendationDetails
operation.
- The fluent builder is configurable:
recommendation_detail_id(impl Into<String>)
/set_recommendation_detail_id(Option<String>)
:
required: trueThe ID that is associated with the Savings Plan recommendation.
- On success, responds with
GetSavingsPlanPurchaseRecommendationDetailsOutput
with field(s):recommendation_detail_id(Option<String>)
:The ID that is associated with the Savings Plan recommendation.
recommendation_detail_data(Option<RecommendationDetailData>)
:Contains detailed information about a specific Savings Plan recommendation.
- On failure, responds with
SdkError<GetSavingsPlanPurchaseRecommendationDetailsError>
Source§impl Client
impl Client
Sourcepub fn get_savings_plans_coverage(&self) -> GetSavingsPlansCoverageFluentBuilder
pub fn get_savings_plans_coverage(&self) -> GetSavingsPlansCoverageFluentBuilder
Constructs a fluent builder for the GetSavingsPlansCoverage
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueThe time period that you want the usage and costs for. The
Start
date must be within 13 months. TheEnd
date must be after theStart
date, and before the current date. Future dates can’t be used as anEnd
date.group_by(GroupDefinition)
/set_group_by(Option<Vec::<GroupDefinition>>)
:
required: falseYou can group the data using the attributes
INSTANCE_FAMILY
,REGION
, orSERVICE
.granularity(Granularity)
/set_granularity(Option<Granularity>)
:
required: falseThe granularity of the Amazon Web Services cost data for your Savings Plans.
Granularity
can’t be set ifGroupBy
is set.The
GetSavingsPlansCoverage
operation supports onlyDAILY
andMONTHLY
granularities.filter(Expression)
/set_filter(Option<Expression>)
:
required: falseFilters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the following dimensions:
-
LINKED_ACCOUNT
-
REGION
-
SERVICE
-
INSTANCE_FAMILY
GetSavingsPlansCoverage
uses the same Expression object as the other operations, but onlyAND
is supported among each dimension. If there are multiple values for a dimension, they are OR’d together.Cost category is also supported.
-
metrics(impl Into<String>)
/set_metrics(Option<Vec::<String>>)
:
required: falseThe measurement that you want your Savings Plans coverage reported in. The only valid value is
SpendCoveredBySavingsPlans
.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe number of items to be returned in a response. The default is
20
, with a minimum value of1
.sort_by(SortDefinition)
/set_sort_by(Option<SortDefinition>)
:
required: falseThe value that you want to sort the data by.
The following values are supported for
Key
:-
SpendCoveredBySavingsPlan
-
OnDemandCost
-
CoveragePercentage
-
TotalCost
-
InstanceFamily
-
Region
-
Service
The supported values for
SortOrder
areASCENDING
andDESCENDING
.-
- On success, responds with
GetSavingsPlansCoverageOutput
with field(s):savings_plans_coverages(Vec::<SavingsPlansCoverage>)
:The amount of spend that your Savings Plans covered.
next_token(Option<String>)
:The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<GetSavingsPlansCoverageError>
Source§impl Client
impl Client
Sourcepub fn get_savings_plans_purchase_recommendation(
&self,
) -> GetSavingsPlansPurchaseRecommendationFluentBuilder
pub fn get_savings_plans_purchase_recommendation( &self, ) -> GetSavingsPlansPurchaseRecommendationFluentBuilder
Constructs a fluent builder for the GetSavingsPlansPurchaseRecommendation
operation.
- The fluent builder is configurable:
savings_plans_type(SupportedSavingsPlansType)
/set_savings_plans_type(Option<SupportedSavingsPlansType>)
:
required: trueThe Savings Plans recommendation type that’s requested.
term_in_years(TermInYears)
/set_term_in_years(Option<TermInYears>)
:
required: trueThe savings plan recommendation term that’s used to generate these recommendations.
payment_option(PaymentOption)
/set_payment_option(Option<PaymentOption>)
:
required: trueThe payment option that’s used to generate these recommendations.
account_scope(AccountScope)
/set_account_scope(Option<AccountScope>)
:
required: falseThe account scope that you want your recommendations for. Amazon Web Services calculates recommendations including the management account and member accounts if the value is set to
PAYER
. If the value isLINKED
, recommendations are calculated for individual member accounts only.next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
page_size(i32)
/set_page_size(Option<i32>)
:
required: falseThe number of recommendations that you want returned in a single response object.
lookback_period_in_days(LookbackPeriodInDays)
/set_lookback_period_in_days(Option<LookbackPeriodInDays>)
:
required: trueThe lookback period that’s used to generate the recommendation.
filter(Expression)
/set_filter(Option<Expression>)
:
required: falseYou can filter your recommendations by Account ID with the
LINKED_ACCOUNT
dimension. To filter your recommendations by Account ID, specifyKey
asLINKED_ACCOUNT
andValue
as the comma-separated Acount ID(s) that you want to see Savings Plans purchase recommendations for.For GetSavingsPlansPurchaseRecommendation, the
Filter
doesn’t includeCostCategories
orTags
. It only includesDimensions
. WithDimensions
,Key
must beLINKED_ACCOUNT
andValue
can be a single Account ID or multiple comma-separated Account IDs that you want to see Savings Plans Purchase Recommendations for.AND
andOR
operators are not supported.
- On success, responds with
GetSavingsPlansPurchaseRecommendationOutput
with field(s):metadata(Option<SavingsPlansPurchaseRecommendationMetadata>)
:Information that regards this specific recommendation set.
savings_plans_purchase_recommendation(Option<SavingsPlansPurchaseRecommendation>)
:Contains your request parameters, Savings Plan Recommendations Summary, and Details.
next_page_token(Option<String>)
:The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<GetSavingsPlansPurchaseRecommendationError>
Source§impl Client
impl Client
Sourcepub fn get_savings_plans_utilization(
&self,
) -> GetSavingsPlansUtilizationFluentBuilder
pub fn get_savings_plans_utilization( &self, ) -> GetSavingsPlansUtilizationFluentBuilder
Constructs a fluent builder for the GetSavingsPlansUtilization
operation.
- The fluent builder is configurable:
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueThe time period that you want the usage and costs for. The
Start
date must be within 13 months. TheEnd
date must be after theStart
date, and before the current date. Future dates can’t be used as anEnd
date.granularity(Granularity)
/set_granularity(Option<Granularity>)
:
required: falseThe granularity of the Amazon Web Services utillization data for your Savings Plans.
The
GetSavingsPlansUtilization
operation supports onlyDAILY
andMONTHLY
granularities.filter(Expression)
/set_filter(Option<Expression>)
:
required: falseFilters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the following dimensions:
-
LINKED_ACCOUNT
-
SAVINGS_PLAN_ARN
-
SAVINGS_PLANS_TYPE
-
REGION
-
PAYMENT_OPTION
-
INSTANCE_TYPE_FAMILY
GetSavingsPlansUtilization
uses the same Expression object as the other operations, but onlyAND
is supported among each dimension.-
sort_by(SortDefinition)
/set_sort_by(Option<SortDefinition>)
:
required: falseThe value that you want to sort the data by.
The following values are supported for
Key
:-
UtilizationPercentage
-
TotalCommitment
-
UsedCommitment
-
UnusedCommitment
-
NetSavings
The supported values for
SortOrder
areASCENDING
andDESCENDING
.-
- On success, responds with
GetSavingsPlansUtilizationOutput
with field(s):savings_plans_utilizations_by_time(Option<Vec::<SavingsPlansUtilizationByTime>>)
:The amount of cost/commitment that you used your Savings Plans. You can use it to specify date ranges.
total(Option<SavingsPlansUtilizationAggregates>)
:The total amount of cost/commitment that you used your Savings Plans, regardless of date ranges.
- On failure, responds with
SdkError<GetSavingsPlansUtilizationError>
Source§impl Client
impl Client
Sourcepub fn get_savings_plans_utilization_details(
&self,
) -> GetSavingsPlansUtilizationDetailsFluentBuilder
pub fn get_savings_plans_utilization_details( &self, ) -> GetSavingsPlansUtilizationDetailsFluentBuilder
Constructs a fluent builder for the GetSavingsPlansUtilizationDetails
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueThe time period that you want the usage and costs for. The
Start
date must be within 13 months. TheEnd
date must be after theStart
date, and before the current date. Future dates can’t be used as anEnd
date.filter(Expression)
/set_filter(Option<Expression>)
:
required: falseFilters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the following dimensions:
-
LINKED_ACCOUNT
-
SAVINGS_PLAN_ARN
-
REGION
-
PAYMENT_OPTION
-
INSTANCE_TYPE_FAMILY
GetSavingsPlansUtilizationDetails
uses the same Expression object as the other operations, but onlyAND
is supported among each dimension.-
data_type(SavingsPlansDataType)
/set_data_type(Option<Vec::<SavingsPlansDataType>>)
:
required: falseThe data type.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe number of items to be returned in a response. The default is
20
, with a minimum value of1
.sort_by(SortDefinition)
/set_sort_by(Option<SortDefinition>)
:
required: falseThe value that you want to sort the data by.
The following values are supported for
Key
:-
UtilizationPercentage
-
TotalCommitment
-
UsedCommitment
-
UnusedCommitment
-
NetSavings
-
AmortizedRecurringCommitment
-
AmortizedUpfrontCommitment
The supported values for
SortOrder
areASCENDING
andDESCENDING
.-
- On success, responds with
GetSavingsPlansUtilizationDetailsOutput
with field(s):savings_plans_utilization_details(Vec::<SavingsPlansUtilizationDetail>)
:Retrieves a single daily or monthly Savings Plans utilization rate and details for your account.
total(Option<SavingsPlansUtilizationAggregates>)
:The total Savings Plans utilization, regardless of time period.
time_period(Option<DateInterval>)
:The time period of the request.
next_token(Option<String>)
:The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<GetSavingsPlansUtilizationDetailsError>
Source§impl Client
impl Client
Constructs a fluent builder for the GetTags
operation.
- The fluent builder is configurable:
search_string(impl Into<String>)
/set_search_string(Option<String>)
:
required: falseThe value that you want to search for.
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueThe start and end dates for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if
start
is2017-01-01
andend
is2017-05-01
, then the cost and usage data is retrieved from2017-01-01
up to and including2017-04-30
but not including2017-05-01
.tag_key(impl Into<String>)
/set_tag_key(Option<String>)
:
required: falseThe key of the tag that you want to return values for.
filter(Expression)
/set_filter(Option<Expression>)
:
required: falseUse
Expression
to filter in various Cost Explorer APIs.Not all
Expression
types are supported in each API. Refer to the documentation for each specific API to see what is supported.There are two patterns:
-
Simple dimension values.
-
There are three types of simple dimension values:
CostCategories
,Tags
, andDimensions
.-
Specify the
CostCategories
field to define a filter that acts on Cost Categories. -
Specify the
Tags
field to define a filter that acts on Cost Allocation Tags. -
Specify the
Dimensions
field to define a filter that acts on theDimensionValues
.
-
-
For each filter type, you can set the dimension name and values for the filters that you plan to use.
-
For example, you can filter for
REGION==us-east-1 OR REGION==us-west-1
. ForGetRightsizingRecommendation
, the Region is a full name (for example,REGION==US East (N. Virginia)
. -
The corresponding
Expression
for this example is as follows:{ “Dimensions”: { “Key”: “REGION”, “Values”: [ “us-east-1”, “us-west-1” ] } }
-
As shown in the previous example, lists of dimension values are combined with
OR
when applying the filter.
-
-
You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
-
For example, you can filter for linked account names that start with “a”.
-
The corresponding
Expression
for this example is as follows:{ “Dimensions”: { “Key”: “LINKED_ACCOUNT_NAME”, “MatchOptions”: [ “STARTS_WITH” ], “Values”: [ “a” ] } }
-
-
-
Compound
Expression
types with logical operations.-
You can use multiple
Expression
types and the logical operatorsAND/OR/NOT
to create a list of one or moreExpression
objects. By doing this, you can filter by more advanced options. -
For example, you can filter by
((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)
. -
The corresponding
Expression
for this example is as follows:{ “And”: [ {“Or”: [ {“Dimensions”: { “Key”: “REGION”, “Values”: [ “us-east-1”, “us-west-1” ] }}, {“Tags”: { “Key”: “TagName”, “Values”: [“Value1”] } } ]}, {“Not”: {“Dimensions”: { “Key”: “USAGE_TYPE”, “Values”: [“DataTransfer”] }}} ] }
Because each
Expression
can have only one operator, the service returns an error if more than one is specified. The following example shows anExpression
object that creates an error:{ “And”: [ … ], “Dimensions”: { “Key”: “USAGE_TYPE”, “Values”: [ “DataTransfer” ] } }
The following is an example of the corresponding error message:
“Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories”
-
For the
GetRightsizingRecommendation
action, a combination of OR and NOT isn’t supported. OR isn’t supported between different dimensions, or dimensions and tags. NOT operators aren’t supported. Dimensions are also limited toLINKED_ACCOUNT
,REGION
, orRIGHTSIZING_TYPE
.For the
GetReservationPurchaseRecommendation
action, only NOT is supported. AND and OR aren’t supported. Dimensions are limited toLINKED_ACCOUNT
.-
sort_by(SortDefinition)
/set_sort_by(Option<Vec::<SortDefinition>>)
:
required: falseThe value that you want to sort the data by.
The key represents cost and usage metrics. The following values are supported:
-
BlendedCost
-
UnblendedCost
-
AmortizedCost
-
NetAmortizedCost
-
NetUnblendedCost
-
UsageQuantity
-
NormalizedUsageAmount
The supported values for
SortOrder
areASCENDING
andDESCENDING
.When you use
SortBy
,NextPageToken
andSearchString
aren’t supported.-
billing_view_arn(impl Into<String>)
/set_billing_view_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThis field is only used when SortBy is provided in the request. The maximum number of objects that are returned for this request. If MaxResults isn’t specified with SortBy, the request returns 1000 results as the default value for this parameter.
For
GetTags
, MaxResults has an upper quota of 1000.next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On success, responds with
GetTagsOutput
with field(s):next_page_token(Option<String>)
:The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
tags(Vec::<String>)
:The tags that match your request.
return_size(i32)
:The number of query results that Amazon Web Services returns at a time.
total_size(i32)
:The total number of query results.
- On failure, responds with
SdkError<GetTagsError>
Source§impl Client
impl Client
Sourcepub fn get_usage_forecast(&self) -> GetUsageForecastFluentBuilder
pub fn get_usage_forecast(&self) -> GetUsageForecastFluentBuilder
Constructs a fluent builder for the GetUsageForecast
operation.
- The fluent builder is configurable:
time_period(DateInterval)
/set_time_period(Option<DateInterval>)
:
required: trueThe start and end dates of the period that you want to retrieve usage forecast for. The start date is included in the period, but the end date isn’t included in the period. For example, if
start
is2017-01-01
andend
is2017-05-01
, then the cost and usage data is retrieved from2017-01-01
up to and including2017-04-30
but not including2017-05-01
. The start date must be equal to or later than the current date to avoid a validation error.metric(Metric)
/set_metric(Option<Metric>)
:
required: trueWhich metric Cost Explorer uses to create your forecast.
Valid values for a
GetUsageForecast
call are the following:-
USAGE_QUANTITY
-
NORMALIZED_USAGE_AMOUNT
-
granularity(Granularity)
/set_granularity(Option<Granularity>)
:
required: trueHow granular you want the forecast to be. You can get 3 months of
DAILY
forecasts or 12 months ofMONTHLY
forecasts.The
GetUsageForecast
operation supports onlyDAILY
andMONTHLY
granularities.filter(Expression)
/set_filter(Option<Expression>)
:
required: falseThe filters that you want to use to filter your forecast. The
GetUsageForecast
API supports filtering by the following dimensions:-
AZ
-
INSTANCE_TYPE
-
LINKED_ACCOUNT
-
LINKED_ACCOUNT_NAME
-
OPERATION
-
PURCHASE_TYPE
-
REGION
-
SERVICE
-
USAGE_TYPE
-
USAGE_TYPE_GROUP
-
RECORD_TYPE
-
OPERATING_SYSTEM
-
TENANCY
-
SCOPE
-
PLATFORM
-
SUBSCRIPTION_ID
-
LEGAL_ENTITY_NAME
-
DEPLOYMENT_OPTION
-
DATABASE_ENGINE
-
INSTANCE_TYPE_FAMILY
-
BILLING_ENTITY
-
RESERVATION_ID
-
SAVINGS_PLAN_ARN
-
billing_view_arn(impl Into<String>)
/set_billing_view_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.
prediction_interval_level(i32)
/set_prediction_interval_level(Option<i32>)
:
required: falseAmazon Web Services Cost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals.
- On success, responds with
GetUsageForecastOutput
with field(s):total(Option<MetricValue>)
:How much you’re forecasted to use over the forecast period.
forecast_results_by_time(Option<Vec::<ForecastResult>>)
:The forecasts for your query, in order. For
DAILY
forecasts, this is a list of days. ForMONTHLY
forecasts, this is a list of months.
- On failure, responds with
SdkError<GetUsageForecastError>
Source§impl Client
impl Client
Sourcepub fn list_commitment_purchase_analyses(
&self,
) -> ListCommitmentPurchaseAnalysesFluentBuilder
pub fn list_commitment_purchase_analyses( &self, ) -> ListCommitmentPurchaseAnalysesFluentBuilder
Constructs a fluent builder for the ListCommitmentPurchaseAnalyses
operation.
- The fluent builder is configurable:
analysis_status(AnalysisStatus)
/set_analysis_status(Option<AnalysisStatus>)
:
required: falseThe status of the analysis.
next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results.
page_size(i32)
/set_page_size(Option<i32>)
:
required: falseThe number of analyses that you want returned in a single response object.
analysis_ids(impl Into<String>)
/set_analysis_ids(Option<Vec::<String>>)
:
required: falseThe analysis IDs associated with the commitment purchase analyses.
- On success, responds with
ListCommitmentPurchaseAnalysesOutput
with field(s):analysis_summary_list(Option<Vec::<AnalysisSummary>>)
:The list of analyses.
next_page_token(Option<String>)
:The token to retrieve the next set of results.
- On failure, responds with
SdkError<ListCommitmentPurchaseAnalysesError>
Source§impl Client
impl Client
Sourcepub fn list_cost_allocation_tag_backfill_history(
&self,
) -> ListCostAllocationTagBackfillHistoryFluentBuilder
pub fn list_cost_allocation_tag_backfill_history( &self, ) -> ListCostAllocationTagBackfillHistoryFluentBuilder
Constructs a fluent builder for the ListCostAllocationTagBackfillHistory
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of objects that are returned for this request.
- On success, responds with
ListCostAllocationTagBackfillHistoryOutput
with field(s):backfill_requests(Option<Vec::<CostAllocationTagBackfillRequest>>)
:The list of historical cost allocation tag backfill requests.
next_token(Option<String>)
:The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<ListCostAllocationTagBackfillHistoryError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListCostAllocationTags
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
status(CostAllocationTagStatus)
/set_status(Option<CostAllocationTagStatus>)
:
required: falseThe status of cost allocation tag keys that are returned for this request.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: falseThe list of cost allocation tag keys that are returned for this request.
r#type(CostAllocationTagType)
/set_type(Option<CostAllocationTagType>)
:
required: falseThe type of
CostAllocationTag
object that are returned for this request. TheAWSGenerated
type tags are tags that Amazon Web Services defines and applies to support Amazon Web Services resources for cost allocation purposes. TheUserDefined
type tags are tags that you define, create, and apply to resources.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of objects that are returned for this request. By default, the request returns 100 results.
- On success, responds with
ListCostAllocationTagsOutput
with field(s):cost_allocation_tags(Option<Vec::<CostAllocationTag>>)
:A list of cost allocation tags that includes the detailed metadata for each one.
next_token(Option<String>)
:The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<ListCostAllocationTagsError>
Source§impl Client
impl Client
Sourcepub fn list_cost_category_definitions(
&self,
) -> ListCostCategoryDefinitionsFluentBuilder
pub fn list_cost_category_definitions( &self, ) -> ListCostCategoryDefinitionsFluentBuilder
Constructs a fluent builder for the ListCostCategoryDefinitions
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
effective_on(impl Into<String>)
/set_effective_on(Option<String>)
:
required: falseThe date when the Cost Category was effective.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe number of entries a paginated response contains.
- On success, responds with
ListCostCategoryDefinitionsOutput
with field(s):cost_category_references(Option<Vec::<CostCategoryReference>>)
:A reference to a Cost Category that contains enough information to identify the Cost Category.
next_token(Option<String>)
:The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.
- On failure, responds with
SdkError<ListCostCategoryDefinitionsError>
Source§impl Client
impl Client
Sourcepub fn list_savings_plans_purchase_recommendation_generation(
&self,
) -> ListSavingsPlansPurchaseRecommendationGenerationFluentBuilder
pub fn list_savings_plans_purchase_recommendation_generation( &self, ) -> ListSavingsPlansPurchaseRecommendationGenerationFluentBuilder
Constructs a fluent builder for the ListSavingsPlansPurchaseRecommendationGeneration
operation.
- The fluent builder is configurable:
generation_status(GenerationStatus)
/set_generation_status(Option<GenerationStatus>)
:
required: falseThe status of the recommendation generation.
recommendation_ids(impl Into<String>)
/set_recommendation_ids(Option<Vec::<String>>)
:
required: falseThe IDs for each specific recommendation.
page_size(i32)
/set_page_size(Option<i32>)
:
required: falseThe number of recommendations that you want returned in a single response object.
next_page_token(impl Into<String>)
/set_next_page_token(Option<String>)
:
required: falseThe token to retrieve the next set of results.
- On success, responds with
ListSavingsPlansPurchaseRecommendationGenerationOutput
with field(s):generation_summary_list(Option<Vec::<GenerationSummary>>)
:The list of historical recommendation generations.
next_page_token(Option<String>)
:The token to retrieve the next set of results.
- On failure, responds with
SdkError<ListSavingsPlansPurchaseRecommendationGenerationError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource. For a list of supported resources, see ResourceTag.
- On success, responds with
ListTagsForResourceOutput
with field(s):resource_tags(Option<Vec::<ResourceTag>>)
:A list of tag key value pairs that are associated with the resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn provide_anomaly_feedback(&self) -> ProvideAnomalyFeedbackFluentBuilder
pub fn provide_anomaly_feedback(&self) -> ProvideAnomalyFeedbackFluentBuilder
Constructs a fluent builder for the ProvideAnomalyFeedback
operation.
- The fluent builder is configurable:
anomaly_id(impl Into<String>)
/set_anomaly_id(Option<String>)
:
required: trueA cost anomaly ID.
feedback(AnomalyFeedbackType)
/set_feedback(Option<AnomalyFeedbackType>)
:
required: trueDescribes whether the cost anomaly was a planned activity or you considered it an anomaly.
- On success, responds with
ProvideAnomalyFeedbackOutput
with field(s):anomaly_id(String)
:The ID of the modified cost anomaly.
- On failure, responds with
SdkError<ProvideAnomalyFeedbackError>
Source§impl Client
impl Client
Sourcepub fn start_commitment_purchase_analysis(
&self,
) -> StartCommitmentPurchaseAnalysisFluentBuilder
pub fn start_commitment_purchase_analysis( &self, ) -> StartCommitmentPurchaseAnalysisFluentBuilder
Constructs a fluent builder for the StartCommitmentPurchaseAnalysis
operation.
- The fluent builder is configurable:
commitment_purchase_analysis_configuration(CommitmentPurchaseAnalysisConfiguration)
/set_commitment_purchase_analysis_configuration(Option<CommitmentPurchaseAnalysisConfiguration>)
:
required: trueThe configuration for the commitment purchase analysis.
- On success, responds with
StartCommitmentPurchaseAnalysisOutput
with field(s):analysis_id(String)
:The analysis ID that’s associated with the commitment purchase analysis.
analysis_started_time(String)
:The start time of the analysis.
estimated_completion_time(String)
:The estimated time for when the analysis will complete.
- On failure, responds with
SdkError<StartCommitmentPurchaseAnalysisError>
Source§impl Client
impl Client
Sourcepub fn start_cost_allocation_tag_backfill(
&self,
) -> StartCostAllocationTagBackfillFluentBuilder
pub fn start_cost_allocation_tag_backfill( &self, ) -> StartCostAllocationTagBackfillFluentBuilder
Constructs a fluent builder for the StartCostAllocationTagBackfill
operation.
- The fluent builder is configurable:
backfill_from(impl Into<String>)
/set_backfill_from(Option<String>)
:
required: trueThe date you want the backfill to start from. The date can only be a first day of the month (a billing start date). Dates can’t precede the previous twelve months, or in the future.
- On success, responds with
StartCostAllocationTagBackfillOutput
with field(s):backfill_request(Option<CostAllocationTagBackfillRequest>)
:An object containing detailed metadata of your new backfill request.
- On failure, responds with
SdkError<StartCostAllocationTagBackfillError>
Source§impl Client
impl Client
Sourcepub fn start_savings_plans_purchase_recommendation_generation(
&self,
) -> StartSavingsPlansPurchaseRecommendationGenerationFluentBuilder
pub fn start_savings_plans_purchase_recommendation_generation( &self, ) -> StartSavingsPlansPurchaseRecommendationGenerationFluentBuilder
Constructs a fluent builder for the StartSavingsPlansPurchaseRecommendationGeneration
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
StartSavingsPlansPurchaseRecommendationGenerationOutput
with field(s):recommendation_id(Option<String>)
:The ID for this specific recommendation.
generation_started_time(Option<String>)
:The start time of the recommendation generation.
estimated_completion_time(Option<String>)
:The estimated time for when the recommendation generation will complete.
- On failure, responds with
SdkError<StartSavingsPlansPurchaseRecommendationGenerationError>
Source§impl Client
impl Client
Sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource. For a list of supported resources, see ResourceTag.
resource_tags(ResourceTag)
/set_resource_tags(Option<Vec::<ResourceTag>>)
:
required: trueA list of tag key-value pairs to be added to the resource.
Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags:
-
Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for Amazon Web Services use
-
The maximum length of a key is 128 characters
-
The maximum length of a value is 256 characters
-
Keys and values can only contain alphanumeric characters, spaces, and any of the following:
_.:/=+@-
-
Keys and values are case sensitive
-
Keys and values are trimmed for any leading or trailing whitespaces
-
Don’t use
aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
-
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
Source§impl Client
impl Client
Sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource. For a list of supported resources, see ResourceTag.
resource_tag_keys(impl Into<String>)
/set_resource_tag_keys(Option<Vec::<String>>)
:
required: trueA list of tag keys associated with tags that need to be removed from the resource. If you specify a tag key that doesn’t exist, it’s ignored. Although the maximum number of array members is 200, user-tag maximum is 50. The remaining are reserved for Amazon Web Services use.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_anomaly_monitor(&self) -> UpdateAnomalyMonitorFluentBuilder
pub fn update_anomaly_monitor(&self) -> UpdateAnomalyMonitorFluentBuilder
Constructs a fluent builder for the UpdateAnomalyMonitor
operation.
- The fluent builder is configurable:
monitor_arn(impl Into<String>)
/set_monitor_arn(Option<String>)
:
required: trueCost anomaly monitor Amazon Resource Names (ARNs).
monitor_name(impl Into<String>)
/set_monitor_name(Option<String>)
:
required: falseThe new name for the cost anomaly monitor.
- On success, responds with
UpdateAnomalyMonitorOutput
with field(s):monitor_arn(String)
:A cost anomaly monitor ARN.
- On failure, responds with
SdkError<UpdateAnomalyMonitorError>
Source§impl Client
impl Client
Sourcepub fn update_anomaly_subscription(
&self,
) -> UpdateAnomalySubscriptionFluentBuilder
pub fn update_anomaly_subscription( &self, ) -> UpdateAnomalySubscriptionFluentBuilder
Constructs a fluent builder for the UpdateAnomalySubscription
operation.
- The fluent builder is configurable:
subscription_arn(impl Into<String>)
/set_subscription_arn(Option<String>)
:
required: trueA cost anomaly subscription Amazon Resource Name (ARN).
threshold(f64)
/set_threshold(Option<f64>)
:
required: false(deprecated)
The update to the threshold value for receiving notifications.
This field has been deprecated. To update a threshold, use ThresholdExpression. Continued use of Threshold will be treated as shorthand syntax for a ThresholdExpression.
You can specify either Threshold or ThresholdExpression, but not both.
frequency(AnomalySubscriptionFrequency)
/set_frequency(Option<AnomalySubscriptionFrequency>)
:
required: falseThe update to the frequency value that subscribers receive notifications.
monitor_arn_list(impl Into<String>)
/set_monitor_arn_list(Option<Vec::<String>>)
:
required: falseA list of cost anomaly monitor ARNs.
subscribers(Subscriber)
/set_subscribers(Option<Vec::<Subscriber>>)
:
required: falseThe update to the subscriber list.
subscription_name(impl Into<String>)
/set_subscription_name(Option<String>)
:
required: falseThe new name of the subscription.
threshold_expression(Expression)
/set_threshold_expression(Option<Expression>)
:
required: falseThe update to the Expression object used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested expressions. The supported dimensions are
ANOMALY_TOTAL_IMPACT_ABSOLUTE
andANOMALY_TOTAL_IMPACT_PERCENTAGE
, corresponding to an anomaly’s TotalImpact and TotalImpactPercentage, respectively (see Impact for more details). The supported nested expression types areAND
andOR
. The match optionGREATER_THAN_OR_EQUAL
is required. Values must be numbers between 0 and 10,000,000,000 in string format.You can specify either Threshold or ThresholdExpression, but not both.
The following are examples of valid ThresholdExpressions:
-
Absolute threshold:
{ “Dimensions”: { “Key”: “ANOMALY_TOTAL_IMPACT_ABSOLUTE”, “MatchOptions”: [ “GREATER_THAN_OR_EQUAL” ], “Values”: [ “100” ] } }
-
Percentage threshold:
{ “Dimensions”: { “Key”: “ANOMALY_TOTAL_IMPACT_PERCENTAGE”, “MatchOptions”: [ “GREATER_THAN_OR_EQUAL” ], “Values”: [ “100” ] } }
-
AND
two thresholds together:{ “And”: [ { “Dimensions”: { “Key”: “ANOMALY_TOTAL_IMPACT_ABSOLUTE”, “MatchOptions”: [ “GREATER_THAN_OR_EQUAL” ], “Values”: [ “100” ] } }, { “Dimensions”: { “Key”: “ANOMALY_TOTAL_IMPACT_PERCENTAGE”, “MatchOptions”: [ “GREATER_THAN_OR_EQUAL” ], “Values”: [ “100” ] } } ] }
-
OR
two thresholds together:{ “Or”: [ { “Dimensions”: { “Key”: “ANOMALY_TOTAL_IMPACT_ABSOLUTE”, “MatchOptions”: [ “GREATER_THAN_OR_EQUAL” ], “Values”: [ “100” ] } }, { “Dimensions”: { “Key”: “ANOMALY_TOTAL_IMPACT_PERCENTAGE”, “MatchOptions”: [ “GREATER_THAN_OR_EQUAL” ], “Values”: [ “100” ] } } ] }
-
- On success, responds with
UpdateAnomalySubscriptionOutput
with field(s):subscription_arn(String)
:A cost anomaly subscription ARN.
- On failure, responds with
SdkError<UpdateAnomalySubscriptionError>
Source§impl Client
impl Client
Constructs a fluent builder for the UpdateCostAllocationTagsStatus
operation.
- The fluent builder is configurable:
cost_allocation_tags_status(CostAllocationTagStatusEntry)
/set_cost_allocation_tags_status(Option<Vec::<CostAllocationTagStatusEntry>>)
:
required: trueThe list of
CostAllocationTagStatusEntry
objects that are used to update cost allocation tags status for this request.
- On success, responds with
UpdateCostAllocationTagsStatusOutput
with field(s):errors(Option<Vec::<UpdateCostAllocationTagsStatusError>>)
:A list of
UpdateCostAllocationTagsStatusError
objects with error details about each cost allocation tag that can’t be updated. If there’s no failure, an empty array returns.
- On failure, responds with
SdkError<UpdateCostAllocationTagsStatusError>
Source§impl Client
impl Client
Sourcepub fn update_cost_category_definition(
&self,
) -> UpdateCostCategoryDefinitionFluentBuilder
pub fn update_cost_category_definition( &self, ) -> UpdateCostCategoryDefinitionFluentBuilder
Constructs a fluent builder for the UpdateCostCategoryDefinition
operation.
- The fluent builder is configurable:
cost_category_arn(impl Into<String>)
/set_cost_category_arn(Option<String>)
:
required: trueThe unique identifier for your Cost Category.
effective_start(impl Into<String>)
/set_effective_start(Option<String>)
:
required: falseThe Cost Category’s effective start date. It can only be a billing start date (first day of the month). If the date isn’t provided, it’s the first day of the current month. Dates can’t be before the previous twelve months, or in the future.
rule_version(CostCategoryRuleVersion)
/set_rule_version(Option<CostCategoryRuleVersion>)
:
required: trueThe rule schema version in this particular Cost Category.
rules(CostCategoryRule)
/set_rules(Option<Vec::<CostCategoryRule>>)
:
required: trueThe
Expression
object used to categorize costs. For more information, see CostCategoryRule .default_value(impl Into<String>)
/set_default_value(Option<String>)
:
required: falseThe default value for the cost category.
split_charge_rules(CostCategorySplitChargeRule)
/set_split_charge_rules(Option<Vec::<CostCategorySplitChargeRule>>)
:
required: falseThe split charge rules used to allocate your charges between your Cost Category values.
- On success, responds with
UpdateCostCategoryDefinitionOutput
with field(s):cost_category_arn(Option<String>)
:The unique identifier for your Cost Category.
effective_start(Option<String>)
:The Cost Category’s effective start date. It can only be a billing start date (first day of the month).
- On failure, responds with
SdkError<UpdateCostCategoryDefinitionError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.bright_black());
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.bright_green());
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.bright_yellow());
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.bright_magenta());
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.bright_white());
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.on_bright_black());
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.on_bright_green());
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.on_bright_yellow());
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlue
.
§Example
println!("{}", value.on_bright_blue());
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.on_bright_magenta());
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightCyan
.
§Example
println!("{}", value.on_bright_cyan());
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.on_bright_white());
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::Underline
.
§Example
println!("{}", value.underline());
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::RapidBlink
.
§Example
println!("{}", value.rapid_blink());
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);