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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912 .

§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

source

pub fn fleet_id(&self) -> Option<&str>

A unique identifier for the fleet that is associated with this scaling policy.

source

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: ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912 .

source

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.

source

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.

source

pub fn scaling_adjustment(&self) -> Option<i32>

Amount of adjustment to make, based on the scaling adjustment type.

source

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.

source

pub fn comparison_operator(&self) -> Option<&ComparisonOperatorType>

Comparison operator to use when measuring a metric against the threshold value.

source

pub fn threshold(&self) -> Option<f64>

Metric value used to trigger a scaling event.

source

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.

source

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.

source

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.

source

pub fn target_configuration(&self) -> Option<&TargetConfiguration>

An object that contains settings for a target-based scaling policy.

source

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

pub fn location(&self) -> Option<&str>

The fleet location.

source§

impl ScalingPolicy

source

pub fn builder() -> ScalingPolicyBuilder

Creates a new builder-style object to manufacture ScalingPolicy.

Trait Implementations§

source§

impl Clone for ScalingPolicy

source§

fn clone(&self) -> ScalingPolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ScalingPolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for ScalingPolicy

source§

fn eq(&self, other: &ScalingPolicy) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for ScalingPolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more