Class: Aws::Batch::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Batch::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb
Overview
An API client for Batch. To construct a client, you need to configure a :region
and :credentials
.
client = Aws::Batch::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the developer guide.
See #initialize for a full list of supported configuration options.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
API Operations collapse
-
#cancel_job(params = {}) ⇒ Struct
Cancels a job in an AWS Batch job queue.
-
#create_compute_environment(params = {}) ⇒ Types::CreateComputeEnvironmentResponse
Creates an AWS Batch compute environment.
-
#create_job_queue(params = {}) ⇒ Types::CreateJobQueueResponse
Creates an AWS Batch job queue.
-
#delete_compute_environment(params = {}) ⇒ Struct
Deletes an AWS Batch compute environment.
-
#delete_job_queue(params = {}) ⇒ Struct
Deletes the specified job queue.
-
#deregister_job_definition(params = {}) ⇒ Struct
Deregisters an AWS Batch job definition.
-
#describe_compute_environments(params = {}) ⇒ Types::DescribeComputeEnvironmentsResponse
Describes one or more of your compute environments.
-
#describe_job_definitions(params = {}) ⇒ Types::DescribeJobDefinitionsResponse
Describes a list of job definitions.
-
#describe_job_queues(params = {}) ⇒ Types::DescribeJobQueuesResponse
Describes one or more of your job queues.
-
#describe_jobs(params = {}) ⇒ Types::DescribeJobsResponse
Describes a list of AWS Batch jobs.
-
#list_jobs(params = {}) ⇒ Types::ListJobsResponse
Returns a list of AWS Batch jobs.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags for an AWS Batch resource.
-
#register_job_definition(params = {}) ⇒ Types::RegisterJobDefinitionResponse
Registers an AWS Batch job definition.
-
#submit_job(params = {}) ⇒ Types::SubmitJobResponse
Submits an AWS Batch job from a job definition.
-
#tag_resource(params = {}) ⇒ Struct
Associates the specified tags to a resource with the specified
resourceArn
. -
#terminate_job(params = {}) ⇒ Struct
Terminates a job in a job queue.
-
#untag_resource(params = {}) ⇒ Struct
Deletes specified tags from an AWS Batch resource.
-
#update_compute_environment(params = {}) ⇒ Types::UpdateComputeEnvironmentResponse
Updates an AWS Batch compute environment.
-
#update_job_queue(params = {}) ⇒ Types::UpdateJobQueueResponse
Updates a job queue.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
Methods included from ClientStubs
#api_requests, #stub_data, #stub_responses
Methods inherited from Seahorse::Client::Base
add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
324 325 326 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 324 def initialize(*args) super end |
Instance Method Details
#cancel_job(params = {}) ⇒ Struct
Cancels a job in an AWS Batch job queue. Jobs that are in the
SUBMITTED
, PENDING
, or RUNNABLE
state are canceled. Jobs that
have progressed to STARTING
or RUNNING
are not canceled (but the
API operation still succeeds, even if no job is canceled); these jobs
must be terminated with the TerminateJob operation.
371 372 373 374 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 371 def cancel_job(params = {}, = {}) req = build_request(:cancel_job, params) req.send_request() end |
#create_compute_environment(params = {}) ⇒ Types::CreateComputeEnvironmentResponse
Creates an AWS Batch compute environment. You can create MANAGED
or
UNMANAGED
compute environments. MANAGED
compute environments can
use Amazon EC2 or AWS Fargate resources. UNMANAGED
compute
environments can only use EC2 resources.
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 either to use EC2 On-Demand Instances and EC2 Spot Instances, or to 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.
In an unmanaged compute environment, you can manage your own EC2 compute resources and have a lot of flexibility with how you configure your compute resources. For example, you can use custom AMI. However, you need to verify 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's 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.
Create a new compute environment with the new AMI.
Add the compute environment to an existing job queue.
Remove the earlier compute environment from your job queue.
Delete the earlier compute environment.
655 656 657 658 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 655 def create_compute_environment(params = {}, = {}) req = build_request(:create_compute_environment, params) req.send_request() end |
#create_job_queue(params = {}) ⇒ Types::CreateJobQueueResponse
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.
797 798 799 800 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 797 def create_job_queue(params = {}, = {}) req = build_request(:create_job_queue, params) req.send_request() end |
#delete_compute_environment(params = {}) ⇒ Struct
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. Compute environments that use AWS Fargate resources must
terminate all active jobs on that compute environment before deleting
the compute environment. If this isn't done, the compute environment
will end up in an invalid state.
841 842 843 844 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 841 def delete_compute_environment(params = {}, = {}) req = build_request(:delete_compute_environment, params) req.send_request() end |
#delete_job_queue(params = {}) ⇒ Struct
Deletes the specified job queue. You must first disable submissions for a queue with the UpdateJobQueue 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.
It's not necessary to disassociate compute environments from a queue
before submitting a DeleteJobQueue
request.
883 884 885 886 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 883 def delete_job_queue(params = {}, = {}) req = build_request(:delete_job_queue, params) req.send_request() end |
#deregister_job_definition(params = {}) ⇒ Struct
Deregisters an AWS Batch job definition. Job definitions are permanently deleted after 180 days.
920 921 922 923 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 920 def deregister_job_definition(params = {}, = {}) req = build_request(:deregister_job_definition, params) req.send_request() end |
#describe_compute_environments(params = {}) ⇒ Types::DescribeComputeEnvironmentsResponse
Describes one or more of your compute environments.
If you're 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.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1068 1069 1070 1071 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 1068 def describe_compute_environments(params = {}, = {}) req = build_request(:describe_compute_environments, params) req.send_request() end |
#describe_job_definitions(params = {}) ⇒ Types::DescribeJobDefinitionsResponse
Describes a list of job definitions. You can specify a status
(such
as ACTIVE
) to only return job definitions that match that status.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1304 1305 1306 1307 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 1304 def describe_job_definitions(params = {}, = {}) req = build_request(:describe_job_definitions, params) req.send_request() end |
#describe_job_queues(params = {}) ⇒ Types::DescribeJobQueuesResponse
Describes one or more of your job queues.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1404 1405 1406 1407 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 1404 def describe_job_queues(params = {}, = {}) req = build_request(:describe_job_queues, params) req.send_request() end |
#describe_jobs(params = {}) ⇒ Types::DescribeJobsResponse
Describes a list of AWS Batch jobs.
1647 1648 1649 1650 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 1647 def describe_jobs(params = {}, = {}) req = build_request(:describe_jobs, params) req.send_request() end |
#list_jobs(params = {}) ⇒ Types::ListJobsResponse
Returns a list of AWS Batch jobs.
You must specify only one of the following items:
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 don't specify a status, only RUNNING
jobs are
returned.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1786 1787 1788 1789 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 1786 def list_jobs(params = {}, = {}) req = build_request(:list_jobs, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags for an AWS Batch resource. AWS Batch resources that support tags are compute environments, jobs, job definitions, and job queues. ARNs for child jobs of array and multi-node parallel (MNP) jobs are not supported.
1839 1840 1841 1842 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 1839 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#register_job_definition(params = {}) ⇒ Types::RegisterJobDefinitionResponse
Registers an AWS Batch job definition.
2231 2232 2233 2234 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 2231 def register_job_definition(params = {}, = {}) req = build_request(:register_job_definition, params) req.send_request() end |
#submit_job(params = {}) ⇒ Types::SubmitJobResponse
Submits an AWS Batch job from a job definition. Parameters specified during SubmitJob override parameters defined in the job definition.
Jobs run on Fargate resources don't run for more than 14 days. After 14 days, the Fargate resources might no longer be available and the job is terminated.
2458 2459 2460 2461 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 2458 def submit_job(params = {}, = {}) req = build_request(:submit_job, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Associates the specified tags to a resource with the specified
resourceArn
. If existing tags on a resource aren't specified in the
request parameters, they aren't changed. When a resource is deleted,
the tags associated with that resource are deleted as well. AWS Batch
resources that support tags are compute environments, jobs, job
definitions, and job queues. ARNs for child jobs of array and
multi-node parallel (MNP) jobs are not supported.
2518 2519 2520 2521 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 2518 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#terminate_job(params = {}) ⇒ Struct
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.
2563 2564 2565 2566 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 2563 def terminate_job(params = {}, = {}) req = build_request(:terminate_job, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Deletes specified tags from an AWS Batch resource.
2608 2609 2610 2611 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 2608 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_compute_environment(params = {}) ⇒ Types::UpdateComputeEnvironmentResponse
Updates an AWS Batch compute environment.
2713 2714 2715 2716 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 2713 def update_compute_environment(params = {}, = {}) req = build_request(:update_compute_environment, params) req.send_request() end |
#update_job_queue(params = {}) ⇒ Types::UpdateJobQueueResponse
Updates a job queue.
2799 2800 2801 2802 |
# File 'gems/aws-sdk-batch/lib/aws-sdk-batch/client.rb', line 2799 def update_job_queue(params = {}, = {}) req = build_request(:update_job_queue, params) req.send_request() end |