Exemplo n.º 1
0
 /// <summary>
 /// The Update Data Disk operation updates the specified data disk
 /// attached to the specified virtual machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157190.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The name of your service.
 /// </param>
 /// <param name='deploymentName'>
 /// The name of the deployment.
 /// </param>
 /// <param name='roleName'>
 /// The name of the role to add the data disk to.
 /// </param>
 /// <param name='logicalUnitNumber'>
 /// The logical unit number of the disk.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Virtual Machine Data Disk
 /// operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> UpdateDataDiskAsync(this IVirtualMachineDiskOperations operations, string serviceName, string deploymentName, string roleName, int logicalUnitNumber, VirtualMachineDiskUpdateDataDiskParameters parameters)
 {
     return(operations.UpdateDataDiskAsync(serviceName, deploymentName, roleName, logicalUnitNumber, parameters, CancellationToken.None));
 }
Exemplo n.º 2
0
 /// <summary>
 /// The Update Data Disk operation updates the specified data disk
 /// attached to the specified virtual machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157190.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The name of your service.
 /// </param>
 /// <param name='deploymentName'>
 /// The name of the deployment.
 /// </param>
 /// <param name='roleName'>
 /// The name of the role to add the data disk to.
 /// </param>
 /// <param name='logicalUnitNumber'>
 /// The logical unit number of the disk.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Virtual Machine Data Disk
 /// operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse UpdateDataDisk(this IVirtualMachineDiskOperations operations, string serviceName, string deploymentName, string roleName, int logicalUnitNumber, VirtualMachineDiskUpdateDataDiskParameters parameters)
 {
     try
     {
         return(operations.UpdateDataDiskAsync(serviceName, deploymentName, roleName, logicalUnitNumber, parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }