Skip to content

BatchClient#

Index > Batch > BatchClient

Auto-generated documentation for Batch type annotations stubs module mypy-boto3-batch.

BatchClient#

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

# BatchClient usage example

from boto3.session import Session
from mypy_boto3_batch.client import BatchClient

def get_batch_client() -> BatchClient:
    return Session().client("batch")

Exceptions#

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

# Exceptions.exceptions usage example

client = boto3.client("batch")

try:
    do_something(client)
except (
    client.exceptions.ClientError,
    client.exceptions.ClientException,
    client.exceptions.ServerException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_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 boto3.client("batch").can_paginate method. boto3 documentation

# can_paginate 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 boto3.client("batch").cancel_job method. boto3 documentation

# cancel_job method definition

def cancel_job(
    self,
    *,
    jobId: str,
    reason: str,
) -> Dict[str, Any]:
    ...
# cancel_job method usage example with argument unpacking

kwargs: CancelJobRequestRequestTypeDef = {  # (1)
    "jobId": ...,
    "reason": ...,
}

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

close#

Closes underlying endpoint connections.

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

# close method definition

def close(
    self,
) -> None:
    ...

create_compute_environment#

Creates an Batch compute environment.

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

# create_compute_environment method definition

def create_compute_environment(
    self,
    *,
    computeEnvironmentName: str,
    type: CETypeType,  # (1)
    state: CEStateType = ...,  # (2)
    unmanagedvCpus: int = ...,
    computeResources: Union[ComputeResourceTypeDef, ComputeResourceExtraOutputTypeDef] = ...,  # (3)
    serviceRole: str = ...,
    tags: Mapping[str, str] = ...,
    eksConfiguration: EksConfigurationTypeDef = ...,  # (4)
) -> CreateComputeEnvironmentResponseTypeDef:  # (5)
    ...
  1. See CETypeType
  2. See CEStateType
  3. See ComputeResourceTypeDef ComputeResourceExtraOutputTypeDef
  4. See EksConfigurationTypeDef
  5. See CreateComputeEnvironmentResponseTypeDef
# create_compute_environment method usage example with argument unpacking

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 boto3.client("batch").create_job_queue method. boto3 documentation

# create_job_queue method definition

def create_job_queue(
    self,
    *,
    jobQueueName: str,
    priority: int,
    computeEnvironmentOrder: Sequence[ComputeEnvironmentOrderTypeDef],  # (1)
    state: JQStateType = ...,  # (2)
    schedulingPolicyArn: str = ...,
    tags: Mapping[str, str] = ...,
    jobStateTimeLimitActions: Sequence[JobStateTimeLimitActionTypeDef] = ...,  # (3)
) -> CreateJobQueueResponseTypeDef:  # (4)
    ...
  1. See ComputeEnvironmentOrderTypeDef
  2. See JQStateType
  3. See JobStateTimeLimitActionTypeDef
  4. See CreateJobQueueResponseTypeDef
# create_job_queue method usage example with argument unpacking

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 boto3.client("batch").create_scheduling_policy method. boto3 documentation

# create_scheduling_policy method definition

def create_scheduling_policy(
    self,
    *,
    name: str,
    fairsharePolicy: Union[FairsharePolicyTypeDef, FairsharePolicyOutputTypeDef] = ...,  # (1)
    tags: Mapping[str, str] = ...,
) -> CreateSchedulingPolicyResponseTypeDef:  # (2)
    ...
  1. See FairsharePolicyTypeDef FairsharePolicyOutputTypeDef
  2. See CreateSchedulingPolicyResponseTypeDef
# create_scheduling_policy method usage example with argument unpacking

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 boto3.client("batch").delete_compute_environment method. boto3 documentation

# delete_compute_environment method definition

def delete_compute_environment(
    self,
    *,
    computeEnvironment: str,
) -> Dict[str, Any]:
    ...
# delete_compute_environment method usage example with argument unpacking

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 boto3.client("batch").delete_job_queue method. boto3 documentation

# delete_job_queue method definition

def delete_job_queue(
    self,
    *,
    jobQueue: str,
) -> Dict[str, Any]:
    ...
# delete_job_queue method usage example with argument unpacking

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 boto3.client("batch").delete_scheduling_policy method. boto3 documentation

# delete_scheduling_policy method definition

def delete_scheduling_policy(
    self,
    *,
    arn: str,
) -> Dict[str, Any]:
    ...
# delete_scheduling_policy method usage example with argument unpacking

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 boto3.client("batch").deregister_job_definition method. boto3 documentation

# deregister_job_definition method definition

def deregister_job_definition(
    self,
    *,
    jobDefinition: str,
) -> Dict[str, Any]:
    ...
# deregister_job_definition method usage example with argument unpacking

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 boto3.client("batch").describe_compute_environments method. boto3 documentation

# describe_compute_environments method definition

def describe_compute_environments(
    self,
    *,
    computeEnvironments: Sequence[str] = ...,
    maxResults: int = ...,
    nextToken: str = ...,
) -> DescribeComputeEnvironmentsResponseTypeDef:  # (1)
    ...
  1. See DescribeComputeEnvironmentsResponseTypeDef
# describe_compute_environments method usage example with argument unpacking

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 boto3.client("batch").describe_job_definitions method. boto3 documentation

# describe_job_definitions method definition

def describe_job_definitions(
    self,
    *,
    jobDefinitions: Sequence[str] = ...,
    maxResults: int = ...,
    jobDefinitionName: str = ...,
    status: str = ...,
    nextToken: str = ...,
) -> DescribeJobDefinitionsResponseTypeDef:  # (1)
    ...
  1. See DescribeJobDefinitionsResponseTypeDef
# describe_job_definitions method usage example with argument unpacking

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 boto3.client("batch").describe_job_queues method. boto3 documentation

# describe_job_queues method definition

def describe_job_queues(
    self,
    *,
    jobQueues: Sequence[str] = ...,
    maxResults: int = ...,
    nextToken: str = ...,
) -> DescribeJobQueuesResponseTypeDef:  # (1)
    ...
  1. See DescribeJobQueuesResponseTypeDef
# describe_job_queues method usage example with argument unpacking

kwargs: DescribeJobQueuesRequestRequestTypeDef = {  # (1)
    "jobQueues": ...,
}

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

describe_jobs#

Describes a list of Batch jobs.

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