
software.amazon.awssdk.services.codedeploy.model.DeploymentInfo Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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.codedeploy.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Information about a deployment.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeploymentInfo implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField APPLICATION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DeploymentInfo::applicationName)).setter(setter(Builder::applicationName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("applicationName").build()).build();
private static final SdkField DEPLOYMENT_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DeploymentInfo::deploymentGroupName)).setter(setter(Builder::deploymentGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deploymentGroupName").build())
.build();
private static final SdkField DEPLOYMENT_CONFIG_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DeploymentInfo::deploymentConfigName)).setter(setter(Builder::deploymentConfigName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deploymentConfigName").build())
.build();
private static final SdkField DEPLOYMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DeploymentInfo::deploymentId)).setter(setter(Builder::deploymentId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deploymentId").build()).build();
private static final SdkField PREVIOUS_REVISION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(DeploymentInfo::previousRevision))
.setter(setter(Builder::previousRevision)).constructor(RevisionLocation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("previousRevision").build()).build();
private static final SdkField REVISION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(DeploymentInfo::revision))
.setter(setter(Builder::revision)).constructor(RevisionLocation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("revision").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DeploymentInfo::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField ERROR_INFORMATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(DeploymentInfo::errorInformation))
.setter(setter(Builder::errorInformation)).constructor(ErrorInformation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("errorInformation").build()).build();
private static final SdkField CREATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(DeploymentInfo::createTime)).setter(setter(Builder::createTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createTime").build()).build();
private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(DeploymentInfo::startTime)).setter(setter(Builder::startTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTime").build()).build();
private static final SdkField COMPLETE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(DeploymentInfo::completeTime)).setter(setter(Builder::completeTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("completeTime").build()).build();
private static final SdkField DEPLOYMENT_OVERVIEW_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(DeploymentInfo::deploymentOverview))
.setter(setter(Builder::deploymentOverview)).constructor(DeploymentOverview::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deploymentOverview").build())
.build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DeploymentInfo::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField CREATOR_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DeploymentInfo::creatorAsString)).setter(setter(Builder::creator))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creator").build()).build();
private static final SdkField IGNORE_APPLICATION_STOP_FAILURES_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.getter(getter(DeploymentInfo::ignoreApplicationStopFailures))
.setter(setter(Builder::ignoreApplicationStopFailures))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ignoreApplicationStopFailures")
.build()).build();
private static final SdkField AUTO_ROLLBACK_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(DeploymentInfo::autoRollbackConfiguration)).setter(setter(Builder::autoRollbackConfiguration))
.constructor(AutoRollbackConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("autoRollbackConfiguration").build())
.build();
private static final SdkField UPDATE_OUTDATED_INSTANCES_ONLY_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.getter(getter(DeploymentInfo::updateOutdatedInstancesOnly))
.setter(setter(Builder::updateOutdatedInstancesOnly))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updateOutdatedInstancesOnly")
.build()).build();
private static final SdkField ROLLBACK_INFO_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.getter(getter(DeploymentInfo::rollbackInfo)).setter(setter(Builder::rollbackInfo))
.constructor(RollbackInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("rollbackInfo").build()).build();
private static final SdkField DEPLOYMENT_STYLE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(DeploymentInfo::deploymentStyle))
.setter(setter(Builder::deploymentStyle)).constructor(DeploymentStyle::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deploymentStyle").build()).build();
private static final SdkField TARGET_INSTANCES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(DeploymentInfo::targetInstances))
.setter(setter(Builder::targetInstances)).constructor(TargetInstances::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("targetInstances").build()).build();
private static final SdkField INSTANCE_TERMINATION_WAIT_TIME_STARTED_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.getter(getter(DeploymentInfo::instanceTerminationWaitTimeStarted))
.setter(setter(Builder::instanceTerminationWaitTimeStarted))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("instanceTerminationWaitTimeStarted")
.build()).build();
private static final SdkField BLUE_GREEN_DEPLOYMENT_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(DeploymentInfo::blueGreenDeploymentConfiguration))
.setter(setter(Builder::blueGreenDeploymentConfiguration))
.constructor(BlueGreenDeploymentConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("blueGreenDeploymentConfiguration")
.build()).build();
private static final SdkField LOAD_BALANCER_INFO_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(DeploymentInfo::loadBalancerInfo))
.setter(setter(Builder::loadBalancerInfo)).constructor(LoadBalancerInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("loadBalancerInfo").build()).build();
private static final SdkField ADDITIONAL_DEPLOYMENT_STATUS_INFO_FIELD = SdkField
. builder(MarshallingType.STRING)
.getter(getter(DeploymentInfo::additionalDeploymentStatusInfo))
.setter(setter(Builder::additionalDeploymentStatusInfo))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("additionalDeploymentStatusInfo")
.build()).build();
private static final SdkField FILE_EXISTS_BEHAVIOR_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DeploymentInfo::fileExistsBehaviorAsString)).setter(setter(Builder::fileExistsBehavior))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fileExistsBehavior").build())
.build();
private static final SdkField> DEPLOYMENT_STATUS_MESSAGES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(DeploymentInfo::deploymentStatusMessages))
.setter(setter(Builder::deploymentStatusMessages))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deploymentStatusMessages").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField COMPUTE_PLATFORM_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DeploymentInfo::computePlatformAsString)).setter(setter(Builder::computePlatform))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("computePlatform").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APPLICATION_NAME_FIELD,
DEPLOYMENT_GROUP_NAME_FIELD, DEPLOYMENT_CONFIG_NAME_FIELD, DEPLOYMENT_ID_FIELD, PREVIOUS_REVISION_FIELD,
REVISION_FIELD, STATUS_FIELD, ERROR_INFORMATION_FIELD, CREATE_TIME_FIELD, START_TIME_FIELD, COMPLETE_TIME_FIELD,
DEPLOYMENT_OVERVIEW_FIELD, DESCRIPTION_FIELD, CREATOR_FIELD, IGNORE_APPLICATION_STOP_FAILURES_FIELD,
AUTO_ROLLBACK_CONFIGURATION_FIELD, UPDATE_OUTDATED_INSTANCES_ONLY_FIELD, ROLLBACK_INFO_FIELD, DEPLOYMENT_STYLE_FIELD,
TARGET_INSTANCES_FIELD, INSTANCE_TERMINATION_WAIT_TIME_STARTED_FIELD, BLUE_GREEN_DEPLOYMENT_CONFIGURATION_FIELD,
LOAD_BALANCER_INFO_FIELD, ADDITIONAL_DEPLOYMENT_STATUS_INFO_FIELD, FILE_EXISTS_BEHAVIOR_FIELD,
DEPLOYMENT_STATUS_MESSAGES_FIELD, COMPUTE_PLATFORM_FIELD));
private static final long serialVersionUID = 1L;
private final String applicationName;
private final String deploymentGroupName;
private final String deploymentConfigName;
private final String deploymentId;
private final RevisionLocation previousRevision;
private final RevisionLocation revision;
private final String status;
private final ErrorInformation errorInformation;
private final Instant createTime;
private final Instant startTime;
private final Instant completeTime;
private final DeploymentOverview deploymentOverview;
private final String description;
private final String creator;
private final Boolean ignoreApplicationStopFailures;
private final AutoRollbackConfiguration autoRollbackConfiguration;
private final Boolean updateOutdatedInstancesOnly;
private final RollbackInfo rollbackInfo;
private final DeploymentStyle deploymentStyle;
private final TargetInstances targetInstances;
private final Boolean instanceTerminationWaitTimeStarted;
private final BlueGreenDeploymentConfiguration blueGreenDeploymentConfiguration;
private final LoadBalancerInfo loadBalancerInfo;
private final String additionalDeploymentStatusInfo;
private final String fileExistsBehavior;
private final List deploymentStatusMessages;
private final String computePlatform;
private DeploymentInfo(BuilderImpl builder) {
this.applicationName = builder.applicationName;
this.deploymentGroupName = builder.deploymentGroupName;
this.deploymentConfigName = builder.deploymentConfigName;
this.deploymentId = builder.deploymentId;
this.previousRevision = builder.previousRevision;
this.revision = builder.revision;
this.status = builder.status;
this.errorInformation = builder.errorInformation;
this.createTime = builder.createTime;
this.startTime = builder.startTime;
this.completeTime = builder.completeTime;
this.deploymentOverview = builder.deploymentOverview;
this.description = builder.description;
this.creator = builder.creator;
this.ignoreApplicationStopFailures = builder.ignoreApplicationStopFailures;
this.autoRollbackConfiguration = builder.autoRollbackConfiguration;
this.updateOutdatedInstancesOnly = builder.updateOutdatedInstancesOnly;
this.rollbackInfo = builder.rollbackInfo;
this.deploymentStyle = builder.deploymentStyle;
this.targetInstances = builder.targetInstances;
this.instanceTerminationWaitTimeStarted = builder.instanceTerminationWaitTimeStarted;
this.blueGreenDeploymentConfiguration = builder.blueGreenDeploymentConfiguration;
this.loadBalancerInfo = builder.loadBalancerInfo;
this.additionalDeploymentStatusInfo = builder.additionalDeploymentStatusInfo;
this.fileExistsBehavior = builder.fileExistsBehavior;
this.deploymentStatusMessages = builder.deploymentStatusMessages;
this.computePlatform = builder.computePlatform;
}
/**
*
* The application name.
*
*
* @return The application name.
*/
public String applicationName() {
return applicationName;
}
/**
*
* The deployment group name.
*
*
* @return The deployment group name.
*/
public String deploymentGroupName() {
return deploymentGroupName;
}
/**
*
* The deployment configuration name.
*
*
* @return The deployment configuration name.
*/
public String deploymentConfigName() {
return deploymentConfigName;
}
/**
*
* The unique ID of a deployment.
*
*
* @return The unique ID of a deployment.
*/
public String deploymentId() {
return deploymentId;
}
/**
*
* Information about the application revision that was deployed to the deployment group before the most recent
* successful deployment.
*
*
* @return Information about the application revision that was deployed to the deployment group before the most
* recent successful deployment.
*/
public RevisionLocation previousRevision() {
return previousRevision;
}
/**
*
* Information about the location of stored application artifacts and the service from which to retrieve them.
*
*
* @return Information about the location of stored application artifacts and the service from which to retrieve
* them.
*/
public RevisionLocation revision() {
return revision;
}
/**
*
* The current state of the deployment as a whole.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link DeploymentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current state of the deployment as a whole.
* @see DeploymentStatus
*/
public DeploymentStatus status() {
return DeploymentStatus.fromValue(status);
}
/**
*
* The current state of the deployment as a whole.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link DeploymentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current state of the deployment as a whole.
* @see DeploymentStatus
*/
public String statusAsString() {
return status;
}
/**
*
* Information about any error associated with this deployment.
*
*
* @return Information about any error associated with this deployment.
*/
public ErrorInformation errorInformation() {
return errorInformation;
}
/**
*
* A timestamp that indicates when the deployment was created.
*
*
* @return A timestamp that indicates when the deployment was created.
*/
public Instant createTime() {
return createTime;
}
/**
*
* A timestamp that indicates when the deployment was deployed to the deployment group.
*
*
* In some cases, the reported value of the start time might be later than the complete time. This is due to
* differences in the clock settings of backend servers that participate in the deployment process.
*
*
* @return A timestamp that indicates when the deployment was deployed to the deployment group.
*
* In some cases, the reported value of the start time might be later than the complete time. This is due to
* differences in the clock settings of backend servers that participate in the deployment process.
*/
public Instant startTime() {
return startTime;
}
/**
*
* A timestamp that indicates when the deployment was complete.
*
*
* @return A timestamp that indicates when the deployment was complete.
*/
public Instant completeTime() {
return completeTime;
}
/**
*
* A summary of the deployment status of the instances in the deployment.
*
*
* @return A summary of the deployment status of the instances in the deployment.
*/
public DeploymentOverview deploymentOverview() {
return deploymentOverview;
}
/**
*
* A comment about the deployment.
*
*
* @return A comment about the deployment.
*/
public String description() {
return description;
}
/**
*
* The means by which the deployment was created:
*
*
* -
*
* user: A user created the deployment.
*
*
* -
*
* autoscaling: Amazon EC2 Auto Scaling created the deployment.
*
*
* -
*
* codeDeployRollback: A rollback process created the deployment.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #creator} will
* return {@link DeploymentCreator#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #creatorAsString}.
*
*
* @return The means by which the deployment was created:
*
* -
*
* user: A user created the deployment.
*
*
* -
*
* autoscaling: Amazon EC2 Auto Scaling created the deployment.
*
*
* -
*
* codeDeployRollback: A rollback process created the deployment.
*
*
* @see DeploymentCreator
*/
public DeploymentCreator creator() {
return DeploymentCreator.fromValue(creator);
}
/**
*
* The means by which the deployment was created:
*
*
* -
*
* user: A user created the deployment.
*
*
* -
*
* autoscaling: Amazon EC2 Auto Scaling created the deployment.
*
*
* -
*
* codeDeployRollback: A rollback process created the deployment.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #creator} will
* return {@link DeploymentCreator#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #creatorAsString}.
*
*
* @return The means by which the deployment was created:
*
* -
*
* user: A user created the deployment.
*
*
* -
*
* autoscaling: Amazon EC2 Auto Scaling created the deployment.
*
*
* -
*
* codeDeployRollback: A rollback process created the deployment.
*
*
* @see DeploymentCreator
*/
public String creatorAsString() {
return creator;
}
/**
*
* If true, then if an ApplicationStop, BeforeBlockTraffic, or AfterBlockTraffic deployment lifecycle event to an
* instance fails, then the deployment continues to the next deployment lifecycle event. For example, if
* ApplicationStop fails, the deployment continues with DownloadBundle. If BeforeBlockTraffic fails, the deployment
* continues with BlockTraffic. If AfterBlockTraffic fails, the deployment continues with ApplicationStop.
*
*
* If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment
* fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not
* less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.
*
*
* During a deployment, the AWS CodeDeploy agent runs the scripts specified for ApplicationStop, BeforeBlockTraffic,
* and AfterBlockTraffic in the AppSpec file from the previous successful deployment. (All other scripts are run
* from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run
* successfully, the deployment can fail.
*
*
* If the cause of the failure is a script from the last successful deployment that will never run successfully,
* create a new deployment and use ignoreApplicationStopFailures
to specify that the ApplicationStop,
* BeforeBlockTraffic, and AfterBlockTraffic failures should be ignored.
*
*
* @return If true, then if an ApplicationStop, BeforeBlockTraffic, or AfterBlockTraffic deployment lifecycle event
* to an instance fails, then the deployment continues to the next deployment lifecycle event. For example,
* if ApplicationStop fails, the deployment continues with DownloadBundle. If BeforeBlockTraffic fails, the
* deployment continues with BlockTraffic. If AfterBlockTraffic fails, the deployment continues with
* ApplicationStop.
*
* If false or not specified, then if a lifecycle event fails during a deployment to an instance, that
* deployment fails. If deployment to that instance is part of an overall deployment and the number of
* healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next
* instance is attempted.
*
*
* During a deployment, the AWS CodeDeploy agent runs the scripts specified for ApplicationStop,
* BeforeBlockTraffic, and AfterBlockTraffic in the AppSpec file from the previous successful deployment.
* (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts
* contains an error and does not run successfully, the deployment can fail.
*
*
* If the cause of the failure is a script from the last successful deployment that will never run
* successfully, create a new deployment and use ignoreApplicationStopFailures
to specify that
* the ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic failures should be ignored.
*/
public Boolean ignoreApplicationStopFailures() {
return ignoreApplicationStopFailures;
}
/**
*
* Information about the automatic rollback configuration associated with the deployment.
*
*
* @return Information about the automatic rollback configuration associated with the deployment.
*/
public AutoRollbackConfiguration autoRollbackConfiguration() {
return autoRollbackConfiguration;
}
/**
*
* Indicates whether only instances that are not running the latest application revision are to be deployed to.
*
*
* @return Indicates whether only instances that are not running the latest application revision are to be deployed
* to.
*/
public Boolean updateOutdatedInstancesOnly() {
return updateOutdatedInstancesOnly;
}
/**
*
* Information about a deployment rollback.
*
*
* @return Information about a deployment rollback.
*/
public RollbackInfo rollbackInfo() {
return rollbackInfo;
}
/**
*
* Information about the type of deployment, either in-place or blue/green, you want to run and whether to route
* deployment traffic behind a load balancer.
*
*
* @return Information about the type of deployment, either in-place or blue/green, you want to run and whether to
* route deployment traffic behind a load balancer.
*/
public DeploymentStyle deploymentStyle() {
return deploymentStyle;
}
/**
*
* Information about the instances that belong to the replacement environment in a blue/green deployment.
*
*
* @return Information about the instances that belong to the replacement environment in a blue/green deployment.
*/
public TargetInstances targetInstances() {
return targetInstances;
}
/**
*
* Indicates whether the wait period set for the termination of instances in the original environment has started.
* Status is 'false' if the KEEP_ALIVE option is specified. Otherwise, 'true' as soon as the termination wait period
* starts.
*
*
* @return Indicates whether the wait period set for the termination of instances in the original environment has
* started. Status is 'false' if the KEEP_ALIVE option is specified. Otherwise, 'true' as soon as the
* termination wait period starts.
*/
public Boolean instanceTerminationWaitTimeStarted() {
return instanceTerminationWaitTimeStarted;
}
/**
*
* Information about blue/green deployment options for this deployment.
*
*
* @return Information about blue/green deployment options for this deployment.
*/
public BlueGreenDeploymentConfiguration blueGreenDeploymentConfiguration() {
return blueGreenDeploymentConfiguration;
}
/**
*
* Information about the load balancer used in the deployment.
*
*
* @return Information about the load balancer used in the deployment.
*/
public LoadBalancerInfo loadBalancerInfo() {
return loadBalancerInfo;
}
/**
*
* Provides information about the results of a deployment, such as whether instances in the original environment in
* a blue/green deployment were not terminated.
*
*
* @return Provides information about the results of a deployment, such as whether instances in the original
* environment in a blue/green deployment were not terminated.
*/
public String additionalDeploymentStatusInfo() {
return additionalDeploymentStatusInfo;
}
/**
*
* Information about how AWS CodeDeploy handles files that already exist in a deployment target location but weren't
* part of the previous successful deployment.
*
*
* -
*
* DISALLOW: The deployment fails. This is also the default behavior if no option is specified.
*
*
* -
*
* OVERWRITE: The version of the file from the application revision currently being deployed replaces the version
* already on the instance.
*
*
* -
*
* RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #fileExistsBehavior} will return {@link FileExistsBehavior#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #fileExistsBehaviorAsString}.
*
*
* @return Information about how AWS CodeDeploy handles files that already exist in a deployment target location but
* weren't part of the previous successful deployment.
*
* -
*
* DISALLOW: The deployment fails. This is also the default behavior if no option is specified.
*
*
* -
*
* OVERWRITE: The version of the file from the application revision currently being deployed replaces the
* version already on the instance.
*
*
* -
*
* RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.
*
*
* @see FileExistsBehavior
*/
public FileExistsBehavior fileExistsBehavior() {
return FileExistsBehavior.fromValue(fileExistsBehavior);
}
/**
*
* Information about how AWS CodeDeploy handles files that already exist in a deployment target location but weren't
* part of the previous successful deployment.
*
*
* -
*
* DISALLOW: The deployment fails. This is also the default behavior if no option is specified.
*
*
* -
*
* OVERWRITE: The version of the file from the application revision currently being deployed replaces the version
* already on the instance.
*
*
* -
*
* RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #fileExistsBehavior} will return {@link FileExistsBehavior#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #fileExistsBehaviorAsString}.
*
*
* @return Information about how AWS CodeDeploy handles files that already exist in a deployment target location but
* weren't part of the previous successful deployment.
*
* -
*
* DISALLOW: The deployment fails. This is also the default behavior if no option is specified.
*
*
* -
*
* OVERWRITE: The version of the file from the application revision currently being deployed replaces the
* version already on the instance.
*
*
* -
*
* RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.
*
*
* @see FileExistsBehavior
*/
public String fileExistsBehaviorAsString() {
return fileExistsBehavior;
}
/**
*
* Messages that contain information about the status of a deployment.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Messages that contain information about the status of a deployment.
*/
public List deploymentStatusMessages() {
return deploymentStatusMessages;
}
/**
*
* The destination platform type for the deployment (Lambda
or Server
).
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #computePlatform}
* will return {@link ComputePlatform#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #computePlatformAsString}.
*
*
* @return The destination platform type for the deployment (Lambda
or Server
).
* @see ComputePlatform
*/
public ComputePlatform computePlatform() {
return ComputePlatform.fromValue(computePlatform);
}
/**
*
* The destination platform type for the deployment (Lambda
or Server
).
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #computePlatform}
* will return {@link ComputePlatform#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #computePlatformAsString}.
*
*
* @return The destination platform type for the deployment (Lambda
or Server
).
* @see ComputePlatform
*/
public String computePlatformAsString() {
return computePlatform;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(applicationName());
hashCode = 31 * hashCode + Objects.hashCode(deploymentGroupName());
hashCode = 31 * hashCode + Objects.hashCode(deploymentConfigName());
hashCode = 31 * hashCode + Objects.hashCode(deploymentId());
hashCode = 31 * hashCode + Objects.hashCode(previousRevision());
hashCode = 31 * hashCode + Objects.hashCode(revision());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(errorInformation());
hashCode = 31 * hashCode + Objects.hashCode(createTime());
hashCode = 31 * hashCode + Objects.hashCode(startTime());
hashCode = 31 * hashCode + Objects.hashCode(completeTime());
hashCode = 31 * hashCode + Objects.hashCode(deploymentOverview());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(creatorAsString());
hashCode = 31 * hashCode + Objects.hashCode(ignoreApplicationStopFailures());
hashCode = 31 * hashCode + Objects.hashCode(autoRollbackConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(updateOutdatedInstancesOnly());
hashCode = 31 * hashCode + Objects.hashCode(rollbackInfo());
hashCode = 31 * hashCode + Objects.hashCode(deploymentStyle());
hashCode = 31 * hashCode + Objects.hashCode(targetInstances());
hashCode = 31 * hashCode + Objects.hashCode(instanceTerminationWaitTimeStarted());
hashCode = 31 * hashCode + Objects.hashCode(blueGreenDeploymentConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(loadBalancerInfo());
hashCode = 31 * hashCode + Objects.hashCode(additionalDeploymentStatusInfo());
hashCode = 31 * hashCode + Objects.hashCode(fileExistsBehaviorAsString());
hashCode = 31 * hashCode + Objects.hashCode(deploymentStatusMessages());
hashCode = 31 * hashCode + Objects.hashCode(computePlatformAsString());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DeploymentInfo)) {
return false;
}
DeploymentInfo other = (DeploymentInfo) obj;
return Objects.equals(applicationName(), other.applicationName())
&& Objects.equals(deploymentGroupName(), other.deploymentGroupName())
&& Objects.equals(deploymentConfigName(), other.deploymentConfigName())
&& Objects.equals(deploymentId(), other.deploymentId())
&& Objects.equals(previousRevision(), other.previousRevision()) && Objects.equals(revision(), other.revision())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(errorInformation(), other.errorInformation())
&& Objects.equals(createTime(), other.createTime()) && Objects.equals(startTime(), other.startTime())
&& Objects.equals(completeTime(), other.completeTime())
&& Objects.equals(deploymentOverview(), other.deploymentOverview())
&& Objects.equals(description(), other.description())
&& Objects.equals(creatorAsString(), other.creatorAsString())
&& Objects.equals(ignoreApplicationStopFailures(), other.ignoreApplicationStopFailures())
&& Objects.equals(autoRollbackConfiguration(), other.autoRollbackConfiguration())
&& Objects.equals(updateOutdatedInstancesOnly(), other.updateOutdatedInstancesOnly())
&& Objects.equals(rollbackInfo(), other.rollbackInfo())
&& Objects.equals(deploymentStyle(), other.deploymentStyle())
&& Objects.equals(targetInstances(), other.targetInstances())
&& Objects.equals(instanceTerminationWaitTimeStarted(), other.instanceTerminationWaitTimeStarted())
&& Objects.equals(blueGreenDeploymentConfiguration(), other.blueGreenDeploymentConfiguration())
&& Objects.equals(loadBalancerInfo(), other.loadBalancerInfo())
&& Objects.equals(additionalDeploymentStatusInfo(), other.additionalDeploymentStatusInfo())
&& Objects.equals(fileExistsBehaviorAsString(), other.fileExistsBehaviorAsString())
&& Objects.equals(deploymentStatusMessages(), other.deploymentStatusMessages())
&& Objects.equals(computePlatformAsString(), other.computePlatformAsString());
}
/**
* 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 String toString() {
return ToString.builder("DeploymentInfo").add("ApplicationName", applicationName())
.add("DeploymentGroupName", deploymentGroupName()).add("DeploymentConfigName", deploymentConfigName())
.add("DeploymentId", deploymentId()).add("PreviousRevision", previousRevision()).add("Revision", revision())
.add("Status", statusAsString()).add("ErrorInformation", errorInformation()).add("CreateTime", createTime())
.add("StartTime", startTime()).add("CompleteTime", completeTime())
.add("DeploymentOverview", deploymentOverview()).add("Description", description())
.add("Creator", creatorAsString()).add("IgnoreApplicationStopFailures", ignoreApplicationStopFailures())
.add("AutoRollbackConfiguration", autoRollbackConfiguration())
.add("UpdateOutdatedInstancesOnly", updateOutdatedInstancesOnly()).add("RollbackInfo", rollbackInfo())
.add("DeploymentStyle", deploymentStyle()).add("TargetInstances", targetInstances())
.add("InstanceTerminationWaitTimeStarted", instanceTerminationWaitTimeStarted())
.add("BlueGreenDeploymentConfiguration", blueGreenDeploymentConfiguration())
.add("LoadBalancerInfo", loadBalancerInfo())
.add("AdditionalDeploymentStatusInfo", additionalDeploymentStatusInfo())
.add("FileExistsBehavior", fileExistsBehaviorAsString())
.add("DeploymentStatusMessages", deploymentStatusMessages()).add("ComputePlatform", computePlatformAsString())
.build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "applicationName":
return Optional.ofNullable(clazz.cast(applicationName()));
case "deploymentGroupName":
return Optional.ofNullable(clazz.cast(deploymentGroupName()));
case "deploymentConfigName":
return Optional.ofNullable(clazz.cast(deploymentConfigName()));
case "deploymentId":
return Optional.ofNullable(clazz.cast(deploymentId()));
case "previousRevision":
return Optional.ofNullable(clazz.cast(previousRevision()));
case "revision":
return Optional.ofNullable(clazz.cast(revision()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "errorInformation":
return Optional.ofNullable(clazz.cast(errorInformation()));
case "createTime":
return Optional.ofNullable(clazz.cast(createTime()));
case "startTime":
return Optional.ofNullable(clazz.cast(startTime()));
case "completeTime":
return Optional.ofNullable(clazz.cast(completeTime()));
case "deploymentOverview":
return Optional.ofNullable(clazz.cast(deploymentOverview()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "creator":
return Optional.ofNullable(clazz.cast(creatorAsString()));
case "ignoreApplicationStopFailures":
return Optional.ofNullable(clazz.cast(ignoreApplicationStopFailures()));
case "autoRollbackConfiguration":
return Optional.ofNullable(clazz.cast(autoRollbackConfiguration()));
case "updateOutdatedInstancesOnly":
return Optional.ofNullable(clazz.cast(updateOutdatedInstancesOnly()));
case "rollbackInfo":
return Optional.ofNullable(clazz.cast(rollbackInfo()));
case "deploymentStyle":
return Optional.ofNullable(clazz.cast(deploymentStyle()));
case "targetInstances":
return Optional.ofNullable(clazz.cast(targetInstances()));
case "instanceTerminationWaitTimeStarted":
return Optional.ofNullable(clazz.cast(instanceTerminationWaitTimeStarted()));
case "blueGreenDeploymentConfiguration":
return Optional.ofNullable(clazz.cast(blueGreenDeploymentConfiguration()));
case "loadBalancerInfo":
return Optional.ofNullable(clazz.cast(loadBalancerInfo()));
case "additionalDeploymentStatusInfo":
return Optional.ofNullable(clazz.cast(additionalDeploymentStatusInfo()));
case "fileExistsBehavior":
return Optional.ofNullable(clazz.cast(fileExistsBehaviorAsString()));
case "deploymentStatusMessages":
return Optional.ofNullable(clazz.cast(deploymentStatusMessages()));
case "computePlatform":
return Optional.ofNullable(clazz.cast(computePlatformAsString()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function