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 SetInstanceHealth operation.

Sets the health status of the specified instance.

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

 
 public class SetInstanceHealthRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The ID of the EC2 instance.

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

 
     private String instanceId;

    
The health status of the instance. Set to Healthy if you want the instance to remain in service. Set to Unhealthy if you want the instance to be out of service. Auto Scaling will terminate and replace the unhealthy instance.

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

 
     private String healthStatus;

    
If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the HealthCheckGracePeriod parameter description for CreateAutoScalingGroup.

 
     private Boolean shouldRespectGracePeriod;

    
The ID of the EC2 instance.

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

Returns:
The ID of the EC2 instance.
 
     public String getInstanceId() {
         return ;
     }
    
    
The ID of the EC2 instance.

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

Parameters:
instanceId The ID of the EC2 instance.
 
     public void setInstanceId(String instanceId) {
         this. = instanceId;
     }
    
    
The ID of the EC2 instance.

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

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

Parameters:
instanceId The ID of the EC2 instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SetInstanceHealthRequest withInstanceId(String instanceId) {
        this. = instanceId;
        return this;
    }

    
The health status of the instance. Set to Healthy if you want the instance to remain in service. Set to Unhealthy if you want the instance to be out of service. Auto Scaling will terminate and replace the unhealthy instance.

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

Returns:
The health status of the instance. Set to Healthy if you want the instance to remain in service. Set to Unhealthy if you want the instance to be out of service. Auto Scaling will terminate and replace the unhealthy instance.
    public String getHealthStatus() {
        return ;
    }
    
    
The health status of the instance. Set to Healthy if you want the instance to remain in service. Set to Unhealthy if you want the instance to be out of service. Auto Scaling will terminate and replace the unhealthy instance.

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

Parameters:
healthStatus The health status of the instance. Set to Healthy if you want the instance to remain in service. Set to Unhealthy if you want the instance to be out of service. Auto Scaling will terminate and replace the unhealthy instance.
    public void setHealthStatus(String healthStatus) {
        this. = healthStatus;
    }
    
    
The health status of the instance. Set to Healthy if you want the instance to remain in service. Set to Unhealthy if you want the instance to be out of service. Auto Scaling will terminate and replace the unhealthy instance.

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

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

Parameters:
healthStatus The health status of the instance. Set to Healthy if you want the instance to remain in service. Set to Unhealthy if you want the instance to be out of service. Auto Scaling will terminate and replace the unhealthy instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SetInstanceHealthRequest withHealthStatus(String healthStatus) {
        this. = healthStatus;
        return this;
    }

    
If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the HealthCheckGracePeriod parameter description for CreateAutoScalingGroup.

Returns:
If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the HealthCheckGracePeriod parameter description for CreateAutoScalingGroup.

        return ;
    }
    
    
If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the HealthCheckGracePeriod parameter description for CreateAutoScalingGroup.

Parameters:
shouldRespectGracePeriod If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the HealthCheckGracePeriod parameter description for CreateAutoScalingGroup.

    public void setShouldRespectGracePeriod(Boolean shouldRespectGracePeriod) {
        this. = shouldRespectGracePeriod;
    }
    
    
If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the HealthCheckGracePeriod parameter description for CreateAutoScalingGroup.

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

Parameters:
shouldRespectGracePeriod If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the HealthCheckGracePeriod parameter description for CreateAutoScalingGroup.

Returns:
A reference to this updated object so that method calls can be chained together.
    public SetInstanceHealthRequest withShouldRespectGracePeriod(Boolean shouldRespectGracePeriod) {
        this. = shouldRespectGracePeriod;
        return this;
    }

    
If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the HealthCheckGracePeriod parameter description for CreateAutoScalingGroup.

Returns:
If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the HealthCheckGracePeriod parameter description for CreateAutoScalingGroup.

        return ;
    }

    
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 (getInstanceId() != nullsb.append("InstanceId: " + getInstanceId() + ",");
        if (getHealthStatus() != nullsb.append("HealthStatus: " + getHealthStatus() + ",");
        if (isShouldRespectGracePeriod() != nullsb.append("ShouldRespectGracePeriod: " + isShouldRespectGracePeriod() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); 
        hashCode = prime * hashCode + ((getHealthStatus() == null) ? 0 : getHealthStatus().hashCode()); 
        hashCode = prime * hashCode + ((isShouldRespectGracePeriod() == null) ? 0 : isShouldRespectGracePeriod().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof SetInstanceHealthRequest == falsereturn false;
        SetInstanceHealthRequest other = (SetInstanceHealthRequest)obj;
        
        if (other.getInstanceId() == null ^ this.getInstanceId() == nullreturn false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == falsereturn false
        if (other.getHealthStatus() == null ^ this.getHealthStatus() == nullreturn false;
        if (other.getHealthStatus() != null && other.getHealthStatus().equals(this.getHealthStatus()) == falsereturn false
        if (other.isShouldRespectGracePeriod() == null ^ this.isShouldRespectGracePeriod() == nullreturn false;
        if (other.isShouldRespectGracePeriod() != null && other.isShouldRespectGracePeriod().equals(this.isShouldRespectGracePeriod()) == falsereturn false
        return true;
    }
    
    @Override
    public SetInstanceHealthRequest clone() {
        
            return (SetInstanceHealthRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X