Example #1
0
 /// <summary>
 /// Generates new key for the Batch account
 /// </summary>
 /// <param name="resourceGroupName">The name of the resource group in which to create the account</param>
 /// <param name="accountName">The account name</param>
 /// <param name="parameters">Additional parameters that are associated with regenerating a key of the account</param>
 /// <returns>The status of regenerate key operation</returns>
 public BatchAccountRegenerateKeyResponse RegenerateKeys(string resourceGroupName, string accountName, BatchAccountRegenerateKeyParameters parameters)
 {
     return(BatchManagementClient.Accounts.RegenerateKey(resourceGroupName, accountName, parameters));
 }
 /// <summary>
 /// The RegenerateKey operation regenerates the specified account key
 /// for the given Batch account.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Batch.IAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group that contains the Batch
 /// account.
 /// </param>
 /// <param name='accountName'>
 /// Required. The name of the account.
 /// </param>
 /// <param name='parameters'>
 /// Required. The type of key to regenerate
 /// </param>
 /// <returns>
 /// Values returned by the RegenerateKey operation.
 /// </returns>
 public static BatchAccountRegenerateKeyResponse RegenerateKey(this IAccountOperations operations, string resourceGroupName, string accountName, BatchAccountRegenerateKeyParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IAccountOperations)s).RegenerateKeyAsync(resourceGroupName, accountName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The RegenerateKey operation regenerates the specified account key
 /// for the given Batch account.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Batch.IAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group that contains the Batch
 /// account.
 /// </param>
 /// <param name='accountName'>
 /// Required. The name of the account.
 /// </param>
 /// <param name='parameters'>
 /// Required. The type of key to regenerate
 /// </param>
 /// <returns>
 /// Values returned by the RegenerateKey operation.
 /// </returns>
 public static Task <BatchAccountRegenerateKeyResponse> RegenerateKeyAsync(this IAccountOperations operations, string resourceGroupName, string accountName, BatchAccountRegenerateKeyParameters parameters)
 {
     return(operations.RegenerateKeyAsync(resourceGroupName, accountName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Regenerates the specified account key for the specified Batch account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the Batch account.
 /// </param>
 /// <param name='accountName'>
 /// The name of the account.
 /// </param>
 /// <param name='parameters'>
 /// The type of key to regenerate.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <BatchAccountRegenerateKeyResult> RegenerateKeyAsync(this IAccountOperations operations, string resourceGroupName, string accountName, BatchAccountRegenerateKeyParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RegenerateKeyWithHttpMessagesAsync(resourceGroupName, accountName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }