Batch class

Using Batch, you can run batch computing workloads on the Amazon Web Services Cloud. Batch computing is a common means for developers, scientists, and engineers to access large amounts of compute resources. Batch uses the advantages of the batch computing to remove the undifferentiated heavy lifting of configuring and managing required infrastructure. At the same time, it also adopts a familiar batch computing software approach. You can use Batch to efficiently provision resources, and work toward eliminating capacity constraints, reducing your overall compute costs, and delivering results more quickly.

Constructors

Batch({required String region, AwsClientCredentials? credentials, AwsClientCredentialsProvider? credentialsProvider, Client? client, String? endpointUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancelJob({required String jobId, required String reason}) Future<void>
Cancels a job in an Batch job queue. Jobs that are in a SUBMITTED, PENDING, or RUNNABLE state are cancelled and the job status is updated to FAILED.
close() → void
Closes the internal HTTP client if none was provided at creation. If a client was passed as a constructor argument, this becomes a noop.
createComputeEnvironment({required String computeEnvironmentName, required CEType type, ComputeResource? computeResources, String? context, EksConfiguration? eksConfiguration, String? serviceRole, CEState? state, Map<String, String>? tags, int? unmanagedvCpus}) Future<CreateComputeEnvironmentResponse>
Creates an Batch compute environment. You can create MANAGED or UNMANAGED compute environments. MANAGED compute environments can use Amazon EC2 or Fargate resources. UNMANAGED compute environments can only use EC2 resources.
createConsumableResource({required String consumableResourceName, String? resourceType, Map<String, String>? tags, int? totalQuantity}) Future<CreateConsumableResourceResponse>
Creates an Batch consumable resource.
createJobQueue({required String jobQueueName, required int priority, List<ComputeEnvironmentOrder>? computeEnvironmentOrder, JobQueueType? jobQueueType, List<JobStateTimeLimitAction>? jobStateTimeLimitActions, String? schedulingPolicyArn, List<ServiceEnvironmentOrder>? serviceEnvironmentOrder, JQState? state, Map<String, String>? tags}) Future<CreateJobQueueResponse>
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.
createQuotaShare({required List<QuotaShareCapacityLimit> capacityLimits, required String jobQueue, required QuotaSharePreemptionConfiguration preemptionConfiguration, required String quotaShareName, required QuotaShareResourceSharingConfiguration resourceSharingConfiguration, QuotaShareState? state, Map<String, String>? tags}) Future<CreateQuotaShareResponse>
Creates an Batch quota share. Each quota share operates as a virtual queue with a configured compute capacity, resource sharing strategy, and borrow limits.
createSchedulingPolicy({required String name, FairsharePolicy? fairsharePolicy, QuotaSharePolicy? quotaSharePolicy, Map<String, String>? tags}) Future<CreateSchedulingPolicyResponse>
Creates an Batch scheduling policy.
createServiceEnvironment({required List<CapacityLimit> capacityLimits, required String serviceEnvironmentName, required ServiceEnvironmentType serviceEnvironmentType, ServiceEnvironmentState? state, Map<String, String>? tags}) Future<CreateServiceEnvironmentResponse>
Creates a service environment for running service jobs. Service environments define capacity limits for specific service types such as SageMaker Training jobs.
deleteComputeEnvironment({required String computeEnvironment}) Future<void>
Deletes an Batch compute environment.
deleteConsumableResource({required String consumableResource}) Future<void>
Deletes the specified consumable resource.
deleteJobQueue({required String jobQueue}) Future<void>
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.
deleteQuotaShare({required String quotaShareArn}) Future<void>
Deletes the specified quota share. You must first disable submissions for the share by updating the state to DISABLED using the UpdateQuotaShare operation. All jobs in the share are eventually terminated when you delete a quota share.
deleteSchedulingPolicy({required String arn}) Future<void>
Deletes the specified scheduling policy.
deleteServiceEnvironment({required String serviceEnvironment}) Future<void>
Deletes a Service environment. Before you can delete a service environment, you must first set its state to DISABLED with the UpdateServiceEnvironment API operation and disassociate it from any job queues with the UpdateJobQueue API operation.
deregisterJobDefinition({required String jobDefinition}) Future<void>
Deregisters an Batch job definition. Job definitions are permanently deleted after 180 days.
describeComputeEnvironments({List<String>? computeEnvironments, int? maxResults, String? nextToken}) Future<DescribeComputeEnvironmentsResponse>
Describes one or more of your compute environments.
describeConsumableResource({required String consumableResource}) Future<DescribeConsumableResourceResponse>
Returns a description of the specified consumable resource.
describeJobDefinitions({String? jobDefinitionName, List<String>? jobDefinitions, int? maxResults, String? nextToken, String? status}) Future<DescribeJobDefinitionsResponse>
Describes a list of job definitions. You can specify a status (such as ACTIVE) to only return job definitions that match that status.
describeJobQueues({List<String>? jobQueues, int? maxResults, String? nextToken}) Future<DescribeJobQueuesResponse>
Describes one or more of your job queues.
describeJobs({required List<String> jobs}) Future<DescribeJobsResponse>
Describes a list of Batch jobs.
describeQuotaShare({required String quotaShareArn}) Future<DescribeQuotaShareResponse>
Returns a description of the specified quota share.
describeSchedulingPolicies({required List<String> arns}) Future<DescribeSchedulingPoliciesResponse>
Describes one or more of your scheduling policies.
describeServiceEnvironments({int? maxResults, String? nextToken, List<String>? serviceEnvironments}) Future<DescribeServiceEnvironmentsResponse>
Describes one or more of your service environments.
describeServiceJob({required String jobId}) Future<DescribeServiceJobResponse>
The details of a service job.
getJobQueueSnapshot({required String jobQueue}) Future<GetJobQueueSnapshotResponse>
Provides a snapshot of job queue state, including ordering of RUNNABLE jobs, as well as capacity utilization for already dispatched jobs. The first 100 RUNNABLE jobs in the job queue are listed in order of dispatch. For job queues with an attached quota-share policy, the first RUNNABLE job in each quota share is also listed. Capacity utilization for the job queue is provided, as well as break downs by share for job queues with attached fair-share or quota-share scheduling policies.
listConsumableResources({List<KeyValuesPair>? filters, int? maxResults, String? nextToken}) Future<ListConsumableResourcesResponse>
Returns a list of Batch consumable resources.
listJobs({String? arrayJobId, List<KeyValuesPair>? filters, String? jobQueue, JobStatus? jobStatus, int? maxResults, String? multiNodeJobId, String? nextToken}) Future<ListJobsResponse>
Returns a list of Batch jobs.
listJobsByConsumableResource({required String consumableResource, List<KeyValuesPair>? filters, int? maxResults, String? nextToken}) Future<ListJobsByConsumableResourceResponse>
Returns a list of Batch jobs that require a specific consumable resource.
listQuotaShares({required String jobQueue, int? maxResults, String? nextToken}) Future<ListQuotaSharesResponse>
Returns a list of Batch quota shares associated with a job queue.
listSchedulingPolicies({int? maxResults, String? nextToken}) Future<ListSchedulingPoliciesResponse>
Returns a list of Batch scheduling policies.
listServiceJobs({List<KeyValuesPair>? filters, String? jobQueue, ServiceJobStatus? jobStatus, int? maxResults, String? nextToken}) Future<ListServiceJobsResponse>
Returns a list of service jobs for a specified job queue.
listTagsForResource({required String resourceArn}) Future<ListTagsForResourceResponse>
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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerJobDefinition({required String jobDefinitionName, required JobDefinitionType type, ConsumableResourceProperties? consumableResourceProperties, ContainerProperties? containerProperties, EcsProperties? ecsProperties, EksProperties? eksProperties, NodeProperties? nodeProperties, Map<String, String>? parameters, List<PlatformCapability>? platformCapabilities, bool? propagateTags, RetryStrategy? retryStrategy, int? schedulingPriority, Map<String, String>? tags, JobTimeout? timeout}) Future<RegisterJobDefinitionResponse>
Registers an Batch job definition.
submitJob({required String jobDefinition, required String jobName, required String jobQueue, ArrayProperties? arrayProperties, ConsumableResourceProperties? consumableResourcePropertiesOverride, ContainerOverrides? containerOverrides, List<JobDependency>? dependsOn, EcsPropertiesOverride? ecsPropertiesOverride, EksPropertiesOverride? eksPropertiesOverride, NodeOverrides? nodeOverrides, Map<String, String>? parameters, bool? propagateTags, RetryStrategy? retryStrategy, int? schedulingPriorityOverride, String? shareIdentifier, Map<String, String>? tags, JobTimeout? timeout}) Future<SubmitJobResponse>
Submits an Batch job from a job definition. Parameters that are specified during SubmitJob override parameters defined in the job definition. vCPU and memory requirements that are specified in the resourceRequirements objects in the job definition are the exception. They can't be overridden this way using the memory and vcpus parameters. Rather, you must specify updates to job definition parameters in a resourceRequirements object that's included in the containerOverrides parameter.
submitServiceJob({required String jobName, required String jobQueue, required ServiceJobType serviceJobType, required String serviceRequestPayload, String? clientToken, ServiceJobPreemptionConfiguration? preemptionConfiguration, String? quotaShareName, ServiceJobRetryStrategy? retryStrategy, int? schedulingPriority, String? shareIdentifier, Map<String, String>? tags, ServiceJobTimeout? timeoutConfig}) Future<SubmitServiceJobResponse>
Submits a service job to a specified job queue to run on SageMaker AI. A service job is a unit of work that you submit to Batch for execution on SageMaker AI.
tagResource({required String resourceArn, required Map<String, String> tags}) Future<void>
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 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.
terminateJob({required String jobId, required String reason}) Future<void>
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.
terminateServiceJob({required String jobId, required String reason}) Future<void>
Terminates a service job in a job queue.
toString() String
A string representation of this object.
inherited
untagResource({required String resourceArn, required List<String> tagKeys}) Future<void>
Deletes specified tags from an Batch resource.
updateComputeEnvironment({required String computeEnvironment, ComputeResourceUpdate? computeResources, String? context, String? serviceRole, CEState? state, int? unmanagedvCpus, UpdatePolicy? updatePolicy}) Future<UpdateComputeEnvironmentResponse>
Updates an Batch compute environment.
updateConsumableResource({required String consumableResource, String? clientToken, String? operation, int? quantity}) Future<UpdateConsumableResourceResponse>
Updates a consumable resource.
updateJobQueue({required String jobQueue, List<ComputeEnvironmentOrder>? computeEnvironmentOrder, List<JobStateTimeLimitAction>? jobStateTimeLimitActions, int? priority, String? schedulingPolicyArn, List<ServiceEnvironmentOrder>? serviceEnvironmentOrder, JQState? state}) Future<UpdateJobQueueResponse>
Updates a job queue.
updateQuotaShare({required String quotaShareArn, List<QuotaShareCapacityLimit>? capacityLimits, QuotaSharePreemptionConfiguration? preemptionConfiguration, QuotaShareResourceSharingConfiguration? resourceSharingConfiguration, QuotaShareState? state}) Future<UpdateQuotaShareResponse>
Updates a quota share.
updateSchedulingPolicy({required String arn, FairsharePolicy? fairsharePolicy, QuotaSharePolicy? quotaSharePolicy}) Future<void>
Updates a scheduling policy.
updateServiceEnvironment({required String serviceEnvironment, List<CapacityLimit>? capacityLimits, ServiceEnvironmentState? state}) Future<UpdateServiceEnvironmentResponse>
Updates a service environment. You can update the state of a service environment from ENABLED to DISABLED to prevent new service jobs from being placed in the service environment.
updateServiceJob({required String jobId, required int schedulingPriority}) Future<UpdateServiceJobResponse>
Updates the priority of a specified service job in an Batch job queue.

Operators

operator ==(Object other) bool
The equality operator.
inherited