Class TaskSet
- All Implemented Interfaces:
Serializable
,SdkPojo
,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:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TaskSet.Builder
builder()
final List
<CapacityProviderStrategyItem> The capacity provider strategy that are associated with the task set.final String
The Amazon Resource Name (ARN) of the cluster that the service that hosts the task set exists in.final Integer
The computed desired count for the task set.final Instant
The Unix timestamp for the time when the task set was created.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final String
The external ID associated with the task set.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final boolean
For responses, this returns true if the service returned a value for the CapacityProviderStrategy property.final int
hashCode()
final boolean
For responses, this returns true if the service returned a value for the LoadBalancers property.final boolean
For responses, this returns true if the service returned a value for the ServiceRegistries property.final boolean
hasTags()
For responses, this returns true if the service returned a value for the Tags property.final String
id()
The ID of the task set.final LaunchType
The launch type the tasks in the task set are using.final String
The launch type the tasks in the task set are using.final List
<LoadBalancer> Details on a load balancer that are used with a task set.final NetworkConfiguration
The network configuration for the task set.final Integer
The number of tasks in the task set that are in thePENDING
status during a deployment.final String
The operating system that your tasks in the set are running on.final String
The Fargate platform version where the tasks in the task set are running.final Integer
The number of tasks in the task set that are in theRUNNING
status during a deployment.final Scale
scale()
A floating-point percentage of your desired number of tasks to place and keep running in the task set.static Class
<? extends TaskSet.Builder> final String
The Amazon Resource Name (ARN) of the service the task set exists in.final List
<ServiceRegistry> The details for the service discovery registries to assign to this task set.final StabilityStatus
The stability status.final String
The stability status.final Instant
The Unix timestamp for the time when the task set stability status was retrieved.final String
The tag specified when a task set is started.final String
status()
The status of the task set.tags()
The metadata that you apply to the task set to help you categorize and organize them.final String
The task definition that the task set is using.final String
The Amazon Resource Name (ARN) of the task set.Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.final Instant
The Unix timestamp for the time when the task set was last updated.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
id
The ID of the task set.
- Returns:
- The ID of the task set.
-
taskSetArn
The Amazon Resource Name (ARN) of the task set.
- Returns:
- The Amazon Resource Name (ARN) of the task set.
-
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
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
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
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
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
The task definition that the task set is using.
- Returns:
- The task definition that the task set is using.
-
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
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
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
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
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
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:
-
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:
-
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
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
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
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
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
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
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
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
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:
-
-
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:
-
-
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
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.
-
-
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<TaskSet.Builder,
TaskSet> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
Description copied from interface:SdkPojo
Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
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. -
getValueForField
-
sdkFields
-