amazonka-gamelift-1.4.5: Amazon GameLift SDK.

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.GameLift.PutScalingPolicy

Contents

Description

Creates or updates a scaling policy for a fleet. An active scaling policy prompts Amazon GameLift to track a certain metric for a fleet and automatically change the fleet's capacity in specific circumstances. Each scaling policy contains one rule statement. Fleets can have multiple scaling policies in force simultaneously.

A scaling policy rule statement has the following structure:

If [MetricName] is [ComparisonOperator] [Threshold] for [EvaluationPeriods] minutes, then [ScalingAdjustmentType] to/by [ScalingAdjustment] .

For example, this policy: "If the number of idle instances exceeds 20 for more than 15 minutes, then reduce the fleet capacity by 10 instances" could be implemented as the following rule statement:

If [IdleInstances] is [GreaterThanOrEqualToThreshold] [20] for [15] minutes, then [ChangeInCapacity] by [-10].

To create or update a scaling policy, specify a unique combination of name and fleet ID, and set the rule values. All parameters for this action are required. If successful, the policy name is returned. Scaling policies cannot be suspended or made inactive. To stop enforcing a scaling policy, call DeleteScalingPolicy .

Synopsis

Creating a Request

putScalingPolicy Source #

Creates a value of PutScalingPolicy with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • pspName - Descriptive label associated with a scaling policy. Policy names do not need to be unique. A fleet can have only one scaling policy with the same name.
  • pspFleetId - Unique identity for the fleet to scale with this policy.
  • pspScalingAdjustment - Amount of adjustment to make, based on the scaling adjustment type.
  • pspScalingAdjustmentType - Type of adjustment to make to a fleet's instance count (see FleetCapacity ): * 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; for example, a value of "-10" scales the fleet down by 10%.
  • pspThreshold - Metric value used to trigger a scaling event.
  • pspComparisonOperator - Comparison operator to use when measuring the metric against the threshold value.
  • pspEvaluationPeriods - Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.
  • pspMetricName - Name of the Amazon GameLift-defined metric that is used to trigger an adjustment. * ActivatingGameSessions – number of game sessions in the process of being created (game session status = ACTIVATING ). * ActiveGameSessions – number of game sessions currently running (game session status = ACTIVE ). * CurrentPlayerSessions – number of active or reserved player sessions (player session status = ACTIVE or RESERVED ). * AvailablePlayerSessions – number of player session slots currently available in active game sessions across the fleet, calculated by subtracting a game session's current player session count from its maximum player session count. This number includes game sessions that are not currently accepting players (game session PlayerSessionCreationPolicy = DENY_ALL ). * ActiveInstances – number of instances currently running a game session. * IdleInstances – number of instances not currently running a game session.

data PutScalingPolicy Source #

Represents the input for a request action.

See: putScalingPolicy smart constructor.

Instances

Eq PutScalingPolicy Source # 
Data PutScalingPolicy Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PutScalingPolicy -> c PutScalingPolicy #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PutScalingPolicy #

toConstr :: PutScalingPolicy -> Constr #

dataTypeOf :: PutScalingPolicy -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c PutScalingPolicy) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PutScalingPolicy) #

gmapT :: (forall b. Data b => b -> b) -> PutScalingPolicy -> PutScalingPolicy #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PutScalingPolicy -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PutScalingPolicy -> r #

gmapQ :: (forall d. Data d => d -> u) -> PutScalingPolicy -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PutScalingPolicy -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PutScalingPolicy -> m PutScalingPolicy #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PutScalingPolicy -> m PutScalingPolicy #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PutScalingPolicy -> m PutScalingPolicy #

Read PutScalingPolicy Source # 
Show PutScalingPolicy Source # 
Generic PutScalingPolicy Source # 
Hashable PutScalingPolicy Source # 
ToJSON PutScalingPolicy Source # 
NFData PutScalingPolicy Source # 

Methods

rnf :: PutScalingPolicy -> () #

