Delen via


IPoolOperations.ResizeWithHttpMessagesAsync Method

Definition

Changes the number of Compute Nodes that are assigned to a Pool.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationHeaderResponse<Microsoft.Azure.Batch.Protocol.Models.PoolResizeHeaders>> ResizeWithHttpMessagesAsync (string poolId, Microsoft.Azure.Batch.Protocol.Models.PoolResizeParameter poolResizeParameter, Microsoft.Azure.Batch.Protocol.Models.PoolResizeOptions poolResizeOptions = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ResizeWithHttpMessagesAsync : string * Microsoft.Azure.Batch.Protocol.Models.PoolResizeParameter * Microsoft.Azure.Batch.Protocol.Models.PoolResizeOptions * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationHeaderResponse<Microsoft.Azure.Batch.Protocol.Models.PoolResizeHeaders>>
Public Function ResizeWithHttpMessagesAsync (poolId As String, poolResizeParameter As PoolResizeParameter, Optional poolResizeOptions As PoolResizeOptions = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationHeaderResponse(Of PoolResizeHeaders))

Parameters

poolId
String

The ID of the Pool to resize.

poolResizeParameter
PoolResizeParameter

The parameters for the request.

poolResizeOptions
PoolResizeOptions

Additional parameters for the operation

customHeaders
Dictionary<String,List<String>>

The headers that will be added to request.

cancellationToken
CancellationToken

The cancellation token.

Returns

Exceptions

Thrown when the operation returned an invalid status code

Thrown when a required parameter is null

Remarks

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.

Applies to