Share via


PoolOperationsExtensions.DeleteAsync Method

Definition

Deletes a Pool from the specified Account.

public static System.Threading.Tasks.Task<Microsoft.Azure.Batch.Protocol.Models.PoolDeleteHeaders> DeleteAsync (this Microsoft.Azure.Batch.Protocol.IPoolOperations operations, string poolId, Microsoft.Azure.Batch.Protocol.Models.PoolDeleteOptions poolDeleteOptions = default, System.Threading.CancellationToken cancellationToken = default);
static member DeleteAsync : Microsoft.Azure.Batch.Protocol.IPoolOperations * string * Microsoft.Azure.Batch.Protocol.Models.PoolDeleteOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Batch.Protocol.Models.PoolDeleteHeaders>
<Extension()>
Public Function DeleteAsync (operations As IPoolOperations, poolId As String, Optional poolDeleteOptions As PoolDeleteOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PoolDeleteHeaders)

Parameters

operations
IPoolOperations

The operations group for this extension method.

poolId
String

The ID of the Pool to delete.

poolDeleteOptions
PoolDeleteOptions

Additional parameters for the operation

cancellationToken
CancellationToken

The cancellation token.

Returns

Remarks

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.

Applies to