AWSRequest PutScalingPolicy Source # 
ToPath PutScalingPolicy Source # 
ToHeaders PutScalingPolicy Source # 
ToQuery PutScalingPolicy Source # 
type Rep PutScalingPolicy Source # 
type Rs PutScalingPolicy Source # 

Request Lenses

pspName :: Lens' PutScalingPolicy Text Source #

Descriptive label associated with a scaling policy. Policy names do not need to be unique. A fleet can have only one scaling policy with the same name.

pspFleetId :: Lens' PutScalingPolicy Text Source #

Unique identity for the fleet to scale with this policy.

pspScalingAdjustment :: Lens' PutScalingPolicy Int Source #

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

pspScalingAdjustmentType :: Lens' PutScalingPolicy ScalingAdjustmentType Source #

Type of adjustment to make to a fleet's instance count (see FleetCapacity ): * 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; for example, a value of "-10" scales the fleet down by 10%.

pspThreshold :: Lens' PutScalingPolicy Double Source #

Metric value used to trigger a scaling event.

pspComparisonOperator :: Lens' PutScalingPolicy ComparisonOperatorType Source #

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

pspEvaluationPeriods :: Lens' PutScalingPolicy Natural Source #

Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.

pspMetricName :: Lens' PutScalingPolicy MetricName Source #

Name of the Amazon GameLift-defined metric that is used to trigger an adjustment. * ActivatingGameSessions – number of game sessions in the process of being created (game session status = ACTIVATING ). * ActiveGameSessions – number of game sessions currently running (game session status = ACTIVE ). * CurrentPlayerSessions – number of active or reserved player sessions (player session status = ACTIVE or RESERVED ). * AvailablePlayerSessions – number of player session slots currently available in active game sessions across the fleet, calculated by subtracting a game session's current player session count from its maximum player session count. This number includes game sessions that are not currently accepting players (game session PlayerSessionCreationPolicy = DENY_ALL ). * ActiveInstances – number of instances currently running a game session. * IdleInstances – number of instances not currently running a game session.

Destructuring the Response

putScalingPolicyResponse Source #

Creates a value of PutScalingPolicyResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • psprsName - Descriptive label associated with a scaling policy. Policy names do not need to be unique.
  • psprsResponseStatus - -- | The response status code.

data PutScalingPolicyResponse Source #

Represents the returned data in response to a request action.

See: putScalingPolicyResponse smart constructor.

Instances

Eq PutScalingPolicyResponse Source # 
Data PutScalingPolicyResponse Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PutScalingPolicyResponse -> c PutScalingPolicyResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PutScalingPolicyResponse #

toConstr :: PutScalingPolicyResponse -> Constr #

dataTypeOf :: PutScalingPolicyResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c PutScalingPolicyResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PutScalingPolicyResponse) #

gmapT :: (forall b. Data b => b -> b) -> PutScalingPolicyResponse -> PutScalingPolicyResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PutScalingPolicyResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PutScalingPolicyResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> PutScalingPolicyResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PutScalingPolicyResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PutScalingPolicyResponse -> m PutScalingPolicyResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PutScalingPolicyResponse -> m PutScalingPolicyResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PutScalingPolicyResponse -> m PutScalingPolicyResponse #

Read PutScalingPolicyResponse Source # 
Show PutScalingPolicyResponse Source # 
Generic PutScalingPolicyResponse Source # 
NFData PutScalingPolicyResponse Source # 
type Rep PutScalingPolicyResponse Source # 
type Rep PutScalingPolicyResponse = D1 (MetaData "PutScalingPolicyResponse" "Network.AWS.GameLift.PutScalingPolicy" "amazonka-gamelift-1.4.5-2krZbzEaIqtLV8ATX8AZ52" False) (C1 (MetaCons "PutScalingPolicyResponse'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_psprsName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_psprsResponseStatus") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))))

Response Lenses

psprsName :: Lens' PutScalingPolicyResponse (Maybe Text) Source #

Descriptive label associated with a scaling policy. Policy names do not need to be unique.