#[non_exhaustive]pub struct ScalingPolicyBuilder { /* private fields */ }Expand description
A builder for ScalingPolicy.
Implementations§
Source§impl ScalingPolicyBuilder
impl ScalingPolicyBuilder
Sourcepub fn fleet_id(self, input: impl Into<String>) -> Self
pub fn fleet_id(self, input: impl Into<String>) -> Self
A unique identifier for the fleet that is associated with this scaling policy.
Sourcepub fn set_fleet_id(self, input: Option<String>) -> Self
pub fn set_fleet_id(self, input: Option<String>) -> Self
A unique identifier for the fleet that is associated with this scaling policy.
Sourcepub fn get_fleet_id(&self) -> &Option<String>
pub fn get_fleet_id(&self) -> &Option<String>
A unique identifier for the fleet that is associated with this scaling policy.
Sourcepub fn fleet_arn(self, input: impl Into<String>) -> Self
pub fn fleet_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift Servers fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is arn:aws:gamelift:.
Sourcepub fn set_fleet_arn(self, input: Option<String>) -> Self
pub fn set_fleet_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift Servers fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is arn:aws:gamelift:.
Sourcepub fn get_fleet_arn(&self) -> &Option<String>
pub fn get_fleet_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift Servers fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is arn:aws:gamelift:.
Sourcepub fn name(self, input: impl Into<String>) -> Self
pub fn name(self, input: impl Into<String>) -> Self
A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique.
Sourcepub fn set_name(self, input: Option<String>) -> Self
pub fn set_name(self, input: Option<String>) -> Self
A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique.
Sourcepub fn get_name(&self) -> &Option<String>
pub fn get_name(&self) -> &Option<String>
A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique.
Sourcepub fn status(self, input: ScalingStatusType) -> Self
pub fn status(self, input: ScalingStatusType) -> Self
Current status of the scaling policy. The scaling policy can be in force only when in an ACTIVE status. Scaling policies can be suspended for individual fleets. If the policy is suspended for a fleet, the policy status does not change.
-
ACTIVE -- The scaling policy can be used for auto-scaling a fleet.
-
UPDATE_REQUESTED -- A request to update the scaling policy has been received.
-
UPDATING -- A change is being made to the scaling policy.
-
DELETE_REQUESTED -- A request to delete the scaling policy has been received.
-
DELETING -- The scaling policy is being deleted.
-
DELETED -- The scaling policy has been deleted.
-
ERROR -- An error occurred in creating the policy. It should be removed and recreated.
Sourcepub fn set_status(self, input: Option<ScalingStatusType>) -> Self
pub fn set_status(self, input: Option<ScalingStatusType>) -> Self
Current status of the scaling policy. The scaling policy can be in force only when in an ACTIVE status. Scaling policies can be suspended for individual fleets. If the policy is suspended for a fleet, the policy status does not change.
-
ACTIVE -- The scaling policy can be used for auto-scaling a fleet.
-
UPDATE_REQUESTED -- A request to update the scaling policy has been received.
-
UPDATING -- A change is being made to the scaling policy.
-
DELETE_REQUESTED -- A request to delete the scaling policy has been received.
-
DELETING -- The scaling policy is being deleted.
-
DELETED -- The scaling policy has been deleted.
-
ERROR -- An error occurred in creating the policy. It should be removed and recreated.
Sourcepub fn get_status(&self) -> &Option<ScalingStatusType>
pub fn get_status(&self) -> &Option<ScalingStatusType>
Current status of the scaling policy. The scaling policy can be in force only when in an ACTIVE status. Scaling policies can be suspended for individual fleets. If the policy is suspended for a fleet, the policy status does not change.
-
ACTIVE -- The scaling policy can be used for auto-scaling a fleet.
-
UPDATE_REQUESTED -- A request to update the scaling policy has been received.
-
UPDATING -- A change is being made to the scaling policy.
-
DELETE_REQUESTED -- A request to delete the scaling policy has been received.
-
DELETING -- The scaling policy is being deleted.
-
DELETED -- The scaling policy has been deleted.
-
ERROR -- An error occurred in creating the policy. It should be removed and recreated.
Sourcepub fn scaling_adjustment(self, input: i32) -> Self
pub fn scaling_adjustment(self, input: i32) -> Self
Amount of adjustment to make, based on the scaling adjustment type.
Sourcepub fn set_scaling_adjustment(self, input: Option<i32>) -> Self
pub fn set_scaling_adjustment(self, input: Option<i32>) -> Self
Amount of adjustment to make, based on the scaling adjustment type.
Sourcepub fn get_scaling_adjustment(&self) -> &Option<i32>
pub fn get_scaling_adjustment(&self) -> &Option<i32>
Amount of adjustment to make, based on the scaling adjustment type.
Sourcepub fn scaling_adjustment_type(self, input: ScalingAdjustmentType) -> Self
pub fn scaling_adjustment_type(self, input: ScalingAdjustmentType) -> Self
The type of adjustment to make to a fleet's instance count.
-
ChangeInCapacity -- add (or subtract) the scaling adjustment value from the current instance count. Positive values scale up while negative values scale down.
-
ExactCapacity -- set the instance count to the scaling adjustment value.
-
PercentChangeInCapacity -- increase or reduce the current instance count by the scaling adjustment, read as a percentage. Positive values scale up while negative values scale down.
Sourcepub fn set_scaling_adjustment_type(
self,
input: Option<ScalingAdjustmentType>,
) -> Self
pub fn set_scaling_adjustment_type( self, input: Option<ScalingAdjustmentType>, ) -> Self
The type of adjustment to make to a fleet's instance count.
-
ChangeInCapacity -- add (or subtract) the scaling adjustment value from the current instance count. Positive values scale up while negative values scale down.
-
ExactCapacity -- set the instance count to the scaling adjustment value.
-
PercentChangeInCapacity -- increase or reduce the current instance count by the scaling adjustment, read as a percentage. Positive values scale up while negative values scale down.
Sourcepub fn get_scaling_adjustment_type(&self) -> &Option<ScalingAdjustmentType>
pub fn get_scaling_adjustment_type(&self) -> &Option<ScalingAdjustmentType>
The type of adjustment to make to a fleet's instance count.
-
ChangeInCapacity -- add (or subtract) the scaling adjustment value from the current instance count. Positive values scale up while negative values scale down.
-
ExactCapacity -- set the instance count to the scaling adjustment value.
-
PercentChangeInCapacity -- increase or reduce the current instance count by the scaling adjustment, read as a percentage. Positive values scale up while negative values scale down.
Sourcepub fn comparison_operator(self, input: ComparisonOperatorType) -> Self
pub fn comparison_operator(self, input: ComparisonOperatorType) -> Self
Comparison operator to use when measuring a metric against the threshold value.
Sourcepub fn set_comparison_operator(
self,
input: Option<ComparisonOperatorType>,
) -> Self
pub fn set_comparison_operator( self, input: Option<ComparisonOperatorType>, ) -> Self
Comparison operator to use when measuring a metric against the threshold value.
Sourcepub fn get_comparison_operator(&self) -> &Option<ComparisonOperatorType>
pub fn get_comparison_operator(&self) -> &Option<ComparisonOperatorType>
Comparison operator to use when measuring a metric against the threshold value.
Sourcepub fn set_threshold(self, input: Option<f64>) -> Self
pub fn set_threshold(self, input: Option<f64>) -> Self
Metric value used to trigger a scaling event.
Sourcepub fn get_threshold(&self) -> &Option<f64>
pub fn get_threshold(&self) -> &Option<f64>
Metric value used to trigger a scaling event.
Sourcepub fn evaluation_periods(self, input: i32) -> Self
pub fn evaluation_periods(self, input: i32) -> Self
Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.
Sourcepub fn set_evaluation_periods(self, input: Option<i32>) -> Self
pub fn set_evaluation_periods(self, input: Option<i32>) -> Self
Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.
Sourcepub fn get_evaluation_periods(&self) -> &Option<i32>
pub fn get_evaluation_periods(&self) -> &Option<i32>
Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.
Sourcepub fn metric_name(self, input: MetricName) -> Self
pub fn metric_name(self, input: MetricName) -> Self
Name of the Amazon GameLift Servers-defined metric that is used to trigger a scaling adjustment. For detailed descriptions of fleet metrics, see Monitor Amazon GameLift Servers with Amazon CloudWatch.
-
ActivatingGameSessions -- Game sessions in the process of being created.
-
ActiveGameSessions -- Game sessions that are currently running.
-
ActiveInstances -- Fleet instances that are currently running at least one game session.
-
AvailableGameSessions -- Additional game sessions that fleet could host simultaneously, given current capacity.
-
AvailablePlayerSessions -- Empty player slots in currently active game sessions. This includes game sessions that are not currently accepting players. Reserved player slots are not included.
-
CurrentPlayerSessions -- Player slots in active game sessions that are being used by a player or are reserved for a player.
-
IdleInstances -- Active instances that are currently hosting zero game sessions.
-
PercentAvailableGameSessions -- Unused percentage of the total number of game sessions that a fleet could host simultaneously, given current capacity. Use this metric for a target-based scaling policy.
-
PercentIdleInstances -- Percentage of the total number of active instances that are hosting zero game sessions.
-
QueueDepth -- Pending game session placement requests, in any queue, where the current fleet is the top-priority destination.
-
WaitTime -- Current wait time for pending game session placement requests, in any queue, where the current fleet is the top-priority destination.
Sourcepub fn set_metric_name(self, input: Option<MetricName>) -> Self
pub fn set_metric_name(self, input: Option<MetricName>) -> Self
Name of the Amazon GameLift Servers-defined metric that is used to trigger a scaling adjustment. For detailed descriptions of fleet metrics, see Monitor Amazon GameLift Servers with Amazon CloudWatch.
-
ActivatingGameSessions -- Game sessions in the process of being created.
-
ActiveGameSessions -- Game sessions that are currently running.
-
ActiveInstances -- Fleet instances that are currently running at least one game session.
-
AvailableGameSessions -- Additional game sessions that fleet could host simultaneously, given current capacity.
-
AvailablePlayerSessions -- Empty player slots in currently active game sessions. This includes game sessions that are not currently accepting players. Reserved player slots are not included.
-
CurrentPlayerSessions -- Player slots in active game sessions that are being used by a player or are reserved for a player.
-
IdleInstances -- Active instances that are currently hosting zero game sessions.
-
PercentAvailableGameSessions -- Unused percentage of the total number of game sessions that a fleet could host simultaneously, given current capacity. Use this metric for a target-based scaling policy.
-
PercentIdleInstances -- Percentage of the total number of active instances that are hosting zero game sessions.
-
QueueDepth -- Pending game session placement requests, in any queue, where the current fleet is the top-priority destination.
-
WaitTime -- Current wait time for pending game session placement requests, in any queue, where the current fleet is the top-priority destination.
Sourcepub fn get_metric_name(&self) -> &Option<MetricName>
pub fn get_metric_name(&self) -> &Option<MetricName>
Name of the Amazon GameLift Servers-defined metric that is used to trigger a scaling adjustment. For detailed descriptions of fleet metrics, see Monitor Amazon GameLift Servers with Amazon CloudWatch.
-
ActivatingGameSessions -- Game sessions in the process of being created.
-
ActiveGameSessions -- Game sessions that are currently running.
-
ActiveInstances -- Fleet instances that are currently running at least one game session.
-
AvailableGameSessions -- Additional game sessions that fleet could host simultaneously, given current capacity.
-
AvailablePlayerSessions -- Empty player slots in currently active game sessions. This includes game sessions that are not currently accepting players. Reserved player slots are not included.
-
CurrentPlayerSessions -- Player slots in active game sessions that are being used by a player or are reserved for a player.
-
IdleInstances -- Active instances that are currently hosting zero game sessions.
-
PercentAvailableGameSessions -- Unused percentage of the total number of game sessions that a fleet could host simultaneously, given current capacity. Use this metric for a target-based scaling policy.
-
PercentIdleInstances -- Percentage of the total number of active instances that are hosting zero game sessions.
-
QueueDepth -- Pending game session placement requests, in any queue, where the current fleet is the top-priority destination.
-
WaitTime -- Current wait time for pending game session placement requests, in any queue, where the current fleet is the top-priority destination.
Sourcepub fn policy_type(self, input: PolicyType) -> Self
pub fn policy_type(self, input: PolicyType) -> Self
The type of scaling policy to create. For a target-based policy, set the parameter MetricName to 'PercentAvailableGameSessions' and specify a TargetConfiguration. For a rule-based policy set the following parameters: MetricName, ComparisonOperator, Threshold, EvaluationPeriods, ScalingAdjustmentType, and ScalingAdjustment.
Sourcepub fn set_policy_type(self, input: Option<PolicyType>) -> Self
pub fn set_policy_type(self, input: Option<PolicyType>) -> Self
The type of scaling policy to create. For a target-based policy, set the parameter MetricName to 'PercentAvailableGameSessions' and specify a TargetConfiguration. For a rule-based policy set the following parameters: MetricName, ComparisonOperator, Threshold, EvaluationPeriods, ScalingAdjustmentType, and ScalingAdjustment.
Sourcepub fn get_policy_type(&self) -> &Option<PolicyType>
pub fn get_policy_type(&self) -> &Option<PolicyType>
The type of scaling policy to create. For a target-based policy, set the parameter MetricName to 'PercentAvailableGameSessions' and specify a TargetConfiguration. For a rule-based policy set the following parameters: MetricName, ComparisonOperator, Threshold, EvaluationPeriods, ScalingAdjustmentType, and ScalingAdjustment.
Sourcepub fn target_configuration(self, input: TargetConfiguration) -> Self
pub fn target_configuration(self, input: TargetConfiguration) -> Self
An object that contains settings for a target-based scaling policy.
Sourcepub fn set_target_configuration(
self,
input: Option<TargetConfiguration>,
) -> Self
pub fn set_target_configuration( self, input: Option<TargetConfiguration>, ) -> Self
An object that contains settings for a target-based scaling policy.
Sourcepub fn get_target_configuration(&self) -> &Option<TargetConfiguration>
pub fn get_target_configuration(&self) -> &Option<TargetConfiguration>
An object that contains settings for a target-based scaling policy.
Sourcepub fn update_status(self, input: LocationUpdateStatus) -> Self
pub fn update_status(self, input: LocationUpdateStatus) -> Self
The current status of the fleet's scaling policies in a requested fleet location. The status PENDING_UPDATE indicates that an update was requested for the fleet but has not yet been completed for the location.
Sourcepub fn set_update_status(self, input: Option<LocationUpdateStatus>) -> Self
pub fn set_update_status(self, input: Option<LocationUpdateStatus>) -> Self
The current status of the fleet's scaling policies in a requested fleet location. The status PENDING_UPDATE indicates that an update was requested for the fleet but has not yet been completed for the location.
Sourcepub fn get_update_status(&self) -> &Option<LocationUpdateStatus>
pub fn get_update_status(&self) -> &Option<LocationUpdateStatus>
The current status of the fleet's scaling policies in a requested fleet location. The status PENDING_UPDATE indicates that an update was requested for the fleet but has not yet been completed for the location.
Sourcepub fn set_location(self, input: Option<String>) -> Self
pub fn set_location(self, input: Option<String>) -> Self
The fleet location.
Sourcepub fn get_location(&self) -> &Option<String>
pub fn get_location(&self) -> &Option<String>
The fleet location.
Sourcepub fn build(self) -> ScalingPolicy
pub fn build(self) -> ScalingPolicy
Consumes the builder and constructs a ScalingPolicy.
Trait Implementations§
Source§impl Clone for ScalingPolicyBuilder
impl Clone for ScalingPolicyBuilder
Source§fn clone(&self) -> ScalingPolicyBuilder
fn clone(&self) -> ScalingPolicyBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScalingPolicyBuilder
impl Debug for ScalingPolicyBuilder
Source§impl Default for ScalingPolicyBuilder
impl Default for ScalingPolicyBuilder
Source§fn default() -> ScalingPolicyBuilder
fn default() -> ScalingPolicyBuilder
Source§impl PartialEq for ScalingPolicyBuilder
impl PartialEq for ScalingPolicyBuilder
impl StructuralPartialEq for ScalingPolicyBuilder
Auto Trait Implementations§
impl Freeze for ScalingPolicyBuilder
impl RefUnwindSafe for ScalingPolicyBuilder
impl Send for ScalingPolicyBuilder
impl Sync for ScalingPolicyBuilder
impl Unpin for ScalingPolicyBuilder
impl UnwindSafe for ScalingPolicyBuilder
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);