All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.autoscaling.model.InstanceRefresh Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Auto Scaling module holds the client classes that are used for communicating with Auto Scaling Service

There is a newer version: 2.29.15
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.autoscaling.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes an instance refresh for an Auto Scaling group. *

*/ @Generated("software.amazon.awssdk:codegen") public final class InstanceRefresh implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField INSTANCE_REFRESH_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InstanceRefreshId").getter(getter(InstanceRefresh::instanceRefreshId)) .setter(setter(Builder::instanceRefreshId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceRefreshId").build()).build(); private static final SdkField AUTO_SCALING_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AutoScalingGroupName").getter(getter(InstanceRefresh::autoScalingGroupName)) .setter(setter(Builder::autoScalingGroupName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoScalingGroupName").build()) .build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(InstanceRefresh::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField STATUS_REASON_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StatusReason").getter(getter(InstanceRefresh::statusReason)).setter(setter(Builder::statusReason)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusReason").build()).build(); private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("StartTime").getter(getter(InstanceRefresh::startTime)).setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build(); private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("EndTime").getter(getter(InstanceRefresh::endTime)).setter(setter(Builder::endTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndTime").build()).build(); private static final SdkField PERCENTAGE_COMPLETE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("PercentageComplete").getter(getter(InstanceRefresh::percentageComplete)) .setter(setter(Builder::percentageComplete)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PercentageComplete").build()) .build(); private static final SdkField INSTANCES_TO_UPDATE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("InstancesToUpdate").getter(getter(InstanceRefresh::instancesToUpdate)) .setter(setter(Builder::instancesToUpdate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstancesToUpdate").build()).build(); private static final SdkField PROGRESS_DETAILS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ProgressDetails") .getter(getter(InstanceRefresh::progressDetails)).setter(setter(Builder::progressDetails)) .constructor(InstanceRefreshProgressDetails::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProgressDetails").build()).build(); private static final SdkField PREFERENCES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("Preferences") .getter(getter(InstanceRefresh::preferences)).setter(setter(Builder::preferences)) .constructor(RefreshPreferences::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Preferences").build()).build(); private static final SdkField DESIRED_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("DesiredConfiguration") .getter(getter(InstanceRefresh::desiredConfiguration)).setter(setter(Builder::desiredConfiguration)) .constructor(DesiredConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DesiredConfiguration").build()) .build(); private static final SdkField ROLLBACK_DETAILS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("RollbackDetails") .getter(getter(InstanceRefresh::rollbackDetails)).setter(setter(Builder::rollbackDetails)) .constructor(RollbackDetails::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RollbackDetails").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INSTANCE_REFRESH_ID_FIELD, AUTO_SCALING_GROUP_NAME_FIELD, STATUS_FIELD, STATUS_REASON_FIELD, START_TIME_FIELD, END_TIME_FIELD, PERCENTAGE_COMPLETE_FIELD, INSTANCES_TO_UPDATE_FIELD, PROGRESS_DETAILS_FIELD, PREFERENCES_FIELD, DESIRED_CONFIGURATION_FIELD, ROLLBACK_DETAILS_FIELD)); private static final long serialVersionUID = 1L; private final String instanceRefreshId; private final String autoScalingGroupName; private final String status; private final String statusReason; private final Instant startTime; private final Instant endTime; private final Integer percentageComplete; private final Integer instancesToUpdate; private final InstanceRefreshProgressDetails progressDetails; private final RefreshPreferences preferences; private final DesiredConfiguration desiredConfiguration; private final RollbackDetails rollbackDetails; private InstanceRefresh(BuilderImpl builder) { this.instanceRefreshId = builder.instanceRefreshId; this.autoScalingGroupName = builder.autoScalingGroupName; this.status = builder.status; this.statusReason = builder.statusReason; this.startTime = builder.startTime; this.endTime = builder.endTime; this.percentageComplete = builder.percentageComplete; this.instancesToUpdate = builder.instancesToUpdate; this.progressDetails = builder.progressDetails; this.preferences = builder.preferences; this.desiredConfiguration = builder.desiredConfiguration; this.rollbackDetails = builder.rollbackDetails; } /** *

* The instance refresh ID. *

* * @return The instance refresh ID. */ public final String instanceRefreshId() { return instanceRefreshId; } /** *

* The name of the Auto Scaling group. *

* * @return The name of the Auto Scaling group. */ public final String autoScalingGroupName() { return autoScalingGroupName; } /** *

* The current status for the instance refresh operation: *

*
    *
  • *

    * Pending - The request was created, but the instance refresh has not started. *

    *
  • *
  • *

    * InProgress - An instance refresh is in progress. *

    *
  • *
  • *

    * Successful - An instance refresh completed successfully. *

    *
  • *
  • *

    * Failed - An instance refresh failed to complete. You can troubleshoot using the status reason and * the scaling activities. *

    *
  • *
  • *

    * Cancelling - An ongoing instance refresh is being cancelled. *

    *
  • *
  • *

    * Cancelled - The instance refresh is cancelled. *

    *
  • *
  • *

    * RollbackInProgress - An instance refresh is being rolled back. *

    *
  • *
  • *

    * RollbackFailed - The rollback failed to complete. You can troubleshoot using the status reason and * the scaling activities. *

    *
  • *
  • *

    * RollbackSuccessful - The rollback completed successfully. *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link InstanceRefreshStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

* * @return The current status for the instance refresh operation:

*
    *
  • *

    * Pending - The request was created, but the instance refresh has not started. *

    *
  • *
  • *

    * InProgress - An instance refresh is in progress. *

    *
  • *
  • *

    * Successful - An instance refresh completed successfully. *

    *
  • *
  • *

    * Failed - An instance refresh failed to complete. You can troubleshoot using the status * reason and the scaling activities. *

    *
  • *
  • *

    * Cancelling - An ongoing instance refresh is being cancelled. *

    *
  • *
  • *

    * Cancelled - The instance refresh is cancelled. *

    *
  • *
  • *

    * RollbackInProgress - An instance refresh is being rolled back. *

    *
  • *
  • *

    * RollbackFailed - The rollback failed to complete. You can troubleshoot using the status * reason and the scaling activities. *

    *
  • *
  • *

    * RollbackSuccessful - The rollback completed successfully. *

    *
  • * @see InstanceRefreshStatus */ public final InstanceRefreshStatus status() { return InstanceRefreshStatus.fromValue(status); } /** *

    * The current status for the instance refresh operation: *

    *
      *
    • *

      * Pending - The request was created, but the instance refresh has not started. *

      *
    • *
    • *

      * InProgress - An instance refresh is in progress. *

      *
    • *
    • *

      * Successful - An instance refresh completed successfully. *

      *
    • *
    • *

      * Failed - An instance refresh failed to complete. You can troubleshoot using the status reason and * the scaling activities. *

      *
    • *
    • *

      * Cancelling - An ongoing instance refresh is being cancelled. *

      *
    • *
    • *

      * Cancelled - The instance refresh is cancelled. *

      *
    • *
    • *

      * RollbackInProgress - An instance refresh is being rolled back. *

      *
    • *
    • *

      * RollbackFailed - The rollback failed to complete. You can troubleshoot using the status reason and * the scaling activities. *

      *
    • *
    • *

      * RollbackSuccessful - The rollback completed successfully. *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link InstanceRefreshStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

    * * @return The current status for the instance refresh operation:

    *
      *
    • *

      * Pending - The request was created, but the instance refresh has not started. *

      *
    • *
    • *

      * InProgress - An instance refresh is in progress. *

      *
    • *
    • *

      * Successful - An instance refresh completed successfully. *

      *
    • *
    • *

      * Failed - An instance refresh failed to complete. You can troubleshoot using the status * reason and the scaling activities. *

      *
    • *
    • *

      * Cancelling - An ongoing instance refresh is being cancelled. *

      *
    • *
    • *

      * Cancelled - The instance refresh is cancelled. *

      *
    • *
    • *

      * RollbackInProgress - An instance refresh is being rolled back. *

      *
    • *
    • *

      * RollbackFailed - The rollback failed to complete. You can troubleshoot using the status * reason and the scaling activities. *

      *
    • *
    • *

      * RollbackSuccessful - The rollback completed successfully. *

      *
    • * @see InstanceRefreshStatus */ public final String statusAsString() { return status; } /** *

      * The explanation for the specific status assigned to this operation. *

      * * @return The explanation for the specific status assigned to this operation. */ public final String statusReason() { return statusReason; } /** *

      * The date and time at which the instance refresh began. *

      * * @return The date and time at which the instance refresh began. */ public final Instant startTime() { return startTime; } /** *

      * The date and time at which the instance refresh ended. *

      * * @return The date and time at which the instance refresh ended. */ public final Instant endTime() { return 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 is added to the percentage complete. *

      * *

      * PercentageComplete does not include instances that are replaced during a rollback. This value * gradually goes back down to zero during a rollback. *

      *
      * * @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 is added to the * percentage complete.

      *

      * PercentageComplete does not include instances that are replaced during a rollback. This * value gradually goes back down to zero during a rollback. *

      */ public final Integer percentageComplete() { return percentageComplete; } /** *

      * The number of instances remaining to update before the instance refresh is complete. *

      * *

      * If you roll back the instance refresh, InstancesToUpdate shows you the number of instances that were * not yet updated by the instance refresh. Therefore, these instances don't need to be replaced as part of the * rollback. *

      *
      * * @return The number of instances remaining to update before the instance refresh is complete.

      *

      * If you roll back the instance refresh, InstancesToUpdate shows you the number of instances * that were not yet updated by the instance refresh. Therefore, these instances don't need to be replaced * as part of the rollback. *

      */ public final Integer instancesToUpdate() { return instancesToUpdate; } /** *

      * Additional progress details for an Auto Scaling group that has a warm pool. *

      * * @return Additional progress details for an Auto Scaling group that has a warm pool. */ public final InstanceRefreshProgressDetails progressDetails() { return progressDetails; } /** *

      * The preferences for an instance refresh. *

      * * @return The preferences for an instance refresh. */ public final RefreshPreferences preferences() { return preferences; } /** *

      * Describes the desired configuration for the instance refresh. *

      * * @return Describes the desired configuration for the instance refresh. */ public final DesiredConfiguration desiredConfiguration() { return desiredConfiguration; } /** *

      * The rollback details. *

      * * @return The rollback details. */ public final RollbackDetails rollbackDetails() { return rollbackDetails; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(instanceRefreshId()); hashCode = 31 * hashCode + Objects.hashCode(autoScalingGroupName()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusReason()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(endTime()); hashCode = 31 * hashCode + Objects.hashCode(percentageComplete()); hashCode = 31 * hashCode + Objects.hashCode(instancesToUpdate()); hashCode = 31 * hashCode + Objects.hashCode(progressDetails()); hashCode = 31 * hashCode + Objects.hashCode(preferences()); hashCode = 31 * hashCode + Objects.hashCode(desiredConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(rollbackDetails()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof InstanceRefresh)) { return false; } InstanceRefresh other = (InstanceRefresh) obj; return Objects.equals(instanceRefreshId(), other.instanceRefreshId()) && Objects.equals(autoScalingGroupName(), other.autoScalingGroupName()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(statusReason(), other.statusReason()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(endTime(), other.endTime()) && Objects.equals(percentageComplete(), other.percentageComplete()) && Objects.equals(instancesToUpdate(), other.instancesToUpdate()) && Objects.equals(progressDetails(), other.progressDetails()) && Objects.equals(preferences(), other.preferences()) && Objects.equals(desiredConfiguration(), other.desiredConfiguration()) && Objects.equals(rollbackDetails(), other.rollbackDetails()); } /** * 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. */ @Override public final String toString() { return ToString.builder("InstanceRefresh").add("InstanceRefreshId", instanceRefreshId()) .add("AutoScalingGroupName", autoScalingGroupName()).add("Status", statusAsString()) .add("StatusReason", statusReason()).add("StartTime", startTime()).add("EndTime", endTime()) .add("PercentageComplete", percentageComplete()).add("InstancesToUpdate", instancesToUpdate()) .add("ProgressDetails", progressDetails()).add("Preferences", preferences()) .add("DesiredConfiguration", desiredConfiguration()).add("RollbackDetails", rollbackDetails()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "InstanceRefreshId": return Optional.ofNullable(clazz.cast(instanceRefreshId())); case "AutoScalingGroupName": return Optional.ofNullable(clazz.cast(autoScalingGroupName())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "StatusReason": return Optional.ofNullable(clazz.cast(statusReason())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "EndTime": return Optional.ofNullable(clazz.cast(endTime())); case "PercentageComplete": return Optional.ofNullable(clazz.cast(percentageComplete())); case "InstancesToUpdate": return Optional.ofNullable(clazz.cast(instancesToUpdate())); case "ProgressDetails": return Optional.ofNullable(clazz.cast(progressDetails())); case "Preferences": return Optional.ofNullable(clazz.cast(preferences())); case "DesiredConfiguration": return Optional.ofNullable(clazz.cast(desiredConfiguration())); case "RollbackDetails": return Optional.ofNullable(clazz.cast(rollbackDetails())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((InstanceRefresh) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * 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. */ Builder instanceRefreshId(String instanceRefreshId); /** *

      * 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. */ Builder autoScalingGroupName(String autoScalingGroupName); /** *

      * The current status for the instance refresh operation: *

      *
        *
      • *

        * Pending - The request was created, but the instance refresh has not started. *

        *
      • *
      • *

        * InProgress - An instance refresh is in progress. *

        *
      • *
      • *

        * Successful - An instance refresh completed successfully. *

        *
      • *
      • *

        * Failed - An instance refresh failed to complete. You can troubleshoot using the status reason * and the scaling activities. *

        *
      • *
      • *

        * Cancelling - An ongoing instance refresh is being cancelled. *

        *
      • *
      • *

        * Cancelled - The instance refresh is cancelled. *

        *
      • *
      • *

        * RollbackInProgress - An instance refresh is being rolled back. *

        *
      • *
      • *

        * RollbackFailed - The rollback failed to complete. You can troubleshoot using the status reason * and the scaling activities. *

        *
      • *
      • *

        * RollbackSuccessful - The rollback completed successfully. *

        *
      • *
      * * @param status * The current status for the instance refresh operation:

      *
        *
      • *

        * Pending - The request was created, but the instance refresh has not started. *

        *
      • *
      • *

        * InProgress - An instance refresh is in progress. *

        *
      • *
      • *

        * Successful - An instance refresh completed successfully. *

        *
      • *
      • *

        * Failed - An instance refresh failed to complete. You can troubleshoot using the status * reason and the scaling activities. *

        *
      • *
      • *

        * Cancelling - An ongoing instance refresh is being cancelled. *

        *
      • *
      • *

        * Cancelled - The instance refresh is cancelled. *

        *
      • *
      • *

        * RollbackInProgress - An instance refresh is being rolled back. *

        *
      • *
      • *

        * RollbackFailed - The rollback failed to complete. You can troubleshoot using the status * reason and the scaling activities. *

        *
      • *
      • *

        * RollbackSuccessful - The rollback completed successfully. *

        *
      • * @see InstanceRefreshStatus * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceRefreshStatus */ Builder status(String status); /** *

        * The current status for the instance refresh operation: *

        *
          *
        • *

          * Pending - The request was created, but the instance refresh has not started. *

          *
        • *
        • *

          * InProgress - An instance refresh is in progress. *

          *
        • *
        • *

          * Successful - An instance refresh completed successfully. *

          *
        • *
        • *

          * Failed - An instance refresh failed to complete. You can troubleshoot using the status reason * and the scaling activities. *

          *
        • *
        • *

          * Cancelling - An ongoing instance refresh is being cancelled. *

          *
        • *
        • *

          * Cancelled - The instance refresh is cancelled. *

          *
        • *
        • *

          * RollbackInProgress - An instance refresh is being rolled back. *

          *
        • *
        • *

          * RollbackFailed - The rollback failed to complete. You can troubleshoot using the status reason * and the scaling activities. *

          *
        • *
        • *

          * RollbackSuccessful - The rollback completed successfully. *

          *
        • *
        * * @param status * The current status for the instance refresh operation:

        *
          *
        • *

          * Pending - The request was created, but the instance refresh has not started. *

          *
        • *
        • *

          * InProgress - An instance refresh is in progress. *

          *
        • *
        • *

          * Successful - An instance refresh completed successfully. *

          *
        • *
        • *

          * Failed - An instance refresh failed to complete. You can troubleshoot using the status * reason and the scaling activities. *

          *
        • *
        • *

          * Cancelling - An ongoing instance refresh is being cancelled. *

          *
        • *
        • *

          * Cancelled - The instance refresh is cancelled. *

          *
        • *
        • *

          * RollbackInProgress - An instance refresh is being rolled back. *

          *
        • *
        • *

          * RollbackFailed - The rollback failed to complete. You can troubleshoot using the status * reason and the scaling activities. *

          *
        • *
        • *

          * RollbackSuccessful - The rollback completed successfully. *

          *
        • * @see InstanceRefreshStatus * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceRefreshStatus */ Builder status(InstanceRefreshStatus status); /** *

          * The explanation for the specific status assigned to this operation. *

          * * @param statusReason * The explanation for the specific status assigned to this operation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusReason(String statusReason); /** *

          * 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. */ Builder startTime(Instant startTime); /** *

          * 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. */ Builder endTime(Instant 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 is added to the * percentage complete. *

          * *

          * PercentageComplete does not include instances that are replaced during a rollback. This value * gradually goes back down to zero during a rollback. *

          *
          * * @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 is * added to the percentage complete.

          *

          * PercentageComplete does not include instances that are replaced during a rollback. This * value gradually goes back down to zero during a rollback. *

          * @return Returns a reference to this object so that method calls can be chained together. */ Builder percentageComplete(Integer percentageComplete); /** *

          * The number of instances remaining to update before the instance refresh is complete. *

          * *

          * If you roll back the instance refresh, InstancesToUpdate shows you the number of instances that * were not yet updated by the instance refresh. Therefore, these instances don't need to be replaced as part of * the rollback. *

          *
          * * @param instancesToUpdate * The number of instances remaining to update before the instance refresh is complete.

          *

          * If you roll back the instance refresh, InstancesToUpdate shows you the number of * instances that were not yet updated by the instance refresh. Therefore, these instances don't need to * be replaced as part of the rollback. *

          * @return Returns a reference to this object so that method calls can be chained together. */ Builder instancesToUpdate(Integer instancesToUpdate); /** *

          * Additional progress details for an Auto Scaling group that has a warm pool. *

          * * @param progressDetails * Additional progress details for an Auto Scaling group that has a warm pool. * @return Returns a reference to this object so that method calls can be chained together. */ Builder progressDetails(InstanceRefreshProgressDetails progressDetails); /** *

          * Additional progress details for an Auto Scaling group that has a warm pool. *

          * This is a convenience method that creates an instance of the {@link InstanceRefreshProgressDetails.Builder} * avoiding the need to create one manually via {@link InstanceRefreshProgressDetails#builder()}. * *

          * When the {@link Consumer} completes, {@link InstanceRefreshProgressDetails.Builder#build()} is called * immediately and its result is passed to {@link #progressDetails(InstanceRefreshProgressDetails)}. * * @param progressDetails * a consumer that will call methods on {@link InstanceRefreshProgressDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #progressDetails(InstanceRefreshProgressDetails) */ default Builder progressDetails(Consumer progressDetails) { return progressDetails(InstanceRefreshProgressDetails.builder().applyMutation(progressDetails).build()); } /** *

          * The preferences for an instance refresh. *

          * * @param preferences * The preferences for an instance refresh. * @return Returns a reference to this object so that method calls can be chained together. */ Builder preferences(RefreshPreferences preferences); /** *

          * The preferences for an instance refresh. *

          * This is a convenience method that creates an instance of the {@link RefreshPreferences.Builder} avoiding the * need to create one manually via {@link RefreshPreferences#builder()}. * *

          * When the {@link Consumer} completes, {@link RefreshPreferences.Builder#build()} is called immediately and its * result is passed to {@link #preferences(RefreshPreferences)}. * * @param preferences * a consumer that will call methods on {@link RefreshPreferences.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #preferences(RefreshPreferences) */ default Builder preferences(Consumer preferences) { return preferences(RefreshPreferences.builder().applyMutation(preferences).build()); } /** *

          * Describes the desired configuration for the instance refresh. *

          * * @param desiredConfiguration * Describes the desired configuration for the instance refresh. * @return Returns a reference to this object so that method calls can be chained together. */ Builder desiredConfiguration(DesiredConfiguration desiredConfiguration); /** *

          * Describes the desired configuration for the instance refresh. *

          * This is a convenience method that creates an instance of the {@link DesiredConfiguration.Builder} avoiding * the need to create one manually via {@link DesiredConfiguration#builder()}. * *

          * When the {@link Consumer} completes, {@link DesiredConfiguration.Builder#build()} is called immediately and * its result is passed to {@link #desiredConfiguration(DesiredConfiguration)}. * * @param desiredConfiguration * a consumer that will call methods on {@link DesiredConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #desiredConfiguration(DesiredConfiguration) */ default Builder desiredConfiguration(Consumer desiredConfiguration) { return desiredConfiguration(DesiredConfiguration.builder().applyMutation(desiredConfiguration).build()); } /** *

          * The rollback details. *

          * * @param rollbackDetails * The rollback details. * @return Returns a reference to this object so that method calls can be chained together. */ Builder rollbackDetails(RollbackDetails rollbackDetails); /** *

          * The rollback details. *

          * This is a convenience method that creates an instance of the {@link RollbackDetails.Builder} avoiding the * need to create one manually via {@link RollbackDetails#builder()}. * *

          * When the {@link Consumer} completes, {@link RollbackDetails.Builder#build()} is called immediately and its * result is passed to {@link #rollbackDetails(RollbackDetails)}. * * @param rollbackDetails * a consumer that will call methods on {@link RollbackDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #rollbackDetails(RollbackDetails) */ default Builder rollbackDetails(Consumer rollbackDetails) { return rollbackDetails(RollbackDetails.builder().applyMutation(rollbackDetails).build()); } } static final class BuilderImpl implements Builder { private String instanceRefreshId; private String autoScalingGroupName; private String status; private String statusReason; private Instant startTime; private Instant endTime; private Integer percentageComplete; private Integer instancesToUpdate; private InstanceRefreshProgressDetails progressDetails; private RefreshPreferences preferences; private DesiredConfiguration desiredConfiguration; private RollbackDetails rollbackDetails; private BuilderImpl() { } private BuilderImpl(InstanceRefresh model) { instanceRefreshId(model.instanceRefreshId); autoScalingGroupName(model.autoScalingGroupName); status(model.status); statusReason(model.statusReason); startTime(model.startTime); endTime(model.endTime); percentageComplete(model.percentageComplete); instancesToUpdate(model.instancesToUpdate); progressDetails(model.progressDetails); preferences(model.preferences); desiredConfiguration(model.desiredConfiguration); rollbackDetails(model.rollbackDetails); } public final String getInstanceRefreshId() { return instanceRefreshId; } public final void setInstanceRefreshId(String instanceRefreshId) { this.instanceRefreshId = instanceRefreshId; } @Override public final Builder instanceRefreshId(String instanceRefreshId) { this.instanceRefreshId = instanceRefreshId; return this; } public final String getAutoScalingGroupName() { return autoScalingGroupName; } public final void setAutoScalingGroupName(String autoScalingGroupName) { this.autoScalingGroupName = autoScalingGroupName; } @Override public final Builder autoScalingGroupName(String autoScalingGroupName) { this.autoScalingGroupName = autoScalingGroupName; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(InstanceRefreshStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getStatusReason() { return statusReason; } public final void setStatusReason(String statusReason) { this.statusReason = statusReason; } @Override public final Builder statusReason(String statusReason) { this.statusReason = statusReason; return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final Integer getPercentageComplete() { return percentageComplete; } public final void setPercentageComplete(Integer percentageComplete) { this.percentageComplete = percentageComplete; } @Override public final Builder percentageComplete(Integer percentageComplete) { this.percentageComplete = percentageComplete; return this; } public final Integer getInstancesToUpdate() { return instancesToUpdate; } public final void setInstancesToUpdate(Integer instancesToUpdate) { this.instancesToUpdate = instancesToUpdate; } @Override public final Builder instancesToUpdate(Integer instancesToUpdate) { this.instancesToUpdate = instancesToUpdate; return this; } public final InstanceRefreshProgressDetails.Builder getProgressDetails() { return progressDetails != null ? progressDetails.toBuilder() : null; } public final void setProgressDetails(InstanceRefreshProgressDetails.BuilderImpl progressDetails) { this.progressDetails = progressDetails != null ? progressDetails.build() : null; } @Override public final Builder progressDetails(InstanceRefreshProgressDetails progressDetails) { this.progressDetails = progressDetails; return this; } public final RefreshPreferences.Builder getPreferences() { return preferences != null ? preferences.toBuilder() : null; } public final void setPreferences(RefreshPreferences.BuilderImpl preferences) { this.preferences = preferences != null ? preferences.build() : null; } @Override public final Builder preferences(RefreshPreferences preferences) { this.preferences = preferences; return this; } public final DesiredConfiguration.Builder getDesiredConfiguration() { return desiredConfiguration != null ? desiredConfiguration.toBuilder() : null; } public final void setDesiredConfiguration(DesiredConfiguration.BuilderImpl desiredConfiguration) { this.desiredConfiguration = desiredConfiguration != null ? desiredConfiguration.build() : null; } @Override public final Builder desiredConfiguration(DesiredConfiguration desiredConfiguration) { this.desiredConfiguration = desiredConfiguration; return this; } public final RollbackDetails.Builder getRollbackDetails() { return rollbackDetails != null ? rollbackDetails.toBuilder() : null; } public final void setRollbackDetails(RollbackDetails.BuilderImpl rollbackDetails) { this.rollbackDetails = rollbackDetails != null ? rollbackDetails.build() : null; } @Override public final Builder rollbackDetails(RollbackDetails rollbackDetails) { this.rollbackDetails = rollbackDetails; return this; } @Override public InstanceRefresh build() { return new InstanceRefresh(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy