/// <summary>
 /// Checks that account name is valid and is not in use.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 public static CheckNameAvailabilityResult CheckNameAvailability(this IStorageAccountsOperations operations, StorageAccountCheckNameAvailabilityParameters accountName)
 {
     return(operations.CheckNameAvailabilityAsync(accountName).GetAwaiter().GetResult());
 }
Exemplo n.º 2
0
 /// <summary>
 /// Lists all the storage accounts available under the subscription. Note that
 /// storage keys are not returned; use the ListKeys operation for this.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <StorageAccount> List(this IStorageAccountsOperations operations)
 {
     return(operations.ListAsync().GetAwaiter().GetResult());
 }
Exemplo n.º 3
0
 /// <summary>
 /// Checks that the storage account name is valid and is not already in use.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// The storage account name.
 /// </param>
 public static CheckNameAvailabilityResult CheckNameAvailability(this IStorageAccountsOperations operations, string name)
 {
     return(operations.CheckNameAvailabilityAsync(name).GetAwaiter().GetResult());
 }
Exemplo n.º 4
0
 /// <summary>
 /// Deletes a storage account in Microsoft Azure.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 public static void Delete(this IStorageAccountsOperations operations, string resourceGroupName, string accountName)
 {
     operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Returns the properties for the specified storage account including but not
 /// limited to name, SKU name, location, and account status. The ListKeys
 /// operation should be used to retrieve storage keys.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='expand'>
 /// May be used to expand the properties within account's properties. By
 /// default, data is not included when fetching properties. Currently we only
 /// support geoReplicationStats. Possible values include: 'geoReplicationStats'
 /// </param>
 public static StorageAccount GetProperties(this IStorageAccountsOperations operations, string resourceGroupName, string accountName, StorageAccountExpand?expand = default(StorageAccountExpand?))
 {
     return(operations.GetPropertiesAsync(resourceGroupName, accountName, expand).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Checks that the storage account name is valid and is not already in use.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// The storage account name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <CheckNameAvailabilityResult> CheckNameAvailabilityAsync(this IStorageAccountsOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Revoke user delegation keys.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 public static void RevokeUserDelegationKeys(this IStorageAccountsOperations operations, string resourceGroupName, string accountName)
 {
     operations.RevokeUserDelegationKeysAsync(resourceGroupName, accountName).GetAwaiter().GetResult();
 }
Exemplo n.º 8
0
 /// <summary>
 /// Lists all the storage accounts available under the given resource group.
 /// Note that storage keys are not returned; use the ListKeys operation for
 /// this.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription.
 /// </param>
 public static System.Collections.Generic.IEnumerable <StorageAccount> ListByResourceGroup(this IStorageAccountsOperations operations, string resourceGroupName)
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IStorageAccountsOperations)s).ListByResourceGroupAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 9
0
 /// <summary>
 /// Checks that account name is valid and is not in use.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and
 /// use numbers and lower-case letters only.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task <CheckNameAvailabilityResult> CheckNameAvailabilityAsync(this IStorageAccountsOperations operations, StorageAccountCheckNameAvailabilityParameters accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(accountName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 10
0
 /// <summary>
 /// Returns the properties for the specified storage account including but not
 /// limited to name, account type, location, and account status. The ListKeys
 /// operation should be used to retrieve storage keys.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and
 /// use numbers and lower-case letters only.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task <StorageAccount> GetPropertiesAsync(this IStorageAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetPropertiesWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// Lists all the storage accounts available under the subscription. Note that
 /// storage keys are not returned; use the ListKeys operation for this.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <System.Collections.Generic.IEnumerable <StorageAccount> > ListAsync(this IStorageAccountsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// Checks that account name is valid and is not in use.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and
 /// use numbers and lower-case letters only.
 /// </param>
 public static CheckNameAvailabilityResult CheckNameAvailability(this IStorageAccountsOperations operations, StorageAccountCheckNameAvailabilityParameters accountName)
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IStorageAccountsOperations)s).CheckNameAvailabilityAsync(accountName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 13
0
 /// <summary>
 /// Deletes a storage account in Microsoft Azure.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and
 /// use numbers and lower-case letters only.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task DeleteAsync(this IStorageAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Regenerates the access keys for the specified storage account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='regenerateKey'>
 /// Specifies name of the key which should be regenerated. key1 or key2 for the
 /// default keys
 /// </param>
 public static StorageAccountKeys RegenerateKey(this IStorageAccountsOperations operations, string resourceGroupName, string accountName, StorageAccountRegenerateKeyParameters regenerateKey)
 {
     return(operations.RegenerateKeyAsync(resourceGroupName, accountName, regenerateKey).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns the requested storage account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Resource location.
 /// </param>
 /// <param name='accountId'>
 /// Internal storage account ID, which is not visible to tenant.
 /// </param>
 public static StorageAccount Get(this IStorageAccountsOperations operations, string location, string accountId)
 {
     return(operations.GetAsync(location, accountId).GetAwaiter().GetResult());
 }
Exemplo n.º 16
0
 /// <summary>
 /// Regenerates the access keys for the specified storage account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and
 /// use numbers and lower-case letters only.
 /// </param>
 /// <param name='regenerateKey'>
 /// Specifies name of the key which should be regenerated. key1 or key2 for
 /// the default keys
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task <StorageAccountKeys> RegenerateKeyAsync(this IStorageAccountsOperations operations, string resourceGroupName, string accountName, StorageAccountRegenerateKeyParameters regenerateKey, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.RegenerateKeyWithHttpMessagesAsync(resourceGroupName, accountName, regenerateKey, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Regenerates one of the access keys for the specified storage account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='keyName'>
 /// The name of storage keys that want to be regenerated, possible values are
 /// key1, key2.
 /// </param>
 public static StorageAccountListKeysResult RegenerateKey(this IStorageAccountsOperations operations, string resourceGroupName, string accountName, string keyName)
 {
     return(operations.RegenerateKeyAsync(resourceGroupName, accountName, keyName).GetAwaiter().GetResult());
 }
Exemplo n.º 18
0
 /// <summary>
 /// Asynchronously creates a new storage account with the specified
 /// parameters. Existing accounts cannot be updated with this API and should
 /// instead use the Update Storage Account API. If an account is already
 /// created and subsequent PUT request is issued with exact same set of
 /// properties, then HTTP 200 would be returned.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and
 /// use numbers and lower-case letters only.
 /// </param>
 /// <param name='parameters'>
 /// The parameters to provide for the created account.
 /// </param>
 public static StorageAccount Create(this IStorageAccountsOperations operations, string resourceGroupName, string accountName, StorageAccountCreateParameters parameters)
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IStorageAccountsOperations)s).CreateAsync(resourceGroupName, accountName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// List service SAS credentials of a specific resource.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='parameters'>
 /// The parameters to provide to list service SAS credentials.
 /// </param>
 public static ListServiceSasResponse ListServiceSAS(this IStorageAccountsOperations operations, string resourceGroupName, string accountName, ServiceSasParameters parameters)
 {
     return(operations.ListServiceSASAsync(resourceGroupName, accountName, parameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Undelete a deleted storage account with new account name if the a new name
 /// is provided.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Resource location.
 /// </param>
 /// <param name='accountId'>
 /// Internal storage account ID, which is not visible to tenant.
 /// </param>
 /// <param name='newAccountName'>
 /// New storage account name when doing undelete storage account operation.
 /// </param>
 public static UndeleteStorageAccount BeginUndelete(this IStorageAccountsOperations operations, string location, string accountId, string newAccountName = default(string))
 {
     return(operations.BeginUndeleteAsync(location, accountId, newAccountName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Failover request can be triggered for a storage account in case of
 /// availability issues. The failover occurs from the storage account's primary
 /// cluster to secondary cluster for RA-GRS accounts. The secondary cluster
 /// will become primary after failover.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 public static void BeginFailover(this IStorageAccountsOperations operations, string resourceGroupName, string accountName)
 {
     operations.BeginFailoverAsync(resourceGroupName, accountName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Start reclaim storage capacity on deleted storage objects.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Resource location.
 /// </param>
 public static void BeginReclaimStorageCapacity(this IStorageAccountsOperations operations, string location)
 {
     operations.BeginReclaimStorageCapacityAsync(location).GetAwaiter().GetResult();
 }
Exemplo n.º 23
0
 /// <summary>
 /// Deletes a storage account in Microsoft Azure.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IStorageAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Start reclaim storage capacity on deleted storage objects.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Resource location.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginReclaimStorageCapacityAsync(this IStorageAccountsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginReclaimStorageCapacityWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Exemplo n.º 25
0
 /// <summary>
 /// The update operation can be used to update the SKU, encryption, access
 /// tier, or tags for a storage account. It can also be used to map the account
 /// to a custom domain. Only one custom domain is supported per storage
 /// account; the replacement/change of custom domain is not supported. In order
 /// to replace an old custom domain, the old value must be cleared/unregistered
 /// before a new value can be set. The update of multiple properties is
 /// supported. This call does not change the storage keys for the account. If
 /// you want to change the storage account keys, use the regenerate keys
 /// operation. The location and name of the storage account cannot be changed
 /// after creation.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='parameters'>
 /// The parameters to provide for the updated account.
 /// </param>
 public static StorageAccount Update(this IStorageAccountsOperations operations, string resourceGroupName, string accountName, StorageAccountUpdateParameters parameters)
 {
     return(operations.UpdateAsync(resourceGroupName, accountName, parameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns a list of storage accounts.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <StorageAccount> ListNext(this IStorageAccountsOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Exemplo n.º 27
0
 /// <summary>
 /// Lists all the storage accounts available under the given resource group.
 /// Note that storage keys are not returned; use the ListKeys operation for
 /// this.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 public static IEnumerable <StorageAccount> ListByResourceGroup(this IStorageAccountsOperations operations, string resourceGroupName)
 {
     return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns a list of storage accounts.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Resource location.
 /// </param>
 /// <param name='filter'>
 /// Filter string
 /// </param>
 /// <param name='summary'>
 /// Switch for whether summary or detailed information is returned.
 /// </param>
 public static IPage <StorageAccount> List(this IStorageAccountsOperations operations, string location, string filter = default(string), bool?summary = default(bool?))
 {
     return(operations.ListAsync(location, filter, summary).GetAwaiter().GetResult());
 }
Exemplo n.º 29
0
 /// <summary>
 /// Lists all the storage accounts available under the given resource group.
 /// Note that storage keys are not returned; use the ListKeys operation for
 /// this.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IEnumerable <StorageAccount> > ListByResourceGroupAsync(this IStorageAccountsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists the access keys for the specified storage account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account.
 /// </param>
 public static StorageAccountKeys ListKeys(this IStorageAccountsOperations operations, string resourceGroupName, string accountName)
 {
     return(operations.ListKeysAsync(resourceGroupName, accountName).GetAwaiter().GetResult());
 }