// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[derive(Debug)]
pub(crate) struct Handle {
pub(crate) client: aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
pub(crate) conf: crate::Config,
}
/// Client for AWS Batch
///
/// Client for invoking operations on AWS Batch. Each operation on AWS Batch is a method on this
/// this struct. `.send()` MUST be invoked on the generated operations to dispatch the request to the service.
///
/// # Examples
/// **Constructing a client and invoking an operation**
/// ```rust,no_run
/// # async fn docs() {
/// // create a shared configuration. This can be used & shared between multiple service clients.
/// let shared_config = aws_config::load_from_env().await;
/// let client = aws_sdk_batch::Client::new(&shared_config);
/// // invoke an operation
/// /* let rsp = client
/// .<operation_name>().
/// .<param>("some value")
/// .send().await; */
/// # }
/// ```
/// **Constructing a client with custom configuration**
/// ```rust,no_run
/// use aws_config::retry::RetryConfig;
/// # async fn docs() {
/// let shared_config = aws_config::load_from_env().await;
/// let config = aws_sdk_batch::config::Builder::from(&shared_config)
/// .retry_config(RetryConfig::disabled())
/// .build();
/// let client = aws_sdk_batch::Client::from_conf(config);
/// # }
#[derive(std::fmt::Debug)]
pub struct Client {
handle: std::sync::Arc<Handle>,
}
impl std::clone::Clone for Client {
fn clone(&self) -> Self {
Self {
handle: self.handle.clone(),
}
}
}
#[doc(inline)]
pub use aws_smithy_client::Builder;
impl
From<
aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
> for Client
{
fn from(
client: aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
) -> Self {
Self::with_config(client, crate::Config::builder().build())
}
}
impl Client {
/// Creates a client with the given service configuration.
pub fn with_config(
client: aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
conf: crate::Config,
) -> Self {
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
/// Returns the client's configuration.
pub fn conf(&self) -> &crate::Config {
&self.handle.conf
}
}
impl Client {
/// Constructs a fluent builder for the [`CancelJob`](crate::client::fluent_builders::CancelJob) operation.
///
/// - The fluent builder is configurable:
/// - [`job_id(impl Into<String>)`](crate::client::fluent_builders::CancelJob::job_id) / [`set_job_id(Option<String>)`](crate::client::fluent_builders::CancelJob::set_job_id): <p>The Batch job ID of the job to cancel.</p>
/// - [`reason(impl Into<String>)`](crate::client::fluent_builders::CancelJob::reason) / [`set_reason(Option<String>)`](crate::client::fluent_builders::CancelJob::set_reason): <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. This message is also recorded in the Batch activity logs.</p>
/// - On success, responds with [`CancelJobOutput`](crate::output::CancelJobOutput)
/// - On failure, responds with [`SdkError<CancelJobError>`](crate::error::CancelJobError)
pub fn cancel_job(&self) -> fluent_builders::CancelJob {
fluent_builders::CancelJob::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`CreateComputeEnvironment`](crate::client::fluent_builders::CreateComputeEnvironment) operation.
///
/// - The fluent builder is configurable:
/// - [`compute_environment_name(impl Into<String>)`](crate::client::fluent_builders::CreateComputeEnvironment::compute_environment_name) / [`set_compute_environment_name(Option<String>)`](crate::client::fluent_builders::CreateComputeEnvironment::set_compute_environment_name): <p>The name for your compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
/// - [`r#type(CeType)`](crate::client::fluent_builders::CreateComputeEnvironment::type) / [`set_type(Option<CeType>)`](crate::client::fluent_builders::CreateComputeEnvironment::set_type): <p>The type of the compute environment: <code>MANAGED</code> or <code>UNMANAGED</code>. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>Batch User Guide</i>.</p>
/// - [`state(CeState)`](crate::client::fluent_builders::CreateComputeEnvironment::state) / [`set_state(Option<CeState>)`](crate::client::fluent_builders::CreateComputeEnvironment::set_state): <p>The state of the compute environment. If the state is <code>ENABLED</code>, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.</p> <p>If the state is <code>ENABLED</code>, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.</p> <p>If the state is <code>DISABLED</code>, then the Batch scheduler doesn't attempt to place jobs within the environment. Jobs in a <code>STARTING</code> or <code>RUNNING</code> state continue to progress normally. Managed compute environments in the <code>DISABLED</code> state don't scale out. However, they scale in to <code>minvCpus</code> value after instances become idle.</p>
/// - [`unmanagedv_cpus(i32)`](crate::client::fluent_builders::CreateComputeEnvironment::unmanagedv_cpus) / [`set_unmanagedv_cpus(Option<i32>)`](crate::client::fluent_builders::CreateComputeEnvironment::set_unmanagedv_cpus): <p>The maximum number of vCPUs for an unmanaged compute environment. This parameter is only used for fair share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn't provided for a fair share job queue, no vCPU capacity is reserved.</p> <note> <p>This parameter is only supported when the <code>type</code> parameter is set to <code>UNMANAGED</code>.</p> </note>
/// - [`compute_resources(ComputeResource)`](crate::client::fluent_builders::CreateComputeEnvironment::compute_resources) / [`set_compute_resources(Option<ComputeResource>)`](crate::client::fluent_builders::CreateComputeEnvironment::set_compute_resources): <p>Details about the compute resources managed by the compute environment. This parameter is required for managed compute environments. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>Batch User Guide</i>.</p>
/// - [`service_role(impl Into<String>)`](crate::client::fluent_builders::CreateComputeEnvironment::service_role) / [`set_service_role(Option<String>)`](crate::client::fluent_builders::CreateComputeEnvironment::set_service_role): <p>The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html">Batch service IAM role</a> in the <i>Batch User Guide</i>.</p> <important> <p>If your account already created the Batch service-linked role, that role is used by default for your compute environment unless you specify a different role here. If the Batch service-linked role doesn't exist in your account, and no role is specified here, the service attempts to create the Batch service-linked role in your account.</p> </important> <p>If your specified role has a path other than <code>/</code>, then you must specify either the full role ARN (recommended) or prefix the role name with the path. For example, if a role with the name <code>bar</code> has a path of <code>/foo/</code>, specify <code>/foo/bar</code> as the role name. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names">Friendly names and paths</a> in the <i>IAM User Guide</i>.</p> <note> <p>Depending on how you created your Batch service role, its ARN might contain the <code>service-role</code> path prefix. When you only specify the name of the service role, Batch assumes that your ARN doesn't use the <code>service-role</code> path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.</p> </note>
/// - [`tags(HashMap<String, String>)`](crate::client::fluent_builders::CreateComputeEnvironment::tags) / [`set_tags(Option<HashMap<String, String>>)`](crate::client::fluent_builders::CreateComputeEnvironment::set_tags): <p>The tags that you apply to the compute environment 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> <p>These tags can be updated or removed using the <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html">TagResource</a> and <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html">UntagResource</a> API operations. These tags don't propagate to the underlying compute resources.</p>
/// - [`eks_configuration(EksConfiguration)`](crate::client::fluent_builders::CreateComputeEnvironment::eks_configuration) / [`set_eks_configuration(Option<EksConfiguration>)`](crate::client::fluent_builders::CreateComputeEnvironment::set_eks_configuration): <p>The details for the Amazon EKS cluster that supports the compute environment.</p>
/// - On success, responds with [`CreateComputeEnvironmentOutput`](crate::output::CreateComputeEnvironmentOutput) with field(s):
/// - [`compute_environment_name(Option<String>)`](crate::output::CreateComputeEnvironmentOutput::compute_environment_name): <p>The name of the compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
/// - [`compute_environment_arn(Option<String>)`](crate::output::CreateComputeEnvironmentOutput::compute_environment_arn): <p>The Amazon Resource Name (ARN) of the compute environment.</p>
/// - On failure, responds with [`SdkError<CreateComputeEnvironmentError>`](crate::error::CreateComputeEnvironmentError)
pub fn create_compute_environment(&self) -> fluent_builders::CreateComputeEnvironment {
fluent_builders::CreateComputeEnvironment::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`CreateJobQueue`](crate::client::fluent_builders::CreateJobQueue) operation.
///
/// - The fluent builder is configurable:
/// - [`job_queue_name(impl Into<String>)`](crate::client::fluent_builders::CreateJobQueue::job_queue_name) / [`set_job_queue_name(Option<String>)`](crate::client::fluent_builders::CreateJobQueue::set_job_queue_name): <p>The name of the job queue. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
/// - [`state(JqState)`](crate::client::fluent_builders::CreateJobQueue::state) / [`set_state(Option<JqState>)`](crate::client::fluent_builders::CreateJobQueue::set_state): <p>The state of the job queue. If the job queue state is <code>ENABLED</code>, it is able to accept jobs. If the job queue state is <code>DISABLED</code>, new jobs can't be added to the queue, but jobs already in the queue can finish.</p>
/// - [`scheduling_policy_arn(impl Into<String>)`](crate::client::fluent_builders::CreateJobQueue::scheduling_policy_arn) / [`set_scheduling_policy_arn(Option<String>)`](crate::client::fluent_builders::CreateJobQueue::set_scheduling_policy_arn): <p>The Amazon Resource Name (ARN) of the fair share scheduling policy. If this parameter is specified, the job queue uses a fair share scheduling policy. If this parameter isn't specified, the job queue uses a first in, first out (FIFO) scheduling policy. After a job queue is created, you can replace but can't remove the fair share scheduling policy. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. An example is <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>
/// - [`priority(i32)`](crate::client::fluent_builders::CreateJobQueue::priority) / [`set_priority(Option<i32>)`](crate::client::fluent_builders::CreateJobQueue::set_priority): <p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>); EC2 and Fargate compute environments can't be mixed.</p>
/// - [`compute_environment_order(Vec<ComputeEnvironmentOrder>)`](crate::client::fluent_builders::CreateJobQueue::compute_environment_order) / [`set_compute_environment_order(Option<Vec<ComputeEnvironmentOrder>>)`](crate::client::fluent_builders::CreateJobQueue::set_compute_environment_order): <p>The set of compute environments mapped to a job queue and their order relative to each other. The job scheduler uses this parameter to determine which compute environment runs a specific job. Compute environments must be in the <code>VALID</code> state before you can associate them with a job queue. You can associate up to three compute environments with a job queue. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>); EC2 and Fargate compute environments can't be mixed.</p> <note> <p>All compute environments that are associated with a job queue must share the same architecture. Batch doesn't support mixing compute environment architecture types in a single job queue.</p> </note>
/// - [`tags(HashMap<String, String>)`](crate::client::fluent_builders::CreateJobQueue::tags) / [`set_tags(Option<HashMap<String, String>>)`](crate::client::fluent_builders::CreateJobQueue::set_tags): <p>The tags that you apply to the job queue 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/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</p>
/// - On success, responds with [`CreateJobQueueOutput`](crate::output::CreateJobQueueOutput) with field(s):
/// - [`job_queue_name(Option<String>)`](crate::output::CreateJobQueueOutput::job_queue_name): <p>The name of the job queue.</p>
/// - [`job_queue_arn(Option<String>)`](crate::output::CreateJobQueueOutput::job_queue_arn): <p>The Amazon Resource Name (ARN) of the job queue.</p>
/// - On failure, responds with [`SdkError<CreateJobQueueError>`](crate::error::CreateJobQueueError)
pub fn create_job_queue(&self) -> fluent_builders::CreateJobQueue {
fluent_builders::CreateJobQueue::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`CreateSchedulingPolicy`](crate::client::fluent_builders::CreateSchedulingPolicy) operation.
///
/// - The fluent builder is configurable:
/// - [`name(impl Into<String>)`](crate::client::fluent_builders::CreateSchedulingPolicy::name) / [`set_name(Option<String>)`](crate::client::fluent_builders::CreateSchedulingPolicy::set_name): <p>The name of the scheduling policy. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
/// - [`fairshare_policy(FairsharePolicy)`](crate::client::fluent_builders::CreateSchedulingPolicy::fairshare_policy) / [`set_fairshare_policy(Option<FairsharePolicy>)`](crate::client::fluent_builders::CreateSchedulingPolicy::set_fairshare_policy): <p>The fair share policy of the scheduling policy.</p>
/// - [`tags(HashMap<String, String>)`](crate::client::fluent_builders::CreateSchedulingPolicy::tags) / [`set_tags(Option<HashMap<String, String>>)`](crate::client::fluent_builders::CreateSchedulingPolicy::set_tags): <p>The tags that you apply to the scheduling policy 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> <p>These tags can be updated or removed using the <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html">TagResource</a> and <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html">UntagResource</a> API operations.</p>
/// - On success, responds with [`CreateSchedulingPolicyOutput`](crate::output::CreateSchedulingPolicyOutput) with field(s):
/// - [`name(Option<String>)`](crate::output::CreateSchedulingPolicyOutput::name): <p>The name of the scheduling policy.</p>
/// - [`arn(Option<String>)`](crate::output::CreateSchedulingPolicyOutput::arn): <p>The Amazon Resource Name (ARN) of the scheduling policy. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. For example, <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>
/// - On failure, responds with [`SdkError<CreateSchedulingPolicyError>`](crate::error::CreateSchedulingPolicyError)
pub fn create_scheduling_policy(&self) -> fluent_builders::CreateSchedulingPolicy {
fluent_builders::CreateSchedulingPolicy::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DeleteComputeEnvironment`](crate::client::fluent_builders::DeleteComputeEnvironment) operation.
///
/// - The fluent builder is configurable:
/// - [`compute_environment(impl Into<String>)`](crate::client::fluent_builders::DeleteComputeEnvironment::compute_environment) / [`set_compute_environment(Option<String>)`](crate::client::fluent_builders::DeleteComputeEnvironment::set_compute_environment): <p>The name or Amazon Resource Name (ARN) of the compute environment to delete.</p>
/// - On success, responds with [`DeleteComputeEnvironmentOutput`](crate::output::DeleteComputeEnvironmentOutput)
/// - On failure, responds with [`SdkError<DeleteComputeEnvironmentError>`](crate::error::DeleteComputeEnvironmentError)
pub fn delete_compute_environment(&self) -> fluent_builders::DeleteComputeEnvironment {
fluent_builders::DeleteComputeEnvironment::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DeleteJobQueue`](crate::client::fluent_builders::DeleteJobQueue) operation.
///
/// - The fluent builder is configurable:
/// - [`job_queue(impl Into<String>)`](crate::client::fluent_builders::DeleteJobQueue::job_queue) / [`set_job_queue(Option<String>)`](crate::client::fluent_builders::DeleteJobQueue::set_job_queue): <p>The short name or full Amazon Resource Name (ARN) of the queue to delete.</p>
/// - On success, responds with [`DeleteJobQueueOutput`](crate::output::DeleteJobQueueOutput)
/// - On failure, responds with [`SdkError<DeleteJobQueueError>`](crate::error::DeleteJobQueueError)
pub fn delete_job_queue(&self) -> fluent_builders::DeleteJobQueue {
fluent_builders::DeleteJobQueue::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DeleteSchedulingPolicy`](crate::client::fluent_builders::DeleteSchedulingPolicy) operation.
///
/// - The fluent builder is configurable:
/// - [`arn(impl Into<String>)`](crate::client::fluent_builders::DeleteSchedulingPolicy::arn) / [`set_arn(Option<String>)`](crate::client::fluent_builders::DeleteSchedulingPolicy::set_arn): <p>The Amazon Resource Name (ARN) of the scheduling policy to delete.</p>
/// - On success, responds with [`DeleteSchedulingPolicyOutput`](crate::output::DeleteSchedulingPolicyOutput)
/// - On failure, responds with [`SdkError<DeleteSchedulingPolicyError>`](crate::error::DeleteSchedulingPolicyError)
pub fn delete_scheduling_policy(&self) -> fluent_builders::DeleteSchedulingPolicy {
fluent_builders::DeleteSchedulingPolicy::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DeregisterJobDefinition`](crate::client::fluent_builders::DeregisterJobDefinition) operation.
///
/// - The fluent builder is configurable:
/// - [`job_definition(impl Into<String>)`](crate::client::fluent_builders::DeregisterJobDefinition::job_definition) / [`set_job_definition(Option<String>)`](crate::client::fluent_builders::DeregisterJobDefinition::set_job_definition): <p>The name and revision (<code>name:revision</code>) or full Amazon Resource Name (ARN) of the job definition to deregister.</p>
/// - On success, responds with [`DeregisterJobDefinitionOutput`](crate::output::DeregisterJobDefinitionOutput)
/// - On failure, responds with [`SdkError<DeregisterJobDefinitionError>`](crate::error::DeregisterJobDefinitionError)
pub fn deregister_job_definition(&self) -> fluent_builders::DeregisterJobDefinition {
fluent_builders::DeregisterJobDefinition::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeComputeEnvironments`](crate::client::fluent_builders::DescribeComputeEnvironments) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeComputeEnvironments::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`compute_environments(Vec<String>)`](crate::client::fluent_builders::DescribeComputeEnvironments::compute_environments) / [`set_compute_environments(Option<Vec<String>>)`](crate::client::fluent_builders::DescribeComputeEnvironments::set_compute_environments): <p>A list of up to 100 compute environment names or full Amazon Resource Name (ARN) entries.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeComputeEnvironments::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeComputeEnvironments::set_max_results): <p>The maximum number of cluster results returned by <code>DescribeComputeEnvironments</code> in paginated output. When this parameter is used, <code>DescribeComputeEnvironments</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeComputeEnvironments</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeComputeEnvironments</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeComputeEnvironments::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeComputeEnvironments::set_next_token): <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeComputeEnvironments</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
/// - On success, responds with [`DescribeComputeEnvironmentsOutput`](crate::output::DescribeComputeEnvironmentsOutput) with field(s):
/// - [`compute_environments(Option<Vec<ComputeEnvironmentDetail>>)`](crate::output::DescribeComputeEnvironmentsOutput::compute_environments): <p>The list of compute environments.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeComputeEnvironmentsOutput::next_token): <p>The <code>nextToken</code> value to include in a future <code>DescribeComputeEnvironments</code> request. When the results of a <code>DescribeComputeEnvironments</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
/// - On failure, responds with [`SdkError<DescribeComputeEnvironmentsError>`](crate::error::DescribeComputeEnvironmentsError)
pub fn describe_compute_environments(&self) -> fluent_builders::DescribeComputeEnvironments {
fluent_builders::DescribeComputeEnvironments::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeJobDefinitions`](crate::client::fluent_builders::DescribeJobDefinitions) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeJobDefinitions::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`job_definitions(Vec<String>)`](crate::client::fluent_builders::DescribeJobDefinitions::job_definitions) / [`set_job_definitions(Option<Vec<String>>)`](crate::client::fluent_builders::DescribeJobDefinitions::set_job_definitions): <p>A list of up to 100 job definitions. Each entry in the list can either be an ARN in the format <code>arn:aws:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision}</code> or a short version using the form <code>${JobDefinitionName}:${Revision}</code>.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeJobDefinitions::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeJobDefinitions::set_max_results): <p>The maximum number of results returned by <code>DescribeJobDefinitions</code> in paginated output. When this parameter is used, <code>DescribeJobDefinitions</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeJobDefinitions</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeJobDefinitions</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
/// - [`job_definition_name(impl Into<String>)`](crate::client::fluent_builders::DescribeJobDefinitions::job_definition_name) / [`set_job_definition_name(Option<String>)`](crate::client::fluent_builders::DescribeJobDefinitions::set_job_definition_name): <p>The name of the job definition to describe.</p>
/// - [`status(impl Into<String>)`](crate::client::fluent_builders::DescribeJobDefinitions::status) / [`set_status(Option<String>)`](crate::client::fluent_builders::DescribeJobDefinitions::set_status): <p>The status used to filter job definitions.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeJobDefinitions::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeJobDefinitions::set_next_token): <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeJobDefinitions</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
/// - On success, responds with [`DescribeJobDefinitionsOutput`](crate::output::DescribeJobDefinitionsOutput) with field(s):
/// - [`job_definitions(Option<Vec<JobDefinition>>)`](crate::output::DescribeJobDefinitionsOutput::job_definitions): <p>The list of job definitions.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeJobDefinitionsOutput::next_token): <p>The <code>nextToken</code> value to include in a future <code>DescribeJobDefinitions</code> request. When the results of a <code>DescribeJobDefinitions</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
/// - On failure, responds with [`SdkError<DescribeJobDefinitionsError>`](crate::error::DescribeJobDefinitionsError)
pub fn describe_job_definitions(&self) -> fluent_builders::DescribeJobDefinitions {
fluent_builders::DescribeJobDefinitions::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeJobQueues`](crate::client::fluent_builders::DescribeJobQueues) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeJobQueues::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`job_queues(Vec<String>)`](crate::client::fluent_builders::DescribeJobQueues::job_queues) / [`set_job_queues(Option<Vec<String>>)`](crate::client::fluent_builders::DescribeJobQueues::set_job_queues): <p>A list of up to 100 queue names or full queue Amazon Resource Name (ARN) entries.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeJobQueues::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeJobQueues::set_max_results): <p>The maximum number of results returned by <code>DescribeJobQueues</code> in paginated output. When this parameter is used, <code>DescribeJobQueues</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeJobQueues</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeJobQueues</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeJobQueues::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeJobQueues::set_next_token): <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeJobQueues</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
/// - On success, responds with [`DescribeJobQueuesOutput`](crate::output::DescribeJobQueuesOutput) with field(s):
/// - [`job_queues(Option<Vec<JobQueueDetail>>)`](crate::output::DescribeJobQueuesOutput::job_queues): <p>The list of job queues.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeJobQueuesOutput::next_token): <p>The <code>nextToken</code> value to include in a future <code>DescribeJobQueues</code> request. When the results of a <code>DescribeJobQueues</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
/// - On failure, responds with [`SdkError<DescribeJobQueuesError>`](crate::error::DescribeJobQueuesError)
pub fn describe_job_queues(&self) -> fluent_builders::DescribeJobQueues {
fluent_builders::DescribeJobQueues::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeJobs`](crate::client::fluent_builders::DescribeJobs) operation.
///
/// - The fluent builder is configurable:
/// - [`jobs(Vec<String>)`](crate::client::fluent_builders::DescribeJobs::jobs) / [`set_jobs(Option<Vec<String>>)`](crate::client::fluent_builders::DescribeJobs::set_jobs): <p>A list of up to 100 job IDs.</p>
/// - On success, responds with [`DescribeJobsOutput`](crate::output::DescribeJobsOutput) with field(s):
/// - [`jobs(Option<Vec<JobDetail>>)`](crate::output::DescribeJobsOutput::jobs): <p>The list of jobs.</p>
/// - On failure, responds with [`SdkError<DescribeJobsError>`](crate::error::DescribeJobsError)
pub fn describe_jobs(&self) -> fluent_builders::DescribeJobs {
fluent_builders::DescribeJobs::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeSchedulingPolicies`](crate::client::fluent_builders::DescribeSchedulingPolicies) operation.
///
/// - The fluent builder is configurable:
/// - [`arns(Vec<String>)`](crate::client::fluent_builders::DescribeSchedulingPolicies::arns) / [`set_arns(Option<Vec<String>>)`](crate::client::fluent_builders::DescribeSchedulingPolicies::set_arns): <p>A list of up to 100 scheduling policy Amazon Resource Name (ARN) entries.</p>
/// - On success, responds with [`DescribeSchedulingPoliciesOutput`](crate::output::DescribeSchedulingPoliciesOutput) with field(s):
/// - [`scheduling_policies(Option<Vec<SchedulingPolicyDetail>>)`](crate::output::DescribeSchedulingPoliciesOutput::scheduling_policies): <p>The list of scheduling policies.</p>
/// - On failure, responds with [`SdkError<DescribeSchedulingPoliciesError>`](crate::error::DescribeSchedulingPoliciesError)
pub fn describe_scheduling_policies(&self) -> fluent_builders::DescribeSchedulingPolicies {
fluent_builders::DescribeSchedulingPolicies::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListJobs`](crate::client::fluent_builders::ListJobs) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListJobs::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`job_queue(impl Into<String>)`](crate::client::fluent_builders::ListJobs::job_queue) / [`set_job_queue(Option<String>)`](crate::client::fluent_builders::ListJobs::set_job_queue): <p>The name or full Amazon Resource Name (ARN) of the job queue used to list jobs.</p>
/// - [`array_job_id(impl Into<String>)`](crate::client::fluent_builders::ListJobs::array_job_id) / [`set_array_job_id(Option<String>)`](crate::client::fluent_builders::ListJobs::set_array_job_id): <p>The job ID for an array job. Specifying an array job ID with this parameter lists all child jobs from within the specified array.</p>
/// - [`multi_node_job_id(impl Into<String>)`](crate::client::fluent_builders::ListJobs::multi_node_job_id) / [`set_multi_node_job_id(Option<String>)`](crate::client::fluent_builders::ListJobs::set_multi_node_job_id): <p>The job ID for a multi-node parallel job. Specifying a multi-node parallel job ID with this parameter lists all nodes that are associated with the specified job.</p>
/// - [`job_status(JobStatus)`](crate::client::fluent_builders::ListJobs::job_status) / [`set_job_status(Option<JobStatus>)`](crate::client::fluent_builders::ListJobs::set_job_status): <p>The job status used to filter jobs in the specified queue. If the <code>filters</code> parameter is specified, the <code>jobStatus</code> parameter is ignored and jobs with any status are returned. If you don't specify a status, only <code>RUNNING</code> jobs are returned.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::ListJobs::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::ListJobs::set_max_results): <p>The maximum number of results returned by <code>ListJobs</code> in paginated output. When this parameter is used, <code>ListJobs</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListJobs</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>ListJobs</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListJobs::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListJobs::set_next_token): <p>The <code>nextToken</code> value returned from a previous paginated <code>ListJobs</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
/// - [`filters(Vec<KeyValuesPair>)`](crate::client::fluent_builders::ListJobs::filters) / [`set_filters(Option<Vec<KeyValuesPair>>)`](crate::client::fluent_builders::ListJobs::set_filters): <p>The filter to apply to the query. Only one filter can be used at a time. When the filter is used, <code>jobStatus</code> is ignored. The filter doesn't apply to child jobs in an array or multi-node parallel (MNP) jobs. The results are sorted by the <code>createdAt</code> field, with the most recent jobs being first.</p> <dl> <dt> JOB_NAME </dt> <dd> <p>The value of the filter is a case-insensitive match for the job name. If the value ends with an asterisk (*), the filter matches any job name that begins with the string before the '*'. This corresponds to the <code>jobName</code> value. For example, <code>test1</code> matches both <code>Test1</code> and <code>test1</code>, and <code>test1*</code> matches both <code>test1</code> and <code>Test10</code>. When the <code>JOB_NAME</code> filter is used, the results are grouped by the job name and version.</p> </dd> <dt> JOB_DEFINITION </dt> <dd> <p>The value for the filter is the name or Amazon Resource Name (ARN) of the job definition. This corresponds to the <code>jobDefinition</code> value. The value is case sensitive. When the value for the filter is the job definition name, the results include all the jobs that used any revision of that job definition name. If the value ends with an asterisk (*), the filter matches any job definition name that begins with the string before the '*'. For example, <code>jd1</code> matches only <code>jd1</code>, and <code>jd1*</code> matches both <code>jd1</code> and <code>jd1A</code>. The version of the job definition that's used doesn't affect the sort order. When the <code>JOB_DEFINITION</code> filter is used and the ARN is used (which is in the form <code>arn:${Partition}:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision}</code>), the results include jobs that used the specified revision of the job definition. Asterisk (*) isn't supported when the ARN is used.</p> </dd> <dt> BEFORE_CREATED_AT </dt> <dd> <p>The value for the filter is the time that's before the job was created. This corresponds to the <code>createdAt</code> value. The value is a string representation of the number of milliseconds since 00:00:00 UTC (midnight) on January 1, 1970.</p> </dd> <dt> AFTER_CREATED_AT </dt> <dd> <p>The value for the filter is the time that's after the job was created. This corresponds to the <code>createdAt</code> value. The value is a string representation of the number of milliseconds since 00:00:00 UTC (midnight) on January 1, 1970.</p> </dd> </dl>
/// - On success, responds with [`ListJobsOutput`](crate::output::ListJobsOutput) with field(s):
/// - [`job_summary_list(Option<Vec<JobSummary>>)`](crate::output::ListJobsOutput::job_summary_list): <p>A list of job summaries that match the request.</p>
/// - [`next_token(Option<String>)`](crate::output::ListJobsOutput::next_token): <p>The <code>nextToken</code> value to include in a future <code>ListJobs</code> request. When the results of a <code>ListJobs</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
/// - On failure, responds with [`SdkError<ListJobsError>`](crate::error::ListJobsError)
pub fn list_jobs(&self) -> fluent_builders::ListJobs {
fluent_builders::ListJobs::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListSchedulingPolicies`](crate::client::fluent_builders::ListSchedulingPolicies) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListSchedulingPolicies::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`max_results(i32)`](crate::client::fluent_builders::ListSchedulingPolicies::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::ListSchedulingPolicies::set_max_results): <p>The maximum number of results that's returned by <code>ListSchedulingPolicies</code> in paginated output. When this parameter is used, <code>ListSchedulingPolicies</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListSchedulingPolicies</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, <code>ListSchedulingPolicies</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListSchedulingPolicies::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListSchedulingPolicies::set_next_token): <p>The <code>nextToken</code> value that's returned from a previous paginated <code>ListSchedulingPolicies</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
/// - On success, responds with [`ListSchedulingPoliciesOutput`](crate::output::ListSchedulingPoliciesOutput) with field(s):
/// - [`scheduling_policies(Option<Vec<SchedulingPolicyListingDetail>>)`](crate::output::ListSchedulingPoliciesOutput::scheduling_policies): <p>A list of scheduling policies that match the request.</p>
/// - [`next_token(Option<String>)`](crate::output::ListSchedulingPoliciesOutput::next_token): <p>The <code>nextToken</code> value to include in a future <code>ListSchedulingPolicies</code> request. When the results of a <code>ListSchedulingPolicies</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
/// - On failure, responds with [`SdkError<ListSchedulingPoliciesError>`](crate::error::ListSchedulingPoliciesError)
pub fn list_scheduling_policies(&self) -> fluent_builders::ListSchedulingPolicies {
fluent_builders::ListSchedulingPolicies::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListTagsForResource`](crate::client::fluent_builders::ListTagsForResource) operation.
///
/// - The fluent builder is configurable:
/// - [`resource_arn(impl Into<String>)`](crate::client::fluent_builders::ListTagsForResource::resource_arn) / [`set_resource_arn(Option<String>)`](crate::client::fluent_builders::ListTagsForResource::set_resource_arn): <p>The Amazon Resource Name (ARN) that identifies the resource that tags are listed for. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
/// - On success, responds with [`ListTagsForResourceOutput`](crate::output::ListTagsForResourceOutput) with field(s):
/// - [`tags(Option<HashMap<String, String>>)`](crate::output::ListTagsForResourceOutput::tags): <p>The tags for the resource.</p>
/// - On failure, responds with [`SdkError<ListTagsForResourceError>`](crate::error::ListTagsForResourceError)
pub fn list_tags_for_resource(&self) -> fluent_builders::ListTagsForResource {
fluent_builders::ListTagsForResource::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`RegisterJobDefinition`](crate::client::fluent_builders::RegisterJobDefinition) operation.
///
/// - The fluent builder is configurable:
/// - [`job_definition_name(impl Into<String>)`](crate::client::fluent_builders::RegisterJobDefinition::job_definition_name) / [`set_job_definition_name(Option<String>)`](crate::client::fluent_builders::RegisterJobDefinition::set_job_definition_name): <p>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 (_).</p>
/// - [`r#type(JobDefinitionType)`](crate::client::fluent_builders::RegisterJobDefinition::type) / [`set_type(Option<JobDefinitionType>)`](crate::client::fluent_builders::RegisterJobDefinition::set_type): <p>The type of job definition. For more information about multi-node parallel jobs, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/multi-node-job-def.html">Creating a multi-node parallel job definition</a> in the <i>Batch User Guide</i>.</p> <note> <p>If the job is run on Fargate resources, then <code>multinode</code> isn't supported.</p> </note>
/// - [`parameters(HashMap<String, String>)`](crate::client::fluent_builders::RegisterJobDefinition::parameters) / [`set_parameters(Option<HashMap<String, String>>)`](crate::client::fluent_builders::RegisterJobDefinition::set_parameters): <p>Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p>
/// - [`scheduling_priority(i32)`](crate::client::fluent_builders::RegisterJobDefinition::scheduling_priority) / [`set_scheduling_priority(Option<i32>)`](crate::client::fluent_builders::RegisterJobDefinition::set_scheduling_priority): <p>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.</p> <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
/// - [`container_properties(ContainerProperties)`](crate::client::fluent_builders::RegisterJobDefinition::container_properties) / [`set_container_properties(Option<ContainerProperties>)`](crate::client::fluent_builders::RegisterJobDefinition::set_container_properties): <p>An object with various properties specific to Amazon ECS based single-node container-based jobs. If the job definition's <code>type</code> parameter is <code>container</code>, then you must specify either <code>containerProperties</code> or <code>nodeProperties</code>. This must not be specified for Amazon EKS based job definitions.</p> <note> <p>If the job runs on Fargate resources, then you must not specify <code>nodeProperties</code>; use only <code>containerProperties</code>.</p> </note>
/// - [`node_properties(NodeProperties)`](crate::client::fluent_builders::RegisterJobDefinition::node_properties) / [`set_node_properties(Option<NodeProperties>)`](crate::client::fluent_builders::RegisterJobDefinition::set_node_properties): <p>An object with various 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 <a href="https://docs.aws.amazon.com/batch/latest/userguide/multi-node-parallel-jobs.html">Multi-node Parallel Jobs</a> in the <i>Batch User Guide</i>. If the job definition's <code>type</code> parameter is <code>container</code>, then you must specify either <code>containerProperties</code> or <code>nodeProperties</code>.</p> <note> <p>If the job runs on Fargate resources, then you must not specify <code>nodeProperties</code>; use <code>containerProperties</code> instead.</p> </note> <note> <p>If the job runs on Amazon EKS resources, then you must not specify <code>nodeProperties</code>.</p> </note>
/// - [`retry_strategy(RetryStrategy)`](crate::client::fluent_builders::RegisterJobDefinition::retry_strategy) / [`set_retry_strategy(Option<RetryStrategy>)`](crate::client::fluent_builders::RegisterJobDefinition::set_retry_strategy): <p>The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a <code>SubmitJob</code> operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.</p>
/// - [`propagate_tags(bool)`](crate::client::fluent_builders::RegisterJobDefinition::propagate_tags) / [`set_propagate_tags(Option<bool>)`](crate::client::fluent_builders::RegisterJobDefinition::set_propagate_tags): <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 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 <code>FAILED</code> state.</p> <note> <p>If the job runs on Amazon EKS resources, then you must not specify <code>propagateTags</code>.</p> </note>
/// - [`timeout(JobTimeout)`](crate::client::fluent_builders::RegisterJobDefinition::timeout) / [`set_timeout(Option<JobTimeout>)`](crate::client::fluent_builders::RegisterJobDefinition::set_timeout): <p>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 <code>SubmitJob</code> operation overrides the timeout configuration defined here. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/job_timeouts.html">Job Timeouts</a> in the <i>Batch User Guide</i>.</p>
/// - [`tags(HashMap<String, String>)`](crate::client::fluent_builders::RegisterJobDefinition::tags) / [`set_tags(Option<HashMap<String, String>>)`](crate::client::fluent_builders::RegisterJobDefinition::set_tags): <p>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 <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging Amazon Web Services Resources</a> in <i>Batch User Guide</i>.</p>
/// - [`platform_capabilities(Vec<PlatformCapability>)`](crate::client::fluent_builders::RegisterJobDefinition::platform_capabilities) / [`set_platform_capabilities(Option<Vec<PlatformCapability>>)`](crate::client::fluent_builders::RegisterJobDefinition::set_platform_capabilities): <p>The platform capabilities required by the job definition. If no value is specified, it defaults to <code>EC2</code>. To run the job on Fargate resources, specify <code>FARGATE</code>.</p> <note> <p>If the job runs on Amazon EKS resources, then you must not specify <code>platformCapabilities</code>.</p> </note>
/// - [`eks_properties(EksProperties)`](crate::client::fluent_builders::RegisterJobDefinition::eks_properties) / [`set_eks_properties(Option<EksProperties>)`](crate::client::fluent_builders::RegisterJobDefinition::set_eks_properties): <p>An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.</p>
/// - On success, responds with [`RegisterJobDefinitionOutput`](crate::output::RegisterJobDefinitionOutput) with field(s):
/// - [`job_definition_name(Option<String>)`](crate::output::RegisterJobDefinitionOutput::job_definition_name): <p>The name of the job definition.</p>
/// - [`job_definition_arn(Option<String>)`](crate::output::RegisterJobDefinitionOutput::job_definition_arn): <p>The Amazon Resource Name (ARN) of the job definition.</p>
/// - [`revision(Option<i32>)`](crate::output::RegisterJobDefinitionOutput::revision): <p>The revision of the job definition.</p>
/// - On failure, responds with [`SdkError<RegisterJobDefinitionError>`](crate::error::RegisterJobDefinitionError)
pub fn register_job_definition(&self) -> fluent_builders::RegisterJobDefinition {
fluent_builders::RegisterJobDefinition::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`SubmitJob`](crate::client::fluent_builders::SubmitJob) operation.
///
/// - The fluent builder is configurable:
/// - [`job_name(impl Into<String>)`](crate::client::fluent_builders::SubmitJob::job_name) / [`set_job_name(Option<String>)`](crate::client::fluent_builders::SubmitJob::set_job_name): <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>
/// - [`job_queue(impl Into<String>)`](crate::client::fluent_builders::SubmitJob::job_queue) / [`set_job_queue(Option<String>)`](crate::client::fluent_builders::SubmitJob::set_job_queue): <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>
/// - [`share_identifier(impl Into<String>)`](crate::client::fluent_builders::SubmitJob::share_identifier) / [`set_share_identifier(Option<String>)`](crate::client::fluent_builders::SubmitJob::set_share_identifier): <p>The share identifier for the job. If the job queue doesn't have a scheduling policy, then this parameter must not be specified. If the job queue has a scheduling policy, then this parameter must be specified.</p>
/// - [`scheduling_priority_override(i32)`](crate::client::fluent_builders::SubmitJob::scheduling_priority_override) / [`set_scheduling_priority_override(Option<i32>)`](crate::client::fluent_builders::SubmitJob::set_scheduling_priority_override): <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.</p> <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
/// - [`array_properties(ArrayProperties)`](crate::client::fluent_builders::SubmitJob::array_properties) / [`set_array_properties(Option<ArrayProperties>)`](crate::client::fluent_builders::SubmitJob::set_array_properties): <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>
/// - [`depends_on(Vec<JobDependency>)`](crate::client::fluent_builders::SubmitJob::depends_on) / [`set_depends_on(Option<Vec<JobDependency>>)`](crate::client::fluent_builders::SubmitJob::set_depends_on): <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>
/// - [`job_definition(impl Into<String>)`](crate::client::fluent_builders::SubmitJob::job_definition) / [`set_job_definition(Option<String>)`](crate::client::fluent_builders::SubmitJob::set_job_definition): <p>The job definition used by this job. This value can be one of <code>name</code>, <code>name:revision</code>, or the Amazon Resource Name (ARN) for the job definition. If <code>name</code> is specified without a revision then the latest active revision is used.</p>
/// - [`parameters(HashMap<String, String>)`](crate::client::fluent_builders::SubmitJob::parameters) / [`set_parameters(Option<HashMap<String, String>>)`](crate::client::fluent_builders::SubmitJob::set_parameters): <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>
/// - [`container_overrides(ContainerOverrides)`](crate::client::fluent_builders::SubmitJob::container_overrides) / [`set_container_overrides(Option<ContainerOverrides>)`](crate::client::fluent_builders::SubmitJob::set_container_overrides): <p>An object with various 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>
/// - [`node_overrides(NodeOverrides)`](crate::client::fluent_builders::SubmitJob::node_overrides) / [`set_node_overrides(Option<NodeOverrides>)`](crate::client::fluent_builders::SubmitJob::set_node_overrides): <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> <p>This parameter isn't applicable to jobs that are running on Fargate resources; use <code>containerOverrides</code> instead.</p> </note>
/// - [`retry_strategy(RetryStrategy)`](crate::client::fluent_builders::SubmitJob::retry_strategy) / [`set_retry_strategy(Option<RetryStrategy>)`](crate::client::fluent_builders::SubmitJob::set_retry_strategy): <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>
/// - [`propagate_tags(bool)`](crate::client::fluent_builders::SubmitJob::propagate_tags) / [`set_propagate_tags(Option<bool>)`](crate::client::fluent_builders::SubmitJob::set_propagate_tags): <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>
/// - [`timeout(JobTimeout)`](crate::client::fluent_builders::SubmitJob::timeout) / [`set_timeout(Option<JobTimeout>)`](crate::client::fluent_builders::SubmitJob::set_timeout): <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>
/// - [`tags(HashMap<String, String>)`](crate::client::fluent_builders::SubmitJob::tags) / [`set_tags(Option<HashMap<String, String>>)`](crate::client::fluent_builders::SubmitJob::set_tags): <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>
/// - [`eks_properties_override(EksPropertiesOverride)`](crate::client::fluent_builders::SubmitJob::eks_properties_override) / [`set_eks_properties_override(Option<EksPropertiesOverride>)`](crate::client::fluent_builders::SubmitJob::set_eks_properties_override): <p>An object that can only be specified for jobs that are run on Amazon EKS resources with various properties that override defaults for the job definition.</p>
/// - On success, responds with [`SubmitJobOutput`](crate::output::SubmitJobOutput) with field(s):
/// - [`job_arn(Option<String>)`](crate::output::SubmitJobOutput::job_arn): <p>The Amazon Resource Name (ARN) for the job.</p>
/// - [`job_name(Option<String>)`](crate::output::SubmitJobOutput::job_name): <p>The name of the job.</p>
/// - [`job_id(Option<String>)`](crate::output::SubmitJobOutput::job_id): <p>The unique identifier for the job.</p>
/// - On failure, responds with [`SdkError<SubmitJobError>`](crate::error::SubmitJobError)
pub fn submit_job(&self) -> fluent_builders::SubmitJob {
fluent_builders::SubmitJob::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`TagResource`](crate::client::fluent_builders::TagResource) operation.
///
/// - The fluent builder is configurable:
/// - [`resource_arn(impl Into<String>)`](crate::client::fluent_builders::TagResource::resource_arn) / [`set_resource_arn(Option<String>)`](crate::client::fluent_builders::TagResource::set_resource_arn): <p>The Amazon Resource Name (ARN) of the resource that tags are added to. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
/// - [`tags(HashMap<String, String>)`](crate::client::fluent_builders::TagResource::tags) / [`set_tags(Option<HashMap<String, String>>)`](crate::client::fluent_builders::TagResource::set_tags): <p>The tags that you apply to the resource 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>
/// - On success, responds with [`TagResourceOutput`](crate::output::TagResourceOutput)
/// - On failure, responds with [`SdkError<TagResourceError>`](crate::error::TagResourceError)
pub fn tag_resource(&self) -> fluent_builders::TagResource {
fluent_builders::TagResource::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`TerminateJob`](crate::client::fluent_builders::TerminateJob) operation.
///
/// - The fluent builder is configurable:
/// - [`job_id(impl Into<String>)`](crate::client::fluent_builders::TerminateJob::job_id) / [`set_job_id(Option<String>)`](crate::client::fluent_builders::TerminateJob::set_job_id): <p>The Batch job ID of the job to terminate.</p>
/// - [`reason(impl Into<String>)`](crate::client::fluent_builders::TerminateJob::reason) / [`set_reason(Option<String>)`](crate::client::fluent_builders::TerminateJob::set_reason): <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. This message is also recorded in the Batch activity logs.</p>
/// - On success, responds with [`TerminateJobOutput`](crate::output::TerminateJobOutput)
/// - On failure, responds with [`SdkError<TerminateJobError>`](crate::error::TerminateJobError)
pub fn terminate_job(&self) -> fluent_builders::TerminateJob {
fluent_builders::TerminateJob::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`UntagResource`](crate::client::fluent_builders::UntagResource) operation.
///
/// - The fluent builder is configurable:
/// - [`resource_arn(impl Into<String>)`](crate::client::fluent_builders::UntagResource::resource_arn) / [`set_resource_arn(Option<String>)`](crate::client::fluent_builders::UntagResource::set_resource_arn): <p>The Amazon Resource Name (ARN) of the resource from which to delete tags. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
/// - [`tag_keys(Vec<String>)`](crate::client::fluent_builders::UntagResource::tag_keys) / [`set_tag_keys(Option<Vec<String>>)`](crate::client::fluent_builders::UntagResource::set_tag_keys): <p>The keys of the tags to be removed.</p>
/// - On success, responds with [`UntagResourceOutput`](crate::output::UntagResourceOutput)
/// - On failure, responds with [`SdkError<UntagResourceError>`](crate::error::UntagResourceError)
pub fn untag_resource(&self) -> fluent_builders::UntagResource {
fluent_builders::UntagResource::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`UpdateComputeEnvironment`](crate::client::fluent_builders::UpdateComputeEnvironment) operation.
///
/// - The fluent builder is configurable:
/// - [`compute_environment(impl Into<String>)`](crate::client::fluent_builders::UpdateComputeEnvironment::compute_environment) / [`set_compute_environment(Option<String>)`](crate::client::fluent_builders::UpdateComputeEnvironment::set_compute_environment): <p>The name or full Amazon Resource Name (ARN) of the compute environment to update.</p>
/// - [`state(CeState)`](crate::client::fluent_builders::UpdateComputeEnvironment::state) / [`set_state(Option<CeState>)`](crate::client::fluent_builders::UpdateComputeEnvironment::set_state): <p>The state of the compute environment. Compute environments in the <code>ENABLED</code> state can accept jobs from a queue and scale in or out automatically based on the workload demand of its associated queues.</p> <p>If the state is <code>ENABLED</code>, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.</p> <p>If the state is <code>DISABLED</code>, then the Batch scheduler doesn't attempt to place jobs within the environment. Jobs in a <code>STARTING</code> or <code>RUNNING</code> state continue to progress normally. Managed compute environments in the <code>DISABLED</code> state don't scale out. However, they scale in to <code>minvCpus</code> value after instances become idle.</p>
/// - [`unmanagedv_cpus(i32)`](crate::client::fluent_builders::UpdateComputeEnvironment::unmanagedv_cpus) / [`set_unmanagedv_cpus(Option<i32>)`](crate::client::fluent_builders::UpdateComputeEnvironment::set_unmanagedv_cpus): <p>The maximum number of vCPUs expected to be used for an unmanaged compute environment. Don't specify this parameter for a managed compute environment. This parameter is only used for fair share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn't provided for a fair share job queue, no vCPU capacity is reserved.</p>
/// - [`compute_resources(ComputeResourceUpdate)`](crate::client::fluent_builders::UpdateComputeEnvironment::compute_resources) / [`set_compute_resources(Option<ComputeResourceUpdate>)`](crate::client::fluent_builders::UpdateComputeEnvironment::set_compute_resources): <p>Details of the compute resources managed by the compute environment. Required for a managed compute environment. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>Batch User Guide</i>.</p>
/// - [`service_role(impl Into<String>)`](crate::client::fluent_builders::UpdateComputeEnvironment::service_role) / [`set_service_role(Option<String>)`](crate::client::fluent_builders::UpdateComputeEnvironment::set_service_role): <p>The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html">Batch service IAM role</a> in the <i>Batch User Guide</i>.</p> <important> <p>If the compute environment has a service-linked role, it can't be changed to use a regular IAM role. Likewise, if the compute environment has a regular IAM role, it can't be changed to use a service-linked role. To update the parameters for the compute environment that require an infrastructure update to change, the <b>AWSServiceRoleForBatch</b> service-linked role must be used. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html">Updating compute environments</a> in the <i>Batch User Guide</i>.</p> </important> <p>If your specified role has a path other than <code>/</code>, then you must either specify the full role ARN (recommended) or prefix the role name with the path.</p> <note> <p>Depending on how you created your Batch service role, its ARN might contain the <code>service-role</code> path prefix. When you only specify the name of the service role, Batch assumes that your ARN doesn't use the <code>service-role</code> path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.</p> </note>
/// - [`update_policy(UpdatePolicy)`](crate::client::fluent_builders::UpdateComputeEnvironment::update_policy) / [`set_update_policy(Option<UpdatePolicy>)`](crate::client::fluent_builders::UpdateComputeEnvironment::set_update_policy): <p>Specifies the updated infrastructure update policy for the compute environment. For more information about infrastructure updates, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>
/// - On success, responds with [`UpdateComputeEnvironmentOutput`](crate::output::UpdateComputeEnvironmentOutput) with field(s):
/// - [`compute_environment_name(Option<String>)`](crate::output::UpdateComputeEnvironmentOutput::compute_environment_name): <p>The name of the compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
/// - [`compute_environment_arn(Option<String>)`](crate::output::UpdateComputeEnvironmentOutput::compute_environment_arn): <p>The Amazon Resource Name (ARN) of the compute environment.</p>
/// - On failure, responds with [`SdkError<UpdateComputeEnvironmentError>`](crate::error::UpdateComputeEnvironmentError)
pub fn update_compute_environment(&self) -> fluent_builders::UpdateComputeEnvironment {
fluent_builders::UpdateComputeEnvironment::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`UpdateJobQueue`](crate::client::fluent_builders::UpdateJobQueue) operation.
///
/// - The fluent builder is configurable:
/// - [`job_queue(impl Into<String>)`](crate::client::fluent_builders::UpdateJobQueue::job_queue) / [`set_job_queue(Option<String>)`](crate::client::fluent_builders::UpdateJobQueue::set_job_queue): <p>The name or the Amazon Resource Name (ARN) of the job queue.</p>
/// - [`state(JqState)`](crate::client::fluent_builders::UpdateJobQueue::state) / [`set_state(Option<JqState>)`](crate::client::fluent_builders::UpdateJobQueue::set_state): <p>Describes the queue's ability to accept new jobs. If the job queue state is <code>ENABLED</code>, it can accept jobs. If the job queue state is <code>DISABLED</code>, new jobs can't be added to the queue, but jobs already in the queue can finish.</p>
/// - [`scheduling_policy_arn(impl Into<String>)`](crate::client::fluent_builders::UpdateJobQueue::scheduling_policy_arn) / [`set_scheduling_policy_arn(Option<String>)`](crate::client::fluent_builders::UpdateJobQueue::set_scheduling_policy_arn): <p>Amazon Resource Name (ARN) of the fair share scheduling policy. Once a job queue is created, the fair share scheduling policy can be replaced but not removed. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. For example, <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>
/// - [`priority(i32)`](crate::client::fluent_builders::UpdateJobQueue::priority) / [`set_priority(Option<i32>)`](crate::client::fluent_builders::UpdateJobQueue::set_priority): <p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>). EC2 and Fargate compute environments can't be mixed.</p>
/// - [`compute_environment_order(Vec<ComputeEnvironmentOrder>)`](crate::client::fluent_builders::UpdateJobQueue::compute_environment_order) / [`set_compute_environment_order(Option<Vec<ComputeEnvironmentOrder>>)`](crate::client::fluent_builders::UpdateJobQueue::set_compute_environment_order): <p>Details the set of compute environments mapped to a job queue and their order relative to each other. This is one of the parameters used by the job scheduler to determine which compute environment runs a given job. Compute environments must be in the <code>VALID</code> state before you can associate them with a job queue. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>). EC2 and Fargate compute environments can't be mixed.</p> <note> <p>All compute environments that are associated with a job queue must share the same architecture. Batch doesn't support mixing compute environment architecture types in a single job queue.</p> </note>
/// - On success, responds with [`UpdateJobQueueOutput`](crate::output::UpdateJobQueueOutput) with field(s):
/// - [`job_queue_name(Option<String>)`](crate::output::UpdateJobQueueOutput::job_queue_name): <p>The name of the job queue.</p>
/// - [`job_queue_arn(Option<String>)`](crate::output::UpdateJobQueueOutput::job_queue_arn): <p>The Amazon Resource Name (ARN) of the job queue.</p>
/// - On failure, responds with [`SdkError<UpdateJobQueueError>`](crate::error::UpdateJobQueueError)
pub fn update_job_queue(&self) -> fluent_builders::UpdateJobQueue {
fluent_builders::UpdateJobQueue::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`UpdateSchedulingPolicy`](crate::client::fluent_builders::UpdateSchedulingPolicy) operation.
///
/// - The fluent builder is configurable:
/// - [`arn(impl Into<String>)`](crate::client::fluent_builders::UpdateSchedulingPolicy::arn) / [`set_arn(Option<String>)`](crate::client::fluent_builders::UpdateSchedulingPolicy::set_arn): <p>The Amazon Resource Name (ARN) of the scheduling policy to update.</p>
/// - [`fairshare_policy(FairsharePolicy)`](crate::client::fluent_builders::UpdateSchedulingPolicy::fairshare_policy) / [`set_fairshare_policy(Option<FairsharePolicy>)`](crate::client::fluent_builders::UpdateSchedulingPolicy::set_fairshare_policy): <p>The fair share policy.</p>
/// - On success, responds with [`UpdateSchedulingPolicyOutput`](crate::output::UpdateSchedulingPolicyOutput)
/// - On failure, responds with [`SdkError<UpdateSchedulingPolicyError>`](crate::error::UpdateSchedulingPolicyError)
pub fn update_scheduling_policy(&self) -> fluent_builders::UpdateSchedulingPolicy {
fluent_builders::UpdateSchedulingPolicy::new(self.handle.clone())
}
}
pub mod fluent_builders {
//! Utilities to ergonomically construct a request to the service.
//!
//! Fluent builders are created through the [`Client`](crate::client::Client) by calling
//! one if its operation methods. After parameters are set using the builder methods,
//! the `send` method can be called to initiate the request.
/// Fluent builder constructing a request to `CancelJob`.
///
/// <p>Cancels a job in an Batch job queue. Jobs that are in the <code>SUBMITTED</code>, <code>PENDING</code>, or <code>RUNNABLE</code> state are canceled. Jobs that progressed to the <code>STARTING</code> or <code>RUNNING</code> state aren't canceled. However, the API operation still succeeds, even if no job is canceled. These jobs must be terminated with the <code>TerminateJob</code> operation.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CancelJob {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::cancel_job_input::Builder,
}
impl CancelJob {
/// Creates a new `CancelJob`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::CancelJob,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::CancelJobError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::CancelJobOutput,
aws_smithy_http::result::SdkError<crate::error::CancelJobError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The Batch job ID of the job to cancel.</p>
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_id(input.into());
self
}
/// <p>The Batch job ID of the job to cancel.</p>
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_job_id(input);
self
}
/// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. This message is also recorded in the Batch activity logs.</p>
pub fn reason(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.reason(input.into());
self
}
/// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. This message is also recorded in the Batch activity logs.</p>
pub fn set_reason(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_reason(input);
self
}
}
/// Fluent builder constructing a request to `CreateComputeEnvironment`.
///
/// <p>Creates an Batch compute environment. You can create <code>MANAGED</code> or <code>UNMANAGED</code> compute environments. <code>MANAGED</code> compute environments can use Amazon EC2 or Fargate resources. <code>UNMANAGED</code> compute environments can only use EC2 resources.</p>
/// <p>In a managed compute environment, Batch manages the capacity and instance types of the compute resources within the environment. This is based on the compute resource specification that you define or the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html">launch template</a> that you specify when you create the compute environment. Either, you can choose to use EC2 On-Demand Instances and EC2 Spot Instances. Or, you can use Fargate and Fargate Spot capacity in your managed compute environment. You can optionally set a maximum price so that Spot Instances only launch when the Spot Instance price is less than a specified percentage of the On-Demand price.</p> <note>
/// <p>Multi-node parallel jobs aren't supported on Spot Instances.</p>
/// </note>
/// <p>In an unmanaged compute environment, you can manage your own EC2 compute resources and have flexibility with how you configure your compute resources. For example, you can use custom AMIs. However, you must verify that each of your AMIs meet the Amazon ECS container instance AMI specification. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container_instance_AMIs.html">container instance AMIs</a> in the <i>Amazon Elastic Container Service Developer Guide</i>. After you created your unmanaged compute environment, you can use the <code>DescribeComputeEnvironments</code> operation to find the Amazon ECS cluster that's associated with it. Then, launch your container instances into that Amazon ECS cluster. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html">Launching an Amazon ECS container instance</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> <note>
/// <p>To create a compute environment that uses EKS resources, the caller must have permissions to call <code>eks:DescribeCluster</code>.</p>
/// </note> <note>
/// <p>Batch doesn't automatically upgrade the AMIs in a compute environment after it's created. For example, it also doesn't update the AMIs in your compute environment when a newer version of the Amazon ECS optimized AMI is available. You're responsible for the management of the guest operating system. This includes any updates and security patches. You're also responsible for any additional application software or utilities that you install on the compute resources. There are two ways to use a new AMI for your Batch jobs. The original method is to complete these steps:</p>
/// <ol>
/// <li> <p>Create a new compute environment with the new AMI.</p> </li>
/// <li> <p>Add the compute environment to an existing job queue.</p> </li>
/// <li> <p>Remove the earlier compute environment from your job queue.</p> </li>
/// <li> <p>Delete the earlier compute environment.</p> </li>
/// </ol>
/// <p>In April 2022, Batch added enhanced support for updating compute environments. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html">Updating compute environments</a>. To use the enhanced updating of compute environments to update AMIs, follow these rules:</p>
/// <ul>
/// <li> <p>Either don't set the service role (<code>serviceRole</code>) parameter or set it to the <b>AWSBatchServiceRole</b> service-linked role.</p> </li>
/// <li> <p>Set the allocation strategy (<code>allocationStrategy</code>) parameter to <code>BEST_FIT_PROGRESSIVE</code> or <code>SPOT_CAPACITY_OPTIMIZED</code>.</p> </li>
/// <li> <p>Set the update to latest image version (<code>updateToLatestImageVersion</code>) parameter to <code>true</code>.</p> </li>
/// <li> <p>Don't specify an AMI ID in <code>imageId</code>, <code>imageIdOverride</code> (in <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_Ec2Configuration.html"> <code>ec2Configuration</code> </a>), or in the launch template (<code>launchTemplate</code>). In that case, Batch selects the latest Amazon ECS optimized AMI that's supported by Batch at the time the infrastructure update is initiated. Alternatively, you can specify the AMI ID in the <code>imageId</code> or <code>imageIdOverride</code> parameters, or the launch template identified by the <code>LaunchTemplate</code> properties. Changing any of these properties starts an infrastructure update. If the AMI ID is specified in the launch template, it can't be replaced by specifying an AMI ID in either the <code>imageId</code> or <code>imageIdOverride</code> parameters. It can only be replaced by specifying a different launch template, or if the launch template version is set to <code>$Default</code> or <code>$Latest</code>, by setting either a new default version for the launch template (if <code>$Default</code>) or by adding a new version to the launch template (if <code>$Latest</code>).</p> </li>
/// </ul>
/// <p>If these rules are followed, any update that starts an infrastructure update causes the AMI ID to be re-selected. If the <code>version</code> setting in the launch template (<code>launchTemplate</code>) is set to <code>$Latest</code> or <code>$Default</code>, the latest or default version of the launch template is evaluated up at the time of the infrastructure update, even if the <code>launchTemplate</code> wasn't updated.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CreateComputeEnvironment {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::create_compute_environment_input::Builder,
}
impl CreateComputeEnvironment {
/// Creates a new `CreateComputeEnvironment`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::CreateComputeEnvironment,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::CreateComputeEnvironmentError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::CreateComputeEnvironmentOutput,
aws_smithy_http::result::SdkError<crate::error::CreateComputeEnvironmentError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The name for your compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
pub fn compute_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.compute_environment_name(input.into());
self
}
/// <p>The name for your compute environment. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
pub fn set_compute_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_compute_environment_name(input);
self
}
/// <p>The type of the compute environment: <code>MANAGED</code> or <code>UNMANAGED</code>. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>Batch User Guide</i>.</p>
pub fn r#type(mut self, input: crate::model::CeType) -> Self {
self.inner = self.inner.r#type(input);
self
}
/// <p>The type of the compute environment: <code>MANAGED</code> or <code>UNMANAGED</code>. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>Batch User Guide</i>.</p>
pub fn set_type(mut self, input: std::option::Option<crate::model::CeType>) -> Self {
self.inner = self.inner.set_type(input);
self
}
/// <p>The state of the compute environment. If the state is <code>ENABLED</code>, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.</p>
/// <p>If the state is <code>ENABLED</code>, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.</p>
/// <p>If the state is <code>DISABLED</code>, then the Batch scheduler doesn't attempt to place jobs within the environment. Jobs in a <code>STARTING</code> or <code>RUNNING</code> state continue to progress normally. Managed compute environments in the <code>DISABLED</code> state don't scale out. However, they scale in to <code>minvCpus</code> value after instances become idle.</p>
pub fn state(mut self, input: crate::model::CeState) -> Self {
self.inner = self.inner.state(input);
self
}
/// <p>The state of the compute environment. If the state is <code>ENABLED</code>, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.</p>
/// <p>If the state is <code>ENABLED</code>, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.</p>
/// <p>If the state is <code>DISABLED</code>, then the Batch scheduler doesn't attempt to place jobs within the environment. Jobs in a <code>STARTING</code> or <code>RUNNING</code> state continue to progress normally. Managed compute environments in the <code>DISABLED</code> state don't scale out. However, they scale in to <code>minvCpus</code> value after instances become idle.</p>
pub fn set_state(mut self, input: std::option::Option<crate::model::CeState>) -> Self {
self.inner = self.inner.set_state(input);
self
}
/// <p>The maximum number of vCPUs for an unmanaged compute environment. This parameter is only used for fair share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn't provided for a fair share job queue, no vCPU capacity is reserved.</p> <note>
/// <p>This parameter is only supported when the <code>type</code> parameter is set to <code>UNMANAGED</code>.</p>
/// </note>
pub fn unmanagedv_cpus(mut self, input: i32) -> Self {
self.inner = self.inner.unmanagedv_cpus(input);
self
}
/// <p>The maximum number of vCPUs for an unmanaged compute environment. This parameter is only used for fair share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn't provided for a fair share job queue, no vCPU capacity is reserved.</p> <note>
/// <p>This parameter is only supported when the <code>type</code> parameter is set to <code>UNMANAGED</code>.</p>
/// </note>
pub fn set_unmanagedv_cpus(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_unmanagedv_cpus(input);
self
}
/// <p>Details about the compute resources managed by the compute environment. This parameter is required for managed compute environments. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>Batch User Guide</i>.</p>
pub fn compute_resources(mut self, input: crate::model::ComputeResource) -> Self {
self.inner = self.inner.compute_resources(input);
self
}
/// <p>Details about the compute resources managed by the compute environment. This parameter is required for managed compute environments. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>Batch User Guide</i>.</p>
pub fn set_compute_resources(
mut self,
input: std::option::Option<crate::model::ComputeResource>,
) -> Self {
self.inner = self.inner.set_compute_resources(input);
self
}
/// <p>The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html">Batch service IAM role</a> in the <i>Batch User Guide</i>.</p> <important>
/// <p>If your account already created the Batch service-linked role, that role is used by default for your compute environment unless you specify a different role here. If the Batch service-linked role doesn't exist in your account, and no role is specified here, the service attempts to create the Batch service-linked role in your account.</p>
/// </important>
/// <p>If your specified role has a path other than <code>/</code>, then you must specify either the full role ARN (recommended) or prefix the role name with the path. For example, if a role with the name <code>bar</code> has a path of <code>/foo/</code>, specify <code>/foo/bar</code> as the role name. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names">Friendly names and paths</a> in the <i>IAM User Guide</i>.</p> <note>
/// <p>Depending on how you created your Batch service role, its ARN might contain the <code>service-role</code> path prefix. When you only specify the name of the service role, Batch assumes that your ARN doesn't use the <code>service-role</code> path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.</p>
/// </note>
pub fn service_role(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.service_role(input.into());
self
}
/// <p>The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html">Batch service IAM role</a> in the <i>Batch User Guide</i>.</p> <important>
/// <p>If your account already created the Batch service-linked role, that role is used by default for your compute environment unless you specify a different role here. If the Batch service-linked role doesn't exist in your account, and no role is specified here, the service attempts to create the Batch service-linked role in your account.</p>
/// </important>
/// <p>If your specified role has a path other than <code>/</code>, then you must specify either the full role ARN (recommended) or prefix the role name with the path. For example, if a role with the name <code>bar</code> has a path of <code>/foo/</code>, specify <code>/foo/bar</code> as the role name. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names">Friendly names and paths</a> in the <i>IAM User Guide</i>.</p> <note>
/// <p>Depending on how you created your Batch service role, its ARN might contain the <code>service-role</code> path prefix. When you only specify the name of the service role, Batch assumes that your ARN doesn't use the <code>service-role</code> path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.</p>
/// </note>
pub fn set_service_role(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_service_role(input);
self
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags that you apply to the compute environment 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>
/// <p>These tags can be updated or removed using the <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html">TagResource</a> and <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html">UntagResource</a> API operations. These tags don't propagate to the underlying compute resources.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k.into(), v.into());
self
}
/// <p>The tags that you apply to the compute environment 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>
/// <p>These tags can be updated or removed using the <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html">TagResource</a> and <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html">UntagResource</a> API operations. These tags don't propagate to the underlying compute resources.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <p>The details for the Amazon EKS cluster that supports the compute environment.</p>
pub fn eks_configuration(mut self, input: crate::model::EksConfiguration) -> Self {
self.inner = self.inner.eks_configuration(input);
self
}
/// <p>The details for the Amazon EKS cluster that supports the compute environment.</p>
pub fn set_eks_configuration(
mut self,
input: std::option::Option<crate::model::EksConfiguration>,
) -> Self {
self.inner = self.inner.set_eks_configuration(input);
self
}
}
/// Fluent builder constructing a request to `CreateJobQueue`.
///
/// <p>Creates an Batch job queue. When you create a job queue, you associate one or more compute environments to the queue and assign an order of preference for the compute environments.</p>
/// <p>You also set a priority to the job queue that determines the order that the Batch scheduler places jobs onto its associated compute environments. For example, if a compute environment is associated with more than one job queue, the job queue with a higher priority is given preference for scheduling jobs to that compute environment.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CreateJobQueue {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::create_job_queue_input::Builder,
}
impl CreateJobQueue {
/// Creates a new `CreateJobQueue`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::CreateJobQueue,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::CreateJobQueueError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::CreateJobQueueOutput,
aws_smithy_http::result::SdkError<crate::error::CreateJobQueueError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The name of the job queue. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
pub fn job_queue_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_queue_name(input.into());
self
}
/// <p>The name of the job queue. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
pub fn set_job_queue_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_job_queue_name(input);
self
}
/// <p>The state of the job queue. If the job queue state is <code>ENABLED</code>, it is able to accept jobs. If the job queue state is <code>DISABLED</code>, new jobs can't be added to the queue, but jobs already in the queue can finish.</p>
pub fn state(mut self, input: crate::model::JqState) -> Self {
self.inner = self.inner.state(input);
self
}
/// <p>The state of the job queue. If the job queue state is <code>ENABLED</code>, it is able to accept jobs. If the job queue state is <code>DISABLED</code>, new jobs can't be added to the queue, but jobs already in the queue can finish.</p>
pub fn set_state(mut self, input: std::option::Option<crate::model::JqState>) -> Self {
self.inner = self.inner.set_state(input);
self
}
/// <p>The Amazon Resource Name (ARN) of the fair share scheduling policy. If this parameter is specified, the job queue uses a fair share scheduling policy. If this parameter isn't specified, the job queue uses a first in, first out (FIFO) scheduling policy. After a job queue is created, you can replace but can't remove the fair share scheduling policy. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. An example is <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>
pub fn scheduling_policy_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.scheduling_policy_arn(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the fair share scheduling policy. If this parameter is specified, the job queue uses a fair share scheduling policy. If this parameter isn't specified, the job queue uses a first in, first out (FIFO) scheduling policy. After a job queue is created, you can replace but can't remove the fair share scheduling policy. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. An example is <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>
pub fn set_scheduling_policy_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_scheduling_policy_arn(input);
self
}
/// <p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>); EC2 and Fargate compute environments can't be mixed.</p>
pub fn priority(mut self, input: i32) -> Self {
self.inner = self.inner.priority(input);
self
}
/// <p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>); EC2 and Fargate compute environments can't be mixed.</p>
pub fn set_priority(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_priority(input);
self
}
/// Appends an item to `computeEnvironmentOrder`.
///
/// To override the contents of this collection use [`set_compute_environment_order`](Self::set_compute_environment_order).
///
/// <p>The set of compute environments mapped to a job queue and their order relative to each other. The job scheduler uses this parameter to determine which compute environment runs a specific job. Compute environments must be in the <code>VALID</code> state before you can associate them with a job queue. You can associate up to three compute environments with a job queue. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>); EC2 and Fargate compute environments can't be mixed.</p> <note>
/// <p>All compute environments that are associated with a job queue must share the same architecture. Batch doesn't support mixing compute environment architecture types in a single job queue.</p>
/// </note>
pub fn compute_environment_order(
mut self,
input: crate::model::ComputeEnvironmentOrder,
) -> Self {
self.inner = self.inner.compute_environment_order(input);
self
}
/// <p>The set of compute environments mapped to a job queue and their order relative to each other. The job scheduler uses this parameter to determine which compute environment runs a specific job. Compute environments must be in the <code>VALID</code> state before you can associate them with a job queue. You can associate up to three compute environments with a job queue. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>); EC2 and Fargate compute environments can't be mixed.</p> <note>
/// <p>All compute environments that are associated with a job queue must share the same architecture. Batch doesn't support mixing compute environment architecture types in a single job queue.</p>
/// </note>
pub fn set_compute_environment_order(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ComputeEnvironmentOrder>>,
) -> Self {
self.inner = self.inner.set_compute_environment_order(input);
self
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags that you apply to the job queue 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/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k.into(), v.into());
self
}
/// <p>The tags that you apply to the job queue 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/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `CreateSchedulingPolicy`.
///
/// <p>Creates an Batch scheduling policy.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CreateSchedulingPolicy {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::create_scheduling_policy_input::Builder,
}
impl CreateSchedulingPolicy {
/// Creates a new `CreateSchedulingPolicy`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::CreateSchedulingPolicy,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::CreateSchedulingPolicyError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::CreateSchedulingPolicyOutput,
aws_smithy_http::result::SdkError<crate::error::CreateSchedulingPolicyError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The name of the scheduling policy. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.name(input.into());
self
}
/// <p>The name of the scheduling policy. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_name(input);
self
}
/// <p>The fair share policy of the scheduling policy.</p>
pub fn fairshare_policy(mut self, input: crate::model::FairsharePolicy) -> Self {
self.inner = self.inner.fairshare_policy(input);
self
}
/// <p>The fair share policy of the scheduling policy.</p>
pub fn set_fairshare_policy(
mut self,
input: std::option::Option<crate::model::FairsharePolicy>,
) -> Self {
self.inner = self.inner.set_fairshare_policy(input);
self
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags that you apply to the scheduling policy 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>
/// <p>These tags can be updated or removed using the <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html">TagResource</a> and <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html">UntagResource</a> API operations.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k.into(), v.into());
self
}
/// <p>The tags that you apply to the scheduling policy 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>
/// <p>These tags can be updated or removed using the <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html">TagResource</a> and <a href="https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html">UntagResource</a> API operations.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `DeleteComputeEnvironment`.
///
/// <p>Deletes an Batch compute environment.</p>
/// <p>Before you can delete a compute environment, you must set its state to <code>DISABLED</code> with the <code>UpdateComputeEnvironment</code> API operation and disassociate it from any job queues with the <code>UpdateJobQueue</code> API operation. Compute environments that use Fargate resources must terminate all active jobs on that compute environment before deleting the compute environment. If this isn't done, the compute environment enters an invalid state.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteComputeEnvironment {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::delete_compute_environment_input::Builder,
}
impl DeleteComputeEnvironment {
/// Creates a new `DeleteComputeEnvironment`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::DeleteComputeEnvironment,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::DeleteComputeEnvironmentError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteComputeEnvironmentOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteComputeEnvironmentError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The name or Amazon Resource Name (ARN) of the compute environment to delete.</p>
pub fn compute_environment(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.compute_environment(input.into());
self
}
/// <p>The name or Amazon Resource Name (ARN) of the compute environment to delete.</p>
pub fn set_compute_environment(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_compute_environment(input);
self
}
}
/// Fluent builder constructing a request to `DeleteJobQueue`.
///
/// <p>Deletes the specified job queue. You must first disable submissions for a queue with the <code>UpdateJobQueue</code> operation. All jobs in the queue are eventually terminated when you delete a job queue. The jobs are terminated at a rate of about 16 jobs each second.</p>
/// <p>It's not necessary to disassociate compute environments from a queue before submitting a <code>DeleteJobQueue</code> request.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteJobQueue {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::delete_job_queue_input::Builder,
}
impl DeleteJobQueue {
/// Creates a new `DeleteJobQueue`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::DeleteJobQueue,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::DeleteJobQueueError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteJobQueueOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteJobQueueError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The short name or full Amazon Resource Name (ARN) of the queue to delete.</p>
pub fn job_queue(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_queue(input.into());
self
}
/// <p>The short name or full Amazon Resource Name (ARN) of the queue to delete.</p>
pub fn set_job_queue(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_job_queue(input);
self
}
}
/// Fluent builder constructing a request to `DeleteSchedulingPolicy`.
///
/// <p>Deletes the specified scheduling policy.</p>
/// <p>You can't delete a scheduling policy that's used in any job queues.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteSchedulingPolicy {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::delete_scheduling_policy_input::Builder,
}
impl DeleteSchedulingPolicy {
/// Creates a new `DeleteSchedulingPolicy`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::DeleteSchedulingPolicy,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::DeleteSchedulingPolicyError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteSchedulingPolicyOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteSchedulingPolicyError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The Amazon Resource Name (ARN) of the scheduling policy to delete.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.arn(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the scheduling policy to delete.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_arn(input);
self
}
}
/// Fluent builder constructing a request to `DeregisterJobDefinition`.
///
/// <p>Deregisters an Batch job definition. Job definitions are permanently deleted after 180 days.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeregisterJobDefinition {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::deregister_job_definition_input::Builder,
}
impl DeregisterJobDefinition {
/// Creates a new `DeregisterJobDefinition`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::DeregisterJobDefinition,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::DeregisterJobDefinitionError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeregisterJobDefinitionOutput,
aws_smithy_http::result::SdkError<crate::error::DeregisterJobDefinitionError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The name and revision (<code>name:revision</code>) or full Amazon Resource Name (ARN) of the job definition to deregister.</p>
pub fn job_definition(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_definition(input.into());
self
}
/// <p>The name and revision (<code>name:revision</code>) or full Amazon Resource Name (ARN) of the job definition to deregister.</p>
pub fn set_job_definition(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_job_definition(input);
self
}
}
/// Fluent builder constructing a request to `DescribeComputeEnvironments`.
///
/// <p>Describes one or more of your compute environments.</p>
/// <p>If you're using an unmanaged compute environment, you can use the <code>DescribeComputeEnvironment</code> operation to determine the <code>ecsClusterArn</code> that you launch your Amazon ECS container instances into.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeComputeEnvironments {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::describe_compute_environments_input::Builder,
}
impl DescribeComputeEnvironments {
/// Creates a new `DescribeComputeEnvironments`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::DescribeComputeEnvironments,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::DescribeComputeEnvironmentsError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeComputeEnvironmentsOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeComputeEnvironmentsError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeComputeEnvironmentsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::DescribeComputeEnvironmentsPaginator {
crate::paginator::DescribeComputeEnvironmentsPaginator::new(self.handle, self.inner)
}
/// Appends an item to `computeEnvironments`.
///
/// To override the contents of this collection use [`set_compute_environments`](Self::set_compute_environments).
///
/// <p>A list of up to 100 compute environment names or full Amazon Resource Name (ARN) entries.</p>
pub fn compute_environments(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.compute_environments(input.into());
self
}
/// <p>A list of up to 100 compute environment names or full Amazon Resource Name (ARN) entries.</p>
pub fn set_compute_environments(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_compute_environments(input);
self
}
/// <p>The maximum number of cluster results returned by <code>DescribeComputeEnvironments</code> in paginated output. When this parameter is used, <code>DescribeComputeEnvironments</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeComputeEnvironments</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeComputeEnvironments</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of cluster results returned by <code>DescribeComputeEnvironments</code> in paginated output. When this parameter is used, <code>DescribeComputeEnvironments</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeComputeEnvironments</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeComputeEnvironments</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeComputeEnvironments</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note>
/// <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p>
/// </note>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeComputeEnvironments</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note>
/// <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p>
/// </note>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `DescribeJobDefinitions`.
///
/// <p>Describes a list of job definitions. You can specify a <code>status</code> (such as <code>ACTIVE</code>) to only return job definitions that match that status.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeJobDefinitions {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::describe_job_definitions_input::Builder,
}
impl DescribeJobDefinitions {
/// Creates a new `DescribeJobDefinitions`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::DescribeJobDefinitions,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::DescribeJobDefinitionsError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeJobDefinitionsOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeJobDefinitionsError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeJobDefinitionsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::DescribeJobDefinitionsPaginator {
crate::paginator::DescribeJobDefinitionsPaginator::new(self.handle, self.inner)
}
/// Appends an item to `jobDefinitions`.
///
/// To override the contents of this collection use [`set_job_definitions`](Self::set_job_definitions).
///
/// <p>A list of up to 100 job definitions. Each entry in the list can either be an ARN in the format <code>arn:aws:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision}</code> or a short version using the form <code>${JobDefinitionName}:${Revision}</code>.</p>
pub fn job_definitions(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_definitions(input.into());
self
}
/// <p>A list of up to 100 job definitions. Each entry in the list can either be an ARN in the format <code>arn:aws:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision}</code> or a short version using the form <code>${JobDefinitionName}:${Revision}</code>.</p>
pub fn set_job_definitions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_job_definitions(input);
self
}
/// <p>The maximum number of results returned by <code>DescribeJobDefinitions</code> in paginated output. When this parameter is used, <code>DescribeJobDefinitions</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeJobDefinitions</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeJobDefinitions</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of results returned by <code>DescribeJobDefinitions</code> in paginated output. When this parameter is used, <code>DescribeJobDefinitions</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeJobDefinitions</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeJobDefinitions</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The name of the job definition to describe.</p>
pub fn job_definition_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_definition_name(input.into());
self
}
/// <p>The name of the job definition to describe.</p>
pub fn set_job_definition_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_job_definition_name(input);
self
}
/// <p>The status used to filter job definitions.</p>
pub fn status(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.status(input.into());
self
}
/// <p>The status used to filter job definitions.</p>
pub fn set_status(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_status(input);
self
}
/// <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeJobDefinitions</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note>
/// <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p>
/// </note>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeJobDefinitions</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note>
/// <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p>
/// </note>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `DescribeJobQueues`.
///
/// <p>Describes one or more of your job queues.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeJobQueues {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::describe_job_queues_input::Builder,
}
impl DescribeJobQueues {
/// Creates a new `DescribeJobQueues`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::DescribeJobQueues,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::DescribeJobQueuesError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeJobQueuesOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeJobQueuesError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeJobQueuesPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::DescribeJobQueuesPaginator {
crate::paginator::DescribeJobQueuesPaginator::new(self.handle, self.inner)
}
/// Appends an item to `jobQueues`.
///
/// To override the contents of this collection use [`set_job_queues`](Self::set_job_queues).
///
/// <p>A list of up to 100 queue names or full queue Amazon Resource Name (ARN) entries.</p>
pub fn job_queues(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_queues(input.into());
self
}
/// <p>A list of up to 100 queue names or full queue Amazon Resource Name (ARN) entries.</p>
pub fn set_job_queues(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_job_queues(input);
self
}
/// <p>The maximum number of results returned by <code>DescribeJobQueues</code> in paginated output. When this parameter is used, <code>DescribeJobQueues</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeJobQueues</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeJobQueues</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of results returned by <code>DescribeJobQueues</code> in paginated output. When this parameter is used, <code>DescribeJobQueues</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeJobQueues</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeJobQueues</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeJobQueues</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note>
/// <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p>
/// </note>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeJobQueues</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note>
/// <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p>
/// </note>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `DescribeJobs`.
///
/// <p>Describes a list of Batch jobs.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeJobs {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::describe_jobs_input::Builder,
}
impl DescribeJobs {
/// Creates a new `DescribeJobs`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::DescribeJobs,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::DescribeJobsError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeJobsOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeJobsError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Appends an item to `jobs`.
///
/// To override the contents of this collection use [`set_jobs`](Self::set_jobs).
///
/// <p>A list of up to 100 job IDs.</p>
pub fn jobs(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.jobs(input.into());
self
}
/// <p>A list of up to 100 job IDs.</p>
pub fn set_jobs(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_jobs(input);
self
}
}
/// Fluent builder constructing a request to `DescribeSchedulingPolicies`.
///
/// <p>Describes one or more of your scheduling policies.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeSchedulingPolicies {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::describe_scheduling_policies_input::Builder,
}
impl DescribeSchedulingPolicies {
/// Creates a new `DescribeSchedulingPolicies`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::DescribeSchedulingPolicies,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::DescribeSchedulingPoliciesError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeSchedulingPoliciesOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeSchedulingPoliciesError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Appends an item to `arns`.
///
/// To override the contents of this collection use [`set_arns`](Self::set_arns).
///
/// <p>A list of up to 100 scheduling policy Amazon Resource Name (ARN) entries.</p>
pub fn arns(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.arns(input.into());
self
}
/// <p>A list of up to 100 scheduling policy Amazon Resource Name (ARN) entries.</p>
pub fn set_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_arns(input);
self
}
}
/// Fluent builder constructing a request to `ListJobs`.
///
/// <p>Returns a list of Batch jobs.</p>
/// <p>You must specify only one of the following items:</p>
/// <ul>
/// <li> <p>A job queue ID to return a list of jobs in that job queue</p> </li>
/// <li> <p>A multi-node parallel job ID to return a list of nodes for that job</p> </li>
/// <li> <p>An array job ID to return a list of the children for that job</p> </li>
/// </ul>
/// <p>You can filter the results by job status with the <code>jobStatus</code> parameter. If you don't specify a status, only <code>RUNNING</code> jobs are returned.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListJobs {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::list_jobs_input::Builder,
}
impl ListJobs {
/// Creates a new `ListJobs`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::ListJobs,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::ListJobsError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListJobsOutput,
aws_smithy_http::result::SdkError<crate::error::ListJobsError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListJobsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListJobsPaginator {
crate::paginator::ListJobsPaginator::new(self.handle, self.inner)
}
/// <p>The name or full Amazon Resource Name (ARN) of the job queue used to list jobs.</p>
pub fn job_queue(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_queue(input.into());
self
}
/// <p>The name or full Amazon Resource Name (ARN) of the job queue used to list jobs.</p>
pub fn set_job_queue(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_job_queue(input);
self
}
/// <p>The job ID for an array job. Specifying an array job ID with this parameter lists all child jobs from within the specified array.</p>
pub fn array_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.array_job_id(input.into());
self
}
/// <p>The job ID for an array job. Specifying an array job ID with this parameter lists all child jobs from within the specified array.</p>
pub fn set_array_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_array_job_id(input);
self
}
/// <p>The job ID for a multi-node parallel job. Specifying a multi-node parallel job ID with this parameter lists all nodes that are associated with the specified job.</p>
pub fn multi_node_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.multi_node_job_id(input.into());
self
}
/// <p>The job ID for a multi-node parallel job. Specifying a multi-node parallel job ID with this parameter lists all nodes that are associated with the specified job.</p>
pub fn set_multi_node_job_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_multi_node_job_id(input);
self
}
/// <p>The job status used to filter jobs in the specified queue. If the <code>filters</code> parameter is specified, the <code>jobStatus</code> parameter is ignored and jobs with any status are returned. If you don't specify a status, only <code>RUNNING</code> jobs are returned.</p>
pub fn job_status(mut self, input: crate::model::JobStatus) -> Self {
self.inner = self.inner.job_status(input);
self
}
/// <p>The job status used to filter jobs in the specified queue. If the <code>filters</code> parameter is specified, the <code>jobStatus</code> parameter is ignored and jobs with any status are returned. If you don't specify a status, only <code>RUNNING</code> jobs are returned.</p>
pub fn set_job_status(
mut self,
input: std::option::Option<crate::model::JobStatus>,
) -> Self {
self.inner = self.inner.set_job_status(input);
self
}
/// <p>The maximum number of results returned by <code>ListJobs</code> in paginated output. When this parameter is used, <code>ListJobs</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListJobs</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>ListJobs</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of results returned by <code>ListJobs</code> in paginated output. When this parameter is used, <code>ListJobs</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListJobs</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>ListJobs</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The <code>nextToken</code> value returned from a previous paginated <code>ListJobs</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note>
/// <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p>
/// </note>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The <code>nextToken</code> value returned from a previous paginated <code>ListJobs</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note>
/// <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p>
/// </note>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// Appends an item to `filters`.
///
/// To override the contents of this collection use [`set_filters`](Self::set_filters).
///
/// <p>The filter to apply to the query. Only one filter can be used at a time. When the filter is used, <code>jobStatus</code> is ignored. The filter doesn't apply to child jobs in an array or multi-node parallel (MNP) jobs. The results are sorted by the <code>createdAt</code> field, with the most recent jobs being first.</p>
/// <dl>
/// <dt>
/// JOB_NAME
/// </dt>
/// <dd>
/// <p>The value of the filter is a case-insensitive match for the job name. If the value ends with an asterisk (*), the filter matches any job name that begins with the string before the '*'. This corresponds to the <code>jobName</code> value. For example, <code>test1</code> matches both <code>Test1</code> and <code>test1</code>, and <code>test1*</code> matches both <code>test1</code> and <code>Test10</code>. When the <code>JOB_NAME</code> filter is used, the results are grouped by the job name and version.</p>
/// </dd>
/// <dt>
/// JOB_DEFINITION
/// </dt>
/// <dd>
/// <p>The value for the filter is the name or Amazon Resource Name (ARN) of the job definition. This corresponds to the <code>jobDefinition</code> value. The value is case sensitive. When the value for the filter is the job definition name, the results include all the jobs that used any revision of that job definition name. If the value ends with an asterisk (*), the filter matches any job definition name that begins with the string before the '*'. For example, <code>jd1</code> matches only <code>jd1</code>, and <code>jd1*</code> matches both <code>jd1</code> and <code>jd1A</code>. The version of the job definition that's used doesn't affect the sort order. When the <code>JOB_DEFINITION</code> filter is used and the ARN is used (which is in the form <code>arn:${Partition}:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision}</code>), the results include jobs that used the specified revision of the job definition. Asterisk (*) isn't supported when the ARN is used.</p>
/// </dd>
/// <dt>
/// BEFORE_CREATED_AT
/// </dt>
/// <dd>
/// <p>The value for the filter is the time that's before the job was created. This corresponds to the <code>createdAt</code> value. The value is a string representation of the number of milliseconds since 00:00:00 UTC (midnight) on January 1, 1970.</p>
/// </dd>
/// <dt>
/// AFTER_CREATED_AT
/// </dt>
/// <dd>
/// <p>The value for the filter is the time that's after the job was created. This corresponds to the <code>createdAt</code> value. The value is a string representation of the number of milliseconds since 00:00:00 UTC (midnight) on January 1, 1970.</p>
/// </dd>
/// </dl>
pub fn filters(mut self, input: crate::model::KeyValuesPair) -> Self {
self.inner = self.inner.filters(input);
self
}
/// <p>The filter to apply to the query. Only one filter can be used at a time. When the filter is used, <code>jobStatus</code> is ignored. The filter doesn't apply to child jobs in an array or multi-node parallel (MNP) jobs. The results are sorted by the <code>createdAt</code> field, with the most recent jobs being first.</p>
/// <dl>
/// <dt>
/// JOB_NAME
/// </dt>
/// <dd>
/// <p>The value of the filter is a case-insensitive match for the job name. If the value ends with an asterisk (*), the filter matches any job name that begins with the string before the '*'. This corresponds to the <code>jobName</code> value. For example, <code>test1</code> matches both <code>Test1</code> and <code>test1</code>, and <code>test1*</code> matches both <code>test1</code> and <code>Test10</code>. When the <code>JOB_NAME</code> filter is used, the results are grouped by the job name and version.</p>
/// </dd>
/// <dt>
/// JOB_DEFINITION
/// </dt>
/// <dd>
/// <p>The value for the filter is the name or Amazon Resource Name (ARN) of the job definition. This corresponds to the <code>jobDefinition</code> value. The value is case sensitive. When the value for the filter is the job definition name, the results include all the jobs that used any revision of that job definition name. If the value ends with an asterisk (*), the filter matches any job definition name that begins with the string before the '*'. For example, <code>jd1</code> matches only <code>jd1</code>, and <code>jd1*</code> matches both <code>jd1</code> and <code>jd1A</code>. The version of the job definition that's used doesn't affect the sort order. When the <code>JOB_DEFINITION</code> filter is used and the ARN is used (which is in the form <code>arn:${Partition}:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision}</code>), the results include jobs that used the specified revision of the job definition. Asterisk (*) isn't supported when the ARN is used.</p>
/// </dd>
/// <dt>
/// BEFORE_CREATED_AT
/// </dt>
/// <dd>
/// <p>The value for the filter is the time that's before the job was created. This corresponds to the <code>createdAt</code> value. The value is a string representation of the number of milliseconds since 00:00:00 UTC (midnight) on January 1, 1970.</p>
/// </dd>
/// <dt>
/// AFTER_CREATED_AT
/// </dt>
/// <dd>
/// <p>The value for the filter is the time that's after the job was created. This corresponds to the <code>createdAt</code> value. The value is a string representation of the number of milliseconds since 00:00:00 UTC (midnight) on January 1, 1970.</p>
/// </dd>
/// </dl>
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::KeyValuesPair>>,
) -> Self {
self.inner = self.inner.set_filters(input);
self
}
}
/// Fluent builder constructing a request to `ListSchedulingPolicies`.
///
/// <p>Returns a list of Batch scheduling policies.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListSchedulingPolicies {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::list_scheduling_policies_input::Builder,
}
impl ListSchedulingPolicies {
/// Creates a new `ListSchedulingPolicies`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::ListSchedulingPolicies,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::ListSchedulingPoliciesError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListSchedulingPoliciesOutput,
aws_smithy_http::result::SdkError<crate::error::ListSchedulingPoliciesError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListSchedulingPoliciesPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListSchedulingPoliciesPaginator {
crate::paginator::ListSchedulingPoliciesPaginator::new(self.handle, self.inner)
}
/// <p>The maximum number of results that's returned by <code>ListSchedulingPolicies</code> in paginated output. When this parameter is used, <code>ListSchedulingPolicies</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListSchedulingPolicies</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, <code>ListSchedulingPolicies</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of results that's returned by <code>ListSchedulingPolicies</code> in paginated output. When this parameter is used, <code>ListSchedulingPolicies</code> only returns <code>maxResults</code> results in a single page and a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListSchedulingPolicies</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, <code>ListSchedulingPolicies</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The <code>nextToken</code> value that's returned from a previous paginated <code>ListSchedulingPolicies</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note>
/// <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p>
/// </note>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The <code>nextToken</code> value that's returned from a previous paginated <code>ListSchedulingPolicies</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note>
/// <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p>
/// </note>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `ListTagsForResource`.
///
/// <p>Lists the tags for an Batch resource. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListTagsForResource {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::list_tags_for_resource_input::Builder,
}
impl ListTagsForResource {
/// Creates a new `ListTagsForResource`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::ListTagsForResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::ListTagsForResourceError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListTagsForResourceOutput,
aws_smithy_http::result::SdkError<crate::error::ListTagsForResourceError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The Amazon Resource Name (ARN) that identifies the resource that tags are listed for. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arn(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) that identifies the resource that tags are listed for. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_resource_arn(input);
self
}
}
/// Fluent builder constructing a request to `RegisterJobDefinition`.
///
/// <p>Registers an Batch job definition.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct RegisterJobDefinition {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::register_job_definition_input::Builder,
}
impl RegisterJobDefinition {
/// Creates a new `RegisterJobDefinition`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::RegisterJobDefinition,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::RegisterJobDefinitionError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::RegisterJobDefinitionOutput,
aws_smithy_http::result::SdkError<crate::error::RegisterJobDefinitionError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>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 (_).</p>
pub fn job_definition_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_definition_name(input.into());
self
}
/// <p>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 (_).</p>
pub fn set_job_definition_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_job_definition_name(input);
self
}
/// <p>The type of job definition. For more information about multi-node parallel jobs, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/multi-node-job-def.html">Creating a multi-node parallel job definition</a> in the <i>Batch User Guide</i>.</p> <note>
/// <p>If the job is run on Fargate resources, then <code>multinode</code> isn't supported.</p>
/// </note>
pub fn r#type(mut self, input: crate::model::JobDefinitionType) -> Self {
self.inner = self.inner.r#type(input);
self
}
/// <p>The type of job definition. For more information about multi-node parallel jobs, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/multi-node-job-def.html">Creating a multi-node parallel job definition</a> in the <i>Batch User Guide</i>.</p> <note>
/// <p>If the job is run on Fargate resources, then <code>multinode</code> isn't supported.</p>
/// </note>
pub fn set_type(
mut self,
input: std::option::Option<crate::model::JobDefinitionType>,
) -> Self {
self.inner = self.inner.set_type(input);
self
}
/// Adds a key-value pair to `parameters`.
///
/// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
///
/// <p>Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p>
pub fn parameters(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.parameters(k.into(), v.into());
self
}
/// <p>Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p>
pub fn set_parameters(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_parameters(input);
self
}
/// <p>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.</p>
/// <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
pub fn scheduling_priority(mut self, input: i32) -> Self {
self.inner = self.inner.scheduling_priority(input);
self
}
/// <p>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.</p>
/// <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
pub fn set_scheduling_priority(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_scheduling_priority(input);
self
}
/// <p>An object with various properties specific to Amazon ECS based single-node container-based jobs. If the job definition's <code>type</code> parameter is <code>container</code>, then you must specify either <code>containerProperties</code> or <code>nodeProperties</code>. This must not be specified for Amazon EKS based job definitions.</p> <note>
/// <p>If the job runs on Fargate resources, then you must not specify <code>nodeProperties</code>; use only <code>containerProperties</code>.</p>
/// </note>
pub fn container_properties(mut self, input: crate::model::ContainerProperties) -> Self {
self.inner = self.inner.container_properties(input);
self
}
/// <p>An object with various properties specific to Amazon ECS based single-node container-based jobs. If the job definition's <code>type</code> parameter is <code>container</code>, then you must specify either <code>containerProperties</code> or <code>nodeProperties</code>. This must not be specified for Amazon EKS based job definitions.</p> <note>
/// <p>If the job runs on Fargate resources, then you must not specify <code>nodeProperties</code>; use only <code>containerProperties</code>.</p>
/// </note>
pub fn set_container_properties(
mut self,
input: std::option::Option<crate::model::ContainerProperties>,
) -> Self {
self.inner = self.inner.set_container_properties(input);
self
}
/// <p>An object with various 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 <a href="https://docs.aws.amazon.com/batch/latest/userguide/multi-node-parallel-jobs.html">Multi-node Parallel Jobs</a> in the <i>Batch User Guide</i>. If the job definition's <code>type</code> parameter is <code>container</code>, then you must specify either <code>containerProperties</code> or <code>nodeProperties</code>.</p> <note>
/// <p>If the job runs on Fargate resources, then you must not specify <code>nodeProperties</code>; use <code>containerProperties</code> instead.</p>
/// </note> <note>
/// <p>If the job runs on Amazon EKS resources, then you must not specify <code>nodeProperties</code>.</p>
/// </note>
pub fn node_properties(mut self, input: crate::model::NodeProperties) -> Self {
self.inner = self.inner.node_properties(input);
self
}
/// <p>An object with various 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 <a href="https://docs.aws.amazon.com/batch/latest/userguide/multi-node-parallel-jobs.html">Multi-node Parallel Jobs</a> in the <i>Batch User Guide</i>. If the job definition's <code>type</code> parameter is <code>container</code>, then you must specify either <code>containerProperties</code> or <code>nodeProperties</code>.</p> <note>
/// <p>If the job runs on Fargate resources, then you must not specify <code>nodeProperties</code>; use <code>containerProperties</code> instead.</p>
/// </note> <note>
/// <p>If the job runs on Amazon EKS resources, then you must not specify <code>nodeProperties</code>.</p>
/// </note>
pub fn set_node_properties(
mut self,
input: std::option::Option<crate::model::NodeProperties>,
) -> Self {
self.inner = self.inner.set_node_properties(input);
self
}
/// <p>The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a <code>SubmitJob</code> operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.</p>
pub fn retry_strategy(mut self, input: crate::model::RetryStrategy) -> Self {
self.inner = self.inner.retry_strategy(input);
self
}
/// <p>The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a <code>SubmitJob</code> operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.</p>
pub fn set_retry_strategy(
mut self,
input: std::option::Option<crate::model::RetryStrategy>,
) -> Self {
self.inner = self.inner.set_retry_strategy(input);
self
}
/// <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 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 <code>FAILED</code> state.</p> <note>
/// <p>If the job runs on Amazon EKS resources, then you must not specify <code>propagateTags</code>.</p>
/// </note>
pub fn propagate_tags(mut self, input: bool) -> Self {
self.inner = self.inner.propagate_tags(input);
self
}
/// <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 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 <code>FAILED</code> state.</p> <note>
/// <p>If the job runs on Amazon EKS resources, then you must not specify <code>propagateTags</code>.</p>
/// </note>
pub fn set_propagate_tags(mut self, input: std::option::Option<bool>) -> Self {
self.inner = self.inner.set_propagate_tags(input);
self
}
/// <p>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 <code>SubmitJob</code> operation overrides the timeout configuration defined here. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/job_timeouts.html">Job Timeouts</a> in the <i>Batch User Guide</i>.</p>
pub fn timeout(mut self, input: crate::model::JobTimeout) -> Self {
self.inner = self.inner.timeout(input);
self
}
/// <p>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 <code>SubmitJob</code> operation overrides the timeout configuration defined here. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/job_timeouts.html">Job Timeouts</a> in the <i>Batch User Guide</i>.</p>
pub fn set_timeout(mut self, input: std::option::Option<crate::model::JobTimeout>) -> Self {
self.inner = self.inner.set_timeout(input);
self
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>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 <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging Amazon Web Services Resources</a> in <i>Batch User Guide</i>.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k.into(), v.into());
self
}
/// <p>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 <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging Amazon Web Services Resources</a> in <i>Batch User Guide</i>.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// Appends an item to `platformCapabilities`.
///
/// To override the contents of this collection use [`set_platform_capabilities`](Self::set_platform_capabilities).
///
/// <p>The platform capabilities required by the job definition. If no value is specified, it defaults to <code>EC2</code>. To run the job on Fargate resources, specify <code>FARGATE</code>.</p> <note>
/// <p>If the job runs on Amazon EKS resources, then you must not specify <code>platformCapabilities</code>.</p>
/// </note>
pub fn platform_capabilities(mut self, input: crate::model::PlatformCapability) -> Self {
self.inner = self.inner.platform_capabilities(input);
self
}
/// <p>The platform capabilities required by the job definition. If no value is specified, it defaults to <code>EC2</code>. To run the job on Fargate resources, specify <code>FARGATE</code>.</p> <note>
/// <p>If the job runs on Amazon EKS resources, then you must not specify <code>platformCapabilities</code>.</p>
/// </note>
pub fn set_platform_capabilities(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PlatformCapability>>,
) -> Self {
self.inner = self.inner.set_platform_capabilities(input);
self
}
/// <p>An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.</p>
pub fn eks_properties(mut self, input: crate::model::EksProperties) -> Self {
self.inner = self.inner.eks_properties(input);
self
}
/// <p>An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.</p>
pub fn set_eks_properties(
mut self,
input: std::option::Option<crate::model::EksProperties>,
) -> Self {
self.inner = self.inner.set_eks_properties(input);
self
}
}
/// Fluent builder constructing a request to `SubmitJob`.
///
/// <p>Submits an Batch job from a job definition. Parameters that are specified during <code>SubmitJob</code> override parameters defined in the job definition. vCPU and memory requirements that are specified in the <code>resourceRequirements</code> objects in the job definition are the exception. They can't be overridden this way using the <code>memory</code> and <code>vcpus</code> parameters. Rather, you must specify updates to job definition parameters in a <code>resourceRequirements</code> object that's included in the <code>containerOverrides</code> parameter.</p> <note>
/// <p>Job queues with a scheduling policy are limited to 500 active fair share identifiers at a time. </p>
/// </note> <important>
/// <p>Jobs that run on Fargate resources can't be guaranteed to run for more than 14 days. This is because, after 14 days, Fargate resources might become unavailable and job might be terminated.</p>
/// </important>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct SubmitJob {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::submit_job_input::Builder,
}
impl SubmitJob {
/// Creates a new `SubmitJob`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::SubmitJob,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::SubmitJobError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::SubmitJobOutput,
aws_smithy_http::result::SdkError<crate::error::SubmitJobError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <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>
pub fn job_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_name(input.into());
self
}
/// <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>
pub fn set_job_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_job_name(input);
self
}
/// <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>
pub fn job_queue(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_queue(input.into());
self
}
/// <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>
pub fn set_job_queue(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_job_queue(input);
self
}
/// <p>The share identifier for the job. If the job queue doesn't have a scheduling policy, then this parameter must not be specified. If the job queue has a scheduling policy, then this parameter must be specified.</p>
pub fn share_identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.share_identifier(input.into());
self
}
/// <p>The share identifier for the job. If the job queue doesn't have a scheduling policy, then this parameter must not be specified. If the job queue has a scheduling policy, then this parameter must be specified.</p>
pub fn set_share_identifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_share_identifier(input);
self
}
/// <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.</p>
/// <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
pub fn scheduling_priority_override(mut self, input: i32) -> Self {
self.inner = self.inner.scheduling_priority_override(input);
self
}
/// <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.</p>
/// <p>The minimum supported value is 0 and the maximum supported value is 9999.</p>
pub fn set_scheduling_priority_override(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_scheduling_priority_override(input);
self
}
/// <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>
pub fn array_properties(mut self, input: crate::model::ArrayProperties) -> Self {
self.inner = self.inner.array_properties(input);
self
}
/// <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>
pub fn set_array_properties(
mut self,
input: std::option::Option<crate::model::ArrayProperties>,
) -> Self {
self.inner = self.inner.set_array_properties(input);
self
}
/// Appends an item to `dependsOn`.
///
/// To override the contents of this collection use [`set_depends_on`](Self::set_depends_on).
///
/// <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>
pub fn depends_on(mut self, input: crate::model::JobDependency) -> Self {
self.inner = self.inner.depends_on(input);
self
}
/// <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>
pub fn set_depends_on(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::JobDependency>>,
) -> Self {
self.inner = self.inner.set_depends_on(input);
self
}
/// <p>The job definition used by this job. This value can be one of <code>name</code>, <code>name:revision</code>, or the Amazon Resource Name (ARN) for the job definition. If <code>name</code> is specified without a revision then the latest active revision is used.</p>
pub fn job_definition(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_definition(input.into());
self
}
/// <p>The job definition used by this job. This value can be one of <code>name</code>, <code>name:revision</code>, or the Amazon Resource Name (ARN) for the job definition. If <code>name</code> is specified without a revision then the latest active revision is used.</p>
pub fn set_job_definition(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_job_definition(input);
self
}
/// Adds a key-value pair to `parameters`.
///
/// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
///
/// <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>
pub fn parameters(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.parameters(k.into(), v.into());
self
}
/// <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>
pub fn set_parameters(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_parameters(input);
self
}
/// <p>An object with various 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>
pub fn container_overrides(mut self, input: crate::model::ContainerOverrides) -> Self {
self.inner = self.inner.container_overrides(input);
self
}
/// <p>An object with various 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>
pub fn set_container_overrides(
mut self,
input: std::option::Option<crate::model::ContainerOverrides>,
) -> Self {
self.inner = self.inner.set_container_overrides(input);
self
}
/// <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>
/// <p>This parameter isn't applicable to jobs that are running on Fargate resources; use <code>containerOverrides</code> instead.</p>
/// </note>
pub fn node_overrides(mut self, input: crate::model::NodeOverrides) -> Self {
self.inner = self.inner.node_overrides(input);
self
}
/// <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>
/// <p>This parameter isn't applicable to jobs that are running on Fargate resources; use <code>containerOverrides</code> instead.</p>
/// </note>
pub fn set_node_overrides(
mut self,
input: std::option::Option<crate::model::NodeOverrides>,
) -> Self {
self.inner = self.inner.set_node_overrides(input);
self
}
/// <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>
pub fn retry_strategy(mut self, input: crate::model::RetryStrategy) -> Self {
self.inner = self.inner.retry_strategy(input);
self
}
/// <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>
pub fn set_retry_strategy(
mut self,
input: std::option::Option<crate::model::RetryStrategy>,
) -> Self {
self.inner = self.inner.set_retry_strategy(input);
self
}
/// <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>
pub fn propagate_tags(mut self, input: bool) -> Self {
self.inner = self.inner.propagate_tags(input);
self
}
/// <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>
pub fn set_propagate_tags(mut self, input: std::option::Option<bool>) -> Self {
self.inner = self.inner.set_propagate_tags(input);
self
}
/// <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>
pub fn timeout(mut self, input: crate::model::JobTimeout) -> Self {
self.inner = self.inner.timeout(input);
self
}
/// <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>
pub fn set_timeout(mut self, input: std::option::Option<crate::model::JobTimeout>) -> Self {
self.inner = self.inner.set_timeout(input);
self
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <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>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k.into(), v.into());
self
}
/// <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>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <p>An object that can only be specified for jobs that are run on Amazon EKS resources with various properties that override defaults for the job definition.</p>
pub fn eks_properties_override(
mut self,
input: crate::model::EksPropertiesOverride,
) -> Self {
self.inner = self.inner.eks_properties_override(input);
self
}
/// <p>An object that can only be specified for jobs that are run on Amazon EKS resources with various properties that override defaults for the job definition.</p>
pub fn set_eks_properties_override(
mut self,
input: std::option::Option<crate::model::EksPropertiesOverride>,
) -> Self {
self.inner = self.inner.set_eks_properties_override(input);
self
}
}
/// Fluent builder constructing a request to `TagResource`.
///
/// <p>Associates the specified tags to a resource with the specified <code>resourceArn</code>. If existing tags on a resource aren't specified in the request parameters, they aren't changed. When a resource is deleted, the tags that are associated with that resource are deleted as well. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct TagResource {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::tag_resource_input::Builder,
}
impl TagResource {
/// Creates a new `TagResource`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::TagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::TagResourceError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::TagResourceOutput,
aws_smithy_http::result::SdkError<crate::error::TagResourceError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The Amazon Resource Name (ARN) of the resource that tags are added to. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arn(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the resource that tags are added to. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_resource_arn(input);
self
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags that you apply to the resource 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>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k.into(), v.into());
self
}
/// <p>The tags that you apply to the resource 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>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `TerminateJob`.
///
/// <p>Terminates a job in a job queue. Jobs that are in the <code>STARTING</code> or <code>RUNNING</code> state are terminated, which causes them to transition to <code>FAILED</code>. Jobs that have not progressed to the <code>STARTING</code> state are cancelled.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct TerminateJob {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::terminate_job_input::Builder,
}
impl TerminateJob {
/// Creates a new `TerminateJob`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::TerminateJob,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::TerminateJobError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::TerminateJobOutput,
aws_smithy_http::result::SdkError<crate::error::TerminateJobError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The Batch job ID of the job to terminate.</p>
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_id(input.into());
self
}
/// <p>The Batch job ID of the job to terminate.</p>
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_job_id(input);
self
}
/// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. This message is also recorded in the Batch activity logs.</p>
pub fn reason(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.reason(input.into());
self
}
/// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <code>DescribeJobs</code> operations on the job. This message is also recorded in the Batch activity logs.</p>
pub fn set_reason(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_reason(input);
self
}
}
/// Fluent builder constructing a request to `UntagResource`.
///
/// <p>Deletes specified tags from an Batch resource.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct UntagResource {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::untag_resource_input::Builder,
}
impl UntagResource {
/// Creates a new `UntagResource`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::UntagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::UntagResourceError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::UntagResourceOutput,
aws_smithy_http::result::SdkError<crate::error::UntagResourceError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The Amazon Resource Name (ARN) of the resource from which to delete tags. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arn(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the resource from which to delete tags. Batch resources that support tags are compute environments, jobs, job definitions, job queues, and scheduling policies. ARNs for child jobs of array and multi-node parallel (MNP) jobs aren't supported.</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_resource_arn(input);
self
}
/// Appends an item to `tagKeys`.
///
/// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys).
///
/// <p>The keys of the tags to be removed.</p>
pub fn tag_keys(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.tag_keys(input.into());
self
}
/// <p>The keys of the tags to be removed.</p>
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_tag_keys(input);
self
}
}
/// Fluent builder constructing a request to `UpdateComputeEnvironment`.
///
/// <p>Updates an Batch compute environment.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct UpdateComputeEnvironment {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::update_compute_environment_input::Builder,
}
impl UpdateComputeEnvironment {
/// Creates a new `UpdateComputeEnvironment`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::UpdateComputeEnvironment,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::UpdateComputeEnvironmentError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::UpdateComputeEnvironmentOutput,
aws_smithy_http::result::SdkError<crate::error::UpdateComputeEnvironmentError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The name or full Amazon Resource Name (ARN) of the compute environment to update.</p>
pub fn compute_environment(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.compute_environment(input.into());
self
}
/// <p>The name or full Amazon Resource Name (ARN) of the compute environment to update.</p>
pub fn set_compute_environment(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_compute_environment(input);
self
}
/// <p>The state of the compute environment. Compute environments in the <code>ENABLED</code> state can accept jobs from a queue and scale in or out automatically based on the workload demand of its associated queues.</p>
/// <p>If the state is <code>ENABLED</code>, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.</p>
/// <p>If the state is <code>DISABLED</code>, then the Batch scheduler doesn't attempt to place jobs within the environment. Jobs in a <code>STARTING</code> or <code>RUNNING</code> state continue to progress normally. Managed compute environments in the <code>DISABLED</code> state don't scale out. However, they scale in to <code>minvCpus</code> value after instances become idle.</p>
pub fn state(mut self, input: crate::model::CeState) -> Self {
self.inner = self.inner.state(input);
self
}
/// <p>The state of the compute environment. Compute environments in the <code>ENABLED</code> state can accept jobs from a queue and scale in or out automatically based on the workload demand of its associated queues.</p>
/// <p>If the state is <code>ENABLED</code>, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.</p>
/// <p>If the state is <code>DISABLED</code>, then the Batch scheduler doesn't attempt to place jobs within the environment. Jobs in a <code>STARTING</code> or <code>RUNNING</code> state continue to progress normally. Managed compute environments in the <code>DISABLED</code> state don't scale out. However, they scale in to <code>minvCpus</code> value after instances become idle.</p>
pub fn set_state(mut self, input: std::option::Option<crate::model::CeState>) -> Self {
self.inner = self.inner.set_state(input);
self
}
/// <p>The maximum number of vCPUs expected to be used for an unmanaged compute environment. Don't specify this parameter for a managed compute environment. This parameter is only used for fair share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn't provided for a fair share job queue, no vCPU capacity is reserved.</p>
pub fn unmanagedv_cpus(mut self, input: i32) -> Self {
self.inner = self.inner.unmanagedv_cpus(input);
self
}
/// <p>The maximum number of vCPUs expected to be used for an unmanaged compute environment. Don't specify this parameter for a managed compute environment. This parameter is only used for fair share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn't provided for a fair share job queue, no vCPU capacity is reserved.</p>
pub fn set_unmanagedv_cpus(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_unmanagedv_cpus(input);
self
}
/// <p>Details of the compute resources managed by the compute environment. Required for a managed compute environment. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>Batch User Guide</i>.</p>
pub fn compute_resources(mut self, input: crate::model::ComputeResourceUpdate) -> Self {
self.inner = self.inner.compute_resources(input);
self
}
/// <p>Details of the compute resources managed by the compute environment. Required for a managed compute environment. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>Batch User Guide</i>.</p>
pub fn set_compute_resources(
mut self,
input: std::option::Option<crate::model::ComputeResourceUpdate>,
) -> Self {
self.inner = self.inner.set_compute_resources(input);
self
}
/// <p>The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html">Batch service IAM role</a> in the <i>Batch User Guide</i>.</p> <important>
/// <p>If the compute environment has a service-linked role, it can't be changed to use a regular IAM role. Likewise, if the compute environment has a regular IAM role, it can't be changed to use a service-linked role. To update the parameters for the compute environment that require an infrastructure update to change, the <b>AWSServiceRoleForBatch</b> service-linked role must be used. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>
/// </important>
/// <p>If your specified role has a path other than <code>/</code>, then you must either specify the full role ARN (recommended) or prefix the role name with the path.</p> <note>
/// <p>Depending on how you created your Batch service role, its ARN might contain the <code>service-role</code> path prefix. When you only specify the name of the service role, Batch assumes that your ARN doesn't use the <code>service-role</code> path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.</p>
/// </note>
pub fn service_role(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.service_role(input.into());
self
}
/// <p>The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html">Batch service IAM role</a> in the <i>Batch User Guide</i>.</p> <important>
/// <p>If the compute environment has a service-linked role, it can't be changed to use a regular IAM role. Likewise, if the compute environment has a regular IAM role, it can't be changed to use a service-linked role. To update the parameters for the compute environment that require an infrastructure update to change, the <b>AWSServiceRoleForBatch</b> service-linked role must be used. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>
/// </important>
/// <p>If your specified role has a path other than <code>/</code>, then you must either specify the full role ARN (recommended) or prefix the role name with the path.</p> <note>
/// <p>Depending on how you created your Batch service role, its ARN might contain the <code>service-role</code> path prefix. When you only specify the name of the service role, Batch assumes that your ARN doesn't use the <code>service-role</code> path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.</p>
/// </note>
pub fn set_service_role(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_service_role(input);
self
}
/// <p>Specifies the updated infrastructure update policy for the compute environment. For more information about infrastructure updates, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>
pub fn update_policy(mut self, input: crate::model::UpdatePolicy) -> Self {
self.inner = self.inner.update_policy(input);
self
}
/// <p>Specifies the updated infrastructure update policy for the compute environment. For more information about infrastructure updates, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/updating-compute-environments.html">Updating compute environments</a> in the <i>Batch User Guide</i>.</p>
pub fn set_update_policy(
mut self,
input: std::option::Option<crate::model::UpdatePolicy>,
) -> Self {
self.inner = self.inner.set_update_policy(input);
self
}
}
/// Fluent builder constructing a request to `UpdateJobQueue`.
///
/// <p>Updates a job queue.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct UpdateJobQueue {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::update_job_queue_input::Builder,
}
impl UpdateJobQueue {
/// Creates a new `UpdateJobQueue`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::UpdateJobQueue,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::UpdateJobQueueError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::UpdateJobQueueOutput,
aws_smithy_http::result::SdkError<crate::error::UpdateJobQueueError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The name or the Amazon Resource Name (ARN) of the job queue.</p>
pub fn job_queue(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.job_queue(input.into());
self
}
/// <p>The name or the Amazon Resource Name (ARN) of the job queue.</p>
pub fn set_job_queue(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_job_queue(input);
self
}
/// <p>Describes the queue's ability to accept new jobs. If the job queue state is <code>ENABLED</code>, it can accept jobs. If the job queue state is <code>DISABLED</code>, new jobs can't be added to the queue, but jobs already in the queue can finish.</p>
pub fn state(mut self, input: crate::model::JqState) -> Self {
self.inner = self.inner.state(input);
self
}
/// <p>Describes the queue's ability to accept new jobs. If the job queue state is <code>ENABLED</code>, it can accept jobs. If the job queue state is <code>DISABLED</code>, new jobs can't be added to the queue, but jobs already in the queue can finish.</p>
pub fn set_state(mut self, input: std::option::Option<crate::model::JqState>) -> Self {
self.inner = self.inner.set_state(input);
self
}
/// <p>Amazon Resource Name (ARN) of the fair share scheduling policy. Once a job queue is created, the fair share scheduling policy can be replaced but not removed. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. For example, <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>
pub fn scheduling_policy_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.scheduling_policy_arn(input.into());
self
}
/// <p>Amazon Resource Name (ARN) of the fair share scheduling policy. Once a job queue is created, the fair share scheduling policy can be replaced but not removed. The format is <code>aws:<i>Partition</i>:batch:<i>Region</i>:<i>Account</i>:scheduling-policy/<i>Name</i> </code>. For example, <code>aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy</code>.</p>
pub fn set_scheduling_policy_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_scheduling_policy_arn(input);
self
}
/// <p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>). EC2 and Fargate compute environments can't be mixed.</p>
pub fn priority(mut self, input: i32) -> Self {
self.inner = self.inner.priority(input);
self
}
/// <p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>). EC2 and Fargate compute environments can't be mixed.</p>
pub fn set_priority(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_priority(input);
self
}
/// Appends an item to `computeEnvironmentOrder`.
///
/// To override the contents of this collection use [`set_compute_environment_order`](Self::set_compute_environment_order).
///
/// <p>Details the set of compute environments mapped to a job queue and their order relative to each other. This is one of the parameters used by the job scheduler to determine which compute environment runs a given job. Compute environments must be in the <code>VALID</code> state before you can associate them with a job queue. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>). EC2 and Fargate compute environments can't be mixed.</p> <note>
/// <p>All compute environments that are associated with a job queue must share the same architecture. Batch doesn't support mixing compute environment architecture types in a single job queue.</p>
/// </note>
pub fn compute_environment_order(
mut self,
input: crate::model::ComputeEnvironmentOrder,
) -> Self {
self.inner = self.inner.compute_environment_order(input);
self
}
/// <p>Details the set of compute environments mapped to a job queue and their order relative to each other. This is one of the parameters used by the job scheduler to determine which compute environment runs a given job. Compute environments must be in the <code>VALID</code> state before you can associate them with a job queue. All of the compute environments must be either EC2 (<code>EC2</code> or <code>SPOT</code>) or Fargate (<code>FARGATE</code> or <code>FARGATE_SPOT</code>). EC2 and Fargate compute environments can't be mixed.</p> <note>
/// <p>All compute environments that are associated with a job queue must share the same architecture. Batch doesn't support mixing compute environment architecture types in a single job queue.</p>
/// </note>
pub fn set_compute_environment_order(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ComputeEnvironmentOrder>>,
) -> Self {
self.inner = self.inner.set_compute_environment_order(input);
self
}
}
/// Fluent builder constructing a request to `UpdateSchedulingPolicy`.
///
/// <p>Updates a scheduling policy.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct UpdateSchedulingPolicy {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::update_scheduling_policy_input::Builder,
}
impl UpdateSchedulingPolicy {
/// Creates a new `UpdateSchedulingPolicy`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::UpdateSchedulingPolicy,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::UpdateSchedulingPolicyError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::UpdateSchedulingPolicyOutput,
aws_smithy_http::result::SdkError<crate::error::UpdateSchedulingPolicyError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>The Amazon Resource Name (ARN) of the scheduling policy to update.</p>
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.arn(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the scheduling policy to update.</p>
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_arn(input);
self
}
/// <p>The fair share policy.</p>
pub fn fairshare_policy(mut self, input: crate::model::FairsharePolicy) -> Self {
self.inner = self.inner.fairshare_policy(input);
self
}
/// <p>The fair share policy.</p>
pub fn set_fairshare_policy(
mut self,
input: std::option::Option<crate::model::FairsharePolicy>,
) -> Self {
self.inner = self.inner.set_fairshare_policy(input);
self
}
}
}
impl Client {
/// Creates a new client from an [SDK Config](aws_types::sdk_config::SdkConfig).
///
/// # Panics
///
/// - This method will panic if the `sdk_config` is missing an async sleep implementation. If you experience this panic, set
/// the `sleep_impl` on the Config passed into this function to fix it.
/// - This method will panic if the `sdk_config` is missing an HTTP connector. If you experience this panic, set the
/// `http_connector` on the Config passed into this function to fix it.
pub fn new(sdk_config: &aws_types::sdk_config::SdkConfig) -> Self {
Self::from_conf(sdk_config.into())
}
/// Creates a new client from the service [`Config`](crate::Config).
///
/// # Panics
///
/// - This method will panic if the `conf` is missing an async sleep implementation. If you experience this panic, set
/// the `sleep_impl` on the Config passed into this function to fix it.
/// - This method will panic if the `conf` is missing an HTTP connector. If you experience this panic, set the
/// `http_connector` on the Config passed into this function to fix it.
pub fn from_conf(conf: crate::Config) -> Self {
let retry_config = conf
.retry_config()
.cloned()
.unwrap_or_else(aws_smithy_types::retry::RetryConfig::disabled);
let timeout_config = conf
.timeout_config()
.cloned()
.unwrap_or_else(aws_smithy_types::timeout::TimeoutConfig::disabled);
let sleep_impl = conf.sleep_impl();
if (retry_config.has_retry() || timeout_config.has_timeouts()) && sleep_impl.is_none() {
panic!("An async sleep implementation is required for retries or timeouts to work. \
Set the `sleep_impl` on the Config passed into this function to fix this panic.");
}
let connector = conf.http_connector().and_then(|c| {
let timeout_config = conf
.timeout_config()
.cloned()
.unwrap_or_else(aws_smithy_types::timeout::TimeoutConfig::disabled);
let connector_settings =
aws_smithy_client::http_connector::ConnectorSettings::from_timeout_config(
&timeout_config,
);
c.connector(&connector_settings, conf.sleep_impl())
});
let builder = aws_smithy_client::Builder::new();
let builder = match connector {
// Use provided connector
Some(c) => builder.connector(c),
None => {
#[cfg(any(feature = "rustls", feature = "native-tls"))]
{
// Use default connector based on enabled features
builder.dyn_https_connector(
aws_smithy_client::http_connector::ConnectorSettings::from_timeout_config(
&timeout_config,
),
)
}
#[cfg(not(any(feature = "rustls", feature = "native-tls")))]
{
panic!("No HTTP connector was available. Enable the `rustls` or `native-tls` crate feature or set a connector to fix this.");
}
}
};
let mut builder = builder
.middleware(aws_smithy_client::erase::DynMiddleware::new(
crate::middleware::DefaultMiddleware::new(),
))
.retry_config(retry_config.into())
.operation_timeout_config(timeout_config.into());
builder.set_sleep_impl(sleep_impl);
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}