Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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 parameters 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 SerializableCloneable {

    
The name or ARN of the 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.

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

 
     private String policyName;

    
The adjustment type. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.

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

 
     private String adjustmentType;

    
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 number of instances by which to scale. AdjustmentType determines the interpretation of this number (for example, 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;

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

For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

 
     private Integer cooldown;

    
The name or ARN of the group.

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

Returns:
The name or ARN of the group.
    public String getAutoScalingGroupName() {
        return ;
    }
    
    
The name or ARN of the 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 group.
    public void setAutoScalingGroupName(String autoScalingGroupName) {
        this. = autoScalingGroupName;
    }
    
    
The name or ARN of the 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 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.

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

Returns:
The name of the policy.
    public String getPolicyName() {
        return ;
    }
    
    
The name of the policy.

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

Parameters:
policyName The name of the policy.
    public void setPolicyName(String policyName) {
        this. = policyName;
    }
    
    
The name of the policy.

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.
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 adjustment type. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.

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

Returns:
The adjustment type. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.

    public String getAdjustmentType() {
        return ;
    }
    
    
The adjustment type. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.

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

Parameters:
adjustmentType The adjustment type. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.

    public void setAdjustmentType(String adjustmentType) {
        this. = adjustmentType;
    }
    
    
The adjustment type. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.

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 The adjustment type. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
    public PutScalingPolicyRequest withAdjustmentType(String adjustmentType) {
        this. = adjustmentType;
        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;
    }

    
The number of instances by which to scale. AdjustmentType determines the interpretation of this number (for example, 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 (for example, 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 (for example, 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 (for example, 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 (for example, 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 (for example, 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;
    }

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

For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

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

For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

    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 Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

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 Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

    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 Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

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 Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
    public PutScalingPolicyRequest withCooldown(Integer cooldown) {
        this. = cooldown;
        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 (getAdjustmentType() != nullsb.append("AdjustmentType: " + getAdjustmentType() + ",");
        if (getMinAdjustmentStep() != nullsb.append("MinAdjustmentStep: " + getMinAdjustmentStep() + ",");
        if (getScalingAdjustment() != nullsb.append("ScalingAdjustment: " + getScalingAdjustment() + ",");
        if (getCooldown() != nullsb.append("Cooldown: " + getCooldown() );
        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 + ((getAdjustmentType() == null) ? 0 : getAdjustmentType().hashCode()); 
        hashCode = prime * hashCode + ((getMinAdjustmentStep() == null) ? 0 : getMinAdjustmentStep().hashCode()); 
        hashCode = prime * hashCode + ((getScalingAdjustment() == null) ? 0 : getScalingAdjustment().hashCode()); 
        hashCode = prime * hashCode + ((getCooldown() == null) ? 0 : getCooldown().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.getAdjustmentType() == null ^ this.getAdjustmentType() == nullreturn false;
        if (other.getAdjustmentType() != null && other.getAdjustmentType().equals(this.getAdjustmentType()) == falsereturn false
        if (other.getMinAdjustmentStep() == null ^ this.getMinAdjustmentStep() == nullreturn false;
        if (other.getMinAdjustmentStep() != null && other.getMinAdjustmentStep().equals(this.getMinAdjustmentStep()) == falsereturn false
        if (other.getScalingAdjustment() == null ^ this.getScalingAdjustment() == nullreturn false;
        if (other.getScalingAdjustment() != null && other.getScalingAdjustment().equals(this.getScalingAdjustment()) == falsereturn false
        if (other.getCooldown() == null ^ this.getCooldown() == nullreturn false;
        if (other.getCooldown() != null && other.getCooldown().equals(this.getCooldown()) == falsereturn false
        return true;
    }
    
    @Override
    public PutScalingPolicyRequest clone() {
        
            return (PutScalingPolicyRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X