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:
  • Method Details

    • 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 is CODE_DEPLOY. If an external deployment created the task set, the startedBy 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 is CODE_DEPLOY. If an external deployment created the task set, the startedBy 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 the ECS_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 the ECS_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's scale 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's scale 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 the PENDING state is preparing to enter the RUNNING state. A task set enters the PENDING status when it launches for the first time or when it's restarted after being in the STOPPED state.

      Returns:
      The number of tasks in the task set that are in the PENDING status during a deployment. A task in the PENDING state is preparing to enter the RUNNING state. A task set enters the PENDING status when it launches for the first time or when it's restarted after being in the STOPPED 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 the RUNNING 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 the RUNNING 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 return LaunchType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from launchTypeAsString().

      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

      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 return LaunchType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from launchTypeAsString().

      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 the isEmpty() 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 the isEmpty() 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 the isEmpty() 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 the computedDesiredCount.

      • The pendingCount is 0.

      • 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 return StabilityStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from stabilityStatusAsString().

      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 the computedDesiredCount.

      • The pendingCount is 0.

      • 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

      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 the computedDesiredCount.

      • The pendingCount is 0.

      • 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 return StabilityStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from stabilityStatusAsString().

      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 the computedDesiredCount.

      • The pendingCount is 0.

      • 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

      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 the isEmpty() 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.

    • toBuilder

      public TaskSet.Builder 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 interface ToCopyableBuilder<TaskSet.Builder,TaskSet>
      Returns:
      a builder for type T
    • builder

      public static TaskSet.Builder builder()
    • serializableBuilderClass

      public static Class<? extends TaskSet.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      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 an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • 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.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.