Exemplo n.º 1
0
        /// <summary>
        /// Updates storage type of the vault identified by client
        /// </summary>
        /// <param name="storageType"></param>
        public void UpdateStorageType(string resourceGroupName, string resourceName, string storageType)
        {
            UpdateVaultStorageTypeRequest updateVaultStorageTypeRequest = new UpdateVaultStorageTypeRequest()
            {
                StorageTypeProperties = new StorageTypeProperties()
                {
                    StorageModelType = storageType,
                },
            };

            AzureBackupVaultClient.Vault.UpdateStorageTypeAsync(resourceGroupName, resourceName, updateVaultStorageTypeRequest, GetCustomRequestHeaders(), CmdletCancellationToken).Wait();
        }
Exemplo n.º 2
0
        public void UpdateStorageTypeReturnsValidCodeTest()
        {
            using (UndoContext undoContext = UndoContext.Current)
            {
                undoContext.Start();

                BackupVaultServicesManagementClient client = GetServiceClient<BackupVaultServicesManagementClient>();

                UpdateVaultStorageTypeRequest updateVaultStorageTypeRequest = new UpdateVaultStorageTypeRequest()
                {
                    StorageTypeProperties = new StorageTypeProperties()
                    {
                        StorageModelType = AzureBackupVaultStorageType.LocallyRedundant.ToString(),
                    },
                };

                OperationResponse response = client.Vault.UpdateStorageType(updateVaultStorageTypeRequest, GetCustomRequestHeaders());

                // Response Validation
                Assert.NotNull(response);
                Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
            }
        }
 /// <summary>
 /// Updates vault storage model type.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.BackupServices.IVaultOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required.
 /// </param>
 /// <param name='resourceName'>
 /// Required.
 /// </param>
 /// <param name='updateVaultStorageTypeRequest'>
 /// Required. Update Vault Storage Type Request
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// The definition of a Operation Response.
 /// </returns>
 public static OperationResponse UpdateStorageType(this IVaultOperations operations, string resourceGroupName, string resourceName, UpdateVaultStorageTypeRequest updateVaultStorageTypeRequest, CustomRequestHeaders customRequestHeaders)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IVaultOperations)s).UpdateStorageTypeAsync(resourceGroupName, resourceName, updateVaultStorageTypeRequest, customRequestHeaders);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Updates vault storage model type.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.BackupServices.IVaultOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required.
 /// </param>
 /// <param name='resourceName'>
 /// Required.
 /// </param>
 /// <param name='updateVaultStorageTypeRequest'>
 /// Required. Update Vault Storage Type Request
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// The definition of a Operation Response.
 /// </returns>
 public static Task<OperationResponse> UpdateStorageTypeAsync(this IVaultOperations operations, string resourceGroupName, string resourceName, UpdateVaultStorageTypeRequest updateVaultStorageTypeRequest, CustomRequestHeaders customRequestHeaders)
 {
     return operations.UpdateStorageTypeAsync(resourceGroupName, resourceName, updateVaultStorageTypeRequest, customRequestHeaders, CancellationToken.None);
 }
 /// <summary>
 /// Updates vault storage model type.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.BackupServices.IVaultOperations.
 /// </param>
 /// <param name='updateVaultStorageTypeRequest'>
 /// Required. Update Vault Storage Type Request
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// The definition of a Operation Response.
 /// </returns>
 public static Task<OperationResponse> UpdateStorageTypeAsync(this IVaultOperations operations, UpdateVaultStorageTypeRequest updateVaultStorageTypeRequest, CustomRequestHeaders customRequestHeaders)
 {
     return operations.UpdateStorageTypeAsync(updateVaultStorageTypeRequest, customRequestHeaders, CancellationToken.None);
 }