pub struct Client { /* private fields */ }
Expand description
Client for AWS ARC - Zonal Shift
Client for invoking operations on AWS ARC - Zonal Shift. Each operation on AWS ARC - Zonal Shift 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_arczonalshift::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_arczonalshift::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 CancelZonalShift
operation has
a Client::cancel_zonal_shift
, 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.cancel_zonal_shift()
.zonal_shift_id("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 cancel_zonal_shift(&self) -> CancelZonalShiftFluentBuilder
pub fn cancel_zonal_shift(&self) -> CancelZonalShiftFluentBuilder
Constructs a fluent builder for the CancelZonalShift
operation.
- The fluent builder is configurable:
zonal_shift_id(impl Into<String>)
/set_zonal_shift_id(Option<String>)
:
required: trueThe internally-generated identifier of a zonal shift.
- On success, responds with
CancelZonalShiftOutput
with field(s):zonal_shift_id(String)
:The identifier of a zonal shift.
resource_identifier(String)
:The identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the Amazon Resource Name (ARN) for the resource.
At this time, supported resources are Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.
away_from(String)
:The Availability Zone (for example,
use1-az1
) that traffic is moved away from for a resource when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is instead moved to other Availability Zones in the Amazon Web Services Region.expiry_time(DateTime)
:The expiry time (expiration time) for a customer-initiated zonal shift. A zonal shift is temporary and must be set to expire when you start the zonal shift. You can initially set a zonal shift to expire in a maximum of three days (72 hours). However, you can update a zonal shift to set a new expiration at any time.
When you start a zonal shift, you specify how long you want it to be active, which ARC converts to an expiry time (expiration time). You can cancel a zonal shift when you’re ready to restore traffic to the Availability Zone, or just wait for it to expire. Or you can update the zonal shift to specify another length of time to expire in.
start_time(DateTime)
:The time (UTC) when the zonal shift starts.
status(ZonalShiftStatus)
:A status for a zonal shift.
The
Status
for a zonal shift can have one of the following values:-
ACTIVE: The zonal shift has been started and active.
-
EXPIRED: The zonal shift has expired (the expiry time was exceeded).
-
CANCELED: The zonal shift was canceled.
-
comment(String)
:A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.
- On failure, responds with
SdkError<CancelZonalShiftError>
Source§impl Client
impl Client
Sourcepub fn create_practice_run_configuration(
&self,
) -> CreatePracticeRunConfigurationFluentBuilder
pub fn create_practice_run_configuration( &self, ) -> CreatePracticeRunConfigurationFluentBuilder
Constructs a fluent builder for the CreatePracticeRunConfiguration
operation.
- The fluent builder is configurable:
resource_identifier(impl Into<String>)
/set_resource_identifier(Option<String>)
:
required: trueThe identifier of the resource that Amazon Web Services shifts traffic for with a practice run zonal shift. The identifier is the Amazon Resource Name (ARN) for the resource.
At this time, supported resources are Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.
blocked_windows(impl Into<String>)
/set_blocked_windows(Option<Vec::<String>>)
:
required: falseOptionally, you can block ARC from starting practice runs for specific windows of days and times.
The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple blocked windows with spaces.
For example, say you run business report summaries three days a week. For this scenario, you might set the following recurring days and times as blocked windows, for example:
MON-20:30-21:30 WED-20:30-21:30 FRI-20:30-21:30
.blocked_dates(impl Into<String>)
/set_blocked_dates(Option<Vec::<String>>)
:
required: falseOptionally, you can block ARC from starting practice runs for a resource on specific calendar dates.
The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Separate multiple blocked dates with spaces.
For example, if you have an application update scheduled to launch on May 1, 2024, and you don’t want practice runs to shift traffic away at that time, you could set a blocked date for
2024-05-01
.blocking_alarms(ControlCondition)
/set_blocking_alarms(Option<Vec::<ControlCondition>>)
:
required: falseAn Amazon CloudWatch alarm that you can specify for zonal autoshift practice runs. This alarm blocks ARC from starting practice run zonal shifts, and ends a practice run that’s in progress, when the alarm is in an
ALARM
state.outcome_alarms(ControlCondition)
/set_outcome_alarms(Option<Vec::<ControlCondition>>)
:
required: trueThe outcome alarm for practice runs is a required Amazon CloudWatch alarm that you specify that ends a practice run when the alarm is in an
ALARM
state.Configure the alarm to monitor the health of your application when traffic is shifted away from an Availability Zone during each practice run. You should configure the alarm to go into an
ALARM
state if your application is impacted by the zonal shift, and you want to stop the zonal shift, to let traffic for the resource return to the Availability Zone.
- On success, responds with
CreatePracticeRunConfigurationOutput
with field(s):arn(String)
:The Amazon Resource Name (ARN) of the resource that you configured the practice run for.
name(String)
:The name of the resource that you configured the practice run for.
zonal_autoshift_status(ZonalAutoshiftStatus)
:The status for zonal autoshift for a resource. When you specify
ENABLED
for the autoshift status, Amazon Web Services shifts traffic away from shifts away application resource traffic from an Availability Zone, on your behalf, when internal telemetry indicates that there is an Availability Zone impairment that could potentially impact customers.When you enable zonal autoshift, you must also configure practice runs for the resource.
practice_run_configuration(Option<PracticeRunConfiguration>)
:A practice run configuration for a resource. Configurations include the outcome alarm that you specify for practice runs, and, optionally, a blocking alarm and blocking dates and windows.
- On failure, responds with
SdkError<CreatePracticeRunConfigurationError>
Source§impl Client
impl Client
Sourcepub fn delete_practice_run_configuration(
&self,
) -> DeletePracticeRunConfigurationFluentBuilder
pub fn delete_practice_run_configuration( &self, ) -> DeletePracticeRunConfigurationFluentBuilder
Constructs a fluent builder for the DeletePracticeRunConfiguration
operation.
- The fluent builder is configurable:
resource_identifier(impl Into<String>)
/set_resource_identifier(Option<String>)
:
required: trueThe identifier for the resource that you want to delete the practice run configuration for. The identifier is the Amazon Resource Name (ARN) for the resource.
- On success, responds with
DeletePracticeRunConfigurationOutput
with field(s):arn(String)
:The Amazon Resource Name (ARN) of the resource that you deleted the practice run for.
name(String)
:The name of the resource that you deleted the practice run for.
zonal_autoshift_status(ZonalAutoshiftStatus)
:The status of zonal autoshift for the resource.
- On failure, responds with
SdkError<DeletePracticeRunConfigurationError>
Source§impl Client
impl Client
Sourcepub fn get_autoshift_observer_notification_status(
&self,
) -> GetAutoshiftObserverNotificationStatusFluentBuilder
pub fn get_autoshift_observer_notification_status( &self, ) -> GetAutoshiftObserverNotificationStatusFluentBuilder
Constructs a fluent builder for the GetAutoshiftObserverNotificationStatus
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
GetAutoshiftObserverNotificationStatusOutput
with field(s):status(AutoshiftObserverNotificationStatus)
:The status of autoshift observer notification. If the status is
ENABLED
, ARC includes all autoshift events when you use the Amazon EventBridge patternAutoshift In Progress
. When the status isDISABLED
, ARC includes only autoshift events for autoshifts when one or more of your resources is included in the autoshift.
- On failure, responds with
SdkError<GetAutoshiftObserverNotificationStatusError>
Source§impl Client
impl Client
Sourcepub fn get_managed_resource(&self) -> GetManagedResourceFluentBuilder
pub fn get_managed_resource(&self) -> GetManagedResourceFluentBuilder
Constructs a fluent builder for the GetManagedResource
operation.
- The fluent builder is configurable:
resource_identifier(impl Into<String>)
/set_resource_identifier(Option<String>)
:
required: trueThe identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the Amazon Resource Name (ARN) for the resource.
At this time, supported resources are Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.
- On success, responds with
GetManagedResourceOutput
with field(s):arn(Option<String>)
:The Amazon Resource Name (ARN) for the resource.
name(Option<String>)
:The name of the resource.
applied_weights(HashMap::<String, f32>)
:A collection of key-value pairs that indicate whether resources are active in Availability Zones or not. The key name is the Availability Zone where the resource is deployed. The value is 1 or 0.
zonal_shifts(Vec::<ZonalShiftInResource>)
:The zonal shifts that are currently active for a resource.
autoshifts(Option<Vec::<AutoshiftInResource>>)
:An array of the autoshifts that are active for the resource.
practice_run_configuration(Option<PracticeRunConfiguration>)
:The practice run configuration for zonal autoshift that’s associated with the resource.
zonal_autoshift_status(Option<ZonalAutoshiftStatus>)
:The status for zonal autoshift for a resource. When the autoshift status is
ENABLED
, Amazon Web Services shifts traffic for a resource away from an Availability Zone, on your behalf, when Amazon Web Services determines that there’s an issue in the Availability Zone that could potentially affect customers.
- On failure, responds with
SdkError<GetManagedResourceError>
Source§impl Client
impl Client
Sourcepub fn list_autoshifts(&self) -> ListAutoshiftsFluentBuilder
pub fn list_autoshifts(&self) -> ListAutoshiftsFluentBuilder
Constructs a fluent builder for the ListAutoshifts
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseSpecifies that you want to receive the next page of results. Valid only if you received a
nextToken
response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call’snextToken
response to request the next page of results.status(AutoshiftExecutionStatus)
/set_status(Option<AutoshiftExecutionStatus>)
:
required: falseThe status of the autoshift.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe number of objects that you want to return with this call.
- On success, responds with
ListAutoshiftsOutput
with field(s):items(Option<Vec::<AutoshiftSummary>>)
:The items in the response list.
next_token(Option<String>)
:Specifies that you want to receive the next page of results. Valid only if you received a
nextToken
response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call’snextToken
response to request the next page of results.
- On failure, responds with
SdkError<ListAutoshiftsError>
Source§impl Client
impl Client
Sourcepub fn list_managed_resources(&self) -> ListManagedResourcesFluentBuilder
pub fn list_managed_resources(&self) -> ListManagedResourcesFluentBuilder
Constructs a fluent builder for the ListManagedResources
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseSpecifies that you want to receive the next page of results. Valid only if you received a
nextToken
response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call’snextToken
response to request the next page of results.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe number of objects that you want to return with this call.
- On success, responds with
ListManagedResourcesOutput
with field(s):items(Vec::<ManagedResourceSummary>)
:The items in the response list.
next_token(Option<String>)
:Specifies that you want to receive the next page of results. Valid only if you received a
nextToken
response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call’snextToken
response to request the next page of results.
- On failure, responds with
SdkError<ListManagedResourcesError>
Source§impl Client
impl Client
Sourcepub fn list_zonal_shifts(&self) -> ListZonalShiftsFluentBuilder
pub fn list_zonal_shifts(&self) -> ListZonalShiftsFluentBuilder
Constructs a fluent builder for the ListZonalShifts
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseSpecifies that you want to receive the next page of results. Valid only if you received a
nextToken
response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call’snextToken
response to request the next page of results.status(ZonalShiftStatus)
/set_status(Option<ZonalShiftStatus>)
:
required: falseA status for a zonal shift.
The
Status
for a zonal shift can have one of the following values:-
ACTIVE: The zonal shift has been started and active.
-
EXPIRED: The zonal shift has expired (the expiry time was exceeded).
-
CANCELED: The zonal shift was canceled.
-
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe number of objects that you want to return with this call.
resource_identifier(impl Into<String>)
/set_resource_identifier(Option<String>)
:
required: falseThe identifier for the resource that you want to list zonal shifts for. The identifier is the Amazon Resource Name (ARN) for the resource.
- On success, responds with
ListZonalShiftsOutput
with field(s):items(Option<Vec::<ZonalShiftSummary>>)
:The items in the response list.
next_token(Option<String>)
:Specifies that you want to receive the next page of results. Valid only if you received a
nextToken
response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call’snextToken
response to request the next page of results.
- On failure, responds with
SdkError<ListZonalShiftsError>
Source§impl Client
impl Client
Sourcepub fn start_zonal_shift(&self) -> StartZonalShiftFluentBuilder
pub fn start_zonal_shift(&self) -> StartZonalShiftFluentBuilder
Constructs a fluent builder for the StartZonalShift
operation.
- The fluent builder is configurable:
resource_identifier(impl Into<String>)
/set_resource_identifier(Option<String>)
:
required: trueThe identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the Amazon Resource Name (ARN) for the resource.
At this time, supported resources are Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.
away_from(impl Into<String>)
/set_away_from(Option<String>)
:
required: trueThe Availability Zone (for example,
use1-az1
) that traffic is moved away from for a resource when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is instead moved to other Availability Zones in the Amazon Web Services Region.expires_in(impl Into<String>)
/set_expires_in(Option<String>)
:
required: trueThe length of time that you want a zonal shift to be active, which ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours).
If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you’re ready to restore traffic to the Availability Zone.
To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:
-
A lowercase letter m: To specify that the value is in minutes.
-
A lowercase letter h: To specify that the value is in hours.
For example:
20h
means the zonal shift expires in 20 hours.120m
means the zonal shift expires in 120 minutes (2 hours).-
comment(impl Into<String>)
/set_comment(Option<String>)
:
required: trueA comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.
- On success, responds with
StartZonalShiftOutput
with field(s):zonal_shift_id(String)
:The identifier of a zonal shift.
resource_identifier(String)
:The identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the Amazon Resource Name (ARN) for the resource.
At this time, supported resources are Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.
away_from(String)
:The Availability Zone (for example,
use1-az1
) that traffic is moved away from for a resource when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is instead moved to other Availability Zones in the Amazon Web Services Region.expiry_time(DateTime)
:The expiry time (expiration time) for a customer-initiated zonal shift. A zonal shift is temporary and must be set to expire when you start the zonal shift. You can initially set a zonal shift to expire in a maximum of three days (72 hours). However, you can update a zonal shift to set a new expiration at any time.
When you start a zonal shift, you specify how long you want it to be active, which ARC converts to an expiry time (expiration time). You can cancel a zonal shift when you’re ready to restore traffic to the Availability Zone, or just wait for it to expire. Or you can update the zonal shift to specify another length of time to expire in.
start_time(DateTime)
:The time (UTC) when the zonal shift starts.
status(ZonalShiftStatus)
:A status for a zonal shift.
The
Status
for a zonal shift can have one of the following values:-
ACTIVE: The zonal shift has been started and active.
-
EXPIRED: The zonal shift has expired (the expiry time was exceeded).
-
CANCELED: The zonal shift was canceled.
-
comment(String)
:A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.
- On failure, responds with
SdkError<StartZonalShiftError>
Source§impl Client
impl Client
Sourcepub fn update_autoshift_observer_notification_status(
&self,
) -> UpdateAutoshiftObserverNotificationStatusFluentBuilder
pub fn update_autoshift_observer_notification_status( &self, ) -> UpdateAutoshiftObserverNotificationStatusFluentBuilder
Constructs a fluent builder for the UpdateAutoshiftObserverNotificationStatus
operation.
- The fluent builder is configurable:
status(AutoshiftObserverNotificationStatus)
/set_status(Option<AutoshiftObserverNotificationStatus>)
:
required: trueThe status to set for autoshift observer notification. If the status is
ENABLED
, ARC includes all autoshift events when you use the Amazon EventBridge patternAutoshift In Progress
. When the status isDISABLED
, ARC includes only autoshift events for autoshifts when one or more of your resources is included in the autoshift.
- On success, responds with
UpdateAutoshiftObserverNotificationStatusOutput
with field(s):status(AutoshiftObserverNotificationStatus)
:The status for autoshift observer notification.
- On failure, responds with
SdkError<UpdateAutoshiftObserverNotificationStatusError>
Source§impl Client
impl Client
Sourcepub fn update_practice_run_configuration(
&self,
) -> UpdatePracticeRunConfigurationFluentBuilder
pub fn update_practice_run_configuration( &self, ) -> UpdatePracticeRunConfigurationFluentBuilder
Constructs a fluent builder for the UpdatePracticeRunConfiguration
operation.
- The fluent builder is configurable:
resource_identifier(impl Into<String>)
/set_resource_identifier(Option<String>)
:
required: trueThe identifier for the resource that you want to update the practice run configuration for. The identifier is the Amazon Resource Name (ARN) for the resource.
blocked_windows(impl Into<String>)
/set_blocked_windows(Option<Vec::<String>>)
:
required: falseAdd, change, or remove windows of days and times for when you can, optionally, block ARC from starting a practice run for a resource.
The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple blocked windows with spaces.
For example, say you run business report summaries three days a week. For this scenario, you might set the following recurring days and times as blocked windows, for example:
MON-20:30-21:30 WED-20:30-21:30 FRI-20:30-21:30
.blocked_dates(impl Into<String>)
/set_blocked_dates(Option<Vec::<String>>)
:
required: falseAdd, change, or remove blocked dates for a practice run in zonal autoshift.
Optionally, you can block practice runs for specific calendar dates. The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Separate multiple blocked dates with spaces.
For example, if you have an application update scheduled to launch on May 1, 2024, and you don’t want practice runs to shift traffic away at that time, you could set a blocked date for
2024-05-01
.blocking_alarms(ControlCondition)
/set_blocking_alarms(Option<Vec::<ControlCondition>>)
:
required: falseAdd, change, or remove the Amazon CloudWatch alarm that you optionally specify as the blocking alarm for practice runs.
outcome_alarms(ControlCondition)
/set_outcome_alarms(Option<Vec::<ControlCondition>>)
:
required: falseSpecify a new the Amazon CloudWatch alarm as the outcome alarm for practice runs.
- On success, responds with
UpdatePracticeRunConfigurationOutput
with field(s):arn(String)
:The Amazon Resource Name (ARN) of the resource that you updated the practice run for.
name(String)
:The name of the resource that you updated the practice run for.
zonal_autoshift_status(ZonalAutoshiftStatus)
:The zonal autoshift status for the resource that you updated the practice run for.
practice_run_configuration(Option<PracticeRunConfiguration>)
:The practice run configuration that was updated.
- On failure, responds with
SdkError<UpdatePracticeRunConfigurationError>
Source§impl Client
impl Client
Sourcepub fn update_zonal_autoshift_configuration(
&self,
) -> UpdateZonalAutoshiftConfigurationFluentBuilder
pub fn update_zonal_autoshift_configuration( &self, ) -> UpdateZonalAutoshiftConfigurationFluentBuilder
Constructs a fluent builder for the UpdateZonalAutoshiftConfiguration
operation.
- The fluent builder is configurable:
resource_identifier(impl Into<String>)
/set_resource_identifier(Option<String>)
:
required: trueThe identifier for the resource that you want to update the zonal autoshift configuration for. The identifier is the Amazon Resource Name (ARN) for the resource.
zonal_autoshift_status(ZonalAutoshiftStatus)
/set_zonal_autoshift_status(Option<ZonalAutoshiftStatus>)
:
required: trueThe zonal autoshift status for the resource that you want to update the zonal autoshift configuration for. Choose
ENABLED
to authorize Amazon Web Services to shift away resource traffic for an application from an Availability Zone during events, on your behalf, to help reduce time to recovery.
- On success, responds with
UpdateZonalAutoshiftConfigurationOutput
with field(s):resource_identifier(String)
:The identifier for the resource that you updated the zonal autoshift configuration for. The identifier is the Amazon Resource Name (ARN) for the resource.
zonal_autoshift_status(ZonalAutoshiftStatus)
:The updated zonal autoshift status for the resource.
- On failure, responds with
SdkError<UpdateZonalAutoshiftConfigurationError>
Source§impl Client
impl Client
Sourcepub fn update_zonal_shift(&self) -> UpdateZonalShiftFluentBuilder
pub fn update_zonal_shift(&self) -> UpdateZonalShiftFluentBuilder
Constructs a fluent builder for the UpdateZonalShift
operation.
- The fluent builder is configurable:
zonal_shift_id(impl Into<String>)
/set_zonal_shift_id(Option<String>)
:
required: trueThe identifier of a zonal shift.
comment(impl Into<String>)
/set_comment(Option<String>)
:
required: falseA comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.
expires_in(impl Into<String>)
/set_expires_in(Option<String>)
:
required: falseThe length of time that you want a zonal shift to be active, which ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours).
If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you’re ready to restore traffic to the Availability Zone.
To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:
-
A lowercase letter m: To specify that the value is in minutes.
-
A lowercase letter h: To specify that the value is in hours.
For example:
20h
means the zonal shift expires in 20 hours.120m
means the zonal shift expires in 120 minutes (2 hours).-
- On success, responds with
UpdateZonalShiftOutput
with field(s):zonal_shift_id(String)
:The identifier of a zonal shift.
resource_identifier(String)
:The identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the Amazon Resource Name (ARN) for the resource.
At this time, supported resources are Network Load Balancers and Application Load Balancers with cross-zone load balancing turned off.
away_from(String)
:The Availability Zone (for example,
use1-az1
) that traffic is moved away from for a resource when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is instead moved to other Availability Zones in the Amazon Web Services Region.expiry_time(DateTime)
:The expiry time (expiration time) for a customer-initiated zonal shift. A zonal shift is temporary and must be set to expire when you start the zonal shift. You can initially set a zonal shift to expire in a maximum of three days (72 hours). However, you can update a zonal shift to set a new expiration at any time.
When you start a zonal shift, you specify how long you want it to be active, which ARC converts to an expiry time (expiration time). You can cancel a zonal shift when you’re ready to restore traffic to the Availability Zone, or just wait for it to expire. Or you can update the zonal shift to specify another length of time to expire in.
start_time(DateTime)
:The time (UTC) when the zonal shift starts.
status(ZonalShiftStatus)
:A status for a zonal shift.
The
Status
for a zonal shift can have one of the following values:-
ACTIVE: The zonal shift has been started and active.
-
EXPIRED: The zonal shift has expired (the expiry time was exceeded).
-
CANCELED: The zonal shift was canceled.
-
comment(String)
:A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.
- On failure, responds with
SdkError<UpdateZonalShiftError>
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);