azure.batch.operations module

class azure.batch.operations.ApplicationOperations(client, config, serializer, deserializer)[source]

Bases: object

ApplicationOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client API Version. Constant value: “2017-05-01.5.0”.

get(application_id, application_get_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets information about the specified application.

Parameters:
  • application_id (str) – The ID of the application.
  • application_get_options (ApplicationGetOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

ApplicationSummary

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

list(application_list_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists all of the applications available in the specified account.

This operation returns only applications and versions that are available for use on compute nodes; that is, that can be used in an application package reference. For administrator information about applications and versions that are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API.

Parameters:
Return type:

ApplicationSummaryPaged

Raises:

BatchErrorException

class azure.batch.operations.PoolOperations(client, config, serializer, deserializer)[source]

Bases: object

PoolOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client API Version. Constant value: “2017-05-01.5.0”.

add(pool, pool_add_options=None, custom_headers=None, raw=False, **operation_config)[source]

Adds a pool to the specified account.

When naming pools, avoid including sensitive information such as user names or secret project names. This information may appear in telemetry logs accessible to Microsoft Support engineers.

Parameters:
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

delete(pool_id, pool_delete_options=None, custom_headers=None, raw=False, **operation_config)[source]

Deletes a pool from the specified account.

When you request that a pool be deleted, the following actions occur: the pool state is set to deleting; any ongoing resize operation on the pool are stopped; the Batch service starts resizing the pool to zero nodes; any tasks running on existing nodes are terminated and requeued (as if a resize pool operation had been requested with the default requeue option); finally, the pool is removed from the system. Because running tasks are requeued, the user can rerun these tasks by updating their job to target a different pool. The tasks can then run on the new pool. If you want to override the requeue behavior, then you should call resize pool explicitly to shrink the pool to zero size before deleting the pool. If you call an Update, Patch or Delete API on a pool in the deleting state, it will fail with HTTP status code 409 with error code PoolBeingDeleted.

Parameters:
  • pool_id (str) – The ID of the pool to delete.
  • pool_delete_options (PoolDeleteOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

disable_auto_scale(pool_id, pool_disable_auto_scale_options=None, custom_headers=None, raw=False, **operation_config)[source]

Disables automatic scaling for a pool.

Parameters:
  • pool_id (str) – The ID of the pool on which to disable automatic scaling.
  • pool_disable_auto_scale_options (PoolDisableAutoScaleOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

enable_auto_scale(pool_id, pool_enable_auto_scale_options=None, auto_scale_formula=None, auto_scale_evaluation_interval=None, custom_headers=None, raw=False, **operation_config)[source]

Enables automatic scaling for a pool.

You cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If automatic scaling of the pool is currently disabled, you must specify a valid autoscale formula as part of the request. If automatic scaling of the pool is already enabled, you may specify a new autoscale formula and/or a new evaluation interval. You cannot call this API for the same pool more than once every 30 seconds.

Parameters:
  • pool_id (str) – The ID of the pool on which to enable automatic scaling.
  • pool_enable_auto_scale_options (PoolEnableAutoScaleOptions) – Additional parameters for the operation
  • auto_scale_formula (str) – The formula for the desired number of compute nodes in the pool. The formula is checked for validity before it is applied to the pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
  • auto_scale_evaluation_interval (timedelta) – The time interval at which to automatically adjust the pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

evaluate_auto_scale(pool_id, auto_scale_formula, pool_evaluate_auto_scale_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets the result of evaluating an automatic scaling formula on the pool.

This API is primarily for validating an autoscale formula, as it simply returns the result without applying the formula to the pool.

Parameters:
  • pool_id (str) – The ID of the pool on which to evaluate the automatic scaling formula.
  • auto_scale_formula (str) – The formula for the desired number of compute nodes in the pool. The formula is validated and its results calculated, but it is not applied to the pool. To apply the formula to the pool, ‘Enable automatic scaling on a pool’. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
  • pool_evaluate_auto_scale_options (PoolEvaluateAutoScaleOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

AutoScaleRun

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

exists(pool_id, pool_exists_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets basic properties of a pool.

Parameters:
  • pool_id (str) – The ID of the pool to get.
  • pool_exists_options (PoolExistsOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

bool

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get(pool_id, pool_get_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets information about the specified pool.

Parameters:
  • pool_id (str) – The ID of the pool to get.
  • pool_get_options (PoolGetOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

CloudPool

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get_all_lifetime_statistics(pool_get_all_lifetime_statistics_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets lifetime summary statistics for all of the pools in the specified account.

Statistics are aggregated across all pools that have ever existed in the account, from account creation to the last update time of the statistics.

Parameters:
Return type:

PoolStatistics

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

list(pool_list_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists all of the pools in the specified account.

Parameters:
  • pool_list_options (PoolListOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

CloudPoolPaged

Raises:

BatchErrorException

list_usage_metrics(pool_list_usage_metrics_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists the usage metrics, aggregated by pool across individual time intervals, for the specified account.

If you do not specify a $filter clause including a poolId, the response includes all pools that existed in the account in the time range of the returned aggregation intervals.

Parameters:
Return type:

PoolUsageMetricsPaged

Raises:

BatchErrorException

patch(pool_id, pool_patch_parameter, pool_patch_options=None, custom_headers=None, raw=False, **operation_config)[source]

Updates the properties of the specified pool.

This only replaces the pool properties specified in the request. For example, if the pool has a start task associated with it, and a request does not specify a start task element, then the pool keeps the existing start task.

Parameters:
  • pool_id (str) – The ID of the pool to update.
  • pool_patch_parameter (PoolPatchParameter) – The parameters for the request.
  • pool_patch_options (PoolPatchOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

remove_nodes(pool_id, node_remove_parameter, pool_remove_nodes_options=None, custom_headers=None, raw=False, **operation_config)[source]

Removes compute nodes from the specified pool.

This operation can only run when the allocation state of the pool is steady. When this operation runs, the allocation state changes from steady to resizing.

Parameters:
  • pool_id (str) – The ID of the pool from which you want to remove nodes.
  • node_remove_parameter (NodeRemoveParameter) – The parameters for the request.
  • pool_remove_nodes_options (PoolRemoveNodesOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

resize(pool_id, pool_resize_parameter, pool_resize_options=None, custom_headers=None, raw=False, **operation_config)[source]

Changes the number of compute nodes that are assigned to a pool.

You can only resize a pool when its allocation state is steady. If the pool is already resizing, the request fails with status code 409. When you resize a pool, the pool’s allocation state changes from steady to resizing. You cannot resize pools which are configured for automatic scaling. If you try to do this, the Batch service returns an error 409. If you resize a pool downwards, the Batch service chooses which nodes to remove. To remove specific nodes, use the pool remove nodes API instead.

Parameters:
  • pool_id (str) – The ID of the pool to resize.
  • pool_resize_parameter (PoolResizeParameter) – The parameters for the request.
  • pool_resize_options (PoolResizeOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

stop_resize(pool_id, pool_stop_resize_options=None, custom_headers=None, raw=False, **operation_config)[source]

Stops an ongoing resize operation on the pool.

This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created.

Parameters:
  • pool_id (str) – The ID of the pool whose resizing you want to stop.
  • pool_stop_resize_options (PoolStopResizeOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

update_properties(pool_id, pool_update_properties_parameter, pool_update_properties_options=None, custom_headers=None, raw=False, **operation_config)[source]

Updates the properties of the specified pool.

This fully replaces all the updateable properties of the pool. For example, if the pool has a start task associated with it and if start task is not specified with this request, then the Batch service will remove the existing start task.

Parameters:
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

upgrade_os(pool_id, target_os_version, pool_upgrade_os_options=None, custom_headers=None, raw=False, **operation_config)[source]

Upgrades the operating system of the specified pool.

During an upgrade, the Batch service upgrades each compute node in the pool. When a compute node is chosen for upgrade, any tasks running on that node are removed from the node and returned to the queue to be rerun later (or on a different compute node). The node will be unavailable until the upgrade is complete. This operation results in temporarily reduced pool capacity as nodes are taken out of service to be upgraded. Although the Batch service tries to avoid upgrading all compute nodes at the same time, it does not guarantee to do this (particularly on small pools); therefore, the pool may be temporarily unavailable to run tasks. When this operation runs, the pool state changes to upgrading. When all compute nodes have finished upgrading, the pool state returns to active.

Parameters:
  • pool_id (str) – The ID of the pool to upgrade.
  • target_os_version (str) – The Azure Guest OS version to be installed on the virtual machines in the pool.
  • pool_upgrade_os_options (PoolUpgradeOsOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

class azure.batch.operations.AccountOperations(client, config, serializer, deserializer)[source]

Bases: object

AccountOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client API Version. Constant value: “2017-05-01.5.0”.

list_node_agent_skus(account_list_node_agent_skus_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists all node agent SKUs supported by the Azure Batch service.

Parameters:
Return type:

NodeAgentSkuPaged

Raises:

BatchErrorException

class azure.batch.operations.JobOperations(client, config, serializer, deserializer)[source]

Bases: object

JobOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client API Version. Constant value: “2017-05-01.5.0”.

add(job, job_add_options=None, custom_headers=None, raw=False, **operation_config)[source]

Adds a job to the specified account.

The Batch service supports two ways to control the work done as part of a job. In the first approach, the user specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming jobs, avoid including sensitive information such as user names or secret project names. This information may appear in telemetry logs accessible to Microsoft Support engineers.

Parameters:
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

delete(job_id, job_delete_options=None, custom_headers=None, raw=False, **operation_config)[source]

Deletes a job.

Deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes, the Batch services deletes those tasks’ working directories and all their contents.

Parameters:
  • job_id (str) – The ID of the job to delete.
  • job_delete_options (JobDeleteOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

disable(job_id, disable_tasks, job_disable_options=None, custom_headers=None, raw=False, **operation_config)[source]

Disables the specified job, preventing new tasks from running.

The Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling state until the disable operation is completed and all tasks have been dealt with according to the disableTasks option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the request fails with status code 409.

Parameters:
  • job_id (str) – The ID of the job to disable.
  • disable_tasks (str or DisableJobOption) – What to do with active tasks associated with the job. requeue - Terminate running tasks and requeue them. The tasks will run again when the job is enabled. terminate - Terminate running tasks. The tasks will not run again. wait - Allow currently running tasks to complete. Possible values include: ‘requeue’, ‘terminate’, ‘wait’
  • job_disable_options (JobDisableOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

enable(job_id, job_enable_options=None, custom_headers=None, raw=False, **operation_config)[source]

Enables the specified job, allowing new tasks to run.

When you call this API, the Batch service sets a disabled job to the enabling state. After the this operation is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch service does not allow a task to remain in the active state for more than 7 days. Therefore, if you enable a job containing active tasks which were added more than 7 days ago, those tasks will not run.

Parameters:
  • job_id (str) – The ID of the job to enable.
  • job_enable_options (JobEnableOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get(job_id, job_get_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets information about the specified job.

Parameters:
  • job_id (str) – The ID of the job.
  • job_get_options (JobGetOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

CloudJob

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get_all_lifetime_statistics(job_get_all_lifetime_statistics_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets lifetime summary statistics for all of the jobs in the specified account.

Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last update time of the statistics.

Parameters:
Return type:

JobStatistics

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

list(job_list_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists all of the jobs in the specified account.

Parameters:
  • job_list_options (JobListOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

CloudJobPaged

Raises:

BatchErrorException

list_from_job_schedule(job_schedule_id, job_list_from_job_schedule_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists the jobs that have been created under the specified job schedule.

Parameters:
  • job_schedule_id (str) – The ID of the job schedule from which you want to get a list of jobs.
  • job_list_from_job_schedule_options (JobListFromJobScheduleOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

CloudJobPaged

Raises:

BatchErrorException

list_preparation_and_release_task_status(job_id, job_list_preparation_and_release_task_status_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run.

This API returns the Job Preparation and Job Release task status on all compute nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from the pool. .

Parameters:
Return type:

JobPreparationAndReleaseTaskExecutionInformationPaged

Raises:

BatchErrorException

patch(job_id, job_patch_parameter, job_patch_options=None, custom_headers=None, raw=False, **operation_config)[source]

Updates the properties of the specified job.

This replaces only the job properties specified in the request. For example, if the job has constraints, and a request does not specify the constraints element, then the job keeps the existing constraints.

Parameters:
  • job_id (str) – The ID of the job whose properties you want to update.
  • job_patch_parameter (JobPatchParameter) – The parameters for the request.
  • job_patch_options (JobPatchOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

terminate(job_id, job_terminate_options=None, terminate_reason=None, custom_headers=None, raw=False, **operation_config)[source]

Terminates the specified job, marking it as completed.

When a Terminate Job request is received, the Batch service sets the job to the terminating state. The Batch service then terminates any active or running tasks associated with the job, and runs any required Job Release tasks. The job then moves into the completed state.

Parameters:
  • job_id (str) – The ID of the job to terminate.
  • job_terminate_options (JobTerminateOptions) – Additional parameters for the operation
  • terminate_reason (str) – The text you want to appear as the job’s TerminateReason. The default is ‘UserTerminate’.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

update(job_id, job_update_parameter, job_update_options=None, custom_headers=None, raw=False, **operation_config)[source]

Updates the properties of the specified job.

This fully replaces all the updateable properties of the job. For example, if the job has constraints associated with it and if constraints is not specified with this request, then the Batch service will remove the existing constraints.

Parameters:
  • job_id (str) – The ID of the job whose properties you want to update.
  • job_update_parameter (JobUpdateParameter) – The parameters for the request.
  • job_update_options (JobUpdateOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

class azure.batch.operations.CertificateOperations(client, config, serializer, deserializer)[source]

Bases: object

CertificateOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client API Version. Constant value: “2017-05-01.5.0”.

add(certificate, certificate_add_options=None, custom_headers=None, raw=False, **operation_config)[source]

Adds a certificate to the specified account.

Parameters:
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

cancel_deletion(thumbprint_algorithm, thumbprint, certificate_cancel_deletion_options=None, custom_headers=None, raw=False, **operation_config)[source]

Cancels a failed deletion of a certificate from the specified account.

If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate.

Parameters:
  • thumbprint_algorithm (str) – The algorithm used to derive the thumbprint parameter. This must be sha1.
  • thumbprint (str) – The thumbprint of the certificate being deleted.
  • certificate_cancel_deletion_options (CertificateCancelDeletionOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

delete(thumbprint_algorithm, thumbprint, certificate_delete_options=None, custom_headers=None, raw=False, **operation_config)[source]

Deletes a certificate from the specified account.

You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a certificate, you must therefore make sure that the certificate is not associated with any existing pools, the certificate is not installed on any compute nodes (even if you remove a certificate from a pool, it is not removed from existing compute nodes in that pool until they restart), and no running tasks depend on the certificate. If you try to delete a certificate that is in use, the deletion fails. The certificate status changes to deleteFailed. You can use Cancel Delete Certificate to set the status back to active if you decide that you want to continue using the certificate.

Parameters:
  • thumbprint_algorithm (str) – The algorithm used to derive the thumbprint parameter. This must be sha1.
  • thumbprint (str) – The thumbprint of the certificate to be deleted.
  • certificate_delete_options (CertificateDeleteOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get(thumbprint_algorithm, thumbprint, certificate_get_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets information about the specified certificate.

Parameters:
  • thumbprint_algorithm (str) – The algorithm used to derive the thumbprint parameter. This must be sha1.
  • thumbprint (str) – The thumbprint of the certificate to get.
  • certificate_get_options (CertificateGetOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

Certificate

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

list(certificate_list_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists all of the certificates that have been added to the specified account.

Parameters:
Return type:

CertificatePaged

Raises:

BatchErrorException

class azure.batch.operations.FileOperations(client, config, serializer, deserializer)[source]

Bases: object

FileOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client API Version. Constant value: “2017-05-01.5.0”.

delete_from_compute_node(pool_id, node_id, file_path, recursive=None, file_delete_from_compute_node_options=None, custom_headers=None, raw=False, **operation_config)[source]

Deletes the specified file from the compute node.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node from which you want to delete the file.
  • file_path (str) – The path to the file that you want to delete.
  • recursive (bool) – Whether to delete children of a directory. If the filePath parameter represents a directory instead of a file, you can set recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false then the directory must be empty or deletion will fail.
  • file_delete_from_compute_node_options (FileDeleteFromComputeNodeOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

delete_from_task(job_id, task_id, file_path, recursive=None, file_delete_from_task_options=None, custom_headers=None, raw=False, **operation_config)[source]

Deletes the specified task file from the compute node where the task ran.

Parameters:
  • job_id (str) – The ID of the job that contains the task.
  • task_id (str) – The ID of the task whose file you want to delete.
  • file_path (str) – The path to the task file that you want to delete.
  • recursive (bool) – Whether to delete children of a directory. If the filePath parameter represents a directory instead of a file, you can set recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false then the directory must be empty or deletion will fail.
  • file_delete_from_task_options (FileDeleteFromTaskOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get_from_compute_node(pool_id, node_id, file_path, file_get_from_compute_node_options=None, custom_headers=None, raw=False, callback=None, **operation_config)[source]

Returns the content of the specified compute node file.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node that contains the file.
  • file_path (str) – The path to the compute node file that you want to get the content of.
  • file_get_from_compute_node_options (FileGetFromComputeNodeOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Return type:

Generator

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get_from_task(job_id, task_id, file_path, file_get_from_task_options=None, custom_headers=None, raw=False, callback=None, **operation_config)[source]

Returns the content of the specified task file.

Parameters:
  • job_id (str) – The ID of the job that contains the task.
  • task_id (str) – The ID of the task whose file you want to retrieve.
  • file_path (str) – The path to the task file that you want to get the content of.
  • file_get_from_task_options (FileGetFromTaskOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Return type:

Generator

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get_properties_from_compute_node(pool_id, node_id, file_path, file_get_properties_from_compute_node_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets the properties of the specified compute node file.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node that contains the file.
  • file_path (str) – The path to the compute node file that you want to get the properties of.
  • file_get_properties_from_compute_node_options (FileGetPropertiesFromComputeNodeOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get_properties_from_task(job_id, task_id, file_path, file_get_properties_from_task_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets the properties of the specified task file.

Parameters:
  • job_id (str) – The ID of the job that contains the task.
  • task_id (str) – The ID of the task whose file you want to get the properties of.
  • file_path (str) – The path to the task file that you want to get the properties of.
  • file_get_properties_from_task_options (FileGetPropertiesFromTaskOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

list_from_compute_node(pool_id, node_id, recursive=None, file_list_from_compute_node_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists all of the files in task directories on the specified compute node.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node whose files you want to list.
  • recursive (bool) – Whether to list children of a directory.
  • file_list_from_compute_node_options (FileListFromComputeNodeOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

NodeFilePaged

Raises:

BatchErrorException

list_from_task(job_id, task_id, recursive=None, file_list_from_task_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists the files in a task’s directory on its compute node.

Parameters:
  • job_id (str) – The ID of the job that contains the task.
  • task_id (str) – The ID of the task whose files you want to list.
  • recursive (bool) – Whether to list children of a directory. This parameter can be used in combination with the filter parameter to list specific type of files.
  • file_list_from_task_options (FileListFromTaskOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

NodeFilePaged

Raises:

BatchErrorException

class azure.batch.operations.JobScheduleOperations(client, config, serializer, deserializer)[source]

Bases: object

JobScheduleOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client API Version. Constant value: “2017-05-01.5.0”.

add(cloud_job_schedule, job_schedule_add_options=None, custom_headers=None, raw=False, **operation_config)[source]

Adds a job schedule to the specified account.

Parameters:
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

delete(job_schedule_id, job_schedule_delete_options=None, custom_headers=None, raw=False, **operation_config)[source]

Deletes a job schedule from the specified account.

When you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are still counted towards account lifetime statistics.

Parameters:
  • job_schedule_id (str) – The ID of the job schedule to delete.
  • job_schedule_delete_options (JobScheduleDeleteOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

disable(job_schedule_id, job_schedule_disable_options=None, custom_headers=None, raw=False, **operation_config)[source]

Disables a job schedule.

No new jobs will be created until the job schedule is enabled again.

Parameters:
  • job_schedule_id (str) – The ID of the job schedule to disable.
  • job_schedule_disable_options (JobScheduleDisableOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

enable(job_schedule_id, job_schedule_enable_options=None, custom_headers=None, raw=False, **operation_config)[source]

Enables a job schedule.

Parameters:
  • job_schedule_id (str) – The ID of the job schedule to enable.
  • job_schedule_enable_options (JobScheduleEnableOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

exists(job_schedule_id, job_schedule_exists_options=None, custom_headers=None, raw=False, **operation_config)[source]

Checks the specified job schedule exists.

Parameters:
  • job_schedule_id (str) – The ID of the job schedule which you want to check.
  • job_schedule_exists_options (JobScheduleExistsOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

bool

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get(job_schedule_id, job_schedule_get_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets information about the specified job schedule.

Parameters:
  • job_schedule_id (str) – The ID of the job schedule to get.
  • job_schedule_get_options (JobScheduleGetOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

CloudJobSchedule

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

list(job_schedule_list_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists all of the job schedules in the specified account.

Parameters:
Return type:

CloudJobSchedulePaged

Raises:

BatchErrorException

patch(job_schedule_id, job_schedule_patch_parameter, job_schedule_patch_options=None, custom_headers=None, raw=False, **operation_config)[source]

Updates the properties of the specified job schedule.

This replaces only the job schedule properties specified in the request. For example, if the schedule property is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are unaffected.

Parameters:
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

terminate(job_schedule_id, job_schedule_terminate_options=None, custom_headers=None, raw=False, **operation_config)[source]

Terminates a job schedule.

Parameters:
  • job_schedule_id (str) – The ID of the job schedule to terminates.
  • job_schedule_terminate_options (JobScheduleTerminateOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

update(job_schedule_id, job_schedule_update_parameter, job_schedule_update_options=None, custom_headers=None, raw=False, **operation_config)[source]

Updates the properties of the specified job schedule.

This fully replaces all the updateable properties of the job schedule. For example, if the schedule property is not specified with this request, then the Batch service will remove the existing schedule. Changes to a job schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are unaffected.

Parameters:
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

class azure.batch.operations.TaskOperations(client, config, serializer, deserializer)[source]

Bases: object

TaskOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client API Version. Constant value: “2017-05-01.5.0”.

add(job_id, task, task_add_options=None, custom_headers=None, raw=False, **operation_config)[source]

Adds a task to the specified job.

Parameters:
  • job_id (str) – The ID of the job to which the task is to be added.
  • task (TaskAddParameter) – The task to be added.
  • task_add_options (TaskAddOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

add_collection(job_id, value, task_add_collection_options=None, custom_headers=None, raw=False, **operation_config)[source]

Adds a collection of tasks to the specified job.

Note that each task must have a unique ID. The Batch service may not return the results for each task in the same order the tasks were submitted in this request. If the server times out or the connection is closed during the request, the request may have been partially or fully processed, or not at all. In such cases, the user should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request. For example, you should use the same task ids during a retry so that if the prior operation succeeded, the retry will not create extra tasks unexpectedly.

Parameters:
  • job_id (str) – The ID of the job to which the task collection is to be added.
  • value (list of TaskAddParameter) – The collection of tasks to add.
  • task_add_collection_options (TaskAddCollectionOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

TaskAddCollectionResult

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

delete(job_id, task_id, task_delete_options=None, custom_headers=None, raw=False, **operation_config)[source]

Deletes a task from the specified job.

When a task is deleted, all of the files in its directory on the compute node where it ran are also deleted (regardless of the retention time). For multi-instance tasks, the delete task operation applies synchronously to the primary task; subtasks and their files are then deleted asynchronously in the background.

Parameters:
  • job_id (str) – The ID of the job from which to delete the task.
  • task_id (str) – The ID of the task to delete.
  • task_delete_options (TaskDeleteOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get(job_id, task_id, task_get_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets information about the specified task.

For multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. Use the list subtasks API to retrieve information about subtasks.

Parameters:
  • job_id (str) – The ID of the job that contains the task.
  • task_id (str) – The ID of the task to get information about.
  • task_get_options (TaskGetOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

CloudTask

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

list(job_id, task_list_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists all of the tasks that are associated with the specified job.

For multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. Use the list subtasks API to retrieve information about subtasks.

Parameters:
  • job_id (str) – The ID of the job.
  • task_list_options (TaskListOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

CloudTaskPaged

Raises:

BatchErrorException

list_subtasks(job_id, task_id, task_list_subtasks_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists all of the subtasks that are associated with the specified multi-instance task.

If the task is not a multi-instance task then this returns an empty collection.

Parameters:
  • job_id (str) – The ID of the job.
  • task_id (str) – The ID of the task.
  • task_list_subtasks_options (TaskListSubtasksOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

CloudTaskListSubtasksResult

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

reactivate(job_id, task_id, task_reactivate_options=None, custom_headers=None, raw=False, **operation_config)[source]

Reactivates the specified task.

Reactivation makes a task eligible to be retried again up to its maximum retry count. The task’s state is changed to active. As the task is no longer in the completed state, any previous exit code or scheduling error is no longer available after reactivation. This will fail for tasks that are not completed or that previously completed successfully (with an exit code of 0). Additionally, this will fail if the job has completed (or is terminating or deleting).

Parameters:
  • job_id (str) – The ID of the job containing the task.
  • task_id (str) – The ID of the task to reactivate.
  • task_reactivate_options (TaskReactivateOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

terminate(job_id, task_id, task_terminate_options=None, custom_headers=None, raw=False, **operation_config)[source]

Terminates the specified task.

When the task has been terminated, it moves to the completed state. For multi-instance tasks, the terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in the background.

Parameters:
  • job_id (str) – The ID of the job containing the task.
  • task_id (str) – The ID of the task to terminate.
  • task_terminate_options (TaskTerminateOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

update(job_id, task_id, task_update_options=None, constraints=None, custom_headers=None, raw=False, **operation_config)[source]

Updates the properties of the specified task.

Parameters:
  • job_id (str) – The ID of the job containing the task.
  • task_id (str) – The ID of the task to update.
  • task_update_options (TaskUpdateOptions) – Additional parameters for the operation
  • constraints (TaskConstraints) – Constraints that apply to this task. If omitted, the task is given the default constraints.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

class azure.batch.operations.ComputeNodeOperations(client, config, serializer, deserializer)[source]

Bases: object

ComputeNodeOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client API Version. Constant value: “2017-05-01.5.0”.

add_user(pool_id, node_id, user, compute_node_add_user_options=None, custom_headers=None, raw=False, **operation_config)[source]

Adds a user account to the specified compute node.

You can add a user account to a node only when it is in the idle or running state.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the machine on which you want to create a user account.
  • user (ComputeNodeUser) – The user account to be created.
  • compute_node_add_user_options (ComputeNodeAddUserOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

delete_user(pool_id, node_id, user_name, compute_node_delete_user_options=None, custom_headers=None, raw=False, **operation_config)[source]

Deletes a user account from the specified compute node.

You can delete a user account to a node only when it is in the idle or running state.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the machine on which you want to delete a user account.
  • user_name (str) – The name of the user account to delete.
  • compute_node_delete_user_options (ComputeNodeDeleteUserOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

disable_scheduling(pool_id, node_id, compute_node_disable_scheduling_options=None, node_disable_scheduling_option=None, custom_headers=None, raw=False, **operation_config)[source]

Disables task scheduling on the specified compute node.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node on which you want to disable task scheduling.
  • compute_node_disable_scheduling_options (ComputeNodeDisableSchedulingOptions) – Additional parameters for the operation
  • node_disable_scheduling_option (str or DisableComputeNodeSchedulingOption) – What to do with currently running tasks when disabling task scheduling on the compute node. The default value is requeue. Possible values include: ‘requeue’, ‘terminate’, ‘taskCompletion’
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

enable_scheduling(pool_id, node_id, compute_node_enable_scheduling_options=None, custom_headers=None, raw=False, **operation_config)[source]

Enables task scheduling on the specified compute node.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node on which you want to enable task scheduling.
  • compute_node_enable_scheduling_options (ComputeNodeEnableSchedulingOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get(pool_id, node_id, compute_node_get_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets information about the specified compute node.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node that you want to get information about.
  • compute_node_get_options (ComputeNodeGetOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

ComputeNode

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get_remote_desktop(pool_id, node_id, compute_node_get_remote_desktop_options=None, custom_headers=None, raw=False, callback=None, **operation_config)[source]

Gets the Remote Desktop Protocol file for the specified compute node.

Before you can access a node by using the RDP file, you must create a user account on the node. This API can only be invoked on pools created with the cloud service configuration property.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node for which you want to get the Remote Desktop Protocol file.
  • compute_node_get_remote_desktop_options (ComputeNodeGetRemoteDesktopOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • callback (Callable[Bytes, response=None]) – When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.
  • operation_configOperation configuration overrides.
Return type:

Generator

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

get_remote_login_settings(pool_id, node_id, compute_node_get_remote_login_settings_options=None, custom_headers=None, raw=False, **operation_config)[source]

Gets the settings required for remote login to a compute node.

Before you can remotely login to a node using the remote login settings, you must create a user account on the node. This API can be invoked only on pools created with the virtual machine configuration property.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node for which to obtain the remote login settings.
  • compute_node_get_remote_login_settings_options (ComputeNodeGetRemoteLoginSettingsOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

ComputeNodeGetRemoteLoginSettingsResult

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

list(pool_id, compute_node_list_options=None, custom_headers=None, raw=False, **operation_config)[source]

Lists the compute nodes in the specified pool.

Parameters:
  • pool_id (str) – The ID of the pool from which you want to list nodes.
  • compute_node_list_options (ComputeNodeListOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

ComputeNodePaged

Raises:

BatchErrorException

reboot(pool_id, node_id, compute_node_reboot_options=None, node_reboot_option=None, custom_headers=None, raw=False, **operation_config)[source]

Restarts the specified compute node.

You can restart a node only if it is in an idle or running state.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node that you want to restart.
  • compute_node_reboot_options (ComputeNodeRebootOptions) – Additional parameters for the operation
  • node_reboot_option (str or ComputeNodeRebootOption) – When to reboot the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: ‘requeue’, ‘terminate’, ‘taskCompletion’, ‘retainedData’
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

reimage(pool_id, node_id, compute_node_reimage_options=None, node_reimage_option=None, custom_headers=None, raw=False, **operation_config)[source]

Reinstalls the operating system on the specified compute node.

You can reinstall the operating system on a node only if it is in an idle or running state. This API can be invoked only on pools created with the cloud service configuration property.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the compute node that you want to restart.
  • compute_node_reimage_options (ComputeNodeReimageOptions) – Additional parameters for the operation
  • node_reimage_option (str or ComputeNodeReimageOption) – When to reimage the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: ‘requeue’, ‘terminate’, ‘taskCompletion’, ‘retainedData’
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException

update_user(pool_id, node_id, user_name, node_update_user_parameter, compute_node_update_user_options=None, custom_headers=None, raw=False, **operation_config)[source]

Updates the password or expiration time of a user account on the specified compute node.

This operation replaces of all the updateable properties of the account. For example, if the expiryTime element is not specified, the current value is replaced with the default value, not left unmodified. You can update a user account on a node only when it is in the idle or running state.

Parameters:
  • pool_id (str) – The ID of the pool that contains the compute node.
  • node_id (str) – The ID of the machine on which you want to update a user account.
  • user_name (str) – The name of the user account to update.
  • node_update_user_parameter (NodeUpdateUserParameter) – The parameters for the request.
  • compute_node_update_user_options (ComputeNodeUpdateUserOptions) – Additional parameters for the operation
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

BatchErrorException