您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

PoolOperations class

Definition

PoolOperations operations.

You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute.

PoolOperations(client, config, serializer, deserializer)
Inheritance
builtins.object
PoolOperations

Parameters

client

Client for service requests.

config

Configuration of service client.

serializer

An object model serializer.

deserializer

An object model deserializer.

Variables

api_version
class
Client API Version. Constant value: "2019-08-01.10.0".

Methods

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

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.

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

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 Compute Nodes; any Tasks running on existing Compute 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.

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

Disables automatic scaling for a Pool.

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

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.

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

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. The Pool must have auto scaling enabled in order to evaluate a formula.

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

Gets basic properties of a Pool.

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

Gets information about the specified Pool.

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

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. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes.

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

Lists all of the Pools in the specified Account.

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

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. If you do not specify a $filter clause including a startTime or endTime these filters default to the start and end times of the last aggregation interval currently available; that is, only the last aggregation interval is returned.

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

Updates the properties of the specified Pool.

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

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

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.

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

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 Compute Nodes to remove. To remove specific Compute Nodes, use the Pool remove Compute Nodes API instead.

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

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. After stopping, the Pool stabilizes at the number of Compute Nodes it was at when the stop operation was done. During the stop operation, the Pool allocation state changes first to stopping and then to steady. 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.

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

Updates the properties of the specified Pool.

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

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

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.

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

Parameters

pool
PoolAddParameter

The Pool to be added.

pool_add_options
PoolAddOptions

Additional parameters for the operation

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

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

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 Compute Nodes; any Tasks running on existing Compute 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.

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

Parameters

pool_id
str

The ID of the Pool to delete.

pool_delete_options
PoolDeleteOptions

Additional parameters for the operation

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

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

Disables automatic scaling for a Pool.

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

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

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

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

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.

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

Parameters

pool_id
str

The ID of the Pool on which to enable automatic scaling.

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).

default value: None
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.

default value: None
pool_enable_auto_scale_options
PoolEnableAutoScaleOptions

Additional parameters for the operation

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

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

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. The Pool must have auto scaling enabled in order to evaluate a formula.

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

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

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

AutoScaleRun or ClientRawResponse if raw=true

Return type

Exceptions

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

Gets basic properties of a Pool.

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

Parameters

pool_id
str

The ID of the Pool to get.

pool_exists_options
PoolExistsOptions

Additional parameters for the operation

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

bool or ClientRawResponse if raw=true

Return type

Exceptions

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

Gets information about the specified Pool.

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

Parameters

pool_id
str

The ID of the Pool to get.

pool_get_options
PoolGetOptions

Additional parameters for the operation

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

CloudPool or ClientRawResponse if raw=true

Return type

Exceptions

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

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. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes.

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

Parameters

pool_get_all_lifetime_statistics_options
PoolGetAllLifetimeStatisticsOptions

Additional parameters for the operation

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

PoolStatistics or ClientRawResponse if raw=true

Return type

Exceptions

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

Lists all of the Pools in the specified Account.

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

Parameters

pool_list_options
PoolListOptions

Additional parameters for the operation

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

An iterator like instance of CloudPool

Return type

Exceptions

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

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. If you do not specify a $filter clause including a startTime or endTime these filters default to the start and end times of the last aggregation interval currently available; that is, only the last aggregation interval is returned.

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

Parameters

pool_list_usage_metrics_options
PoolListUsageMetricsOptions

Additional parameters for the operation

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

An iterator like instance of PoolUsageMetrics

Return type

Exceptions

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

Updates the properties of the specified Pool.

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

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

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

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

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

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.

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

Parameters

pool_id
str

The ID of the Pool from which you want to remove Compute Nodes.

node_remove_parameter
NodeRemoveParameter

The parameters for the request.

pool_remove_nodes_options
PoolRemoveNodesOptions

Additional parameters for the operation

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

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

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 Compute Nodes to remove. To remove specific Compute Nodes, use the Pool remove Compute Nodes API instead.

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

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

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

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

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. After stopping, the Pool stabilizes at the number of Compute Nodes it was at when the stop operation was done. During the stop operation, the Pool allocation state changes first to stopping and then to steady. 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.

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

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

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

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

Updates the properties of the specified Pool.

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

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

Parameters

pool_id
str

The ID of the Pool to update.

pool_update_properties_parameter
PoolUpdatePropertiesParameter

The parameters for the request.

pool_update_properties_options
PoolUpdatePropertiesOptions

Additional parameters for the operation

default value: None
custom_headers
dict

headers that will be added to the request

default value: None
raw
bool

returns the direct response alongside the deserialized response

default value: False
operation_config

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

Exceptions

Attributes

models

models = <module 'azure.batch.models' from 'c:\\hostedtoolcache\\windows\\python\\3.6.8\\x64\\lib\\site-packages\\azure\\batch\\models\\__init__.py'>