java.lang.Object
software.amazon.awssdk.services.batch.model.JobDetail
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<JobDetail.Builder,JobDetail>

@Generated("software.amazon.awssdk:codegen") public final class JobDetail extends Object implements SdkPojo, Serializable, ToCopyableBuilder<JobDetail.Builder,JobDetail>

An object that represents an Batch job.

See Also:
  • Method Details

    • jobArn

      public final String jobArn()

      The Amazon Resource Name (ARN) of the job.

      Returns:
      The Amazon Resource Name (ARN) of the job.
    • jobName

      public final String jobName()

      The job name.

      Returns:
      The job name.
    • jobId

      public final String jobId()

      The job ID.

      Returns:
      The job ID.
    • jobQueue

      public final String jobQueue()

      The Amazon Resource Name (ARN) of the job queue that the job is associated with.

      Returns:
      The Amazon Resource Name (ARN) of the job queue that the job is associated with.
    • status

      public final JobStatus status()

      The current status for the job.

      If your jobs don't progress to STARTING, see Jobs stuck in RUNNABLE status in the troubleshooting section of the Batch User Guide.

      If the service returns an enum value that is not available in the current SDK version, status will return JobStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

      Returns:
      The current status for the job.

      If your jobs don't progress to STARTING, see Jobs stuck in RUNNABLE status in the troubleshooting section of the Batch User Guide.

      See Also:
    • statusAsString

      public final String statusAsString()

      The current status for the job.

      If your jobs don't progress to STARTING, see Jobs stuck in RUNNABLE status in the troubleshooting section of the Batch User Guide.

      If the service returns an enum value that is not available in the current SDK version, status will return JobStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

      Returns:
      The current status for the job.

      If your jobs don't progress to STARTING, see Jobs stuck in RUNNABLE status in the troubleshooting section of the Batch User Guide.

      See Also:
    • shareIdentifier

      public final String shareIdentifier()

      The share identifier for the job.

      Returns:
      The share identifier for the job.
    • schedulingPriority

      public final Integer schedulingPriority()

      The scheduling policy of the job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.

      Returns:
      The scheduling policy of the job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
    • hasAttempts

      public final boolean hasAttempts()
      For responses, this returns true if the service returned a value for the Attempts 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.
    • attempts

      public final List<AttemptDetail> attempts()

      A list of job attempts that are associated with this job.

      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 hasAttempts() method.

      Returns:
      A list of job attempts that are associated with this job.
    • statusReason

      public final String statusReason()

      A short, human-readable string to provide more details for the current status of the job.

      • CAPACITY:INSUFFICIENT_INSTANCE_CAPACITY - All compute environments have insufficient capacity to service the job.

      • MISCONFIGURATION:COMPUTE_ENVIRONMENT_MAX_RESOURCE - All compute environments have a maxVcpu setting that is smaller than the job requirements.

      • MISCONFIGURATION:JOB_RESOURCE_REQUIREMENT - All compute environments have no connected instances that meet the job requirements.

      • MISCONFIGURATION:SERVICE_ROLE_PERMISSIONS - All compute environments have problems with the service role permissions.

      Returns:
      A short, human-readable string to provide more details for the current status of the job.

      • CAPACITY:INSUFFICIENT_INSTANCE_CAPACITY - All compute environments have insufficient capacity to service the job.

      • MISCONFIGURATION:COMPUTE_ENVIRONMENT_MAX_RESOURCE - All compute environments have a maxVcpu setting that is smaller than the job requirements.

      • MISCONFIGURATION:JOB_RESOURCE_REQUIREMENT - All compute environments have no connected instances that meet the job requirements.

      • MISCONFIGURATION:SERVICE_ROLE_PERMISSIONS - All compute environments have problems with the service role permissions.

    • createdAt

      public final Long createdAt()

      The Unix timestamp (in milliseconds) for when the job was created. For non-array jobs and parent array jobs, this is when the job entered the SUBMITTED state. This is specifically at the time SubmitJob was called. For array child jobs, this is when the child job was spawned by its parent and entered the PENDING state.

      Returns:
      The Unix timestamp (in milliseconds) for when the job was created. For non-array jobs and parent array jobs, this is when the job entered the SUBMITTED state. This is specifically at the time SubmitJob was called. For array child jobs, this is when the child job was spawned by its parent and entered the PENDING state.
    • retryStrategy

      public final RetryStrategy retryStrategy()

      The retry strategy to use for this job if an attempt fails.

      Returns:
      The retry strategy to use for this job if an attempt fails.
    • startedAt

      public final Long startedAt()

      The Unix timestamp (in milliseconds) for when the job was started. More specifically, it's when the job transitioned from the STARTING state to the RUNNING state.

      Returns:
      The Unix timestamp (in milliseconds) for when the job was started. More specifically, it's when the job transitioned from the STARTING state to the RUNNING state.
    • stoppedAt

      public final Long stoppedAt()

      The Unix timestamp (in milliseconds) for when the job was stopped. More specifically, it's when the job transitioned from the RUNNING state to a terminal state, such as SUCCEEDED or FAILED.

      Returns:
      The Unix timestamp (in milliseconds) for when the job was stopped. More specifically, it's when the job transitioned from the RUNNING state to a terminal state, such as SUCCEEDED or FAILED.
    • hasDependsOn

      public final boolean hasDependsOn()
      For responses, this returns true if the service returned a value for the DependsOn 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.
    • dependsOn

      public final List<JobDependency> dependsOn()

      A list of job IDs that this job depends on.

      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 hasDependsOn() method.

      Returns:
      A list of job IDs that this job depends on.
    • jobDefinition

      public final String jobDefinition()

      The Amazon Resource Name (ARN) of the job definition that this job uses.

      Returns:
      The Amazon Resource Name (ARN) of the job definition that this job uses.
    • hasParameters

      public final boolean hasParameters()
      For responses, this returns true if the service returned a value for the Parameters 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.
    • parameters

      public final Map<String,String> parameters()

      Additional parameters that are passed to the job that replace parameter substitution placeholders or override any corresponding parameter defaults from the job definition.

      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 hasParameters() method.

      Returns:
      Additional parameters that are passed to the job that replace parameter substitution placeholders or override any corresponding parameter defaults from the job definition.
    • container

      public final ContainerDetail container()

      An object that represents the details for the container that's associated with the job. If the details are for a multiple-container job, this object will be empty.

      Returns:
      An object that represents the details for the container that's associated with the job. If the details are for a multiple-container job, this object will be empty.
    • nodeDetails

      public final NodeDetails nodeDetails()

      An object that represents the details of a node that's associated with a multi-node parallel job.

      Returns:
      An object that represents the details of a node that's associated with a multi-node parallel job.
    • nodeProperties

      public final NodeProperties nodeProperties()

      An object that represents the node properties of a multi-node parallel job.

      This isn't applicable to jobs that are running on Fargate resources.

      Returns:
      An object that represents the node properties of a multi-node parallel job.

      This isn't applicable to jobs that are running on Fargate resources.

    • arrayProperties

      public final ArrayPropertiesDetail arrayProperties()

      The array properties of the job, if it's an array job.

      Returns:
      The array properties of the job, if it's an array job.
    • timeout

      public final JobTimeout timeout()

      The timeout configuration for the job.

      Returns:
      The timeout configuration for the job.
    • 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 Map<String,String> tags()

      The tags that are applied to the job.

      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 tags that are applied to the job.
    • propagateTags

      public final Boolean propagateTags()

      Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks when the tasks are created. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the FAILED state.

      Returns:
      Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks when the tasks are created. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the FAILED state.
    • platformCapabilities

      public final List<PlatformCapability> platformCapabilities()

      The platform capabilities required by the job definition. If no value is specified, it defaults to EC2. Jobs run on Fargate resources specify FARGATE.

      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 hasPlatformCapabilities() method.

      Returns:
      The platform capabilities required by the job definition. If no value is specified, it defaults to EC2. Jobs run on Fargate resources specify FARGATE.
    • hasPlatformCapabilities

      public final boolean hasPlatformCapabilities()
      For responses, this returns true if the service returned a value for the PlatformCapabilities 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.
    • platformCapabilitiesAsStrings

      public final List<String> platformCapabilitiesAsStrings()

      The platform capabilities required by the job definition. If no value is specified, it defaults to EC2. Jobs run on Fargate resources specify FARGATE.

      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 hasPlatformCapabilities() method.

      Returns:
      The platform capabilities required by the job definition. If no value is specified, it defaults to EC2. Jobs run on Fargate resources specify FARGATE.
    • eksProperties

      public final EksPropertiesDetail eksProperties()

      An object with various properties that are specific to Amazon EKS based jobs.

      Returns:
      An object with various properties that are specific to Amazon EKS based jobs.
    • hasEksAttempts

      public final boolean hasEksAttempts()
      For responses, this returns true if the service returned a value for the EksAttempts 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.
    • eksAttempts

      public final List<EksAttemptDetail> eksAttempts()

      A list of job attempts that are associated with this job.

      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 hasEksAttempts() method.

      Returns:
      A list of job attempts that are associated with this job.
    • ecsProperties

      public final EcsPropertiesDetail ecsProperties()

      An object with properties that are specific to Amazon ECS-based jobs.

      Returns:
      An object with properties that are specific to Amazon ECS-based jobs.
    • isCancelled

      public final Boolean isCancelled()

      Indicates whether the job is canceled.

      Returns:
      Indicates whether the job is canceled.
    • isTerminated

      public final Boolean isTerminated()

      Indicates whether the job is terminated.

      Returns:
      Indicates whether the job is terminated.
    • toBuilder

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

      public static JobDetail.Builder builder()
    • serializableBuilderClass

      public static Class<? extends JobDetail.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.