Skip to content

BatchClient

Index > Batch > BatchClient

Auto-generated documentation for Batch type annotations stubs module types-aiobotocore-batch.

BatchClient

Type annotations and code completion for session.client("batch") boto3 documentation

Usage example
from aioboto3.session import Session
from types_aiobotocore_batch.client import BatchClient

session = Session()
async with session.client("batch") as client:
    client: BatchClient

Exceptions

aioboto3 client exceptions are generated in runtime. This class provides code completion for session.client("batch").exceptions structure.

Usage example
async with session.client("batch") as client:
    try:
        do_something(client)
    except (
            client.ClientError,
        client.ClientException,
        client.ServerException,
    ) as e:
        print(e)
Type checking example
from types_aiobotocore_batch.client import Exceptions

def handle_error(exc: Exceptions.ClientError) -> None:
    ...

Methods

can_paginate

Check if an operation can be paginated.

Type annotations and code completion for session.client("batch").can_paginate method. boto3 documentation

Method definition
def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

cancel_job

Cancels a job in an Batch job queue.

Type annotations and code completion for session.client("batch").cancel_job method. boto3 documentation

Method definition
await def cancel_job(
    self,
    *,
    jobId: str,
    reason: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: CancelJobRequestRequestTypeDef = {  # (1)
    "jobId": ...,
    "reason": ...,
}

parent.cancel_job(**kwargs)
  1. See CancelJobRequestRequestTypeDef

close

Closes underlying endpoint connections.

Type annotations and code completion for session.client("batch").close method. boto3 documentation

Method definition
await def close(
    self,
) -> None:
    ...

create_compute_environment

.

Type annotations and code completion for session.client("batch").create_compute_environment method. boto3 documentation

Method definition
await def create_compute_environment(
    self,
    *,
    computeEnvironmentName: str,
    type: CETypeType,  # (1)
    state: CEStateType = ...,  # (2)
    unmanagedvCpus: int = ...,
    computeResources: ComputeResourceTypeDef = ...,  # (3)
    serviceRole: str = ...,
    tags: Mapping[str, str] = ...,
) -> CreateComputeEnvironmentResponseTypeDef:  # (4)
    ...
  1. See CETypeType
  2. See CEStateType
  3. See ComputeResourceTypeDef
  4. See CreateComputeEnvironmentResponseTypeDef
Usage example with kwargs
kwargs: CreateComputeEnvironmentRequestRequestTypeDef = {  # (1)
    "computeEnvironmentName": ...,
    "type": ...,
}

parent.create_compute_environment(**kwargs)
  1. See CreateComputeEnvironmentRequestRequestTypeDef

create_job_queue

Creates an Batch job queue.

Type annotations and code completion for session.client("batch").create_job_queue method. boto3 documentation

Method definition
await def create_job_queue(
    self,
    *,
    jobQueueName: str,
    priority: int,
    computeEnvironmentOrder: Sequence[ComputeEnvironmentOrderTypeDef],  # (1)
    state: JQStateType = ...,  # (2)
    schedulingPolicyArn: str = ...,
    tags: Mapping[str, str] = ...,
) -> CreateJobQueueResponseTypeDef:  # (3)
    ...
  1. See ComputeEnvironmentOrderTypeDef
  2. See JQStateType
  3. See CreateJobQueueResponseTypeDef
Usage example with kwargs
kwargs: CreateJobQueueRequestRequestTypeDef = {  # (1)
    "jobQueueName": ...,
    "priority": ...,
    "computeEnvironmentOrder": ...,
}

parent.create_job_queue(**kwargs)
  1. See CreateJobQueueRequestRequestTypeDef

create_scheduling_policy

Creates an Batch scheduling policy.

Type annotations and code completion for session.client("batch").create_scheduling_policy method. boto3 documentation

Method definition
await def create_scheduling_policy(
    self,
    *,
    name: str,
    fairsharePolicy: FairsharePolicyTypeDef = ...,  # (1)
    tags: Mapping[str, str] = ...,
) -> CreateSchedulingPolicyResponseTypeDef:  # (2)
    ...
  1. See FairsharePolicyTypeDef
  2. See CreateSchedulingPolicyResponseTypeDef
Usage example with kwargs
kwargs: CreateSchedulingPolicyRequestRequestTypeDef = {  # (1)
    "name": ...,
}

parent.create_scheduling_policy(**kwargs)
  1. See CreateSchedulingPolicyRequestRequestTypeDef

delete_compute_environment

Deletes an Batch compute environment.

Type annotations and code completion for session.client("batch").delete_compute_environment method. boto3 documentation

Method definition
await def delete_compute_environment(
    self,
    *,
    computeEnvironment: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DeleteComputeEnvironmentRequestRequestTypeDef = {  # (1)
    "computeEnvironment": ...,
}

parent.delete_compute_environment(**kwargs)
  1. See DeleteComputeEnvironmentRequestRequestTypeDef

delete_job_queue

Deletes the specified job queue.

Type annotations and code completion for session.client("batch").delete_job_queue method. boto3 documentation

Method definition
await def delete_job_queue(
    self,
    *,
    jobQueue: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DeleteJobQueueRequestRequestTypeDef = {  # (1)
    "jobQueue": ...,
}

parent.delete_job_queue(**kwargs)
  1. See DeleteJobQueueRequestRequestTypeDef

delete_scheduling_policy

Deletes the specified scheduling policy.

Type annotations and code completion for session.client("batch").delete_scheduling_policy method. boto3 documentation

Method definition
await def delete_scheduling_policy(
    self,
    *,
    arn: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DeleteSchedulingPolicyRequestRequestTypeDef = {  # (1)
    "arn": ...,
}

parent.delete_scheduling_policy(**kwargs)
  1. See DeleteSchedulingPolicyRequestRequestTypeDef

deregister_job_definition

Deregisters an Batch job definition.

Type annotations and code completion for session.client("batch").deregister_job_definition method. boto3 documentation

Method definition
await def deregister_job_definition(
    self,
    *,
    jobDefinition: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DeregisterJobDefinitionRequestRequestTypeDef = {  # (1)
    "jobDefinition": ...,
}

parent.deregister_job_definition(**kwargs)
  1. See DeregisterJobDefinitionRequestRequestTypeDef

describe_compute_environments

Describes one or more of your compute environments.

Type annotations and code completion for session.client("batch").describe_compute_environments method. boto3 documentation

Method definition
await def describe_compute_environments(
    self,
    *,
    computeEnvironments: Sequence[str] = ...,
    maxResults: int = ...,
    nextToken: str = ...,
) -> DescribeComputeEnvironmentsResponseTypeDef:  # (1)
    ...
  1. See DescribeComputeEnvironmentsResponseTypeDef
Usage example with kwargs
kwargs: DescribeComputeEnvironmentsRequestRequestTypeDef = {  # (1)
    "computeEnvironments": ...,
}

parent.describe_compute_environments(**kwargs)
  1. See DescribeComputeEnvironmentsRequestRequestTypeDef

describe_job_definitions

Describes a list of job definitions.

Type annotations and code completion for session.client("batch").describe_job_definitions method. boto3 documentation

Method definition
await def describe_job_definitions(
    self,
    *,
    jobDefinitions: Sequence[str] = ...,
    maxResults: int = ...,
    jobDefinitionName: str = ...,
    status: str = ...,
    nextToken: str = ...,
) -> DescribeJobDefinitionsResponseTypeDef:  # (1)
    ...
  1. See DescribeJobDefinitionsResponseTypeDef
Usage example with kwargs
kwargs: DescribeJobDefinitionsRequestRequestTypeDef = {  # (1)
    "jobDefinitions": ...,
}

parent.describe_job_definitions(**kwargs)
  1. See DescribeJobDefinitionsRequestRequestTypeDef

describe_job_queues

Describes one or more of your job queues.

Type annotations and code completion for session.client("batch").describe_job_queues method. boto3 documentation

Method definition
await def describe_job_queues(
    self,
    *,
    jobQueues: Sequence[str] = ...,
    maxResults: int = ...,
    nextToken: str = ...,
) -> DescribeJobQueuesResponseTypeDef:  # (1)
    ...
  1. See DescribeJobQueuesResponseTypeDef
Usage example with kwargs
kwargs: DescribeJobQueuesRequestRequestTypeDef = {  # (1)
    "jobQueues": ...,
}

parent.describe_job_queues(**kwargs)
  1. See DescribeJobQueuesRequestRequestTypeDef

describe_jobs

.

Type annotations and code completion for session.client("batch").describe_jobs method. boto3 documentation

Method definition
await def describe_jobs(
    self,
    *,
    jobs: Sequence[str],
) -> DescribeJobsResponseTypeDef:  # (1)
    ...
  1. See DescribeJobsResponseTypeDef
Usage example with kwargs
kwargs: DescribeJobsRequestRequestTypeDef = {  # (1)
    "jobs": ...,
}

parent.describe_jobs(**kwargs)
  1. See DescribeJobsRequestRequestTypeDef

describe_scheduling_policies

Describes one or more of your scheduling policies.

Type annotations and code completion for session.client("batch").describe_scheduling_policies method. boto3 documentation

Method definition
await def describe_scheduling_policies(
    self,
    *,
    arns: Sequence[str],
) -> DescribeSchedulingPoliciesResponseTypeDef:  # (1)
    ...
  1. See DescribeSchedulingPoliciesResponseTypeDef
Usage example with kwargs
kwargs: DescribeSchedulingPoliciesRequestRequestTypeDef = {  # (1)
    "arns": ...,
}

parent.describe_scheduling_policies(**kwargs)
  1. See DescribeSchedulingPoliciesRequestRequestTypeDef

generate_presigned_url

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for session.client("batch").generate_presigned_url method. boto3 documentation

Method definition
await def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

list_jobs

Returns a list of Batch jobs.

Type annotations and code completion for session.client("batch").list_jobs method. boto3 documentation

Method definition
await def list_jobs(
    self,
    *,
    jobQueue: str = ...,
    arrayJobId: str = ...,
    multiNodeJobId: str = ...,
    jobStatus: JobStatusType = ...,  # (1)
    maxResults: int = ...,
    nextToken: str = ...,
    filters: Sequence[KeyValuesPairTypeDef] = ...,  # (2)
) -> ListJobsResponseTypeDef:  # (3)
    ...
  1. See JobStatusType
  2. See KeyValuesPairTypeDef
  3. See ListJobsResponseTypeDef
Usage example with kwargs
kwargs: ListJobsRequestRequestTypeDef = {  # (1)
    "jobQueue": ...,
}

parent.list_jobs(**kwargs)
  1. See ListJobsRequestRequestTypeDef

list_scheduling_policies

Returns a list of Batch scheduling policies.

Type annotations and code completion for session.client("batch").list_scheduling_policies method. boto3 documentation

Method definition
await def list_scheduling_policies(
    self,
    *,
    maxResults: int = ...,
    nextToken: str = ...,
) -> ListSchedulingPoliciesResponseTypeDef:  # (1)
    ...
  1. See ListSchedulingPoliciesResponseTypeDef
Usage example with kwargs
kwargs: ListSchedulingPoliciesRequestRequestTypeDef = {  # (1)
    "maxResults": ...,
}

parent.list_scheduling_policies(**kwargs)
  1. See ListSchedulingPoliciesRequestRequestTypeDef

list_tags_for_resource

Lists the tags for an Batch resource.

Type annotations and code completion for session.client("batch").list_tags_for_resource method. boto3 documentation

Method definition
await def list_tags_for_resource(
    self,
    *,
    resourceArn: str,
) -> ListTagsForResourceResponseTypeDef:  # (1)
    ...
  1. See ListTagsForResourceResponseTypeDef
Usage example with kwargs
kwargs: ListTagsForResourceRequestRequestTypeDef = {  # (1)
    "resourceArn": ...,
}

parent.list_tags_for_resource(**kwargs)
  1. See ListTagsForResourceRequestRequestTypeDef

register_job_definition

Registers an Batch job definition.

Type annotations and code completion for session.client("batch").register_job_definition method. boto3 documentation

Method definition
await def register_job_definition(
    self,
    *,
    jobDefinitionName: str,
    type: JobDefinitionTypeType,  # (1)
    parameters: Mapping[str, str] = ...,
    schedulingPriority: int = ...,
    containerProperties: ContainerPropertiesTypeDef = ...,  # (2)
    nodeProperties: NodePropertiesTypeDef = ...,  # (3)
    retryStrategy: RetryStrategyTypeDef = ...,  # (4)
    propagateTags: bool = ...,
    timeout: JobTimeoutTypeDef = ...,  # (5)
    tags: Mapping[str, str] = ...,
    platformCapabilities: Sequence[PlatformCapabilityType] = ...,  # (6)
) -> RegisterJobDefinitionResponseTypeDef:  # (7)
    ...
  1. See JobDefinitionTypeType
  2. See ContainerPropertiesTypeDef
  3. See NodePropertiesTypeDef
  4. See RetryStrategyTypeDef
  5. See JobTimeoutTypeDef
  6. See PlatformCapabilityType
  7. See RegisterJobDefinitionResponseTypeDef
Usage example with kwargs
kwargs: RegisterJobDefinitionRequestRequestTypeDef = {  # (1)
    "jobDefinitionName": ...,
    "type": ...,
}

parent.register_job_definition(**kwargs)
  1. See RegisterJobDefinitionRequestRequestTypeDef

submit_job

Submits an Batch job from a job definition.

Type annotations and code completion for session.client("batch").submit_job method. boto3 documentation

Method definition
await def submit_job(
    self,
    *,
    jobName: str,
    jobQueue: str,
    jobDefinition: str,
    shareIdentifier: str = ...,
    schedulingPriorityOverride: int = ...,
    arrayProperties: ArrayPropertiesTypeDef = ...,  # (1)
    dependsOn: Sequence[JobDependencyTypeDef] = ...,  # (2)
    parameters: Mapping[str, str] = ...,
    containerOverrides: ContainerOverridesTypeDef = ...,  # (3)
    nodeOverrides: NodeOverridesTypeDef = ...,  # (4)
    retryStrategy: RetryStrategyTypeDef = ...,  # (5)
    propagateTags: bool = ...,
    timeout: JobTimeoutTypeDef = ...,  # (6)
    tags: Mapping[str, str] = ...,
) -> SubmitJobResponseTypeDef:  # (7)
    ...
  1. See ArrayPropertiesTypeDef
  2. See JobDependencyTypeDef
  3. See ContainerOverridesTypeDef
  4. See NodeOverridesTypeDef
  5. See RetryStrategyTypeDef
  6. See JobTimeoutTypeDef
  7. See SubmitJobResponseTypeDef
Usage example with kwargs
kwargs: SubmitJobRequestRequestTypeDef = {  # (1)
    "jobName": ...,
    "jobQueue": ...,
    "jobDefinition": ...,
}

parent.submit_job(**kwargs)
  1. See SubmitJobRequestRequestTypeDef

tag_resource

Associates the specified tags to a resource with the specified resourceArn.

Type annotations and code completion for session.client("batch").tag_resource method. boto3 documentation

Method definition
await def tag_resource(
    self,
    *,
    resourceArn: str,
    tags: Mapping[str, str],
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: TagResourceRequestRequestTypeDef = {  # (1)
    "resourceArn": ...,
    "tags": ...,
}

parent.tag_resource(**kwargs)
  1. See TagResourceRequestRequestTypeDef

terminate_job

Terminates a job in a job queue.

Type annotations and code completion for session.client("batch").terminate_job method. boto3 documentation

Method definition
await def terminate_job(
    self,
    *,
    jobId: str,
    reason: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: TerminateJobRequestRequestTypeDef = {  # (1)
    "jobId": ...,
    "reason": ...,
}

parent.terminate_job(**kwargs)
  1. See TerminateJobRequestRequestTypeDef

untag_resource

Deletes specified tags from an Batch resource.

Type annotations and code completion for session.client("batch").untag_resource method. boto3 documentation

Method definition
await def untag_resource(
    self,
    *,
    resourceArn: str,
    tagKeys: Sequence[str],
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: UntagResourceRequestRequestTypeDef = {  # (1)
    "resourceArn": ...,
    "tagKeys": ...,
}

parent.untag_resource(**kwargs)
  1. See UntagResourceRequestRequestTypeDef

update_compute_environment

Updates an Batch compute environment.

Type annotations and code completion for session.client("batch").update_compute_environment method. boto3 documentation

Method definition
await def update_compute_environment(
    self,
    *,
    computeEnvironment: str,
    state: CEStateType = ...,  # (1)
    unmanagedvCpus: int = ...,
    computeResources: ComputeResourceUpdateTypeDef = ...,  # (2)
    serviceRole: str = ...,
    updatePolicy: UpdatePolicyTypeDef = ...,  # (3)
) -> UpdateComputeEnvironmentResponseTypeDef:  # (4)
    ...
  1. See CEStateType
  2. See ComputeResourceUpdateTypeDef
  3. See UpdatePolicyTypeDef
  4. See UpdateComputeEnvironmentResponseTypeDef
Usage example with kwargs
kwargs: UpdateComputeEnvironmentRequestRequestTypeDef = {  # (1)
    "computeEnvironment": ...,
}

parent.update_compute_environment(**kwargs)
  1. See UpdateComputeEnvironmentRequestRequestTypeDef

update_job_queue

Updates a job queue.

Type annotations and code completion for session.client("batch").update_job_queue method. boto3 documentation

Method definition
await def update_job_queue(
    self,
    *,
    jobQueue: str,
    state: JQStateType = ...,  # (1)
    schedulingPolicyArn: str = ...,
    priority: int = ...,
    computeEnvironmentOrder: Sequence[ComputeEnvironmentOrderTypeDef] = ...,  # (2)
) -> UpdateJobQueueResponseTypeDef:  # (3)
    ...
  1. See JQStateType
  2. See ComputeEnvironmentOrderTypeDef
  3. See UpdateJobQueueResponseTypeDef
Usage example with kwargs
kwargs: UpdateJobQueueRequestRequestTypeDef = {  # (1)
    "jobQueue": ...,
}

parent.update_job_queue(**kwargs)
  1. See UpdateJobQueueRequestRequestTypeDef

update_scheduling_policy

Updates a scheduling policy.

Type annotations and code completion for session.client("batch").update_scheduling_policy method. boto3 documentation

Method definition
await def update_scheduling_policy(
    self,
    *,
    arn: str,
    fairsharePolicy: FairsharePolicyTypeDef = ...,  # (1)
) -> Dict[str, Any]:
    ...
  1. See FairsharePolicyTypeDef
Usage example with kwargs
kwargs: UpdateSchedulingPolicyRequestRequestTypeDef = {  # (1)
    "arn": ...,
}

parent.update_scheduling_policy(**kwargs)
  1. See UpdateSchedulingPolicyRequestRequestTypeDef

__aenter__

Type annotations and code completion for session.client("batch").__aenter__ method. boto3 documentation

Method definition
await def __aenter__(
    self,
) -> BatchClient:
    ...

__aexit__

Type annotations and code completion for session.client("batch").__aexit__ method. boto3 documentation

Method definition
await def __aexit__(
    self,
    exc_type: Any,
    exc_val: Any,
    exc_tb: Any,
) -> Any:
    ...

get_paginator

Type annotations and code completion for session.client("batch").get_paginator method with overloads.