Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2014 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.autoscaling.model;
 
 
Container for the parameters to the PutScalingPolicy operation.

Creates or updates a policy for an Auto Scaling group. To update an existing policy, use the existing policy name and set the parameter(s) you want to change. Any existing parameter not changed in an update to an existing policy is not changed in this update request.

 
 public class PutScalingPolicyRequest extends AmazonWebServiceRequest implements Serializable {

    
The name or ARN of the Auto Scaling group.

Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String autoScalingGroupName;

    
The name of the policy you want to create or update.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String policyName;

    
The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.
 
     private Integer scalingAdjustment;

    
Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information about the adjustment types supported by Auto Scaling, see Scale Based on Demand.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String adjustmentType;

    
The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

For more information, see Cooldown Period

 
     private Integer cooldown;

    
Used with AdjustmentType with the value PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least the number of instances specified in the value.

You will get a ValidationError if you use MinAdjustmentStep on a policy with an AdjustmentType other than PercentChangeInCapacity.

 
     private Integer minAdjustmentStep;

    
The name or ARN of the Auto Scaling group.

Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The name or ARN of the Auto Scaling group.
    public String getAutoScalingGroupName() {
        return ;
    }
    
    
The name or ARN of the Auto Scaling group.

Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
autoScalingGroupName The name or ARN of the Auto Scaling group.
    public void setAutoScalingGroupName(String autoScalingGroupName) {
        this. = autoScalingGroupName;
    }
    
    
The name or ARN of the Auto Scaling group.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
autoScalingGroupName The name or ARN of the Auto Scaling group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PutScalingPolicyRequest withAutoScalingGroupName(String autoScalingGroupName) {
        this. = autoScalingGroupName;
        return this;
    }

    
The name of the policy you want to create or update.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The name of the policy you want to create or update.
    public String getPolicyName() {
        return ;
    }
    
    
The name of the policy you want to create or update.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
policyName The name of the policy you want to create or update.
    public void setPolicyName(String policyName) {
        this. = policyName;
    }
    
    
The name of the policy you want to create or update.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
policyName The name of the policy you want to create or update.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PutScalingPolicyRequest withPolicyName(String policyName) {
        this. = policyName;
        return this;
    }

    
The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.

Returns:
The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.
    public Integer getScalingAdjustment() {
        return ;
    }
    
    
The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.

Parameters:
scalingAdjustment The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.
    public void setScalingAdjustment(Integer scalingAdjustment) {
        this. = scalingAdjustment;
    }
    
    
The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.

Returns a reference to this object so that method calls can be chained together.

Parameters:
scalingAdjustment The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PutScalingPolicyRequest withScalingAdjustment(Integer scalingAdjustment) {
        this. = scalingAdjustment;
        return this;
    }

    
Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information about the adjustment types supported by Auto Scaling, see Scale Based on Demand.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information about the adjustment types supported by Auto Scaling, see Scale Based on Demand.

    public String getAdjustmentType() {
        return ;
    }
    
    
Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information about the adjustment types supported by Auto Scaling, see Scale Based on Demand.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
adjustmentType Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information about the adjustment types supported by Auto Scaling, see Scale Based on Demand.

    public void setAdjustmentType(String adjustmentType) {
        this. = adjustmentType;
    }
    
    
Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information about the adjustment types supported by Auto Scaling, see Scale Based on Demand.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
adjustmentType Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information about the adjustment types supported by Auto Scaling, see Scale Based on Demand.

Returns:
A reference to this updated object so that method calls can be chained together.
    public PutScalingPolicyRequest withAdjustmentType(String adjustmentType) {
        this. = adjustmentType;
        return this;
    }

    
The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

For more information, see Cooldown Period

Returns:
The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

For more information, see Cooldown Period

    public Integer getCooldown() {
        return ;
    }
    
    
The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

For more information, see Cooldown Period

Parameters:
cooldown The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

For more information, see Cooldown Period

    public void setCooldown(Integer cooldown) {
        this. = cooldown;
    }
    
    
The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

For more information, see Cooldown Period

Returns a reference to this object so that method calls can be chained together.

Parameters:
cooldown The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

For more information, see Cooldown Period

Returns:
A reference to this updated object so that method calls can be chained together.
    public PutScalingPolicyRequest withCooldown(Integer cooldown) {
        this. = cooldown;
        return this;
    }

    
Used with AdjustmentType with the value PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least the number of instances specified in the value.

You will get a ValidationError if you use MinAdjustmentStep on a policy with an AdjustmentType other than PercentChangeInCapacity.

Returns:
Used with AdjustmentType with the value PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least the number of instances specified in the value.

You will get a ValidationError if you use MinAdjustmentStep on a policy with an AdjustmentType other than PercentChangeInCapacity.

    public Integer getMinAdjustmentStep() {
        return ;
    }
    
    
Used with AdjustmentType with the value PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least the number of instances specified in the value.

You will get a ValidationError if you use MinAdjustmentStep on a policy with an AdjustmentType other than PercentChangeInCapacity.

Parameters:
minAdjustmentStep Used with AdjustmentType with the value PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least the number of instances specified in the value.

You will get a ValidationError if you use MinAdjustmentStep on a policy with an AdjustmentType other than PercentChangeInCapacity.

    public void setMinAdjustmentStep(Integer minAdjustmentStep) {
        this. = minAdjustmentStep;
    }
    
    
Used with AdjustmentType with the value PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least the number of instances specified in the value.

You will get a ValidationError if you use MinAdjustmentStep on a policy with an AdjustmentType other than PercentChangeInCapacity.

Returns a reference to this object so that method calls can be chained together.

Parameters:
minAdjustmentStep Used with AdjustmentType with the value PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least the number of instances specified in the value.

You will get a ValidationError if you use MinAdjustmentStep on a policy with an AdjustmentType other than PercentChangeInCapacity.

Returns:
A reference to this updated object so that method calls can be chained together.
    public PutScalingPolicyRequest withMinAdjustmentStep(Integer minAdjustmentStep) {
        this. = minAdjustmentStep;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getAutoScalingGroupName() != nullsb.append("AutoScalingGroupName: " + getAutoScalingGroupName() + ",");
        if (getPolicyName() != nullsb.append("PolicyName: " + getPolicyName() + ",");
        if (getScalingAdjustment() != nullsb.append("ScalingAdjustment: " + getScalingAdjustment() + ",");
        if (getAdjustmentType() != nullsb.append("AdjustmentType: " + getAdjustmentType() + ",");
        if (getCooldown() != nullsb.append("Cooldown: " + getCooldown() + ",");
        if (getMinAdjustmentStep() != nullsb.append("MinAdjustmentStep: " + getMinAdjustmentStep() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode()); 
        hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); 
        hashCode = prime * hashCode + ((getScalingAdjustment() == null) ? 0 : getScalingAdjustment().hashCode()); 
        hashCode = prime * hashCode + ((getAdjustmentType() == null) ? 0 : getAdjustmentType().hashCode()); 
        hashCode = prime * hashCode + ((getCooldown() == null) ? 0 : getCooldown().hashCode()); 
        hashCode = prime * hashCode + ((getMinAdjustmentStep() == null) ? 0 : getMinAdjustmentStep().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof PutScalingPolicyRequest == falsereturn false;
        PutScalingPolicyRequest other = (PutScalingPolicyRequest)obj;
        
        if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == nullreturn false;
        if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == falsereturn false
        if (other.getPolicyName() == null ^ this.getPolicyName() == nullreturn false;
        if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == falsereturn false
        if (other.getScalingAdjustment() == null ^ this.getScalingAdjustment() == nullreturn false;
        if (other.getScalingAdjustment() != null && other.getScalingAdjustment().equals(this.getScalingAdjustment()) == falsereturn false
        if (other.getAdjustmentType() == null ^ this.getAdjustmentType() == nullreturn false;
        if (other.getAdjustmentType() != null && other.getAdjustmentType().equals(this.getAdjustmentType()) == falsereturn false
        if (other.getCooldown() == null ^ this.getCooldown() == nullreturn false;
        if (other.getCooldown() != null && other.getCooldown().equals(this.getCooldown()) == falsereturn false
        if (other.getMinAdjustmentStep() == null ^ this.getMinAdjustmentStep() == nullreturn false;
        if (other.getMinAdjustmentStep() != null && other.getMinAdjustmentStep().equals(this.getMinAdjustmentStep()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X