com.amazonaws.services.batch.model.RegisterJobDefinitionRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-batch Show documentation
/*
* Copyright 2019-2024 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 com.amazonaws.services.batch.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* Contains the parameters for RegisterJobDefinition
.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RegisterJobDefinitionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and
* lowercase letters, numbers, hyphens (-), and underscores (_).
*
*/
private String jobDefinitionName;
/**
*
* The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node parallel
* job definition in the Batch User Guide.
*
*
* -
*
* If the value is container
, then one of the following is required: containerProperties
,
* ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
*
*/
private String type;
/**
*
* Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value
* pair mapping. Parameters in a SubmitJob
request override any corresponding parameter defaults from
* the job definition.
*
*/
private java.util.Map parameters;
/**
*
* The scheduling priority for jobs that are submitted with this 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.
*
*
* The minimum supported value is 0 and the maximum supported value is 9999.
*
*/
private Integer schedulingPriority;
/**
*
* An object with properties specific to Amazon ECS-based single-node container-based jobs. If the job definition's
* type
parameter is container
, then you must specify either
* containerProperties
or nodeProperties
. This must not be specified for Amazon EKS-based
* job definitions.
*
*
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use only
* containerProperties
.
*
*
*/
private ContainerProperties containerProperties;
/**
*
* An object with properties specific to multi-node parallel jobs. If you specify node properties for a job, it
* becomes a multi-node parallel job. For more information, see Multi-node Parallel
* Jobs in the Batch User Guide.
*
*
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use
* containerProperties
instead.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify nodeProperties
.
*
*
*/
private NodeProperties nodeProperties;
/**
*
* The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's
* specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated
* due to a timeout, it isn't retried.
*
*/
private RetryStrategy retryStrategy;
/**
*
* 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 are not propagated. Tags can only be propagated to the tasks during task
* creation. 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.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify propagateTags
.
*
*
*/
private Boolean propagateTags;
/**
*
* The timeout configuration for jobs that are submitted with this job definition, after which Batch terminates your
* jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for
* the timeout is 60 seconds. Any timeout configuration that's specified during a SubmitJob operation
* overrides the timeout configuration defined here. For more information, see Job Timeouts in the Batch User
* Guide.
*
*/
private JobTimeout timeout;
/**
*
* The tags that you apply to the job definition to help you categorize and organize your resources. Each tag
* consists of a key and an optional value. For more information, see Tagging Amazon Web Services
* Resources in Batch User Guide.
*
*/
private java.util.Map tags;
/**
*
* The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
*
*/
private java.util.List platformCapabilities;
/**
*
* An object with properties that are specific to Amazon EKS-based jobs. This must not be specified for Amazon ECS
* based job definitions.
*
*/
private EksProperties eksProperties;
/**
*
* An object with properties that are specific to Amazon ECS-based jobs. This must not be specified for Amazon
* EKS-based job definitions.
*
*/
private EcsProperties ecsProperties;
/**
*
* The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and
* lowercase letters, numbers, hyphens (-), and underscores (_).
*
*
* @param jobDefinitionName
* The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and
* lowercase letters, numbers, hyphens (-), and underscores (_).
*/
public void setJobDefinitionName(String jobDefinitionName) {
this.jobDefinitionName = jobDefinitionName;
}
/**
*
* The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and
* lowercase letters, numbers, hyphens (-), and underscores (_).
*
*
* @return The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase
* and lowercase letters, numbers, hyphens (-), and underscores (_).
*/
public String getJobDefinitionName() {
return this.jobDefinitionName;
}
/**
*
* The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and
* lowercase letters, numbers, hyphens (-), and underscores (_).
*
*
* @param jobDefinitionName
* The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and
* lowercase letters, numbers, hyphens (-), and underscores (_).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withJobDefinitionName(String jobDefinitionName) {
setJobDefinitionName(jobDefinitionName);
return this;
}
/**
*
* The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node parallel
* job definition in the Batch User Guide.
*
*
* -
*
* If the value is container
, then one of the following is required: containerProperties
,
* ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
*
*
* @param type
* The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node
* parallel job definition in the Batch User Guide.
*
* -
*
* If the value is container
, then one of the following is required:
* containerProperties
, ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
* @see JobDefinitionType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node parallel
* job definition in the Batch User Guide.
*
*
* -
*
* If the value is container
, then one of the following is required: containerProperties
,
* ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
*
*
* @return The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node
* parallel job definition in the Batch User Guide.
*
* -
*
* If the value is container
, then one of the following is required:
* containerProperties
, ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
* @see JobDefinitionType
*/
public String getType() {
return this.type;
}
/**
*
* The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node parallel
* job definition in the Batch User Guide.
*
*
* -
*
* If the value is container
, then one of the following is required: containerProperties
,
* ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
*
*
* @param type
* The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node
* parallel job definition in the Batch User Guide.
*
* -
*
* If the value is container
, then one of the following is required:
* containerProperties
, ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see JobDefinitionType
*/
public RegisterJobDefinitionRequest withType(String type) {
setType(type);
return this;
}
/**
*
* The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node parallel
* job definition in the Batch User Guide.
*
*
* -
*
* If the value is container
, then one of the following is required: containerProperties
,
* ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
*
*
* @param type
* The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node
* parallel job definition in the Batch User Guide.
*
* -
*
* If the value is container
, then one of the following is required:
* containerProperties
, ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
* @see JobDefinitionType
*/
public void setType(JobDefinitionType type) {
withType(type);
}
/**
*
* The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node parallel
* job definition in the Batch User Guide.
*
*
* -
*
* If the value is container
, then one of the following is required: containerProperties
,
* ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
*
*
* @param type
* The type of job definition. For more information about multi-node parallel jobs, see Creating a multi-node
* parallel job definition in the Batch User Guide.
*
* -
*
* If the value is container
, then one of the following is required:
* containerProperties
, ecsProperties
, or eksProperties
.
*
*
* -
*
* If the value is multinode
, then nodeProperties
is required.
*
*
*
*
*
* If the job is run on Fargate resources, then multinode
isn't supported.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see JobDefinitionType
*/
public RegisterJobDefinitionRequest withType(JobDefinitionType type) {
this.type = type.toString();
return this;
}
/**
*
* Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value
* pair mapping. Parameters in a SubmitJob
request override any corresponding parameter defaults from
* the job definition.
*
*
* @return Default parameter substitution placeholders to set in the job definition. Parameters are specified as a
* key-value pair mapping. Parameters in a SubmitJob
request override any corresponding
* parameter defaults from the job definition.
*/
public java.util.Map getParameters() {
return parameters;
}
/**
*
* Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value
* pair mapping. Parameters in a SubmitJob
request override any corresponding parameter defaults from
* the job definition.
*
*
* @param parameters
* Default parameter substitution placeholders to set in the job definition. Parameters are specified as a
* key-value pair mapping. Parameters in a SubmitJob
request override any corresponding
* parameter defaults from the job definition.
*/
public void setParameters(java.util.Map parameters) {
this.parameters = parameters;
}
/**
*
* Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value
* pair mapping. Parameters in a SubmitJob
request override any corresponding parameter defaults from
* the job definition.
*
*
* @param parameters
* Default parameter substitution placeholders to set in the job definition. Parameters are specified as a
* key-value pair mapping. Parameters in a SubmitJob
request override any corresponding
* parameter defaults from the job definition.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withParameters(java.util.Map parameters) {
setParameters(parameters);
return this;
}
/**
* Add a single Parameters entry
*
* @see RegisterJobDefinitionRequest#withParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest addParametersEntry(String key, String value) {
if (null == this.parameters) {
this.parameters = new java.util.HashMap();
}
if (this.parameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.parameters.put(key, value);
return this;
}
/**
* Removes all the entries added into Parameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest clearParametersEntries() {
this.parameters = null;
return this;
}
/**
*
* The scheduling priority for jobs that are submitted with this 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.
*
*
* The minimum supported value is 0 and the maximum supported value is 9999.
*
*
* @param schedulingPriority
* The scheduling priority for jobs that are submitted with this 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.
*
* The minimum supported value is 0 and the maximum supported value is 9999.
*/
public void setSchedulingPriority(Integer schedulingPriority) {
this.schedulingPriority = schedulingPriority;
}
/**
*
* The scheduling priority for jobs that are submitted with this 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.
*
*
* The minimum supported value is 0 and the maximum supported value is 9999.
*
*
* @return The scheduling priority for jobs that are submitted with this 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.
*
* The minimum supported value is 0 and the maximum supported value is 9999.
*/
public Integer getSchedulingPriority() {
return this.schedulingPriority;
}
/**
*
* The scheduling priority for jobs that are submitted with this 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.
*
*
* The minimum supported value is 0 and the maximum supported value is 9999.
*
*
* @param schedulingPriority
* The scheduling priority for jobs that are submitted with this 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.
*
* The minimum supported value is 0 and the maximum supported value is 9999.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withSchedulingPriority(Integer schedulingPriority) {
setSchedulingPriority(schedulingPriority);
return this;
}
/**
*
* An object with properties specific to Amazon ECS-based single-node container-based jobs. If the job definition's
* type
parameter is container
, then you must specify either
* containerProperties
or nodeProperties
. This must not be specified for Amazon EKS-based
* job definitions.
*
*
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use only
* containerProperties
.
*
*
*
* @param containerProperties
* An object with properties specific to Amazon ECS-based single-node container-based jobs. If the job
* definition's type
parameter is container
, then you must specify either
* containerProperties
or nodeProperties
. This must not be specified for Amazon
* EKS-based job definitions.
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use only
* containerProperties
.
*
*/
public void setContainerProperties(ContainerProperties containerProperties) {
this.containerProperties = containerProperties;
}
/**
*
* An object with properties specific to Amazon ECS-based single-node container-based jobs. If the job definition's
* type
parameter is container
, then you must specify either
* containerProperties
or nodeProperties
. This must not be specified for Amazon EKS-based
* job definitions.
*
*
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use only
* containerProperties
.
*
*
*
* @return An object with properties specific to Amazon ECS-based single-node container-based jobs. If the job
* definition's type
parameter is container
, then you must specify either
* containerProperties
or nodeProperties
. This must not be specified for Amazon
* EKS-based job definitions.
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use only
* containerProperties
.
*
*/
public ContainerProperties getContainerProperties() {
return this.containerProperties;
}
/**
*
* An object with properties specific to Amazon ECS-based single-node container-based jobs. If the job definition's
* type
parameter is container
, then you must specify either
* containerProperties
or nodeProperties
. This must not be specified for Amazon EKS-based
* job definitions.
*
*
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use only
* containerProperties
.
*
*
*
* @param containerProperties
* An object with properties specific to Amazon ECS-based single-node container-based jobs. If the job
* definition's type
parameter is container
, then you must specify either
* containerProperties
or nodeProperties
. This must not be specified for Amazon
* EKS-based job definitions.
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use only
* containerProperties
.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withContainerProperties(ContainerProperties containerProperties) {
setContainerProperties(containerProperties);
return this;
}
/**
*
* An object with properties specific to multi-node parallel jobs. If you specify node properties for a job, it
* becomes a multi-node parallel job. For more information, see Multi-node Parallel
* Jobs in the Batch User Guide.
*
*
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use
* containerProperties
instead.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify nodeProperties
.
*
*
*
* @param nodeProperties
* An object with properties specific to multi-node parallel jobs. If you specify node properties for a job,
* it becomes a multi-node parallel job. For more information, see Multi-node
* Parallel Jobs in the Batch User Guide.
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use
* containerProperties
instead.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify nodeProperties
.
*
*/
public void setNodeProperties(NodeProperties nodeProperties) {
this.nodeProperties = nodeProperties;
}
/**
*
* An object with properties specific to multi-node parallel jobs. If you specify node properties for a job, it
* becomes a multi-node parallel job. For more information, see Multi-node Parallel
* Jobs in the Batch User Guide.
*
*
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use
* containerProperties
instead.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify nodeProperties
.
*
*
*
* @return An object with properties specific to multi-node parallel jobs. If you specify node properties for a job,
* it becomes a multi-node parallel job. For more information, see Multi-node
* Parallel Jobs in the Batch User Guide.
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use
* containerProperties
instead.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify nodeProperties
.
*
*/
public NodeProperties getNodeProperties() {
return this.nodeProperties;
}
/**
*
* An object with properties specific to multi-node parallel jobs. If you specify node properties for a job, it
* becomes a multi-node parallel job. For more information, see Multi-node Parallel
* Jobs in the Batch User Guide.
*
*
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use
* containerProperties
instead.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify nodeProperties
.
*
*
*
* @param nodeProperties
* An object with properties specific to multi-node parallel jobs. If you specify node properties for a job,
* it becomes a multi-node parallel job. For more information, see Multi-node
* Parallel Jobs in the Batch User Guide.
*
* If the job runs on Fargate resources, then you must not specify nodeProperties
; use
* containerProperties
instead.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify nodeProperties
.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withNodeProperties(NodeProperties nodeProperties) {
setNodeProperties(nodeProperties);
return this;
}
/**
*
* The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's
* specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated
* due to a timeout, it isn't retried.
*
*
* @param retryStrategy
* The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy
* that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job
* is terminated due to a timeout, it isn't retried.
*/
public void setRetryStrategy(RetryStrategy retryStrategy) {
this.retryStrategy = retryStrategy;
}
/**
*
* The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's
* specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated
* due to a timeout, it isn't retried.
*
*
* @return The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy
* that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job
* is terminated due to a timeout, it isn't retried.
*/
public RetryStrategy getRetryStrategy() {
return this.retryStrategy;
}
/**
*
* The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's
* specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated
* due to a timeout, it isn't retried.
*
*
* @param retryStrategy
* The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy
* that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job
* is terminated due to a timeout, it isn't retried.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withRetryStrategy(RetryStrategy retryStrategy) {
setRetryStrategy(retryStrategy);
return this;
}
/**
*
* 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 are not propagated. Tags can only be propagated to the tasks during task
* creation. 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.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify propagateTags
.
*
*
*
* @param 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 are not propagated. Tags can only be propagated to the tasks
* during task creation. 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.
*
* If the job runs on Amazon EKS resources, then you must not specify propagateTags
.
*
*/
public void setPropagateTags(Boolean propagateTags) {
this.propagateTags = 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 are not propagated. Tags can only be propagated to the tasks during task
* creation. 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.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify propagateTags
.
*
*
*
* @return 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 are not propagated. Tags can only be propagated to the tasks
* during task creation. 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.
*
* If the job runs on Amazon EKS resources, then you must not specify propagateTags
.
*
*/
public Boolean getPropagateTags() {
return this.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 are not propagated. Tags can only be propagated to the tasks during task
* creation. 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.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify propagateTags
.
*
*
*
* @param 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 are not propagated. Tags can only be propagated to the tasks
* during task creation. 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.
*
* If the job runs on Amazon EKS resources, then you must not specify propagateTags
.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withPropagateTags(Boolean propagateTags) {
setPropagateTags(propagateTags);
return this;
}
/**
*
* 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 are not propagated. Tags can only be propagated to the tasks during task
* creation. 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.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify propagateTags
.
*
*
*
* @return 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 are not propagated. Tags can only be propagated to the tasks
* during task creation. 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.
*
* If the job runs on Amazon EKS resources, then you must not specify propagateTags
.
*
*/
public Boolean isPropagateTags() {
return this.propagateTags;
}
/**
*
* The timeout configuration for jobs that are submitted with this job definition, after which Batch terminates your
* jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for
* the timeout is 60 seconds. Any timeout configuration that's specified during a SubmitJob operation
* overrides the timeout configuration defined here. For more information, see Job Timeouts in the Batch User
* Guide.
*
*
* @param timeout
* The timeout configuration for jobs that are submitted with this job definition, after which Batch
* terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried.
* The minimum value for the timeout is 60 seconds. Any timeout configuration that's specified during a
* SubmitJob operation overrides the timeout configuration defined here. For more information, see Job Timeouts in the
* Batch User Guide.
*/
public void setTimeout(JobTimeout timeout) {
this.timeout = timeout;
}
/**
*
* The timeout configuration for jobs that are submitted with this job definition, after which Batch terminates your
* jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for
* the timeout is 60 seconds. Any timeout configuration that's specified during a SubmitJob operation
* overrides the timeout configuration defined here. For more information, see Job Timeouts in the Batch User
* Guide.
*
*
* @return The timeout configuration for jobs that are submitted with this job definition, after which Batch
* terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't
* retried. The minimum value for the timeout is 60 seconds. Any timeout configuration that's specified
* during a SubmitJob operation overrides the timeout configuration defined here. For more
* information, see Job
* Timeouts in the Batch User Guide.
*/
public JobTimeout getTimeout() {
return this.timeout;
}
/**
*
* The timeout configuration for jobs that are submitted with this job definition, after which Batch terminates your
* jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for
* the timeout is 60 seconds. Any timeout configuration that's specified during a SubmitJob operation
* overrides the timeout configuration defined here. For more information, see Job Timeouts in the Batch User
* Guide.
*
*
* @param timeout
* The timeout configuration for jobs that are submitted with this job definition, after which Batch
* terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried.
* The minimum value for the timeout is 60 seconds. Any timeout configuration that's specified during a
* SubmitJob operation overrides the timeout configuration defined here. For more information, see Job Timeouts in the
* Batch User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withTimeout(JobTimeout timeout) {
setTimeout(timeout);
return this;
}
/**
*
* The tags that you apply to the job definition to help you categorize and organize your resources. Each tag
* consists of a key and an optional value. For more information, see Tagging Amazon Web Services
* Resources in Batch User Guide.
*
*
* @return The tags that you apply to the job definition to help you categorize and organize your resources. Each
* tag consists of a key and an optional value. For more information, see Tagging Amazon Web Services
* Resources in Batch User Guide.
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* The tags that you apply to the job definition to help you categorize and organize your resources. Each tag
* consists of a key and an optional value. For more information, see Tagging Amazon Web Services
* Resources in Batch User Guide.
*
*
* @param tags
* The tags that you apply to the job definition to help you categorize and organize your resources. Each tag
* consists of a key and an optional value. For more information, see Tagging Amazon Web Services
* Resources in Batch User Guide.
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* The tags that you apply to the job definition to help you categorize and organize your resources. Each tag
* consists of a key and an optional value. For more information, see Tagging Amazon Web Services
* Resources in Batch User Guide.
*
*
* @param tags
* The tags that you apply to the job definition to help you categorize and organize your resources. Each tag
* consists of a key and an optional value. For more information, see Tagging Amazon Web Services
* Resources in Batch User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see RegisterJobDefinitionRequest#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest clearTagsEntries() {
this.tags = null;
return this;
}
/**
*
* The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
*
*
* @return The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
* @see PlatformCapability
*/
public java.util.List getPlatformCapabilities() {
return platformCapabilities;
}
/**
*
* The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
*
*
* @param platformCapabilities
* The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
* @see PlatformCapability
*/
public void setPlatformCapabilities(java.util.Collection platformCapabilities) {
if (platformCapabilities == null) {
this.platformCapabilities = null;
return;
}
this.platformCapabilities = new java.util.ArrayList(platformCapabilities);
}
/**
*
* The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPlatformCapabilities(java.util.Collection)} or {@link #withPlatformCapabilities(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param platformCapabilities
* The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see PlatformCapability
*/
public RegisterJobDefinitionRequest withPlatformCapabilities(String... platformCapabilities) {
if (this.platformCapabilities == null) {
setPlatformCapabilities(new java.util.ArrayList(platformCapabilities.length));
}
for (String ele : platformCapabilities) {
this.platformCapabilities.add(ele);
}
return this;
}
/**
*
* The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
*
*
* @param platformCapabilities
* The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see PlatformCapability
*/
public RegisterJobDefinitionRequest withPlatformCapabilities(java.util.Collection platformCapabilities) {
setPlatformCapabilities(platformCapabilities);
return this;
}
/**
*
* The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
*
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
*
*
* @param platformCapabilities
* The platform capabilities required by the job definition. If no value is specified, it defaults to
* EC2
. To run the job on Fargate resources, specify FARGATE
.
*
* If the job runs on Amazon EKS resources, then you must not specify platformCapabilities
.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see PlatformCapability
*/
public RegisterJobDefinitionRequest withPlatformCapabilities(PlatformCapability... platformCapabilities) {
java.util.ArrayList platformCapabilitiesCopy = new java.util.ArrayList(platformCapabilities.length);
for (PlatformCapability value : platformCapabilities) {
platformCapabilitiesCopy.add(value.toString());
}
if (getPlatformCapabilities() == null) {
setPlatformCapabilities(platformCapabilitiesCopy);
} else {
getPlatformCapabilities().addAll(platformCapabilitiesCopy);
}
return this;
}
/**
*
* An object with properties that are specific to Amazon EKS-based jobs. This must not be specified for Amazon ECS
* based job definitions.
*
*
* @param eksProperties
* An object with properties that are specific to Amazon EKS-based jobs. This must not be specified for
* Amazon ECS based job definitions.
*/
public void setEksProperties(EksProperties eksProperties) {
this.eksProperties = eksProperties;
}
/**
*
* An object with properties that are specific to Amazon EKS-based jobs. This must not be specified for Amazon ECS
* based job definitions.
*
*
* @return An object with properties that are specific to Amazon EKS-based jobs. This must not be specified for
* Amazon ECS based job definitions.
*/
public EksProperties getEksProperties() {
return this.eksProperties;
}
/**
*
* An object with properties that are specific to Amazon EKS-based jobs. This must not be specified for Amazon ECS
* based job definitions.
*
*
* @param eksProperties
* An object with properties that are specific to Amazon EKS-based jobs. This must not be specified for
* Amazon ECS based job definitions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withEksProperties(EksProperties eksProperties) {
setEksProperties(eksProperties);
return this;
}
/**
*
* An object with properties that are specific to Amazon ECS-based jobs. This must not be specified for Amazon
* EKS-based job definitions.
*
*
* @param ecsProperties
* An object with properties that are specific to Amazon ECS-based jobs. This must not be specified for
* Amazon EKS-based job definitions.
*/
public void setEcsProperties(EcsProperties ecsProperties) {
this.ecsProperties = ecsProperties;
}
/**
*
* An object with properties that are specific to Amazon ECS-based jobs. This must not be specified for Amazon
* EKS-based job definitions.
*
*
* @return An object with properties that are specific to Amazon ECS-based jobs. This must not be specified for
* Amazon EKS-based job definitions.
*/
public EcsProperties getEcsProperties() {
return this.ecsProperties;
}
/**
*
* An object with properties that are specific to Amazon ECS-based jobs. This must not be specified for Amazon
* EKS-based job definitions.
*
*
* @param ecsProperties
* An object with properties that are specific to Amazon ECS-based jobs. This must not be specified for
* Amazon EKS-based job definitions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegisterJobDefinitionRequest withEcsProperties(EcsProperties ecsProperties) {
setEcsProperties(ecsProperties);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getJobDefinitionName() != null)
sb.append("JobDefinitionName: ").append(getJobDefinitionName()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getParameters() != null)
sb.append("Parameters: ").append(getParameters()).append(",");
if (getSchedulingPriority() != null)
sb.append("SchedulingPriority: ").append(getSchedulingPriority()).append(",");
if (getContainerProperties() != null)
sb.append("ContainerProperties: ").append(getContainerProperties()).append(",");
if (getNodeProperties() != null)
sb.append("NodeProperties: ").append(getNodeProperties()).append(",");
if (getRetryStrategy() != null)
sb.append("RetryStrategy: ").append(getRetryStrategy()).append(",");
if (getPropagateTags() != null)
sb.append("PropagateTags: ").append(getPropagateTags()).append(",");
if (getTimeout() != null)
sb.append("Timeout: ").append(getTimeout()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getPlatformCapabilities() != null)
sb.append("PlatformCapabilities: ").append(getPlatformCapabilities()).append(",");
if (getEksProperties() != null)
sb.append("EksProperties: ").append(getEksProperties()).append(",");
if (getEcsProperties() != null)
sb.append("EcsProperties: ").append(getEcsProperties());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RegisterJobDefinitionRequest == false)
return false;
RegisterJobDefinitionRequest other = (RegisterJobDefinitionRequest) obj;
if (other.getJobDefinitionName() == null ^ this.getJobDefinitionName() == null)
return false;
if (other.getJobDefinitionName() != null && other.getJobDefinitionName().equals(this.getJobDefinitionName()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getParameters() == null ^ this.getParameters() == null)
return false;
if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false)
return false;
if (other.getSchedulingPriority() == null ^ this.getSchedulingPriority() == null)
return false;
if (other.getSchedulingPriority() != null && other.getSchedulingPriority().equals(this.getSchedulingPriority()) == false)
return false;
if (other.getContainerProperties() == null ^ this.getContainerProperties() == null)
return false;
if (other.getContainerProperties() != null && other.getContainerProperties().equals(this.getContainerProperties()) == false)
return false;
if (other.getNodeProperties() == null ^ this.getNodeProperties() == null)
return false;
if (other.getNodeProperties() != null && other.getNodeProperties().equals(this.getNodeProperties()) == false)
return false;
if (other.getRetryStrategy() == null ^ this.getRetryStrategy() == null)
return false;
if (other.getRetryStrategy() != null && other.getRetryStrategy().equals(this.getRetryStrategy()) == false)
return false;
if (other.getPropagateTags() == null ^ this.getPropagateTags() == null)
return false;
if (other.getPropagateTags() != null && other.getPropagateTags().equals(this.getPropagateTags()) == false)
return false;
if (other.getTimeout() == null ^ this.getTimeout() == null)
return false;
if (other.getTimeout() != null && other.getTimeout().equals(this.getTimeout()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getPlatformCapabilities() == null ^ this.getPlatformCapabilities() == null)
return false;
if (other.getPlatformCapabilities() != null && other.getPlatformCapabilities().equals(this.getPlatformCapabilities()) == false)
return false;
if (other.getEksProperties() == null ^ this.getEksProperties() == null)
return false;
if (other.getEksProperties() != null && other.getEksProperties().equals(this.getEksProperties()) == false)
return false;
if (other.getEcsProperties() == null ^ this.getEcsProperties() == null)
return false;
if (other.getEcsProperties() != null && other.getEcsProperties().equals(this.getEcsProperties()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getJobDefinitionName() == null) ? 0 : getJobDefinitionName().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode());
hashCode = prime * hashCode + ((getSchedulingPriority() == null) ? 0 : getSchedulingPriority().hashCode());
hashCode = prime * hashCode + ((getContainerProperties() == null) ? 0 : getContainerProperties().hashCode());
hashCode = prime * hashCode + ((getNodeProperties() == null) ? 0 : getNodeProperties().hashCode());
hashCode = prime * hashCode + ((getRetryStrategy() == null) ? 0 : getRetryStrategy().hashCode());
hashCode = prime * hashCode + ((getPropagateTags() == null) ? 0 : getPropagateTags().hashCode());
hashCode = prime * hashCode + ((getTimeout() == null) ? 0 : getTimeout().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getPlatformCapabilities() == null) ? 0 : getPlatformCapabilities().hashCode());
hashCode = prime * hashCode + ((getEksProperties() == null) ? 0 : getEksProperties().hashCode());
hashCode = prime * hashCode + ((getEcsProperties() == null) ? 0 : getEcsProperties().hashCode());
return hashCode;
}
@Override
public RegisterJobDefinitionRequest clone() {
return (RegisterJobDefinitionRequest) super.clone();
}
}