/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.gamelift.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Rule that controls how a fleet is scaled. Scaling policies are uniquely identified by the combination of name and * fleet ID. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ScalingPolicy implements Serializable, Cloneable, StructuredPojo { /** *

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

*/ private String fleetId; /** *

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

*/ private String fleetArn; /** *

* A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. *

*/ private String name; /** *

* 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. *

* */ private String status; /** *

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

*/ private Integer scalingAdjustment; /** *

* The type of adjustment to make to a fleet's instance count. *

* */ private String scalingAdjustmentType; /** *

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

*/ private String comparisonOperator; /** *

* Metric value used to trigger a scaling event. *

*/ private Double threshold; /** *

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

*/ private Integer evaluationPeriods; /** *

* 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. *

* */ private String metricName; /** *

* 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. *

*/ private String policyType; /** *

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

*/ private TargetConfiguration targetConfiguration; /** *

* 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. *

*/ private String updateStatus; /** *

* The fleet location. *

*/ private String location; /** *

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

* * @param fleetId * A unique identifier for the fleet that is associated with this scaling policy. */ public void setFleetId(String fleetId) { this.fleetId = fleetId; } /** *

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

* * @return A unique identifier for the fleet that is associated with this scaling policy. */ public String getFleetId() { return this.fleetId; } /** *

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

* * @param fleetId * A unique identifier for the fleet that is associated with this scaling policy. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPolicy withFleetId(String fleetId) { setFleetId(fleetId); return this; } /** *

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

* * @param fleetArn * 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:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. */ public void setFleetArn(String fleetArn) { this.fleetArn = fleetArn; } /** *

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

* * @return 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:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. */ public String getFleetArn() { return this.fleetArn; } /** *

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

* * @param fleetArn * 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:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPolicy withFleetArn(String fleetArn) { setFleetArn(fleetArn); return this; } /** *

* A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. *

* * @param name * A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be * unique. */ public void setName(String name) { this.name = name; } /** *

* A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. *

* * @return A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be * unique. */ public String getName() { return this.name; } /** *

* A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. *

* * @param name * A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be * unique. * @return Returns a reference to this object so that method calls can be chained together. */ public ScalingPolicy withName(String name) { setName(name); return this; } /** *

* 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. *

* * * @param status * 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.

*