Пример #1
0
 public virtual Response Resize(string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions, CancellationToken cancellationToken = default)
 {
     return(RestClient.Resize(poolId, poolResizeParameter, poolResizeOptions, cancellationToken).GetRawResponse());
 }
Пример #2
0
 public virtual async Task <Response> ResizeAsync(string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions, CancellationToken cancellationToken = default)
 {
     return((await RestClient.ResizeAsync(poolId, poolResizeParameter, poolResizeOptions, cancellationToken).ConfigureAwait(false)).GetRawResponse());
 }
Пример #3
0
 /// <summary>
 /// Changes the number of Compute Nodes that are assigned to a Pool.
 /// </summary>
 /// <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.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='poolId'>
 /// The ID of the Pool to resize.
 /// </param>
 /// <param name='poolResizeParameter'>
 /// The parameters for the request.
 /// </param>
 /// <param name='poolResizeOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static PoolResizeHeaders Resize(this IPoolOperations operations, string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions = default(PoolResizeOptions))
 {
     return(operations.ResizeAsync(poolId, poolResizeParameter, poolResizeOptions).GetAwaiter().GetResult());
 }
Пример #4
0
 /// <summary>
 /// Changes the number of Compute Nodes that are assigned to a Pool.
 /// </summary>
 /// <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.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='poolId'>
 /// The ID of the Pool to resize.
 /// </param>
 /// <param name='poolResizeParameter'>
 /// The parameters for the request.
 /// </param>
 /// <param name='poolResizeOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <PoolResizeHeaders> ResizeAsync(this IPoolOperations operations, string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions = default(PoolResizeOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ResizeWithHttpMessagesAsync(poolId, poolResizeParameter, poolResizeOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Headers);
     }
 }
Пример #5
0
 /// <summary>
 /// Changes the number of compute nodes that are assigned to a pool.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='poolId'>
 /// The id of the pool to resize.
 /// </param>
 /// <param name='poolResizeParameter'>
 /// The parameters for the request.
 /// </param>
 /// <param name='poolResizeOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static PoolResizeHeaders Resize(this IPoolOperations operations, string poolId, PoolResizeParameter poolResizeParameter, PoolResizeOptions poolResizeOptions = default(PoolResizeOptions))
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IPoolOperations)s).ResizeAsync(poolId, poolResizeParameter, poolResizeOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }