Struct aws_sdk_gamelift::types::ScalingPolicy
source · #[non_exhaustive]pub struct ScalingPolicy {Show 14 fields
pub fleet_id: Option<String>,
pub fleet_arn: Option<String>,
pub name: Option<String>,
pub status: Option<ScalingStatusType>,
pub scaling_adjustment: Option<i32>,
pub scaling_adjustment_type: Option<ScalingAdjustmentType>,
pub comparison_operator: Option<ComparisonOperatorType>,
pub threshold: Option<f64>,
pub evaluation_periods: Option<i32>,
pub metric_name: Option<MetricName>,
pub policy_type: Option<PolicyType>,
pub target_configuration: Option<TargetConfiguration>,
pub update_status: Option<LocationUpdateStatus>,
pub location: Option<String>,
}
Expand description
Rule that controls how a fleet is scaled. Scaling policies are uniquely identified by the combination of name and fleet ID.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.fleet_id: Option<String>
A unique identifier for the fleet that is associated with this scaling policy.
fleet_arn: Option<String>
The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is arn:aws:gamelift:
.
name: Option<String>
A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique.
status: 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.
scaling_adjustment: Option<i32>
Amount of adjustment to make, based on the scaling adjustment type.
scaling_adjustment_type: 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.
comparison_operator: Option<ComparisonOperatorType>
Comparison operator to use when measuring a metric against the threshold value.
threshold: Option<f64>
Metric value used to trigger a scaling event.
evaluation_periods: Option<i32>
Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.
metric_name: Option<MetricName>
Name of the Amazon GameLift-defined metric that is used to trigger a scaling adjustment. For detailed descriptions of fleet metrics, see Monitor Amazon GameLift 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.
policy_type: 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.
target_configuration: Option<TargetConfiguration>
An object that contains settings for a target-based scaling policy.
update_status: 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.
location: Option<String>
The fleet location.
Implementations§
source§impl ScalingPolicy
impl ScalingPolicy
sourcepub fn fleet_id(&self) -> Option<&str>
pub fn fleet_id(&self) -> Option<&str>
A unique identifier for the fleet that is associated with this scaling policy.
sourcepub fn fleet_arn(&self) -> Option<&str>
pub fn fleet_arn(&self) -> Option<&str>
The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is arn:aws:gamelift:
.
sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique.
sourcepub fn status(&self) -> Option<&ScalingStatusType>
pub fn 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) -> Option<i32>
pub fn scaling_adjustment(&self) -> Option<i32>
Amount of adjustment to make, based on the scaling adjustment type.
sourcepub fn scaling_adjustment_type(&self) -> Option<&ScalingAdjustmentType>
pub fn 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) -> Option<&ComparisonOperatorType>
pub fn comparison_operator(&self) -> Option<&ComparisonOperatorType>
Comparison operator to use when measuring a metric against the threshold value.
sourcepub fn evaluation_periods(&self) -> Option<i32>
pub fn 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) -> Option<&MetricName>
pub fn metric_name(&self) -> Option<&MetricName>
Name of the Amazon GameLift-defined metric that is used to trigger a scaling adjustment. For detailed descriptions of fleet metrics, see Monitor Amazon GameLift 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) -> Option<&PolicyType>
pub fn 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) -> Option<&TargetConfiguration>
pub fn target_configuration(&self) -> Option<&TargetConfiguration>
An object that contains settings for a target-based scaling policy.
sourcepub fn update_status(&self) -> Option<&LocationUpdateStatus>
pub fn 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.
source§impl ScalingPolicy
impl ScalingPolicy
sourcepub fn builder() -> ScalingPolicyBuilder
pub fn builder() -> ScalingPolicyBuilder
Creates a new builder-style object to manufacture ScalingPolicy
.
Trait Implementations§
source§impl Clone for ScalingPolicy
impl Clone for ScalingPolicy
source§fn clone(&self) -> ScalingPolicy
fn clone(&self) -> ScalingPolicy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScalingPolicy
impl Debug for ScalingPolicy
source§impl PartialEq for ScalingPolicy
impl PartialEq for ScalingPolicy
source§fn eq(&self, other: &ScalingPolicy) -> bool
fn eq(&self, other: &ScalingPolicy) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ScalingPolicy
Auto Trait Implementations§
impl Freeze for ScalingPolicy
impl RefUnwindSafe for ScalingPolicy
impl Send for ScalingPolicy
impl Sync for ScalingPolicy
impl Unpin for ScalingPolicy
impl UnwindSafe for ScalingPolicy
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> 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 more