com.amazonaws.services.autoscaling.model.InstanceRefresh Maven / Gradle / Ivy
Show all versions of aws-java-sdk-autoscaling Show documentation
/*
* Copyright 2015-2020 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;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes an instance refresh for an Auto Scaling group.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class InstanceRefresh implements Serializable, Cloneable {
/**
*
* The instance refresh ID.
*
*/
private String instanceRefreshId;
/**
*
* The name of the Auto Scaling group.
*
*/
private String autoScalingGroupName;
/**
*
* The current status for the instance refresh operation:
*
*
* -
*
* Pending
- The request was created, but the operation has not started.
*
*
* -
*
* InProgress
- The operation is in progress.
*
*
* -
*
* Successful
- The operation completed successfully.
*
*
* -
*
* Failed
- The operation failed to complete. You can troubleshoot using the status reason and the
* scaling activities.
*
*
* -
*
* Cancelling
- An ongoing operation is being cancelled. Cancellation does not roll back any
* replacements that have already been completed, but it prevents new replacements from being started.
*
*
* -
*
* Cancelled
- The operation is cancelled.
*
*
*
*/
private String status;
/**
*
* Provides more details about the current status of the instance refresh.
*
*/
private String statusReason;
/**
*
* The date and time at which the instance refresh began.
*
*/
private java.util.Date startTime;
/**
*
* The date and time at which the instance refresh ended.
*
*/
private java.util.Date endTime;
/**
*
* The percentage of the instance refresh that is complete. For each instance replacement, Amazon EC2 Auto Scaling
* tracks the instance's health status and warm-up time. When the instance's health status changes to healthy and
* the specified warm-up time passes, the instance is considered updated and added to the percentage complete.
*
*/
private Integer percentageComplete;
/**
*
* The number of instances remaining to update before the instance refresh is complete.
*
*/
private Integer instancesToUpdate;
/**
*
* The instance refresh ID.
*
*
* @param instanceRefreshId
* The instance refresh ID.
*/
public void setInstanceRefreshId(String instanceRefreshId) {
this.instanceRefreshId = instanceRefreshId;
}
/**
*
* The instance refresh ID.
*
*
* @return The instance refresh ID.
*/
public String getInstanceRefreshId() {
return this.instanceRefreshId;
}
/**
*
* The instance refresh ID.
*
*
* @param instanceRefreshId
* The instance refresh ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceRefresh withInstanceRefreshId(String instanceRefreshId) {
setInstanceRefreshId(instanceRefreshId);
return this;
}
/**
*
* The name of the Auto Scaling group.
*
*
* @param autoScalingGroupName
* The name of the Auto Scaling group.
*/
public void setAutoScalingGroupName(String autoScalingGroupName) {
this.autoScalingGroupName = autoScalingGroupName;
}
/**
*
* The name of the Auto Scaling group.
*
*
* @return The name of the Auto Scaling group.
*/
public String getAutoScalingGroupName() {
return this.autoScalingGroupName;
}
/**
*
* The name of the Auto Scaling group.
*
*
* @param autoScalingGroupName
* The name of the Auto Scaling group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceRefresh withAutoScalingGroupName(String autoScalingGroupName) {
setAutoScalingGroupName(autoScalingGroupName);
return this;
}
/**
*
* The current status for the instance refresh operation:
*
*
* -
*
* Pending
- The request was created, but the operation has not started.
*
*
* -
*
* InProgress
- The operation is in progress.
*
*
* -
*
* Successful
- The operation completed successfully.
*
*
* -
*
* Failed
- The operation failed to complete. You can troubleshoot using the status reason and the
* scaling activities.
*
*
* -
*
* Cancelling
- An ongoing operation is being cancelled. Cancellation does not roll back any
* replacements that have already been completed, but it prevents new replacements from being started.
*
*
* -
*
* Cancelled
- The operation is cancelled.
*
*
*
*
* @param status
* The current status for the instance refresh operation:
*
* -
*
* Pending
- The request was created, but the operation has not started.
*
*
* -
*
* InProgress
- The operation is in progress.
*
*
* -
*
* Successful
- The operation completed successfully.
*
*
* -
*
* Failed
- The operation failed to complete. You can troubleshoot using the status reason and
* the scaling activities.
*
*
* -
*
* Cancelling
- An ongoing operation is being cancelled. Cancellation does not roll back any
* replacements that have already been completed, but it prevents new replacements from being started.
*
*
* -
*
* Cancelled
- The operation is cancelled.
*
*
* @see InstanceRefreshStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The current status for the instance refresh operation:
*
*
* -
*
* Pending
- The request was created, but the operation has not started.
*
*
* -
*
* InProgress
- The operation is in progress.
*
*
* -
*
* Successful
- The operation completed successfully.
*
*
* -
*
* Failed
- The operation failed to complete. You can troubleshoot using the status reason and the
* scaling activities.
*
*
* -
*
* Cancelling
- An ongoing operation is being cancelled. Cancellation does not roll back any
* replacements that have already been completed, but it prevents new replacements from being started.
*
*
* -
*
* Cancelled
- The operation is cancelled.
*
*
*
*
* @return The current status for the instance refresh operation:
*
* -
*
* Pending
- The request was created, but the operation has not started.
*
*
* -
*
* InProgress
- The operation is in progress.
*
*
* -
*
* Successful
- The operation completed successfully.
*
*
* -
*
* Failed
- The operation failed to complete. You can troubleshoot using the status reason and
* the scaling activities.
*
*
* -
*
* Cancelling
- An ongoing operation is being cancelled. Cancellation does not roll back any
* replacements that have already been completed, but it prevents new replacements from being started.
*
*
* -
*
* Cancelled
- The operation is cancelled.
*
*
* @see InstanceRefreshStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The current status for the instance refresh operation:
*
*
* -
*
* Pending
- The request was created, but the operation has not started.
*
*
* -
*
* InProgress
- The operation is in progress.
*
*
* -
*
* Successful
- The operation completed successfully.
*
*
* -
*
* Failed
- The operation failed to complete. You can troubleshoot using the status reason and the
* scaling activities.
*
*
* -
*
* Cancelling
- An ongoing operation is being cancelled. Cancellation does not roll back any
* replacements that have already been completed, but it prevents new replacements from being started.
*
*
* -
*
* Cancelled
- The operation is cancelled.
*
*
*
*
* @param status
* The current status for the instance refresh operation:
*
* -
*
* Pending
- The request was created, but the operation has not started.
*
*
* -
*
* InProgress
- The operation is in progress.
*
*
* -
*
* Successful
- The operation completed successfully.
*
*
* -
*
* Failed
- The operation failed to complete. You can troubleshoot using the status reason and
* the scaling activities.
*
*
* -
*
* Cancelling
- An ongoing operation is being cancelled. Cancellation does not roll back any
* replacements that have already been completed, but it prevents new replacements from being started.
*
*
* -
*
* Cancelled
- The operation is cancelled.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceRefreshStatus
*/
public InstanceRefresh withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The current status for the instance refresh operation:
*
*
* -
*
* Pending
- The request was created, but the operation has not started.
*
*
* -
*
* InProgress
- The operation is in progress.
*
*
* -
*
* Successful
- The operation completed successfully.
*
*
* -
*
* Failed
- The operation failed to complete. You can troubleshoot using the status reason and the
* scaling activities.
*
*
* -
*
* Cancelling
- An ongoing operation is being cancelled. Cancellation does not roll back any
* replacements that have already been completed, but it prevents new replacements from being started.
*
*
* -
*
* Cancelled
- The operation is cancelled.
*
*
*
*
* @param status
* The current status for the instance refresh operation:
*
* -
*
* Pending
- The request was created, but the operation has not started.
*
*
* -
*
* InProgress
- The operation is in progress.
*
*
* -
*
* Successful
- The operation completed successfully.
*
*
* -
*
* Failed
- The operation failed to complete. You can troubleshoot using the status reason and
* the scaling activities.
*
*
* -
*
* Cancelling
- An ongoing operation is being cancelled. Cancellation does not roll back any
* replacements that have already been completed, but it prevents new replacements from being started.
*
*
* -
*
* Cancelled
- The operation is cancelled.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceRefreshStatus
*/
public InstanceRefresh withStatus(InstanceRefreshStatus status) {
this.status = status.toString();
return this;
}
/**
*
* Provides more details about the current status of the instance refresh.
*
*
* @param statusReason
* Provides more details about the current status of the instance refresh.
*/
public void setStatusReason(String statusReason) {
this.statusReason = statusReason;
}
/**
*
* Provides more details about the current status of the instance refresh.
*
*
* @return Provides more details about the current status of the instance refresh.
*/
public String getStatusReason() {
return this.statusReason;
}
/**
*
* Provides more details about the current status of the instance refresh.
*
*
* @param statusReason
* Provides more details about the current status of the instance refresh.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceRefresh withStatusReason(String statusReason) {
setStatusReason(statusReason);
return this;
}
/**
*
* The date and time at which the instance refresh began.
*
*
* @param startTime
* The date and time at which the instance refresh began.
*/
public void setStartTime(java.util.Date startTime) {
this.startTime = startTime;
}
/**
*
* The date and time at which the instance refresh began.
*
*
* @return The date and time at which the instance refresh began.
*/
public java.util.Date getStartTime() {
return this.startTime;
}
/**
*
* The date and time at which the instance refresh began.
*
*
* @param startTime
* The date and time at which the instance refresh began.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceRefresh withStartTime(java.util.Date startTime) {
setStartTime(startTime);
return this;
}
/**
*
* The date and time at which the instance refresh ended.
*
*
* @param endTime
* The date and time at which the instance refresh ended.
*/
public void setEndTime(java.util.Date endTime) {
this.endTime = endTime;
}
/**
*
* The date and time at which the instance refresh ended.
*
*
* @return The date and time at which the instance refresh ended.
*/
public java.util.Date getEndTime() {
return this.endTime;
}
/**
*
* The date and time at which the instance refresh ended.
*
*
* @param endTime
* The date and time at which the instance refresh ended.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceRefresh withEndTime(java.util.Date endTime) {
setEndTime(endTime);
return this;
}
/**
*
* The percentage of the instance refresh that is complete. For each instance replacement, Amazon EC2 Auto Scaling
* tracks the instance's health status and warm-up time. When the instance's health status changes to healthy and
* the specified warm-up time passes, the instance is considered updated and added to the percentage complete.
*
*
* @param percentageComplete
* The percentage of the instance refresh that is complete. For each instance replacement, Amazon EC2 Auto
* Scaling tracks the instance's health status and warm-up time. When the instance's health status changes to
* healthy and the specified warm-up time passes, the instance is considered updated and added to the
* percentage complete.
*/
public void setPercentageComplete(Integer percentageComplete) {
this.percentageComplete = percentageComplete;
}
/**
*
* The percentage of the instance refresh that is complete. For each instance replacement, Amazon EC2 Auto Scaling
* tracks the instance's health status and warm-up time. When the instance's health status changes to healthy and
* the specified warm-up time passes, the instance is considered updated and added to the percentage complete.
*
*
* @return The percentage of the instance refresh that is complete. For each instance replacement, Amazon EC2 Auto
* Scaling tracks the instance's health status and warm-up time. When the instance's health status changes
* to healthy and the specified warm-up time passes, the instance is considered updated and added to the
* percentage complete.
*/
public Integer getPercentageComplete() {
return this.percentageComplete;
}
/**
*
* The percentage of the instance refresh that is complete. For each instance replacement, Amazon EC2 Auto Scaling
* tracks the instance's health status and warm-up time. When the instance's health status changes to healthy and
* the specified warm-up time passes, the instance is considered updated and added to the percentage complete.
*
*
* @param percentageComplete
* The percentage of the instance refresh that is complete. For each instance replacement, Amazon EC2 Auto
* Scaling tracks the instance's health status and warm-up time. When the instance's health status changes to
* healthy and the specified warm-up time passes, the instance is considered updated and added to the
* percentage complete.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceRefresh withPercentageComplete(Integer percentageComplete) {
setPercentageComplete(percentageComplete);
return this;
}
/**
*
* The number of instances remaining to update before the instance refresh is complete.
*
*
* @param instancesToUpdate
* The number of instances remaining to update before the instance refresh is complete.
*/
public void setInstancesToUpdate(Integer instancesToUpdate) {
this.instancesToUpdate = instancesToUpdate;
}
/**
*
* The number of instances remaining to update before the instance refresh is complete.
*
*
* @return The number of instances remaining to update before the instance refresh is complete.
*/
public Integer getInstancesToUpdate() {
return this.instancesToUpdate;
}
/**
*
* The number of instances remaining to update before the instance refresh is complete.
*
*
* @param instancesToUpdate
* The number of instances remaining to update before the instance refresh is complete.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceRefresh withInstancesToUpdate(Integer instancesToUpdate) {
setInstancesToUpdate(instancesToUpdate);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getInstanceRefreshId() != null)
sb.append("InstanceRefreshId: ").append(getInstanceRefreshId()).append(",");
if (getAutoScalingGroupName() != null)
sb.append("AutoScalingGroupName: ").append(getAutoScalingGroupName()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getStatusReason() != null)
sb.append("StatusReason: ").append(getStatusReason()).append(",");
if (getStartTime() != null)
sb.append("StartTime: ").append(getStartTime()).append(",");
if (getEndTime() != null)
sb.append("EndTime: ").append(getEndTime()).append(",");
if (getPercentageComplete() != null)
sb.append("PercentageComplete: ").append(getPercentageComplete()).append(",");
if (getInstancesToUpdate() != null)
sb.append("InstancesToUpdate: ").append(getInstancesToUpdate());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof InstanceRefresh == false)
return false;
InstanceRefresh other = (InstanceRefresh) obj;
if (other.getInstanceRefreshId() == null ^ this.getInstanceRefreshId() == null)
return false;
if (other.getInstanceRefreshId() != null && other.getInstanceRefreshId().equals(this.getInstanceRefreshId()) == false)
return false;
if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == null)
return false;
if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getStatusReason() == null ^ this.getStatusReason() == null)
return false;
if (other.getStatusReason() != null && other.getStatusReason().equals(this.getStatusReason()) == false)
return false;
if (other.getStartTime() == null ^ this.getStartTime() == null)
return false;
if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false)
return false;
if (other.getEndTime() == null ^ this.getEndTime() == null)
return false;
if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false)
return false;
if (other.getPercentageComplete() == null ^ this.getPercentageComplete() == null)
return false;
if (other.getPercentageComplete() != null && other.getPercentageComplete().equals(this.getPercentageComplete()) == false)
return false;
if (other.getInstancesToUpdate() == null ^ this.getInstancesToUpdate() == null)
return false;
if (other.getInstancesToUpdate() != null && other.getInstancesToUpdate().equals(this.getInstancesToUpdate()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getInstanceRefreshId() == null) ? 0 : getInstanceRefreshId().hashCode());
hashCode = prime * hashCode + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getStatusReason() == null) ? 0 : getStatusReason().hashCode());
hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
hashCode = prime * hashCode + ((getPercentageComplete() == null) ? 0 : getPercentageComplete().hashCode());
hashCode = prime * hashCode + ((getInstancesToUpdate() == null) ? 0 : getInstancesToUpdate().hashCode());
return hashCode;
}
@Override
public InstanceRefresh clone() {
try {
return (InstanceRefresh) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}