pub struct Client { /* private fields */ }
Expand description
Client for AWS Compute Optimizer
Client for invoking operations on AWS Compute Optimizer. Each operation on AWS Compute Optimizer 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_computeoptimizer::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_computeoptimizer::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 DeleteRecommendationPreferences
operation has
a Client::delete_recommendation_preferences
, 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.delete_recommendation_preferences()
.resource_type("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 delete_recommendation_preferences(
&self,
) -> DeleteRecommendationPreferencesFluentBuilder
pub fn delete_recommendation_preferences( &self, ) -> DeleteRecommendationPreferencesFluentBuilder
Constructs a fluent builder for the DeleteRecommendationPreferences
operation.
- The fluent builder is configurable:
resource_type(ResourceType)
/set_resource_type(Option<ResourceType>)
:
required: trueThe target resource type of the recommendation preference to delete.
The
Ec2Instance
option encompasses standalone instances and instances that are part of Auto Scaling groups. TheAutoScalingGroup
option encompasses only instances that are part of an Auto Scaling group.scope(Scope)
/set_scope(Option<Scope>)
:
required: falseAn object that describes the scope of the recommendation preference to delete.
You can delete recommendation preferences that are created at the organization level (for management accounts of an organization only), account level, and resource level. For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.
recommendation_preference_names(RecommendationPreferenceName)
/set_recommendation_preference_names(Option<Vec::<RecommendationPreferenceName>>)
:
required: trueThe name of the recommendation preference to delete.
- On success, responds with
DeleteRecommendationPreferencesOutput
- On failure, responds with
SdkError<DeleteRecommendationPreferencesError>
Source§impl Client
impl Client
Sourcepub fn describe_recommendation_export_jobs(
&self,
) -> DescribeRecommendationExportJobsFluentBuilder
pub fn describe_recommendation_export_jobs( &self, ) -> DescribeRecommendationExportJobsFluentBuilder
Constructs a fluent builder for the DescribeRecommendationExportJobs
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
job_ids(impl Into<String>)
/set_job_ids(Option<Vec::<String>>)
:
required: falseThe identification numbers of the export jobs to return.
An export job ID is returned when you create an export using the
ExportAutoScalingGroupRecommendations
orExportEC2InstanceRecommendations
actions.All export jobs created in the last seven days are returned if this parameter is omitted.
filters(JobFilter)
/set_filters(Option<Vec::<JobFilter>>)
:
required: falseAn array of objects to specify a filter that returns a more specific list of export jobs.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of export jobs.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of export jobs to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.
- On success, responds with
DescribeRecommendationExportJobsOutput
with field(s):recommendation_export_jobs(Option<Vec::<RecommendationExportJob>>)
:An array of objects that describe recommendation export jobs.
next_token(Option<String>)
:The token to use to advance to the next page of export jobs.
This value is null when there are no more pages of export jobs to return.
- On failure, responds with
SdkError<DescribeRecommendationExportJobsError>
Source§impl Client
impl Client
Sourcepub fn export_auto_scaling_group_recommendations(
&self,
) -> ExportAutoScalingGroupRecommendationsFluentBuilder
pub fn export_auto_scaling_group_recommendations( &self, ) -> ExportAutoScalingGroupRecommendationsFluentBuilder
Constructs a fluent builder for the ExportAutoScalingGroupRecommendations
operation.
- The fluent builder is configurable:
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe IDs of the Amazon Web Services accounts for which to export Auto Scaling group recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to export recommendations.
This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.
Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.
You can specify multiple account IDs per request.
filters(Filter)
/set_filters(Option<Vec::<Filter>>)
:
required: falseAn array of objects to specify a filter that exports a more specific set of Auto Scaling group recommendations.
fields_to_export(ExportableAutoScalingGroupField)
/set_fields_to_export(Option<Vec::<ExportableAutoScalingGroupField>>)
:
required: falseThe recommendations data to include in the export file. For more information about the fields that can be exported, see Exported files in the Compute Optimizer User Guide.
s3_destination_config(S3DestinationConfig)
/set_s3_destination_config(Option<S3DestinationConfig>)
:
required: trueAn object to specify the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for the export job.
You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permissions policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see Amazon S3 Bucket Policy for Compute Optimizer in the Compute Optimizer User Guide.
file_format(FileFormat)
/set_file_format(Option<FileFormat>)
:
required: falseThe format of the export file.
The only export file format currently supported is
Csv
.include_member_accounts(bool)
/set_include_member_accounts(Option<bool>)
:
required: falseIndicates whether to include recommendations for resources in all member accounts of the organization if your account is the management account of an organization.
The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User Guide.
Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.
This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.
Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.
recommendation_preferences(RecommendationPreferences)
/set_recommendation_preferences(Option<RecommendationPreferences>)
:
required: falseAn object to specify the preferences for the Auto Scaling group recommendations to export.
- On success, responds with
ExportAutoScalingGroupRecommendationsOutput
with field(s):job_id(Option<String>)
:The identification number of the export job.
Use the
DescribeRecommendationExportJobs
action, and specify the job ID to view the status of an export job.s3_destination(Option<S3Destination>)
:An object that describes the destination Amazon S3 bucket of a recommendations export file.
- On failure, responds with
SdkError<ExportAutoScalingGroupRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn export_ebs_volume_recommendations(
&self,
) -> ExportEBSVolumeRecommendationsFluentBuilder
pub fn export_ebs_volume_recommendations( &self, ) -> ExportEBSVolumeRecommendationsFluentBuilder
Constructs a fluent builder for the ExportEBSVolumeRecommendations
operation.
- The fluent builder is configurable:
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe IDs of the Amazon Web Services accounts for which to export Amazon EBS volume recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to export recommendations.
This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.
Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.
You can specify multiple account IDs per request.
filters(EbsFilter)
/set_filters(Option<Vec::<EbsFilter>>)
:
required: falseAn array of objects to specify a filter that exports a more specific set of Amazon EBS volume recommendations.
fields_to_export(ExportableVolumeField)
/set_fields_to_export(Option<Vec::<ExportableVolumeField>>)
:
required: falseThe recommendations data to include in the export file. For more information about the fields that can be exported, see Exported files in the Compute Optimizer User Guide.
s3_destination_config(S3DestinationConfig)
/set_s3_destination_config(Option<S3DestinationConfig>)
:
required: trueDescribes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.
You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see Amazon S3 Bucket Policy for Compute Optimizer in the Compute Optimizer User Guide.
file_format(FileFormat)
/set_file_format(Option<FileFormat>)
:
required: falseThe format of the export file.
The only export file format currently supported is
Csv
.include_member_accounts(bool)
/set_include_member_accounts(Option<bool>)
:
required: falseIndicates whether to include recommendations for resources in all member accounts of the organization if your account is the management account of an organization.
The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User Guide.
Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.
This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.
Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.
- On success, responds with
ExportEbsVolumeRecommendationsOutput
with field(s):job_id(Option<String>)
:The identification number of the export job.
Use the
DescribeRecommendationExportJobs
action, and specify the job ID to view the status of an export job.s3_destination(Option<S3Destination>)
:Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and object keys of a recommendations export file, and its associated metadata file.
- On failure, responds with
SdkError<ExportEBSVolumeRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn export_ec2_instance_recommendations(
&self,
) -> ExportEC2InstanceRecommendationsFluentBuilder
pub fn export_ec2_instance_recommendations( &self, ) -> ExportEC2InstanceRecommendationsFluentBuilder
Constructs a fluent builder for the ExportEC2InstanceRecommendations
operation.
- The fluent builder is configurable:
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe IDs of the Amazon Web Services accounts for which to export instance recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to export recommendations.
This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.
Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.
You can specify multiple account IDs per request.
filters(Filter)
/set_filters(Option<Vec::<Filter>>)
:
required: falseAn array of objects to specify a filter that exports a more specific set of instance recommendations.
fields_to_export(ExportableInstanceField)
/set_fields_to_export(Option<Vec::<ExportableInstanceField>>)
:
required: falseThe recommendations data to include in the export file. For more information about the fields that can be exported, see Exported files in the Compute Optimizer User Guide.
s3_destination_config(S3DestinationConfig)
/set_s3_destination_config(Option<S3DestinationConfig>)
:
required: trueAn object to specify the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for the export job.
You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permissions policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see Amazon S3 Bucket Policy for Compute Optimizer in the Compute Optimizer User Guide.
file_format(FileFormat)
/set_file_format(Option<FileFormat>)
:
required: falseThe format of the export file.
The only export file format currently supported is
Csv
.include_member_accounts(bool)
/set_include_member_accounts(Option<bool>)
:
required: falseIndicates whether to include recommendations for resources in all member accounts of the organization if your account is the management account of an organization.
The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User Guide.
Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.
Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.
recommendation_preferences(RecommendationPreferences)
/set_recommendation_preferences(Option<RecommendationPreferences>)
:
required: falseAn object to specify the preferences for the Amazon EC2 instance recommendations to export.
- On success, responds with
ExportEc2InstanceRecommendationsOutput
with field(s):job_id(Option<String>)
:The identification number of the export job.
Use the
DescribeRecommendationExportJobs
action, and specify the job ID to view the status of an export job.s3_destination(Option<S3Destination>)
:An object that describes the destination Amazon S3 bucket of a recommendations export file.
- On failure, responds with
SdkError<ExportEC2InstanceRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn export_ecs_service_recommendations(
&self,
) -> ExportECSServiceRecommendationsFluentBuilder
pub fn export_ecs_service_recommendations( &self, ) -> ExportECSServiceRecommendationsFluentBuilder
Constructs a fluent builder for the ExportECSServiceRecommendations
operation.
- The fluent builder is configurable:
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe Amazon Web Services account IDs for the export Amazon ECS service recommendations.
If your account is the management account or the delegated administrator of an organization, use this parameter to specify the member account you want to export recommendations to.
This parameter can’t be specified together with the include member accounts parameter. The parameters are mutually exclusive.
If this parameter or the include member accounts parameter is omitted, the recommendations for member accounts aren’t included in the export.
You can specify multiple account IDs per request.
filters(EcsServiceRecommendationFilter)
/set_filters(Option<Vec::<EcsServiceRecommendationFilter>>)
:
required: falseAn array of objects to specify a filter that exports a more specific set of Amazon ECS service recommendations.
fields_to_export(ExportableEcsServiceField)
/set_fields_to_export(Option<Vec::<ExportableEcsServiceField>>)
:
required: falseThe recommendations data to include in the export file. For more information about the fields that can be exported, see Exported files in the Compute Optimizer User Guide.
s3_destination_config(S3DestinationConfig)
/set_s3_destination_config(Option<S3DestinationConfig>)
:
required: trueDescribes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.
You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see Amazon S3 Bucket Policy for Compute Optimizer in the Compute Optimizer User Guide.
file_format(FileFormat)
/set_file_format(Option<FileFormat>)
:
required: falseThe format of the export file.
The CSV file is the only export file format currently supported.
include_member_accounts(bool)
/set_include_member_accounts(Option<bool>)
:
required: falseIf your account is the management account or the delegated administrator of an organization, this parameter indicates whether to include recommendations for resources in all member accounts of the organization.
The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User Guide.
If this parameter is omitted, recommendations for member accounts of the organization aren’t included in the export file.
If this parameter or the account ID parameter is omitted, recommendations for member accounts aren’t included in the export.
- On success, responds with
ExportEcsServiceRecommendationsOutput
with field(s):job_id(Option<String>)
:The identification number of the export job.
To view the status of an export job, use the
DescribeRecommendationExportJobs
action and specify the job ID.s3_destination(Option<S3Destination>)
:Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and object keys of a recommendations export file, and its associated metadata file.
- On failure, responds with
SdkError<ExportECSServiceRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn export_idle_recommendations(
&self,
) -> ExportIdleRecommendationsFluentBuilder
pub fn export_idle_recommendations( &self, ) -> ExportIdleRecommendationsFluentBuilder
Constructs a fluent builder for the ExportIdleRecommendations
operation.
- The fluent builder is configurable:
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe Amazon Web Services account IDs for the export idle resource recommendations.
If your account is the management account or the delegated administrator of an organization, use this parameter to specify the member account you want to export recommendations to.
This parameter can’t be specified together with the include member accounts parameter. The parameters are mutually exclusive.
If this parameter or the include member accounts parameter is omitted, the recommendations for member accounts aren’t included in the export.
You can specify multiple account IDs per request.
filters(IdleRecommendationFilter)
/set_filters(Option<Vec::<IdleRecommendationFilter>>)
:
required: falseAn array of objects to specify a filter that exports a more specific set of idle resource recommendations.
fields_to_export(ExportableIdleField)
/set_fields_to_export(Option<Vec::<ExportableIdleField>>)
:
required: falseThe recommendations data to include in the export file. For more information about the fields that can be exported, see Exported files in the Compute Optimizer User Guide.
s3_destination_config(S3DestinationConfig)
/set_s3_destination_config(Option<S3DestinationConfig>)
:
required: trueDescribes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.
You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see Amazon S3 Bucket Policy for Compute Optimizer in the Compute Optimizer User Guide.
file_format(FileFormat)
/set_file_format(Option<FileFormat>)
:
required: falseThe format of the export file. The CSV file is the only export file format currently supported.
include_member_accounts(bool)
/set_include_member_accounts(Option<bool>)
:
required: falseIf your account is the management account or the delegated administrator of an organization, this parameter indicates whether to include recommendations for resources in all member accounts of the organization.
The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User Guide.
If this parameter is omitted, recommendations for member accounts of the organization aren’t included in the export file.
If this parameter or the account ID parameter is omitted, recommendations for member accounts aren’t included in the export.
- On success, responds with
ExportIdleRecommendationsOutput
with field(s):job_id(Option<String>)
:The identification number of the export job.
To view the status of an export job, use the
DescribeRecommendationExportJobs
action and specify the job ID.s3_destination(Option<S3Destination>)
:Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and object keys of a recommendations export file, and its associated metadata file.
- On failure, responds with
SdkError<ExportIdleRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn export_lambda_function_recommendations(
&self,
) -> ExportLambdaFunctionRecommendationsFluentBuilder
pub fn export_lambda_function_recommendations( &self, ) -> ExportLambdaFunctionRecommendationsFluentBuilder
Constructs a fluent builder for the ExportLambdaFunctionRecommendations
operation.
- The fluent builder is configurable:
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe IDs of the Amazon Web Services accounts for which to export Lambda function recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to export recommendations.
This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.
Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.
You can specify multiple account IDs per request.
filters(LambdaFunctionRecommendationFilter)
/set_filters(Option<Vec::<LambdaFunctionRecommendationFilter>>)
:
required: falseAn array of objects to specify a filter that exports a more specific set of Lambda function recommendations.
fields_to_export(ExportableLambdaFunctionField)
/set_fields_to_export(Option<Vec::<ExportableLambdaFunctionField>>)
:
required: falseThe recommendations data to include in the export file. For more information about the fields that can be exported, see Exported files in the Compute Optimizer User Guide.
s3_destination_config(S3DestinationConfig)
/set_s3_destination_config(Option<S3DestinationConfig>)
:
required: trueDescribes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.
You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see Amazon S3 Bucket Policy for Compute Optimizer in the Compute Optimizer User Guide.
file_format(FileFormat)
/set_file_format(Option<FileFormat>)
:
required: falseThe format of the export file.
The only export file format currently supported is
Csv
.include_member_accounts(bool)
/set_include_member_accounts(Option<bool>)
:
required: falseIndicates whether to include recommendations for resources in all member accounts of the organization if your account is the management account of an organization.
The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User Guide.
Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.
This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.
Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.
- On success, responds with
ExportLambdaFunctionRecommendationsOutput
with field(s):job_id(Option<String>)
:The identification number of the export job.
Use the
DescribeRecommendationExportJobs
action, and specify the job ID to view the status of an export job.s3_destination(Option<S3Destination>)
:Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and object keys of a recommendations export file, and its associated metadata file.
- On failure, responds with
SdkError<ExportLambdaFunctionRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn export_license_recommendations(
&self,
) -> ExportLicenseRecommendationsFluentBuilder
pub fn export_license_recommendations( &self, ) -> ExportLicenseRecommendationsFluentBuilder
Constructs a fluent builder for the ExportLicenseRecommendations
operation.
- The fluent builder is configurable:
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe IDs of the Amazon Web Services accounts for which to export license recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to export recommendations.
This parameter can’t be specified together with the include member accounts parameter. The parameters are mutually exclusive.
If this parameter is omitted, recommendations for member accounts aren’t included in the export.
You can specify multiple account IDs per request.
filters(LicenseRecommendationFilter)
/set_filters(Option<Vec::<LicenseRecommendationFilter>>)
:
required: falseAn array of objects to specify a filter that exports a more specific set of license recommendations.
fields_to_export(ExportableLicenseField)
/set_fields_to_export(Option<Vec::<ExportableLicenseField>>)
:
required: falseThe recommendations data to include in the export file. For more information about the fields that can be exported, see Exported files in the Compute Optimizer User Guide.
s3_destination_config(S3DestinationConfig)
/set_s3_destination_config(Option<S3DestinationConfig>)
:
required: trueDescribes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.
You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see Amazon S3 Bucket Policy for Compute Optimizer in the Compute Optimizer User Guide.
file_format(FileFormat)
/set_file_format(Option<FileFormat>)
:
required: falseThe format of the export file.
A CSV file is the only export format currently supported.
include_member_accounts(bool)
/set_include_member_accounts(Option<bool>)
:
required: falseIndicates whether to include recommendations for resources in all member accounts of the organization if your account is the management account of an organization.
The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User Guide.
If this parameter is omitted, recommendations for member accounts of the organization aren’t included in the export file .
This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.
- On success, responds with
ExportLicenseRecommendationsOutput
with field(s):job_id(Option<String>)
:The identification number of the export job.
To view the status of an export job, use the
DescribeRecommendationExportJobs
action and specify the job ID.s3_destination(Option<S3Destination>)
:Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and object keys of a recommendations export file, and its associated metadata file.
- On failure, responds with
SdkError<ExportLicenseRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn export_rds_database_recommendations(
&self,
) -> ExportRDSDatabaseRecommendationsFluentBuilder
pub fn export_rds_database_recommendations( &self, ) -> ExportRDSDatabaseRecommendationsFluentBuilder
Constructs a fluent builder for the ExportRDSDatabaseRecommendations
operation.
- The fluent builder is configurable:
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe Amazon Web Services account IDs for the export Amazon RDS recommendations.
If your account is the management account or the delegated administrator of an organization, use this parameter to specify the member account you want to export recommendations to.
This parameter can’t be specified together with the include member accounts parameter. The parameters are mutually exclusive.
If this parameter or the include member accounts parameter is omitted, the recommendations for member accounts aren’t included in the export.
You can specify multiple account IDs per request.
filters(RdsdbRecommendationFilter)
/set_filters(Option<Vec::<RdsdbRecommendationFilter>>)
:
required: falseAn array of objects to specify a filter that exports a more specific set of Amazon RDS recommendations.
fields_to_export(ExportableRdsdbField)
/set_fields_to_export(Option<Vec::<ExportableRdsdbField>>)
:
required: falseThe recommendations data to include in the export file. For more information about the fields that can be exported, see Exported files in the Compute Optimizer User Guide.
s3_destination_config(S3DestinationConfig)
/set_s3_destination_config(Option<S3DestinationConfig>)
:
required: trueDescribes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.
You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see Amazon S3 Bucket Policy for Compute Optimizer in the Compute Optimizer User Guide.
file_format(FileFormat)
/set_file_format(Option<FileFormat>)
:
required: falseThe format of the export file.
The CSV file is the only export file format currently supported.
include_member_accounts(bool)
/set_include_member_accounts(Option<bool>)
:
required: falseIf your account is the management account or the delegated administrator of an organization, this parameter indicates whether to include recommendations for resources in all member accounts of the organization.
The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User Guide.
If this parameter is omitted, recommendations for member accounts of the organization aren’t included in the export file.
If this parameter or the account ID parameter is omitted, recommendations for member accounts aren’t included in the export.
recommendation_preferences(RecommendationPreferences)
/set_recommendation_preferences(Option<RecommendationPreferences>)
:
required: falseDescribes the recommendation preferences to return in the response of a
GetAutoScalingGroupRecommendations
,GetEC2InstanceRecommendations
,GetEC2RecommendationProjectedMetrics
,GetRDSDatabaseRecommendations
, andGetRDSDatabaseRecommendationProjectedMetrics
request.
- On success, responds with
ExportRdsDatabaseRecommendationsOutput
with field(s):job_id(Option<String>)
:The identification number of the export job.
To view the status of an export job, use the
DescribeRecommendationExportJobs
action and specify the job ID.s3_destination(Option<S3Destination>)
:Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and object keys of a recommendations export file, and its associated metadata file.
- On failure, responds with
SdkError<ExportRDSDatabaseRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn get_auto_scaling_group_recommendations(
&self,
) -> GetAutoScalingGroupRecommendationsFluentBuilder
pub fn get_auto_scaling_group_recommendations( &self, ) -> GetAutoScalingGroupRecommendationsFluentBuilder
Constructs a fluent builder for the GetAutoScalingGroupRecommendations
operation.
- The fluent builder is configurable:
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe ID of the Amazon Web Services account for which to return Auto Scaling group recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to return Auto Scaling group recommendations.
Only one account ID can be specified per request.
auto_scaling_group_arns(impl Into<String>)
/set_auto_scaling_group_arns(Option<Vec::<String>>)
:
required: falseThe Amazon Resource Name (ARN) of the Auto Scaling groups for which to return recommendations.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of Auto Scaling group recommendations.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of Auto Scaling group recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.filters(Filter)
/set_filters(Option<Vec::<Filter>>)
:
required: falseAn array of objects to specify a filter that returns a more specific list of Auto Scaling group recommendations.
recommendation_preferences(RecommendationPreferences)
/set_recommendation_preferences(Option<RecommendationPreferences>)
:
required: falseAn object to specify the preferences for the Auto Scaling group recommendations to return in the response.
- On success, responds with
GetAutoScalingGroupRecommendationsOutput
with field(s):next_token(Option<String>)
:The token to use to advance to the next page of Auto Scaling group recommendations.
This value is null when there are no more pages of Auto Scaling group recommendations to return.
auto_scaling_group_recommendations(Option<Vec::<AutoScalingGroupRecommendation>>)
:An array of objects that describe Auto Scaling group recommendations.
errors(Option<Vec::<GetRecommendationError>>)
:An array of objects that describe errors of the request.
For example, an error is returned if you request recommendations for an unsupported Auto Scaling group.
- On failure, responds with
SdkError<GetAutoScalingGroupRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn get_ebs_volume_recommendations(
&self,
) -> GetEBSVolumeRecommendationsFluentBuilder
pub fn get_ebs_volume_recommendations( &self, ) -> GetEBSVolumeRecommendationsFluentBuilder
Constructs a fluent builder for the GetEBSVolumeRecommendations
operation.
- The fluent builder is configurable:
volume_arns(impl Into<String>)
/set_volume_arns(Option<Vec::<String>>)
:
required: falseThe Amazon Resource Name (ARN) of the volumes for which to return recommendations.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of volume recommendations.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of volume recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.filters(EbsFilter)
/set_filters(Option<Vec::<EbsFilter>>)
:
required: falseAn array of objects to specify a filter that returns a more specific list of volume recommendations.
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe ID of the Amazon Web Services account for which to return volume recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to return volume recommendations.
Only one account ID can be specified per request.
- On success, responds with
GetEbsVolumeRecommendationsOutput
with field(s):next_token(Option<String>)
:The token to use to advance to the next page of volume recommendations.
This value is null when there are no more pages of volume recommendations to return.
volume_recommendations(Option<Vec::<VolumeRecommendation>>)
:An array of objects that describe volume recommendations.
errors(Option<Vec::<GetRecommendationError>>)
:An array of objects that describe errors of the request.
For example, an error is returned if you request recommendations for an unsupported volume.
- On failure, responds with
SdkError<GetEBSVolumeRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn get_ec2_instance_recommendations(
&self,
) -> GetEC2InstanceRecommendationsFluentBuilder
pub fn get_ec2_instance_recommendations( &self, ) -> GetEC2InstanceRecommendationsFluentBuilder
Constructs a fluent builder for the GetEC2InstanceRecommendations
operation.
- The fluent builder is configurable:
instance_arns(impl Into<String>)
/set_instance_arns(Option<Vec::<String>>)
:
required: falseThe Amazon Resource Name (ARN) of the instances for which to return recommendations.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of instance recommendations.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of instance recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.filters(Filter)
/set_filters(Option<Vec::<Filter>>)
:
required: falseAn array of objects to specify a filter that returns a more specific list of instance recommendations.
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe ID of the Amazon Web Services account for which to return instance recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to return instance recommendations.
Only one account ID can be specified per request.
recommendation_preferences(RecommendationPreferences)
/set_recommendation_preferences(Option<RecommendationPreferences>)
:
required: falseAn object to specify the preferences for the Amazon EC2 instance recommendations to return in the response.
- On success, responds with
GetEc2InstanceRecommendationsOutput
with field(s):next_token(Option<String>)
:The token to use to advance to the next page of instance recommendations.
This value is null when there are no more pages of instance recommendations to return.
instance_recommendations(Option<Vec::<InstanceRecommendation>>)
:An array of objects that describe instance recommendations.
errors(Option<Vec::<GetRecommendationError>>)
:An array of objects that describe errors of the request.
For example, an error is returned if you request recommendations for an instance of an unsupported instance family.
- On failure, responds with
SdkError<GetEC2InstanceRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn get_ec2_recommendation_projected_metrics(
&self,
) -> GetEC2RecommendationProjectedMetricsFluentBuilder
pub fn get_ec2_recommendation_projected_metrics( &self, ) -> GetEC2RecommendationProjectedMetricsFluentBuilder
Constructs a fluent builder for the GetEC2RecommendationProjectedMetrics
operation.
- The fluent builder is configurable:
instance_arn(impl Into<String>)
/set_instance_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.
stat(MetricStatistic)
/set_stat(Option<MetricStatistic>)
:
required: trueThe statistic of the projected metrics.
period(i32)
/set_period(Option<i32>)
:
required: trueThe granularity, in seconds, of the projected metrics data points.
start_time(DateTime)
/set_start_time(Option<DateTime>)
:
required: trueThe timestamp of the first projected metrics data point to return.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:
required: trueThe timestamp of the last projected metrics data point to return.
recommendation_preferences(RecommendationPreferences)
/set_recommendation_preferences(Option<RecommendationPreferences>)
:
required: falseAn object to specify the preferences for the Amazon EC2 recommendation projected metrics to return in the response.
- On success, responds with
GetEc2RecommendationProjectedMetricsOutput
with field(s):recommended_option_projected_metrics(Option<Vec::<RecommendedOptionProjectedMetric>>)
:An array of objects that describes projected metrics.
- On failure, responds with
SdkError<GetEC2RecommendationProjectedMetricsError>
Source§impl Client
impl Client
Sourcepub fn get_ecs_service_recommendation_projected_metrics(
&self,
) -> GetECSServiceRecommendationProjectedMetricsFluentBuilder
pub fn get_ecs_service_recommendation_projected_metrics( &self, ) -> GetECSServiceRecommendationProjectedMetricsFluentBuilder
Constructs a fluent builder for the GetECSServiceRecommendationProjectedMetrics
operation.
- The fluent builder is configurable:
service_arn(impl Into<String>)
/set_service_arn(Option<String>)
:
required: trueThe ARN that identifies the Amazon ECS service.
The following is the format of the ARN:
arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name
stat(MetricStatistic)
/set_stat(Option<MetricStatistic>)
:
required: trueThe statistic of the projected metrics.
period(i32)
/set_period(Option<i32>)
:
required: trueThe granularity, in seconds, of the projected metrics data points.
start_time(DateTime)
/set_start_time(Option<DateTime>)
:
required: trueThe timestamp of the first projected metrics data point to return.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:
required: trueThe timestamp of the last projected metrics data point to return.
- On success, responds with
GetEcsServiceRecommendationProjectedMetricsOutput
with field(s):recommended_option_projected_metrics(Option<Vec::<EcsServiceRecommendedOptionProjectedMetric>>)
:An array of objects that describes the projected metrics.
- On failure, responds with
SdkError<GetECSServiceRecommendationProjectedMetricsError>
Source§impl Client
impl Client
Sourcepub fn get_ecs_service_recommendations(
&self,
) -> GetECSServiceRecommendationsFluentBuilder
pub fn get_ecs_service_recommendations( &self, ) -> GetECSServiceRecommendationsFluentBuilder
Constructs a fluent builder for the GetECSServiceRecommendations
operation.
- The fluent builder is configurable:
service_arns(impl Into<String>)
/set_service_arns(Option<Vec::<String>>)
:
required: falseThe ARN that identifies the Amazon ECS service.
The following is the format of the ARN:
arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of Amazon ECS service recommendations.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of Amazon ECS service recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.filters(EcsServiceRecommendationFilter)
/set_filters(Option<Vec::<EcsServiceRecommendationFilter>>)
:
required: falseAn array of objects to specify a filter that returns a more specific list of Amazon ECS service recommendations.
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseReturn the Amazon ECS service recommendations to the specified Amazon Web Services account IDs.
If your account is the management account or the delegated administrator of an organization, use this parameter to return the Amazon ECS service recommendations to specific member accounts.
You can only specify one account ID per request.
- On success, responds with
GetEcsServiceRecommendationsOutput
with field(s):next_token(Option<String>)
:The token to advance to the next page of Amazon ECS service recommendations.
ecs_service_recommendations(Option<Vec::<EcsServiceRecommendation>>)
:An array of objects that describe the Amazon ECS service recommendations.
errors(Option<Vec::<GetRecommendationError>>)
:An array of objects that describe errors of the request.
- On failure, responds with
SdkError<GetECSServiceRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn get_effective_recommendation_preferences(
&self,
) -> GetEffectiveRecommendationPreferencesFluentBuilder
pub fn get_effective_recommendation_preferences( &self, ) -> GetEffectiveRecommendationPreferencesFluentBuilder
Constructs a fluent builder for the GetEffectiveRecommendationPreferences
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 which to confirm effective recommendation preferences. Only EC2 instance and Auto Scaling group ARNs are currently supported.
- On success, responds with
GetEffectiveRecommendationPreferencesOutput
with field(s):enhanced_infrastructure_metrics(Option<EnhancedInfrastructureMetrics>)
:The status of the enhanced infrastructure metrics recommendation preference. Considers all applicable preferences that you might have set at the resource, account, and organization level.
A status of
Active
confirms that the preference is applied in the latest recommendation refresh, and a status ofInactive
confirms that it’s not yet applied to recommendations.To validate whether the preference is applied to your last generated set of recommendations, review the
effectiveRecommendationPreferences
value in the response of theGetAutoScalingGroupRecommendations
andGetEC2InstanceRecommendations
actions.For more information, see Enhanced infrastructure metrics in the Compute Optimizer User Guide.
external_metrics_preference(Option<ExternalMetricsPreference>)
:The provider of the external metrics recommendation preference. Considers all applicable preferences that you might have set at the account and organization level.
If the preference is applied in the latest recommendation refresh, an object with a valid
source
value appears in the response. If the preference isn’t applied to the recommendations already, then this object doesn’t appear in the response.To validate whether the preference is applied to your last generated set of recommendations, review the
effectiveRecommendationPreferences
value in the response of theGetEC2InstanceRecommendations
actions.For more information, see Enhanced infrastructure metrics in the Compute Optimizer User Guide.
look_back_period(Option<LookBackPeriodPreference>)
:The number of days the utilization metrics of the Amazon Web Services resource are analyzed.
To validate that the preference is applied to your last generated set of recommendations, review the
effectiveRecommendationPreferences
value in the response of the GetAutoScalingGroupRecommendations or GetEC2InstanceRecommendations actions.utilization_preferences(Option<Vec::<UtilizationPreference>>)
:The resource’s CPU and memory utilization preferences, such as threshold and headroom, that were used to generate rightsizing recommendations. It considers all applicable preferences that you set at the resource, account, and organization level.
To validate that the preference is applied to your last generated set of recommendations, review the
effectiveRecommendationPreferences
value in the response of the GetAutoScalingGroupRecommendations or GetEC2InstanceRecommendations actions.preferred_resources(Option<Vec::<EffectivePreferredResource>>)
:The resource type values that are considered as candidates when generating rightsizing recommendations. This object resolves any wildcard expressions and returns the effective list of candidate resource type values. It also considers all applicable preferences that you set at the resource, account, and organization level.
To validate that the preference is applied to your last generated set of recommendations, review the
effectiveRecommendationPreferences
value in the response of the GetAutoScalingGroupRecommendations or GetEC2InstanceRecommendations actions.
- On failure, responds with
SdkError<GetEffectiveRecommendationPreferencesError>
Source§impl Client
impl Client
Sourcepub fn get_enrollment_status(&self) -> GetEnrollmentStatusFluentBuilder
pub fn get_enrollment_status(&self) -> GetEnrollmentStatusFluentBuilder
Constructs a fluent builder for the GetEnrollmentStatus
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
GetEnrollmentStatusOutput
with field(s):status(Option<Status>)
:The enrollment status of the account.
status_reason(Option<String>)
:The reason for the enrollment status of the account.
For example, an account might show a status of
Pending
because member accounts of an organization require more time to be enrolled in the service.member_accounts_enrolled(bool)
:Confirms the enrollment status of member accounts of the organization, if the account is a management account of an organization.
last_updated_timestamp(Option<DateTime>)
:The Unix epoch timestamp, in seconds, of when the account enrollment status was last updated.
number_of_member_accounts_opted_in(Option<i32>)
:The count of organization member accounts that are opted in to the service, if your account is an organization management account.
- On failure, responds with
SdkError<GetEnrollmentStatusError>
Source§impl Client
impl Client
Sourcepub fn get_enrollment_statuses_for_organization(
&self,
) -> GetEnrollmentStatusesForOrganizationFluentBuilder
pub fn get_enrollment_statuses_for_organization( &self, ) -> GetEnrollmentStatusesForOrganizationFluentBuilder
Constructs a fluent builder for the GetEnrollmentStatusesForOrganization
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
filters(EnrollmentFilter)
/set_filters(Option<Vec::<EnrollmentFilter>>)
:
required: falseAn array of objects to specify a filter that returns a more specific list of account enrollment statuses.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of account enrollment statuses.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of account enrollment statuses to return with a single request. You can specify up to 100 statuses to return with each request.
To retrieve the remaining results, make another request with the returned
nextToken
value.
- On success, responds with
GetEnrollmentStatusesForOrganizationOutput
with field(s):account_enrollment_statuses(Option<Vec::<AccountEnrollmentStatus>>)
:An array of objects that describe the enrollment statuses of organization member accounts.
next_token(Option<String>)
:The token to use to advance to the next page of account enrollment statuses.
This value is null when there are no more pages of account enrollment statuses to return.
- On failure, responds with
SdkError<GetEnrollmentStatusesForOrganizationError>
Source§impl Client
impl Client
Sourcepub fn get_idle_recommendations(&self) -> GetIdleRecommendationsFluentBuilder
pub fn get_idle_recommendations(&self) -> GetIdleRecommendationsFluentBuilder
Constructs a fluent builder for the GetIdleRecommendations
operation.
- The fluent builder is configurable:
resource_arns(impl Into<String>)
/set_resource_arns(Option<Vec::<String>>)
:
required: falseThe ARN that identifies the idle resource.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of idle resource recommendations.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of idle resource recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.filters(IdleRecommendationFilter)
/set_filters(Option<Vec::<IdleRecommendationFilter>>)
:
required: falseAn array of objects to specify a filter that returns a more specific list of idle resource recommendations.
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseReturn the idle resource recommendations to the specified Amazon Web Services account IDs.
If your account is the management account or the delegated administrator of an organization, use this parameter to return the idle resource recommendations to specific member accounts.
You can only specify one account ID per request.
order_by(OrderBy)
/set_order_by(Option<OrderBy>)
:
required: falseThe order to sort the idle resource recommendations.
- On success, responds with
GetIdleRecommendationsOutput
with field(s):next_token(Option<String>)
:The token to advance to the next page of idle resource recommendations.
idle_recommendations(Option<Vec::<IdleRecommendation>>)
:An array of objects that describe the idle resource recommendations.
errors(Option<Vec::<IdleRecommendationError>>)
:An array of objects that describe errors of the request.
- On failure, responds with
SdkError<GetIdleRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn get_lambda_function_recommendations(
&self,
) -> GetLambdaFunctionRecommendationsFluentBuilder
pub fn get_lambda_function_recommendations( &self, ) -> GetLambdaFunctionRecommendationsFluentBuilder
Constructs a fluent builder for the GetLambdaFunctionRecommendations
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
function_arns(impl Into<String>)
/set_function_arns(Option<Vec::<String>>)
:
required: falseThe Amazon Resource Name (ARN) of the functions for which to return recommendations.
You can specify a qualified or unqualified ARN. If you specify an unqualified ARN without a function version suffix, Compute Optimizer will return recommendations for the latest (
$LATEST
) version of the function. If you specify a qualified ARN with a version suffix, Compute Optimizer will return recommendations for the specified function version. For more information about using function versions, see Using versions in the Lambda Developer Guide.account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe ID of the Amazon Web Services account for which to return function recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to return function recommendations.
Only one account ID can be specified per request.
filters(LambdaFunctionRecommendationFilter)
/set_filters(Option<Vec::<LambdaFunctionRecommendationFilter>>)
:
required: falseAn array of objects to specify a filter that returns a more specific list of function recommendations.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of function recommendations.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of function recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.
- On success, responds with
GetLambdaFunctionRecommendationsOutput
with field(s):next_token(Option<String>)
:The token to use to advance to the next page of function recommendations.
This value is null when there are no more pages of function recommendations to return.
lambda_function_recommendations(Option<Vec::<LambdaFunctionRecommendation>>)
:An array of objects that describe function recommendations.
- On failure, responds with
SdkError<GetLambdaFunctionRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn get_license_recommendations(
&self,
) -> GetLicenseRecommendationsFluentBuilder
pub fn get_license_recommendations( &self, ) -> GetLicenseRecommendationsFluentBuilder
Constructs a fluent builder for the GetLicenseRecommendations
operation.
- The fluent builder is configurable:
resource_arns(impl Into<String>)
/set_resource_arns(Option<Vec::<String>>)
:
required: falseThe ARN that identifies the Amazon EC2 instance.
The following is the format of the ARN:
arn:aws:ec2:region:aws_account_id:instance/instance-id
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of license recommendations.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of license recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.filters(LicenseRecommendationFilter)
/set_filters(Option<Vec::<LicenseRecommendationFilter>>)
:
required: falseAn array of objects to specify a filter that returns a more specific list of license recommendations.
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe ID of the Amazon Web Services account for which to return license recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to return license recommendations.
Only one account ID can be specified per request.
- On success, responds with
GetLicenseRecommendationsOutput
with field(s):next_token(Option<String>)
:The token to use to advance to the next page of license recommendations.
license_recommendations(Option<Vec::<LicenseRecommendation>>)
:An array of objects that describe license recommendations.
errors(Option<Vec::<GetRecommendationError>>)
:An array of objects that describe errors of the request.
- On failure, responds with
SdkError<GetLicenseRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn get_rds_database_recommendation_projected_metrics(
&self,
) -> GetRDSDatabaseRecommendationProjectedMetricsFluentBuilder
pub fn get_rds_database_recommendation_projected_metrics( &self, ) -> GetRDSDatabaseRecommendationProjectedMetricsFluentBuilder
Constructs a fluent builder for the GetRDSDatabaseRecommendationProjectedMetrics
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN that identifies the Amazon RDS.
The following is the format of the ARN:
arn:aws:rds:{region}:{accountId}:db:{resourceName}
stat(MetricStatistic)
/set_stat(Option<MetricStatistic>)
:
required: trueThe statistic of the projected metrics.
period(i32)
/set_period(Option<i32>)
:
required: trueThe granularity, in seconds, of the projected metrics data points.
start_time(DateTime)
/set_start_time(Option<DateTime>)
:
required: trueThe timestamp of the first projected metrics data point to return.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:
required: trueThe timestamp of the last projected metrics data point to return.
recommendation_preferences(RecommendationPreferences)
/set_recommendation_preferences(Option<RecommendationPreferences>)
:
required: falseDescribes the recommendation preferences to return in the response of a
GetAutoScalingGroupRecommendations
,GetEC2InstanceRecommendations
,GetEC2RecommendationProjectedMetrics
,GetRDSDatabaseRecommendations
, andGetRDSDatabaseRecommendationProjectedMetrics
request.
- On success, responds with
GetRdsDatabaseRecommendationProjectedMetricsOutput
with field(s):recommended_option_projected_metrics(Option<Vec::<RdsDatabaseRecommendedOptionProjectedMetric>>)
:An array of objects that describes the projected metrics.
- On failure, responds with
SdkError<GetRDSDatabaseRecommendationProjectedMetricsError>
Source§impl Client
impl Client
Sourcepub fn get_rds_database_recommendations(
&self,
) -> GetRDSDatabaseRecommendationsFluentBuilder
pub fn get_rds_database_recommendations( &self, ) -> GetRDSDatabaseRecommendationsFluentBuilder
Constructs a fluent builder for the GetRDSDatabaseRecommendations
operation.
- The fluent builder is configurable:
resource_arns(impl Into<String>)
/set_resource_arns(Option<Vec::<String>>)
:
required: falseThe ARN that identifies the Amazon RDS.
The following is the format of the ARN:
arn:aws:rds:{region}:{accountId}:db:{resourceName}
The following is the format of a DB Cluster ARN:
arn:aws:rds:{region}:{accountId}:cluster:{resourceName}
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of Amazon RDS recommendations.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of Amazon RDS recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.filters(RdsdbRecommendationFilter)
/set_filters(Option<Vec::<RdsdbRecommendationFilter>>)
:
required: falseAn array of objects to specify a filter that returns a more specific list of Amazon RDS recommendations.
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseReturn the Amazon RDS recommendations to the specified Amazon Web Services account IDs.
If your account is the management account or the delegated administrator of an organization, use this parameter to return the Amazon RDS recommendations to specific member accounts.
You can only specify one account ID per request.
recommendation_preferences(RecommendationPreferences)
/set_recommendation_preferences(Option<RecommendationPreferences>)
:
required: falseDescribes the recommendation preferences to return in the response of a
GetAutoScalingGroupRecommendations
,GetEC2InstanceRecommendations
,GetEC2RecommendationProjectedMetrics
,GetRDSDatabaseRecommendations
, andGetRDSDatabaseRecommendationProjectedMetrics
request.
- On success, responds with
GetRdsDatabaseRecommendationsOutput
with field(s):next_token(Option<String>)
:The token to advance to the next page of Amazon RDS recommendations.
rds_db_recommendations(Option<Vec::<RdsdbRecommendation>>)
:An array of objects that describe the Amazon RDS recommendations.
errors(Option<Vec::<GetRecommendationError>>)
:An array of objects that describe errors of the request.
- On failure, responds with
SdkError<GetRDSDatabaseRecommendationsError>
Source§impl Client
impl Client
Sourcepub fn get_recommendation_preferences(
&self,
) -> GetRecommendationPreferencesFluentBuilder
pub fn get_recommendation_preferences( &self, ) -> GetRecommendationPreferencesFluentBuilder
Constructs a fluent builder for the GetRecommendationPreferences
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
resource_type(ResourceType)
/set_resource_type(Option<ResourceType>)
:
required: trueThe target resource type of the recommendation preference for which to return preferences.
The
Ec2Instance
option encompasses standalone instances and instances that are part of Auto Scaling groups. TheAutoScalingGroup
option encompasses only instances that are part of an Auto Scaling group.scope(Scope)
/set_scope(Option<Scope>)
:
required: falseAn object that describes the scope of the recommendation preference to return.
You can return recommendation preferences that are created at the organization level (for management accounts of an organization only), account level, and resource level. For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of recommendation preferences.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of recommendation preferences to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.
- On success, responds with
GetRecommendationPreferencesOutput
with field(s):next_token(Option<String>)
:The token to use to advance to the next page of recommendation preferences.
This value is null when there are no more pages of recommendation preferences to return.
recommendation_preferences_details(Option<Vec::<RecommendationPreferencesDetail>>)
:An array of objects that describe recommendation preferences.
- On failure, responds with
SdkError<GetRecommendationPreferencesError>
Source§impl Client
impl Client
Sourcepub fn get_recommendation_summaries(
&self,
) -> GetRecommendationSummariesFluentBuilder
pub fn get_recommendation_summaries( &self, ) -> GetRecommendationSummariesFluentBuilder
Constructs a fluent builder for the GetRecommendationSummaries
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
account_ids(impl Into<String>)
/set_account_ids(Option<Vec::<String>>)
:
required: falseThe ID of the Amazon Web Services account for which to return recommendation summaries.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to return recommendation summaries.
Only one account ID can be specified per request.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to advance to the next page of recommendation summaries.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of recommendation summaries to return with a single request.
To retrieve the remaining results, make another request with the returned
nextToken
value.
- On success, responds with
GetRecommendationSummariesOutput
with field(s):next_token(Option<String>)
:The token to use to advance to the next page of recommendation summaries.
This value is null when there are no more pages of recommendation summaries to return.
recommendation_summaries(Option<Vec::<RecommendationSummary>>)
:An array of objects that summarize a recommendation.
- On failure, responds with
SdkError<GetRecommendationSummariesError>
Source§impl Client
impl Client
Sourcepub fn put_recommendation_preferences(
&self,
) -> PutRecommendationPreferencesFluentBuilder
pub fn put_recommendation_preferences( &self, ) -> PutRecommendationPreferencesFluentBuilder
Constructs a fluent builder for the PutRecommendationPreferences
operation.
- The fluent builder is configurable:
resource_type(ResourceType)
/set_resource_type(Option<ResourceType>)
:
required: trueThe target resource type of the recommendation preference to create.
The
Ec2Instance
option encompasses standalone instances and instances that are part of Auto Scaling groups. TheAutoScalingGroup
option encompasses only instances that are part of an Auto Scaling group.scope(Scope)
/set_scope(Option<Scope>)
:
required: falseAn object that describes the scope of the recommendation preference to create.
You can create recommendation preferences at the organization level (for management accounts of an organization only), account level, and resource level. For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.
You cannot create recommendation preferences for Auto Scaling groups at the organization and account levels. You can create recommendation preferences for Auto Scaling groups only at the resource level by specifying a scope name of
ResourceArn
and a scope value of the Auto Scaling group Amazon Resource Name (ARN). This will configure the preference for all instances that are part of the specified Auto Scaling group. You also cannot create recommendation preferences at the resource level for instances that are part of an Auto Scaling group. You can create recommendation preferences at the resource level only for standalone instances.enhanced_infrastructure_metrics(EnhancedInfrastructureMetrics)
/set_enhanced_infrastructure_metrics(Option<EnhancedInfrastructureMetrics>)
:
required: falseThe status of the enhanced infrastructure metrics recommendation preference to create or update.
Specify the
Active
status to activate the preference, or specifyInactive
to deactivate the preference.For more information, see Enhanced infrastructure metrics in the Compute Optimizer User Guide.
inferred_workload_types(InferredWorkloadTypesPreference)
/set_inferred_workload_types(Option<InferredWorkloadTypesPreference>)
:
required: falseThe status of the inferred workload types recommendation preference to create or update.
The inferred workload type feature is active by default. To deactivate it, create a recommendation preference.
Specify the
Inactive
status to deactivate the feature, or specifyActive
to activate it.For more information, see Inferred workload types in the Compute Optimizer User Guide.
external_metrics_preference(ExternalMetricsPreference)
/set_external_metrics_preference(Option<ExternalMetricsPreference>)
:
required: falseThe provider of the external metrics recommendation preference to create or update.
Specify a valid provider in the
source
field to activate the preference. To delete this preference, see theDeleteRecommendationPreferences
action.This preference can only be set for the
Ec2Instance
resource type.For more information, see External metrics ingestion in the Compute Optimizer User Guide.
look_back_period(LookBackPeriodPreference)
/set_look_back_period(Option<LookBackPeriodPreference>)
:
required: falseThe preference to control the number of days the utilization metrics of the Amazon Web Services resource are analyzed. When this preference isn’t specified, we use the default value
DAYS_14
.You can only set this preference for the Amazon EC2 instance and Auto Scaling group resource types.
-
Amazon EC2 instance lookback preferences can be set at the organization, account, and resource levels.
-
Auto Scaling group lookback preferences can only be set at the resource level.
-
utilization_preferences(UtilizationPreference)
/set_utilization_preferences(Option<Vec::<UtilizationPreference>>)
:
required: falseThe preference to control the resource’s CPU utilization threshold, CPU utilization headroom, and memory utilization headroom. When this preference isn’t specified, we use the following default values.
CPU utilization:
-
P99_5
for threshold -
PERCENT_20
for headroom
Memory utilization:
-
PERCENT_20
for headroom
-
You can only set CPU and memory utilization preferences for the Amazon EC2 instance resource type.
-
The threshold setting isn’t available for memory utilization.
-
preferred_resources(PreferredResource)
/set_preferred_resources(Option<Vec::<PreferredResource>>)
:
required: falseThe preference to control which resource type values are considered when generating rightsizing recommendations. You can specify this preference as a combination of include and exclude lists. You must specify either an
includeList
orexcludeList
. If the preference is an empty set of resource type values, an error occurs.You can only set this preference for the Amazon EC2 instance and Auto Scaling group resource types.
savings_estimation_mode(SavingsEstimationMode)
/set_savings_estimation_mode(Option<SavingsEstimationMode>)
:
required: falseThe status of the savings estimation mode preference to create or update.
Specify the
AfterDiscounts
status to activate the preference, or specifyBeforeDiscounts
to deactivate the preference.Only the account manager or delegated administrator of your organization can activate this preference.
For more information, see Savings estimation mode in the Compute Optimizer User Guide.
- On success, responds with
PutRecommendationPreferencesOutput
- On failure, responds with
SdkError<PutRecommendationPreferencesError>
Source§impl Client
impl Client
Sourcepub fn update_enrollment_status(&self) -> UpdateEnrollmentStatusFluentBuilder
pub fn update_enrollment_status(&self) -> UpdateEnrollmentStatusFluentBuilder
Constructs a fluent builder for the UpdateEnrollmentStatus
operation.
- The fluent builder is configurable:
status(Status)
/set_status(Option<Status>)
:
required: trueThe new enrollment status of the account.
The following status options are available:
-
Active
- Opts in your account to the Compute Optimizer service. Compute Optimizer begins analyzing the configuration and utilization metrics of your Amazon Web Services resources after you opt in. For more information, see Metrics analyzed by Compute Optimizer in the Compute Optimizer User Guide. -
Inactive
- Opts out your account from the Compute Optimizer service. Your account’s recommendations and related metrics data will be deleted from Compute Optimizer after you opt out.
The
Pending
andFailed
options cannot be used to update the enrollment status of an account. They are returned in the response of a request to update the enrollment status of an account.-
include_member_accounts(bool)
/set_include_member_accounts(Option<bool>)
:
required: falseIndicates whether to enroll member accounts of the organization if the account is the management account of an organization.
- On success, responds with
UpdateEnrollmentStatusOutput
with field(s):status(Option<Status>)
:The enrollment status of the account.
status_reason(Option<String>)
:The reason for the enrollment status of the account. For example, an account might show a status of
Pending
because member accounts of an organization require more time to be enrolled in the service.
- On failure, responds with
SdkError<UpdateEnrollmentStatusError>
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>
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>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
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>
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>
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>
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>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
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 rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
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);