aws_sdk_batch/operation/submit_job/_submit_job_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the parameters for <code>SubmitJob</code>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SubmitJobInput {
7 /// <p>The name of the job. It can be up to 128 letters long. The first character must be alphanumeric, can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
8 pub job_name: ::std::option::Option<::std::string::String>,
9 /// <p>The job queue where the job is submitted. You can specify either the name or the Amazon Resource Name (ARN) of the queue.</p>
10 pub job_queue: ::std::option::Option<::std::string::String>,
11 /// <p>The share identifier for the job. Don't specify this parameter if the job queue doesn't have a fair-share scheduling policy. If the job queue has a fair-share scheduling policy, then this parameter must be specified.</p>
12 /// <p>This string is limited to 255 alphanumeric characters, and can be followed by an asterisk (*).</p>
13 pub share_identifier: ::std::option::Option<::std::string::String>,
14 /// <p>The scheduling priority for the job. 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. This overrides any scheduling priority in the job definition and works only within a single share identifier.</p>
15 /// <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
16 pub scheduling_priority_override: ::std::option::Option<i32>,
17 /// <p>The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/array_jobs.html">Array Jobs</a> in the <i>Batch User Guide</i>.</p>
18 pub array_properties: ::std::option::Option<crate::types::ArrayProperties>,
19 /// <p>A list of dependencies for the job. A job can depend upon a maximum of 20 jobs. You can specify a <code>SEQUENTIAL</code> type dependency without specifying a job ID for array jobs so that each child array job completes sequentially, starting at index 0. You can also specify an <code>N_TO_N</code> type dependency with a job ID for array jobs. In that case, each index child of this job must wait for the corresponding index child of each dependency to complete before it can begin.</p>
20 pub depends_on: ::std::option::Option<::std::vec::Vec<crate::types::JobDependency>>,
21 /// <p>The job definition used by this job. This value can be one of <code>definition-name</code>, <code>definition-name:revision</code>, or the Amazon Resource Name (ARN) for the job definition, with or without the revision (<code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i>:<i>revision</i> </code>, or <code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i> </code>).</p>
22 /// <p>If the revision is not specified, then the latest active revision is used.</p>
23 pub job_definition: ::std::option::Option<::std::string::String>,
24 /// <p>Additional parameters passed to the job that replace parameter substitution placeholders that are set in the job definition. Parameters are specified as a key and value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p>
25 pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
26 /// <p>An object with properties that override the defaults for the job definition that specify the name of a container in the specified job definition and the overrides it should receive. You can override the default command for a container, which is specified in the job definition or the Docker image, with a <code>command</code> override. You can also override existing environment variables on a container or add new environment variables to it with an <code>environment</code> override.</p>
27 pub container_overrides: ::std::option::Option<crate::types::ContainerOverrides>,
28 /// <p>A list of node overrides in JSON format that specify the node range to target and the container overrides for that node range.</p><note>
29 /// <p>This parameter isn't applicable to jobs that are running on Fargate resources; use <code>containerOverrides</code> instead.</p>
30 /// </note>
31 pub node_overrides: ::std::option::Option<crate::types::NodeOverrides>,
32 /// <p>The retry strategy to use for failed jobs from this <code>SubmitJob</code> operation. When a retry strategy is specified here, it overrides the retry strategy defined in the job definition.</p>
33 pub retry_strategy: ::std::option::Option<crate::types::RetryStrategy>,
34 /// <p>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 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 <code>FAILED</code> state. When specified, this overrides the tag propagation setting in the job definition.</p>
35 pub propagate_tags: ::std::option::Option<bool>,
36 /// <p>The timeout configuration for this <code>SubmitJob</code> operation. You can specify a timeout duration after which Batch terminates your jobs if they haven't finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds. This configuration overrides any timeout configuration specified in the job definition. For array jobs, child jobs have the same timeout configuration as the parent job. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html">Job Timeouts</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
37 pub timeout: ::std::option::Option<crate::types::JobTimeout>,
38 /// <p>The tags that you apply to the job request to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in <i>Amazon Web Services General Reference</i>.</p>
39 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
40 /// <p>An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon EKS resources.</p>
41 pub eks_properties_override: ::std::option::Option<crate::types::EksPropertiesOverride>,
42 /// <p>An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon ECS resources.</p>
43 pub ecs_properties_override: ::std::option::Option<crate::types::EcsPropertiesOverride>,
44 /// <p>An object that contains overrides for the consumable resources of a job.</p>
45 pub consumable_resource_properties_override: ::std::option::Option<crate::types::ConsumableResourceProperties>,
46}
47impl SubmitJobInput {
48 /// <p>The name of the job. It can be up to 128 letters long. The first character must be alphanumeric, can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
49 pub fn job_name(&self) -> ::std::option::Option<&str> {
50 self.job_name.as_deref()
51 }
52 /// <p>The job queue where the job is submitted. You can specify either the name or the Amazon Resource Name (ARN) of the queue.</p>
53 pub fn job_queue(&self) -> ::std::option::Option<&str> {
54 self.job_queue.as_deref()
55 }
56 /// <p>The share identifier for the job. Don't specify this parameter if the job queue doesn't have a fair-share scheduling policy. If the job queue has a fair-share scheduling policy, then this parameter must be specified.</p>
57 /// <p>This string is limited to 255 alphanumeric characters, and can be followed by an asterisk (*).</p>
58 pub fn share_identifier(&self) -> ::std::option::Option<&str> {
59 self.share_identifier.as_deref()
60 }
61 /// <p>The scheduling priority for the job. 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. This overrides any scheduling priority in the job definition and works only within a single share identifier.</p>
62 /// <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
63 pub fn scheduling_priority_override(&self) -> ::std::option::Option<i32> {
64 self.scheduling_priority_override
65 }
66 /// <p>The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/array_jobs.html">Array Jobs</a> in the <i>Batch User Guide</i>.</p>
67 pub fn array_properties(&self) -> ::std::option::Option<&crate::types::ArrayProperties> {
68 self.array_properties.as_ref()
69 }
70 /// <p>A list of dependencies for the job. A job can depend upon a maximum of 20 jobs. You can specify a <code>SEQUENTIAL</code> type dependency without specifying a job ID for array jobs so that each child array job completes sequentially, starting at index 0. You can also specify an <code>N_TO_N</code> type dependency with a job ID for array jobs. In that case, each index child of this job must wait for the corresponding index child of each dependency to complete before it can begin.</p>
71 ///
72 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.depends_on.is_none()`.
73 pub fn depends_on(&self) -> &[crate::types::JobDependency] {
74 self.depends_on.as_deref().unwrap_or_default()
75 }
76 /// <p>The job definition used by this job. This value can be one of <code>definition-name</code>, <code>definition-name:revision</code>, or the Amazon Resource Name (ARN) for the job definition, with or without the revision (<code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i>:<i>revision</i> </code>, or <code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i> </code>).</p>
77 /// <p>If the revision is not specified, then the latest active revision is used.</p>
78 pub fn job_definition(&self) -> ::std::option::Option<&str> {
79 self.job_definition.as_deref()
80 }
81 /// <p>Additional parameters passed to the job that replace parameter substitution placeholders that are set in the job definition. Parameters are specified as a key and value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p>
82 pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
83 self.parameters.as_ref()
84 }
85 /// <p>An object with properties that override the defaults for the job definition that specify the name of a container in the specified job definition and the overrides it should receive. You can override the default command for a container, which is specified in the job definition or the Docker image, with a <code>command</code> override. You can also override existing environment variables on a container or add new environment variables to it with an <code>environment</code> override.</p>
86 pub fn container_overrides(&self) -> ::std::option::Option<&crate::types::ContainerOverrides> {
87 self.container_overrides.as_ref()
88 }
89 /// <p>A list of node overrides in JSON format that specify the node range to target and the container overrides for that node range.</p><note>
90 /// <p>This parameter isn't applicable to jobs that are running on Fargate resources; use <code>containerOverrides</code> instead.</p>
91 /// </note>
92 pub fn node_overrides(&self) -> ::std::option::Option<&crate::types::NodeOverrides> {
93 self.node_overrides.as_ref()
94 }
95 /// <p>The retry strategy to use for failed jobs from this <code>SubmitJob</code> operation. When a retry strategy is specified here, it overrides the retry strategy defined in the job definition.</p>
96 pub fn retry_strategy(&self) -> ::std::option::Option<&crate::types::RetryStrategy> {
97 self.retry_strategy.as_ref()
98 }
99 /// <p>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 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 <code>FAILED</code> state. When specified, this overrides the tag propagation setting in the job definition.</p>
100 pub fn propagate_tags(&self) -> ::std::option::Option<bool> {
101 self.propagate_tags
102 }
103 /// <p>The timeout configuration for this <code>SubmitJob</code> operation. You can specify a timeout duration after which Batch terminates your jobs if they haven't finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds. This configuration overrides any timeout configuration specified in the job definition. For array jobs, child jobs have the same timeout configuration as the parent job. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html">Job Timeouts</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
104 pub fn timeout(&self) -> ::std::option::Option<&crate::types::JobTimeout> {
105 self.timeout.as_ref()
106 }
107 /// <p>The tags that you apply to the job request to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in <i>Amazon Web Services General Reference</i>.</p>
108 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
109 self.tags.as_ref()
110 }
111 /// <p>An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon EKS resources.</p>
112 pub fn eks_properties_override(&self) -> ::std::option::Option<&crate::types::EksPropertiesOverride> {
113 self.eks_properties_override.as_ref()
114 }
115 /// <p>An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon ECS resources.</p>
116 pub fn ecs_properties_override(&self) -> ::std::option::Option<&crate::types::EcsPropertiesOverride> {
117 self.ecs_properties_override.as_ref()
118 }
119 /// <p>An object that contains overrides for the consumable resources of a job.</p>
120 pub fn consumable_resource_properties_override(&self) -> ::std::option::Option<&crate::types::ConsumableResourceProperties> {
121 self.consumable_resource_properties_override.as_ref()
122 }
123}
124impl SubmitJobInput {
125 /// Creates a new builder-style object to manufacture [`SubmitJobInput`](crate::operation::submit_job::SubmitJobInput).
126 pub fn builder() -> crate::operation::submit_job::builders::SubmitJobInputBuilder {
127 crate::operation::submit_job::builders::SubmitJobInputBuilder::default()
128 }
129}
130
131/// A builder for [`SubmitJobInput`](crate::operation::submit_job::SubmitJobInput).
132#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
133#[non_exhaustive]
134pub struct SubmitJobInputBuilder {
135 pub(crate) job_name: ::std::option::Option<::std::string::String>,
136 pub(crate) job_queue: ::std::option::Option<::std::string::String>,
137 pub(crate) share_identifier: ::std::option::Option<::std::string::String>,
138 pub(crate) scheduling_priority_override: ::std::option::Option<i32>,
139 pub(crate) array_properties: ::std::option::Option<crate::types::ArrayProperties>,
140 pub(crate) depends_on: ::std::option::Option<::std::vec::Vec<crate::types::JobDependency>>,
141 pub(crate) job_definition: ::std::option::Option<::std::string::String>,
142 pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
143 pub(crate) container_overrides: ::std::option::Option<crate::types::ContainerOverrides>,
144 pub(crate) node_overrides: ::std::option::Option<crate::types::NodeOverrides>,
145 pub(crate) retry_strategy: ::std::option::Option<crate::types::RetryStrategy>,
146 pub(crate) propagate_tags: ::std::option::Option<bool>,
147 pub(crate) timeout: ::std::option::Option<crate::types::JobTimeout>,
148 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
149 pub(crate) eks_properties_override: ::std::option::Option<crate::types::EksPropertiesOverride>,
150 pub(crate) ecs_properties_override: ::std::option::Option<crate::types::EcsPropertiesOverride>,
151 pub(crate) consumable_resource_properties_override: ::std::option::Option<crate::types::ConsumableResourceProperties>,
152}
153impl SubmitJobInputBuilder {
154 /// <p>The name of the job. It can be up to 128 letters long. The first character must be alphanumeric, can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
155 /// This field is required.
156 pub fn job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157 self.job_name = ::std::option::Option::Some(input.into());
158 self
159 }
160 /// <p>The name of the job. It can be up to 128 letters long. The first character must be alphanumeric, can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
161 pub fn set_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162 self.job_name = input;
163 self
164 }
165 /// <p>The name of the job. It can be up to 128 letters long. The first character must be alphanumeric, can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
166 pub fn get_job_name(&self) -> &::std::option::Option<::std::string::String> {
167 &self.job_name
168 }
169 /// <p>The job queue where the job is submitted. You can specify either the name or the Amazon Resource Name (ARN) of the queue.</p>
170 /// This field is required.
171 pub fn job_queue(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.job_queue = ::std::option::Option::Some(input.into());
173 self
174 }
175 /// <p>The job queue where the job is submitted. You can specify either the name or the Amazon Resource Name (ARN) of the queue.</p>
176 pub fn set_job_queue(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.job_queue = input;
178 self
179 }
180 /// <p>The job queue where the job is submitted. You can specify either the name or the Amazon Resource Name (ARN) of the queue.</p>
181 pub fn get_job_queue(&self) -> &::std::option::Option<::std::string::String> {
182 &self.job_queue
183 }
184 /// <p>The share identifier for the job. Don't specify this parameter if the job queue doesn't have a fair-share scheduling policy. If the job queue has a fair-share scheduling policy, then this parameter must be specified.</p>
185 /// <p>This string is limited to 255 alphanumeric characters, and can be followed by an asterisk (*).</p>
186 pub fn share_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187 self.share_identifier = ::std::option::Option::Some(input.into());
188 self
189 }
190 /// <p>The share identifier for the job. Don't specify this parameter if the job queue doesn't have a fair-share scheduling policy. If the job queue has a fair-share scheduling policy, then this parameter must be specified.</p>
191 /// <p>This string is limited to 255 alphanumeric characters, and can be followed by an asterisk (*).</p>
192 pub fn set_share_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193 self.share_identifier = input;
194 self
195 }
196 /// <p>The share identifier for the job. Don't specify this parameter if the job queue doesn't have a fair-share scheduling policy. If the job queue has a fair-share scheduling policy, then this parameter must be specified.</p>
197 /// <p>This string is limited to 255 alphanumeric characters, and can be followed by an asterisk (*).</p>
198 pub fn get_share_identifier(&self) -> &::std::option::Option<::std::string::String> {
199 &self.share_identifier
200 }
201 /// <p>The scheduling priority for the job. 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. This overrides any scheduling priority in the job definition and works only within a single share identifier.</p>
202 /// <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
203 pub fn scheduling_priority_override(mut self, input: i32) -> Self {
204 self.scheduling_priority_override = ::std::option::Option::Some(input);
205 self
206 }
207 /// <p>The scheduling priority for the job. 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. This overrides any scheduling priority in the job definition and works only within a single share identifier.</p>
208 /// <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
209 pub fn set_scheduling_priority_override(mut self, input: ::std::option::Option<i32>) -> Self {
210 self.scheduling_priority_override = input;
211 self
212 }
213 /// <p>The scheduling priority for the job. 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. This overrides any scheduling priority in the job definition and works only within a single share identifier.</p>
214 /// <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
215 pub fn get_scheduling_priority_override(&self) -> &::std::option::Option<i32> {
216 &self.scheduling_priority_override
217 }
218 /// <p>The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/array_jobs.html">Array Jobs</a> in the <i>Batch User Guide</i>.</p>
219 pub fn array_properties(mut self, input: crate::types::ArrayProperties) -> Self {
220 self.array_properties = ::std::option::Option::Some(input);
221 self
222 }
223 /// <p>The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/array_jobs.html">Array Jobs</a> in the <i>Batch User Guide</i>.</p>
224 pub fn set_array_properties(mut self, input: ::std::option::Option<crate::types::ArrayProperties>) -> Self {
225 self.array_properties = input;
226 self
227 }
228 /// <p>The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/array_jobs.html">Array Jobs</a> in the <i>Batch User Guide</i>.</p>
229 pub fn get_array_properties(&self) -> &::std::option::Option<crate::types::ArrayProperties> {
230 &self.array_properties
231 }
232 /// Appends an item to `depends_on`.
233 ///
234 /// To override the contents of this collection use [`set_depends_on`](Self::set_depends_on).
235 ///
236 /// <p>A list of dependencies for the job. A job can depend upon a maximum of 20 jobs. You can specify a <code>SEQUENTIAL</code> type dependency without specifying a job ID for array jobs so that each child array job completes sequentially, starting at index 0. You can also specify an <code>N_TO_N</code> type dependency with a job ID for array jobs. In that case, each index child of this job must wait for the corresponding index child of each dependency to complete before it can begin.</p>
237 pub fn depends_on(mut self, input: crate::types::JobDependency) -> Self {
238 let mut v = self.depends_on.unwrap_or_default();
239 v.push(input);
240 self.depends_on = ::std::option::Option::Some(v);
241 self
242 }
243 /// <p>A list of dependencies for the job. A job can depend upon a maximum of 20 jobs. You can specify a <code>SEQUENTIAL</code> type dependency without specifying a job ID for array jobs so that each child array job completes sequentially, starting at index 0. You can also specify an <code>N_TO_N</code> type dependency with a job ID for array jobs. In that case, each index child of this job must wait for the corresponding index child of each dependency to complete before it can begin.</p>
244 pub fn set_depends_on(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::JobDependency>>) -> Self {
245 self.depends_on = input;
246 self
247 }
248 /// <p>A list of dependencies for the job. A job can depend upon a maximum of 20 jobs. You can specify a <code>SEQUENTIAL</code> type dependency without specifying a job ID for array jobs so that each child array job completes sequentially, starting at index 0. You can also specify an <code>N_TO_N</code> type dependency with a job ID for array jobs. In that case, each index child of this job must wait for the corresponding index child of each dependency to complete before it can begin.</p>
249 pub fn get_depends_on(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::JobDependency>> {
250 &self.depends_on
251 }
252 /// <p>The job definition used by this job. This value can be one of <code>definition-name</code>, <code>definition-name:revision</code>, or the Amazon Resource Name (ARN) for the job definition, with or without the revision (<code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i>:<i>revision</i> </code>, or <code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i> </code>).</p>
253 /// <p>If the revision is not specified, then the latest active revision is used.</p>
254 /// This field is required.
255 pub fn job_definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
256 self.job_definition = ::std::option::Option::Some(input.into());
257 self
258 }
259 /// <p>The job definition used by this job. This value can be one of <code>definition-name</code>, <code>definition-name:revision</code>, or the Amazon Resource Name (ARN) for the job definition, with or without the revision (<code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i>:<i>revision</i> </code>, or <code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i> </code>).</p>
260 /// <p>If the revision is not specified, then the latest active revision is used.</p>
261 pub fn set_job_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262 self.job_definition = input;
263 self
264 }
265 /// <p>The job definition used by this job. This value can be one of <code>definition-name</code>, <code>definition-name:revision</code>, or the Amazon Resource Name (ARN) for the job definition, with or without the revision (<code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i>:<i>revision</i> </code>, or <code>arn:aws:batch:<i>region</i>:<i>account</i>:job-definition/<i>definition-name</i> </code>).</p>
266 /// <p>If the revision is not specified, then the latest active revision is used.</p>
267 pub fn get_job_definition(&self) -> &::std::option::Option<::std::string::String> {
268 &self.job_definition
269 }
270 /// Adds a key-value pair to `parameters`.
271 ///
272 /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
273 ///
274 /// <p>Additional parameters passed to the job that replace parameter substitution placeholders that are set in the job definition. Parameters are specified as a key and value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p>
275 pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
276 let mut hash_map = self.parameters.unwrap_or_default();
277 hash_map.insert(k.into(), v.into());
278 self.parameters = ::std::option::Option::Some(hash_map);
279 self
280 }
281 /// <p>Additional parameters passed to the job that replace parameter substitution placeholders that are set in the job definition. Parameters are specified as a key and value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p>
282 pub fn set_parameters(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
283 self.parameters = input;
284 self
285 }
286 /// <p>Additional parameters passed to the job that replace parameter substitution placeholders that are set in the job definition. Parameters are specified as a key and value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p>
287 pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
288 &self.parameters
289 }
290 /// <p>An object with properties that override the defaults for the job definition that specify the name of a container in the specified job definition and the overrides it should receive. You can override the default command for a container, which is specified in the job definition or the Docker image, with a <code>command</code> override. You can also override existing environment variables on a container or add new environment variables to it with an <code>environment</code> override.</p>
291 pub fn container_overrides(mut self, input: crate::types::ContainerOverrides) -> Self {
292 self.container_overrides = ::std::option::Option::Some(input);
293 self
294 }
295 /// <p>An object with properties that override the defaults for the job definition that specify the name of a container in the specified job definition and the overrides it should receive. You can override the default command for a container, which is specified in the job definition or the Docker image, with a <code>command</code> override. You can also override existing environment variables on a container or add new environment variables to it with an <code>environment</code> override.</p>
296 pub fn set_container_overrides(mut self, input: ::std::option::Option<crate::types::ContainerOverrides>) -> Self {
297 self.container_overrides = input;
298 self
299 }
300 /// <p>An object with properties that override the defaults for the job definition that specify the name of a container in the specified job definition and the overrides it should receive. You can override the default command for a container, which is specified in the job definition or the Docker image, with a <code>command</code> override. You can also override existing environment variables on a container or add new environment variables to it with an <code>environment</code> override.</p>
301 pub fn get_container_overrides(&self) -> &::std::option::Option<crate::types::ContainerOverrides> {
302 &self.container_overrides
303 }
304 /// <p>A list of node overrides in JSON format that specify the node range to target and the container overrides for that node range.</p><note>
305 /// <p>This parameter isn't applicable to jobs that are running on Fargate resources; use <code>containerOverrides</code> instead.</p>
306 /// </note>
307 pub fn node_overrides(mut self, input: crate::types::NodeOverrides) -> Self {
308 self.node_overrides = ::std::option::Option::Some(input);
309 self
310 }
311 /// <p>A list of node overrides in JSON format that specify the node range to target and the container overrides for that node range.</p><note>
312 /// <p>This parameter isn't applicable to jobs that are running on Fargate resources; use <code>containerOverrides</code> instead.</p>
313 /// </note>
314 pub fn set_node_overrides(mut self, input: ::std::option::Option<crate::types::NodeOverrides>) -> Self {
315 self.node_overrides = input;
316 self
317 }
318 /// <p>A list of node overrides in JSON format that specify the node range to target and the container overrides for that node range.</p><note>
319 /// <p>This parameter isn't applicable to jobs that are running on Fargate resources; use <code>containerOverrides</code> instead.</p>
320 /// </note>
321 pub fn get_node_overrides(&self) -> &::std::option::Option<crate::types::NodeOverrides> {
322 &self.node_overrides
323 }
324 /// <p>The retry strategy to use for failed jobs from this <code>SubmitJob</code> operation. When a retry strategy is specified here, it overrides the retry strategy defined in the job definition.</p>
325 pub fn retry_strategy(mut self, input: crate::types::RetryStrategy) -> Self {
326 self.retry_strategy = ::std::option::Option::Some(input);
327 self
328 }
329 /// <p>The retry strategy to use for failed jobs from this <code>SubmitJob</code> operation. When a retry strategy is specified here, it overrides the retry strategy defined in the job definition.</p>
330 pub fn set_retry_strategy(mut self, input: ::std::option::Option<crate::types::RetryStrategy>) -> Self {
331 self.retry_strategy = input;
332 self
333 }
334 /// <p>The retry strategy to use for failed jobs from this <code>SubmitJob</code> operation. When a retry strategy is specified here, it overrides the retry strategy defined in the job definition.</p>
335 pub fn get_retry_strategy(&self) -> &::std::option::Option<crate::types::RetryStrategy> {
336 &self.retry_strategy
337 }
338 /// <p>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 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 <code>FAILED</code> state. When specified, this overrides the tag propagation setting in the job definition.</p>
339 pub fn propagate_tags(mut self, input: bool) -> Self {
340 self.propagate_tags = ::std::option::Option::Some(input);
341 self
342 }
343 /// <p>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 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 <code>FAILED</code> state. When specified, this overrides the tag propagation setting in the job definition.</p>
344 pub fn set_propagate_tags(mut self, input: ::std::option::Option<bool>) -> Self {
345 self.propagate_tags = input;
346 self
347 }
348 /// <p>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 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 <code>FAILED</code> state. When specified, this overrides the tag propagation setting in the job definition.</p>
349 pub fn get_propagate_tags(&self) -> &::std::option::Option<bool> {
350 &self.propagate_tags
351 }
352 /// <p>The timeout configuration for this <code>SubmitJob</code> operation. You can specify a timeout duration after which Batch terminates your jobs if they haven't finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds. This configuration overrides any timeout configuration specified in the job definition. For array jobs, child jobs have the same timeout configuration as the parent job. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html">Job Timeouts</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
353 pub fn timeout(mut self, input: crate::types::JobTimeout) -> Self {
354 self.timeout = ::std::option::Option::Some(input);
355 self
356 }
357 /// <p>The timeout configuration for this <code>SubmitJob</code> operation. You can specify a timeout duration after which Batch terminates your jobs if they haven't finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds. This configuration overrides any timeout configuration specified in the job definition. For array jobs, child jobs have the same timeout configuration as the parent job. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html">Job Timeouts</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
358 pub fn set_timeout(mut self, input: ::std::option::Option<crate::types::JobTimeout>) -> Self {
359 self.timeout = input;
360 self
361 }
362 /// <p>The timeout configuration for this <code>SubmitJob</code> operation. You can specify a timeout duration after which Batch terminates your jobs if they haven't finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds. This configuration overrides any timeout configuration specified in the job definition. For array jobs, child jobs have the same timeout configuration as the parent job. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html">Job Timeouts</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
363 pub fn get_timeout(&self) -> &::std::option::Option<crate::types::JobTimeout> {
364 &self.timeout
365 }
366 /// Adds a key-value pair to `tags`.
367 ///
368 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
369 ///
370 /// <p>The tags that you apply to the job request to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in <i>Amazon Web Services General Reference</i>.</p>
371 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
372 let mut hash_map = self.tags.unwrap_or_default();
373 hash_map.insert(k.into(), v.into());
374 self.tags = ::std::option::Option::Some(hash_map);
375 self
376 }
377 /// <p>The tags that you apply to the job request to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in <i>Amazon Web Services General Reference</i>.</p>
378 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
379 self.tags = input;
380 self
381 }
382 /// <p>The tags that you apply to the job request to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in <i>Amazon Web Services General Reference</i>.</p>
383 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
384 &self.tags
385 }
386 /// <p>An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon EKS resources.</p>
387 pub fn eks_properties_override(mut self, input: crate::types::EksPropertiesOverride) -> Self {
388 self.eks_properties_override = ::std::option::Option::Some(input);
389 self
390 }
391 /// <p>An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon EKS resources.</p>
392 pub fn set_eks_properties_override(mut self, input: ::std::option::Option<crate::types::EksPropertiesOverride>) -> Self {
393 self.eks_properties_override = input;
394 self
395 }
396 /// <p>An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon EKS resources.</p>
397 pub fn get_eks_properties_override(&self) -> &::std::option::Option<crate::types::EksPropertiesOverride> {
398 &self.eks_properties_override
399 }
400 /// <p>An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon ECS resources.</p>
401 pub fn ecs_properties_override(mut self, input: crate::types::EcsPropertiesOverride) -> Self {
402 self.ecs_properties_override = ::std::option::Option::Some(input);
403 self
404 }
405 /// <p>An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon ECS resources.</p>
406 pub fn set_ecs_properties_override(mut self, input: ::std::option::Option<crate::types::EcsPropertiesOverride>) -> Self {
407 self.ecs_properties_override = input;
408 self
409 }
410 /// <p>An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon ECS resources.</p>
411 pub fn get_ecs_properties_override(&self) -> &::std::option::Option<crate::types::EcsPropertiesOverride> {
412 &self.ecs_properties_override
413 }
414 /// <p>An object that contains overrides for the consumable resources of a job.</p>
415 pub fn consumable_resource_properties_override(mut self, input: crate::types::ConsumableResourceProperties) -> Self {
416 self.consumable_resource_properties_override = ::std::option::Option::Some(input);
417 self
418 }
419 /// <p>An object that contains overrides for the consumable resources of a job.</p>
420 pub fn set_consumable_resource_properties_override(mut self, input: ::std::option::Option<crate::types::ConsumableResourceProperties>) -> Self {
421 self.consumable_resource_properties_override = input;
422 self
423 }
424 /// <p>An object that contains overrides for the consumable resources of a job.</p>
425 pub fn get_consumable_resource_properties_override(&self) -> &::std::option::Option<crate::types::ConsumableResourceProperties> {
426 &self.consumable_resource_properties_override
427 }
428 /// Consumes the builder and constructs a [`SubmitJobInput`](crate::operation::submit_job::SubmitJobInput).
429 pub fn build(self) -> ::std::result::Result<crate::operation::submit_job::SubmitJobInput, ::aws_smithy_types::error::operation::BuildError> {
430 ::std::result::Result::Ok(crate::operation::submit_job::SubmitJobInput {
431 job_name: self.job_name,
432 job_queue: self.job_queue,
433 share_identifier: self.share_identifier,
434 scheduling_priority_override: self.scheduling_priority_override,
435 array_properties: self.array_properties,
436 depends_on: self.depends_on,
437 job_definition: self.job_definition,
438 parameters: self.parameters,
439 container_overrides: self.container_overrides,
440 node_overrides: self.node_overrides,
441 retry_strategy: self.retry_strategy,
442 propagate_tags: self.propagate_tags,
443 timeout: self.timeout,
444 tags: self.tags,
445 eks_properties_override: self.eks_properties_override,
446 ecs_properties_override: self.ecs_properties_override,
447 consumable_resource_properties_override: self.consumable_resource_properties_override,
448 })
449 }
450}