job#

Utilities for working with Azure Batch jobs.

Functions#

create_job(→ bool)

Create an Azure Batch job if it does

Module Contents#

create_job(client: azure.batch.BatchServiceClient, job: azure.batch.models.JobAddParameter, verify_pool: bool = True, exist_ok: bool = False, verbose: bool = False, **kwargs) bool#

Create an Azure Batch job if it does not already exist, returning True if the job was created successfully.

By default, verifies that the Azure Batch pool specified for the job exists, erroring if the pool cannot be found.

If the job itself already exists, errors by default but can also be configured to proceed without modifying or deleting the existing job.

Parameters#

client

BatchServiceClient to use when creating the job.

job

JobAddParameter instance defining the job to add.

verify_pool

Verify that the specified pool for the job exists before attempting to create the job, and error if it cannot be found? Default True.

exist_ok

Proceed if the job already exists (without attempting to update/modify/overwrite it)? Default False (error if the job already exists).

verbose

Message to stdout if on success or failure due to job already existing? Default False.

**kwargs

Additional keyword arguments passed to azure.batch.BatchServiceClient.job.add().

Returns#

bool

True if the job is successfully created. False if the job already exists and exist_ok is set to True.

Raises#

ValueError

If the pool for the job cannot be found and verify_pool is True.

models.BatchErrorException

if the job exists and exist_ok is not ``True.