Class TaskSet
- java.lang.Object
-
- software.amazon.awssdk.services.ecs.model.TaskSet
-
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<TaskSet.Builder,TaskSet>
@Generated("software.amazon.awssdk:codegen") public final class TaskSet extends Object implements SdkPojo, Serializable, ToCopyableBuilder<TaskSet.Builder,TaskSet>
Information about a set of Amazon ECS tasks in either an CodeDeploy or an
EXTERNAL
deployment. An Amazon ECS task set includes details such as the desired number of tasks, how many tasks are running, and whether the task set serves production traffic.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TaskSet.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TaskSet.Builder
builder()
List<CapacityProviderStrategyItem>
capacityProviderStrategy()
The capacity provider strategy that are associated with the task set.String
clusterArn()
The Amazon Resource Name (ARN) of the cluster that the service that hosts the task set exists in.Integer
computedDesiredCount()
The computed desired count for the task set.Instant
createdAt()
The Unix timestamp for the time when the task set was created.boolean
equals(Object obj)
boolean
equalsBySdkFields(Object obj)
String
externalId()
The external ID associated with the task set.DeploymentEphemeralStorage
fargateEphemeralStorage()
The Fargate ephemeral storage settings for the task set.<T> Optional<T>
getValueForField(String fieldName, Class<T> clazz)
boolean
hasCapacityProviderStrategy()
For responses, this returns true if the service returned a value for the CapacityProviderStrategy property.int
hashCode()
boolean
hasLoadBalancers()
For responses, this returns true if the service returned a value for the LoadBalancers property.boolean
hasServiceRegistries()
For responses, this returns true if the service returned a value for the ServiceRegistries property.boolean
hasTags()
For responses, this returns true if the service returned a value for the Tags property.String
id()
The ID of the task set.LaunchType
launchType()
The launch type the tasks in the task set are using.String
launchTypeAsString()
The launch type the tasks in the task set are using.List<LoadBalancer>
loadBalancers()
Details on a load balancer that are used with a task set.NetworkConfiguration
networkConfiguration()
The network configuration for the task set.Integer
pendingCount()
The number of tasks in the task set that are in thePENDING
status during a deployment.String
platformFamily()
The operating system that your tasks in the set are running on.String
platformVersion()
The Fargate platform version where the tasks in the task set are running.Integer
runningCount()
The number of tasks in the task set that are in theRUNNING
status during a deployment.Scale
scale()
A floating-point percentage of your desired number of tasks to place and keep running in the task set.List<SdkField<?>>
sdkFields()
static Class<? extends TaskSet.Builder>
serializableBuilderClass()
String
serviceArn()
The Amazon Resource Name (ARN) of the service the task set exists in.List<ServiceRegistry>
serviceRegistries()
The details for the service discovery registries to assign to this task set.StabilityStatus
stabilityStatus()
The stability status.String
stabilityStatusAsString()
The stability status.Instant
stabilityStatusAt()
The Unix timestamp for the time when the task set stability status was retrieved.String
startedBy()
The tag specified when a task set is started.String
status()
The status of the task set.List<Tag>
tags()
The metadata that you apply to the task set to help you categorize and organize them.String
taskDefinition()
The task definition that the task set is using.String
taskSetArn()
The Amazon Resource Name (ARN) of the task set.TaskSet.Builder
toBuilder()
String
toString()
Returns a string representation of this object.Instant
updatedAt()
The Unix timestamp for the time when the task set was last updated.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
id
public final String id()
The ID of the task set.
- Returns:
- The ID of the task set.
-
taskSetArn
public final String taskSetArn()
The Amazon Resource Name (ARN) of the task set.
- Returns:
- The Amazon Resource Name (ARN) of the task set.
-
serviceArn
public final String serviceArn()
The Amazon Resource Name (ARN) of the service the task set exists in.
- Returns:
- The Amazon Resource Name (ARN) of the service the task set exists in.
-
clusterArn
public final String clusterArn()
The Amazon Resource Name (ARN) of the cluster that the service that hosts the task set exists in.
- Returns:
- The Amazon Resource Name (ARN) of the cluster that the service that hosts the task set exists in.
-
startedBy
public final String startedBy()
The tag specified when a task set is started. If an CodeDeploy deployment created the task set, the
startedBy
parameter isCODE_DEPLOY
. If an external deployment created the task set, thestartedBy
field isn't used.- Returns:
- The tag specified when a task set is started. If an CodeDeploy deployment created the task set, the
startedBy
parameter isCODE_DEPLOY
. If an external deployment created the task set, thestartedBy
field isn't used.
-
externalId
public final String externalId()
The external ID associated with the task set.
If an CodeDeploy deployment created a task set, the
externalId
parameter contains the CodeDeploy deployment ID.If a task set is created for an external deployment and is associated with a service discovery registry, the
externalId
parameter contains theECS_TASK_SET_EXTERNAL_ID
Cloud Map attribute.- Returns:
- The external ID associated with the task set.
If an CodeDeploy deployment created a task set, the
externalId
parameter contains the CodeDeploy deployment ID.If a task set is created for an external deployment and is associated with a service discovery registry, the
externalId
parameter contains theECS_TASK_SET_EXTERNAL_ID
Cloud Map attribute.
-
status
public final String status()
The status of the task set. The following describes each state.
- PRIMARY
-
The task set is serving production traffic.
- ACTIVE
-
The task set isn't serving production traffic.
- DRAINING
-
The tasks in the task set are being stopped, and their corresponding targets are being deregistered from their target group.
- Returns:
- The status of the task set. The following describes each state.
- PRIMARY
-
The task set is serving production traffic.
- ACTIVE
-
The task set isn't serving production traffic.
- DRAINING
-
The tasks in the task set are being stopped, and their corresponding targets are being deregistered from their target group.
-
taskDefinition
public final String taskDefinition()
The task definition that the task set is using.
- Returns:
- The task definition that the task set is using.
-
computedDesiredCount
public final Integer computedDesiredCount()
The computed desired count for the task set. This is calculated by multiplying the service's
desiredCount
by the task set'sscale
percentage. The result is always rounded up. For example, if the computed desired count is 1.2, it rounds up to 2 tasks.- Returns:
- The computed desired count for the task set. This is calculated by multiplying the service's
desiredCount
by the task set'sscale
percentage. The result is always rounded up. For example, if the computed desired count is 1.2, it rounds up to 2 tasks.
-
pendingCount
public final Integer pendingCount()
The number of tasks in the task set that are in the
PENDING
status during a deployment. A task in thePENDING
state is preparing to enter theRUNNING
state. A task set enters thePENDING
status when it launches for the first time or when it's restarted after being in theSTOPPED
state.- Returns:
- The number of tasks in the task set that are in the
PENDING
status during a deployment. A task in thePENDING
state is preparing to enter theRUNNING
state. A task set enters thePENDING
status when it launches for the first time or when it's restarted after being in theSTOPPED
state.
-
runningCount
public final Integer runningCount()
The number of tasks in the task set that are in the
RUNNING
status during a deployment. A task in theRUNNING
state is running and ready for use.- Returns:
- The number of tasks in the task set that are in the
RUNNING
status during a deployment. A task in theRUNNING
state is running and ready for use.
-
createdAt
public final Instant createdAt()
The Unix timestamp for the time when the task set was created.
- Returns:
- The Unix timestamp for the time when the task set was created.
-
updatedAt
public final Instant updatedAt()
The Unix timestamp for the time when the task set was last updated.
- Returns:
- The Unix timestamp for the time when the task set was last updated.
-
launchType
public final LaunchType launchType()
The launch type the tasks in the task set are using. For more information, see Amazon ECS launch types in the Amazon Elastic Container Service Developer Guide.
If the service returns an enum value that is not available in the current SDK version,
launchType
will returnLaunchType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromlaunchTypeAsString()
.- Returns:
- The launch type the tasks in the task set are using. For more information, see Amazon ECS launch types in the Amazon Elastic Container Service Developer Guide.
- See Also:
LaunchType
-
launchTypeAsString
public final String launchTypeAsString()
The launch type the tasks in the task set are using. For more information, see Amazon ECS launch types in the Amazon Elastic Container Service Developer Guide.
If the service returns an enum value that is not available in the current SDK version,
launchType
will returnLaunchType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromlaunchTypeAsString()
.- Returns:
- The launch type the tasks in the task set are using. For more information, see Amazon ECS launch types in the Amazon Elastic Container Service Developer Guide.
- See Also:
LaunchType
-
hasCapacityProviderStrategy
public final boolean hasCapacityProviderStrategy()
For responses, this returns true if the service returned a value for the CapacityProviderStrategy property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
capacityProviderStrategy
public final List<CapacityProviderStrategyItem> capacityProviderStrategy()
The capacity provider strategy that are associated with the task set.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasCapacityProviderStrategy()
method.- Returns:
- The capacity provider strategy that are associated with the task set.
-
platformVersion
public final String platformVersion()
The Fargate platform version where the tasks in the task set are running. A platform version is only specified for tasks run on Fargate. For more information, see Fargate platform versions in the Amazon Elastic Container Service Developer Guide.
- Returns:
- The Fargate platform version where the tasks in the task set are running. A platform version is only specified for tasks run on Fargate. For more information, see Fargate platform versions in the Amazon Elastic Container Service Developer Guide.
-
platformFamily
public final String platformFamily()
The operating system that your tasks in the set are running on. A platform family is specified only for tasks that use the Fargate launch type.
All tasks in the set must have the same value.
- Returns:
- The operating system that your tasks in the set are running on. A platform family is specified only for
tasks that use the Fargate launch type.
All tasks in the set must have the same value.
-
networkConfiguration
public final NetworkConfiguration networkConfiguration()
The network configuration for the task set.
- Returns:
- The network configuration for the task set.
-
hasLoadBalancers
public final boolean hasLoadBalancers()
For responses, this returns true if the service returned a value for the LoadBalancers property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
loadBalancers
public final List<LoadBalancer> loadBalancers()
Details on a load balancer that are used with a task set.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasLoadBalancers()
method.- Returns:
- Details on a load balancer that are used with a task set.
-
hasServiceRegistries
public final boolean hasServiceRegistries()
For responses, this returns true if the service returned a value for the ServiceRegistries property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
serviceRegistries
public final List<ServiceRegistry> serviceRegistries()
The details for the service discovery registries to assign to this task set. For more information, see Service discovery.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasServiceRegistries()
method.- Returns:
- The details for the service discovery registries to assign to this task set. For more information, see Service discovery.
-
scale
public final Scale scale()
A floating-point percentage of your desired number of tasks to place and keep running in the task set.
- Returns:
- A floating-point percentage of your desired number of tasks to place and keep running in the task set.
-
stabilityStatus
public final StabilityStatus stabilityStatus()
The stability status. This indicates whether the task set has reached a steady state. If the following conditions are met, the task set are in
STEADY_STATE
:-
The task
runningCount
is equal to thecomputedDesiredCount
. -
The
pendingCount
is0
. -
There are no tasks that are running on container instances in the
DRAINING
status. -
All tasks are reporting a healthy status from the load balancers, service discovery, and container health checks.
If any of those conditions aren't met, the stability status returns
STABILIZING
.If the service returns an enum value that is not available in the current SDK version,
stabilityStatus
will returnStabilityStatus.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromstabilityStatusAsString()
.- Returns:
- The stability status. This indicates whether the task set has reached a steady state. If the following
conditions are met, the task set are in
STEADY_STATE
:-
The task
runningCount
is equal to thecomputedDesiredCount
. -
The
pendingCount
is0
. -
There are no tasks that are running on container instances in the
DRAINING
status. -
All tasks are reporting a healthy status from the load balancers, service discovery, and container health checks.
If any of those conditions aren't met, the stability status returns
STABILIZING
. -
- See Also:
StabilityStatus
-
-
stabilityStatusAsString
public final String stabilityStatusAsString()
The stability status. This indicates whether the task set has reached a steady state. If the following conditions are met, the task set are in
STEADY_STATE
:-
The task
runningCount
is equal to thecomputedDesiredCount
. -
The
pendingCount
is0
. -
There are no tasks that are running on container instances in the
DRAINING
status. -
All tasks are reporting a healthy status from the load balancers, service discovery, and container health checks.
If any of those conditions aren't met, the stability status returns
STABILIZING
.If the service returns an enum value that is not available in the current SDK version,
stabilityStatus
will returnStabilityStatus.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromstabilityStatusAsString()
.- Returns:
- The stability status. This indicates whether the task set has reached a steady state. If the following
conditions are met, the task set are in
STEADY_STATE
:-
The task
runningCount
is equal to thecomputedDesiredCount
. -
The
pendingCount
is0
. -
There are no tasks that are running on container instances in the
DRAINING
status. -
All tasks are reporting a healthy status from the load balancers, service discovery, and container health checks.
If any of those conditions aren't met, the stability status returns
STABILIZING
. -
- See Also:
StabilityStatus
-
-
stabilityStatusAt
public final Instant stabilityStatusAt()
The Unix timestamp for the time when the task set stability status was retrieved.
- Returns:
- The Unix timestamp for the time when the task set stability status was retrieved.
-
hasTags
public final boolean hasTags()
For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
tags
public final List<Tag> tags()
The metadata that you apply to the task set to help you categorize and organize them. Each tag consists of a key and an optional value. You define both.
The following basic restrictions apply to tags:
-
Maximum number of tags per resource - 50
-
For each resource, each tag key must be unique, and each tag key can have only one value.
-
Maximum key length - 128 Unicode characters in UTF-8
-
Maximum value length - 256 Unicode characters in UTF-8
-
If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
-
Tag keys and values are case-sensitive.
-
Do not use
aws:
,AWS:
, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTags()
method.- Returns:
- The metadata that you apply to the task set to help you categorize and organize them. Each tag consists
of a key and an optional value. You define both.
The following basic restrictions apply to tags:
-
Maximum number of tags per resource - 50
-
For each resource, each tag key must be unique, and each tag key can have only one value.
-
Maximum key length - 128 Unicode characters in UTF-8
-
Maximum value length - 256 Unicode characters in UTF-8
-
If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
-
Tag keys and values are case-sensitive.
-
Do not use
aws:
,AWS:
, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.
-
-
-
fargateEphemeralStorage
public final DeploymentEphemeralStorage fargateEphemeralStorage()
The Fargate ephemeral storage settings for the task set.
- Returns:
- The Fargate ephemeral storage settings for the task set.
-
toBuilder
public TaskSet.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<TaskSet.Builder,TaskSet>
-
builder
public static TaskSet.Builder builder()
-
serializableBuilderClass
public static Class<? extends TaskSet.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFields
in interfaceSdkPojo
-
toString
public final String toString()
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.
-
-