BatchClient

Struct BatchClient 

Source
pub struct BatchClient { /* private fields */ }
Expand description

A client for the AWS Batch API.

Implementations§

Source§

impl BatchClient

Source

pub fn new(region: Region) -> BatchClient

Creates a client backed by the default tokio event loop.

The client will use the default credentials provider and tls client.

Source

pub fn new_with<P, D>( request_dispatcher: D, credentials_provider: P, region: Region, ) -> BatchClient
where P: ProvideAwsCredentials + Send + Sync + 'static, D: DispatchSignedRequest + Send + Sync + 'static,

Source

pub fn new_with_client(client: Client, region: Region) -> BatchClient

Trait Implementations§

Source§

impl Batch for BatchClient

Source§

fn cancel_job<'life0, 'async_trait>( &'life0 self, input: CancelJobRequest, ) -> Pin<Box<dyn Future<Output = Result<CancelJobResponse, RusotoError<CancelJobError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancels a job in an AWS Batch job queue. Jobs that are in the SUBMITTED, PENDING, or RUNNABLE state are cancelled. Jobs that have progressed to STARTING or RUNNING are not cancelled (but the API operation still succeeds, even if no job is cancelled); these jobs must be terminated with the TerminateJob operation.

Source§

fn create_compute_environment<'life0, 'async_trait>( &'life0 self, input: CreateComputeEnvironmentRequest, ) -> Pin<Box<dyn Future<Output = Result<CreateComputeEnvironmentResponse, RusotoError<CreateComputeEnvironmentError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates an AWS Batch compute environment. You can create MANAGED or UNMANAGED compute environments.

In a managed compute environment, AWS 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 launch template that you specify when you create the compute environment. You can choose to use Amazon EC2 On-Demand Instances or Spot Instances in your managed compute environment. You can optionally set a maximum price so that Spot Instances only launch when the Spot Instance price is below a specified percentage of the On-Demand price.

Multi-node parallel jobs are not supported on Spot Instances.

In an unmanaged compute environment, you can manage your own compute resources. This provides more compute resource configuration options, such as using a custom AMI, but you must ensure that your AMI meets the Amazon ECS container instance AMI specification. For more information, see Container Instance AMIs in the Amazon Elastic Container Service Developer Guide. After you have created your unmanaged compute environment, you can use the DescribeComputeEnvironments operation to find the Amazon ECS cluster that is associated with it. Then, manually launch your container instances into that Amazon ECS cluster. For more information, see Launching an Amazon ECS Container Instance in the Amazon Elastic Container Service Developer Guide.

AWS Batch does not upgrade the AMIs in a compute environment after it is created (for example, when a newer version of the Amazon ECS-optimized AMI is available). You are responsible for the management of the guest operating system (including updates and security patches) and any additional application software or utilities that you install on the compute resources. To use a new AMI for your AWS Batch jobs:

  1. Create a new compute environment with the new AMI.

  2. Add the compute environment to an existing job queue.

  3. Remove the old compute environment from your job queue.

  4. Delete the old compute environment.

Source§

fn create_job_queue<'life0, 'async_trait>( &'life0 self, input: CreateJobQueueRequest, ) -> Pin<Box<dyn Future<Output = Result<CreateJobQueueResponse, RusotoError<CreateJobQueueError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates an AWS 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.

You also set a priority to the job queue that determines the order in which the AWS 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.

Source§

fn delete_compute_environment<'life0, 'async_trait>( &'life0 self, input: DeleteComputeEnvironmentRequest, ) -> Pin<Box<dyn Future<Output = Result<DeleteComputeEnvironmentResponse, RusotoError<DeleteComputeEnvironmentError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deletes an AWS Batch compute environment.

Before you can delete a compute environment, you must set its state to DISABLED with the UpdateComputeEnvironment API operation and disassociate it from any job queues with the UpdateJobQueue API operation.

Source§

fn delete_job_queue<'life0, 'async_trait>( &'life0 self, input: DeleteJobQueueRequest, ) -> Pin<Box<dyn Future<Output = Result<DeleteJobQueueResponse, RusotoError<DeleteJobQueueError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deletes the specified job queue. You must first disable submissions for a queue with the UpdateJobQueue operation. All jobs in the queue are terminated when you delete a job queue.

It is not necessary to disassociate compute environments from a queue before submitting a DeleteJobQueue request.

Source§

fn deregister_job_definition<'life0, 'async_trait>( &'life0 self, input: DeregisterJobDefinitionRequest, ) -> Pin<Box<dyn Future<Output = Result<DeregisterJobDefinitionResponse, RusotoError<DeregisterJobDefinitionError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deregisters an AWS Batch job definition. Job definitions will be permanently deleted after 180 days.

Source§

fn describe_compute_environments<'life0, 'async_trait>( &'life0 self, input: DescribeComputeEnvironmentsRequest, ) -> Pin<Box<dyn Future<Output = Result<DescribeComputeEnvironmentsResponse, RusotoError<DescribeComputeEnvironmentsError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Describes one or more of your compute environments.

If you are using an unmanaged compute environment, you can use the DescribeComputeEnvironment operation to determine the ecsClusterArn that you should launch your Amazon ECS container instances into.

Source§

fn describe_job_definitions<'life0, 'async_trait>( &'life0 self, input: DescribeJobDefinitionsRequest, ) -> Pin<Box<dyn Future<Output = Result<DescribeJobDefinitionsResponse, RusotoError<DescribeJobDefinitionsError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Describes a list of job definitions. You can specify a status (such as ACTIVE) to only return job definitions that match that status.

Source§

fn describe_job_queues<'life0, 'async_trait>( &'life0 self, input: DescribeJobQueuesRequest, ) -> Pin<Box<dyn Future<Output = Result<DescribeJobQueuesResponse, RusotoError<DescribeJobQueuesError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Describes one or more of your job queues.

Source§

fn describe_jobs<'life0, 'async_trait>( &'life0 self, input: DescribeJobsRequest, ) -> Pin<Box<dyn Future<Output = Result<DescribeJobsResponse, RusotoError<DescribeJobsError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Describes a list of AWS Batch jobs.

Source§

fn list_jobs<'life0, 'async_trait>( &'life0 self, input: ListJobsRequest, ) -> Pin<Box<dyn Future<Output = Result<ListJobsResponse, RusotoError<ListJobsError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a list of AWS Batch jobs.

You must specify only one of the following:

  • a job queue ID to return a list of jobs in that job queue

  • a multi-node parallel job ID to return a list of that job's nodes

  • an array job ID to return a list of that job's children

You can filter the results by job status with the jobStatus parameter. If you do not specify a status, only RUNNING jobs are returned.

Source§

fn register_job_definition<'life0, 'async_trait>( &'life0 self, input: RegisterJobDefinitionRequest, ) -> Pin<Box<dyn Future<Output = Result<RegisterJobDefinitionResponse, RusotoError<RegisterJobDefinitionError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Registers an AWS Batch job definition.

Source§

fn submit_job<'life0, 'async_trait>( &'life0 self, input: SubmitJobRequest, ) -> Pin<Box<dyn Future<Output = Result<SubmitJobResponse, RusotoError<SubmitJobError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submits an AWS Batch job from a job definition. Parameters specified during SubmitJob override parameters defined in the job definition.

Source§

fn terminate_job<'life0, 'async_trait>( &'life0 self, input: TerminateJobRequest, ) -> Pin<Box<dyn Future<Output = Result<TerminateJobResponse, RusotoError<TerminateJobError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Terminates a job in a job queue. Jobs that are in the STARTING or RUNNING state are terminated, which causes them to transition to FAILED. Jobs that have not progressed to the STARTING state are cancelled.

Source§

fn update_compute_environment<'life0, 'async_trait>( &'life0 self, input: UpdateComputeEnvironmentRequest, ) -> Pin<Box<dyn Future<Output = Result<UpdateComputeEnvironmentResponse, RusotoError<UpdateComputeEnvironmentError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Updates an AWS Batch compute environment.

Source§

fn update_job_queue<'life0, 'async_trait>( &'life0 self, input: UpdateJobQueueRequest, ) -> Pin<Box<dyn Future<Output = Result<UpdateJobQueueResponse, RusotoError<UpdateJobQueueError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Updates a job queue.

Source§

impl Clone for BatchClient

Source§

fn clone(&self) -> BatchClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more