/// <summary>
 /// The Create Data Disk operation adds a data disk to a virtual
 /// machine. There are three ways to create the data disk using the
 /// Add Data Disk operation. Option 1 - Attach an empty data disk to
 /// the role by specifying the disk label and location of the disk
 /// image. Do not include the DiskName and SourceMediaLink elements in
 /// the request body. Include the MediaLink element and reference a
 /// blob that is in the same geographical region as the role. You can
 /// also omit the MediaLink element. In this usage, Azure will create
 /// the data disk in the storage account configured as default for the
 /// role. Option 2 - Attach an existing data disk that is in the image
 /// repository. Do not include the DiskName and SourceMediaLink
 /// elements in the request body. Specify the data disk to use by
 /// including the DiskName element. Note: If included the in the
 /// response body, the MediaLink and LogicalDiskSizeInGB elements are
 /// ignored. Option 3 - Specify the location of a blob in your storage
 /// account that contain a disk image to use. Include the
 /// SourceMediaLink element. Note: If the MediaLink element
 /// isincluded, it is ignored.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157199.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of your service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of the deployment.
 /// </param>
 /// <param name='roleName'>
 /// Required. The name of the role to add the data disk to.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Create Virtual Machine Data
 /// Disk operation.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static OperationStatusResponse CreateDataDisk(this IVirtualMachineDiskOperations operations, string serviceName, string deploymentName, string roleName, VirtualMachineDataDiskCreateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualMachineDiskOperations)s).CreateDataDiskAsync(serviceName, deploymentName, roleName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The Begin Deleting Data Disk operation removes the specified data
 /// disk from a virtual machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157179.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of your service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of the deployment.
 /// </param>
 /// <param name='roleName'>
 /// Required. The name of the role to delete the data disk from.
 /// </param>
 /// <param name='logicalUnitNumber'>
 /// Required. The logical unit number of the disk.
 /// </param>
 /// <param name='deleteFromStorage'>
 /// Required. Specifies that the source blob for the disk should also
 /// be deleted from storage.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse BeginDeletingDataDisk(this IVirtualMachineDiskOperations operations, string serviceName, string deploymentName, string roleName, int logicalUnitNumber, bool deleteFromStorage)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualMachineDiskOperations)s).BeginDeletingDataDiskAsync(serviceName, deploymentName, roleName, logicalUnitNumber, deleteFromStorage);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The Add Disk operation adds a disk to the user image repository.
 /// The disk can be an operating system disk or a data disk.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157178.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='name'>
 /// Required. The name of the disk being updated.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Update Virtual Machine Disk
 /// operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse BeginUpdatingDisk(this IVirtualMachineDiskOperations operations, string name, VirtualMachineDiskUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualMachineDiskOperations)s).BeginUpdatingDiskAsync(name, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The List Disks operation retrieves a list of the disks in your
 /// image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157176.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <returns>
 /// The List Disks operation response.
 /// </returns>
 public static VirtualMachineDiskListResponse ListDisks(this IVirtualMachineDiskOperations operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualMachineDiskOperations)s).ListDisksAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The Delete Disk operation deletes the specified data or operating
 /// system disk from your image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157200.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='name'>
 /// Required. The name of the disk to delete.
 /// </param>
 /// <param name='deleteFromStorage'>
 /// Required. Specifies that the source blob for the disk should also
 /// be deleted from storage.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse DeleteDisk(this IVirtualMachineDiskOperations operations, string name, bool deleteFromStorage)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualMachineDiskOperations)s).DeleteDiskAsync(name, deleteFromStorage);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The Create Disk operation adds a disk to the user image repository.
 /// The disk can be an operating system disk or a data disk.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157178.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Create Virtual Machine Disk
 /// operation.
 /// </param>
 /// <returns>
 /// A virtual machine disk associated with your subscription.
 /// </returns>
 public static VirtualMachineDiskCreateResponse CreateDisk(this IVirtualMachineDiskOperations operations, VirtualMachineDiskCreateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualMachineDiskOperations)s).CreateDiskAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the ComputeManagementClient class.
 /// </summary>
 private ComputeManagementClient()
     : base()
 {
     this._deployments              = new DeploymentOperations(this);
     this._hostedServices           = new HostedServiceOperations(this);
     this._operatingSystems         = new OperatingSystemOperations(this);
     this._serviceCertificates      = new ServiceCertificateOperations(this);
     this._virtualMachineDisks      = new VirtualMachineDiskOperations(this);
     this._virtualMachineExtensions = new VirtualMachineExtensionOperations(this);
     this._virtualMachineImages     = new VirtualMachineImageOperations(this);
     this._virtualMachines          = new VirtualMachineOperations(this);
     this.HttpClient.Timeout        = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// The Add Disk operation adds a disk to the user image repository.
 /// The disk can be an operating system disk or a data disk.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157178.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='name'>
 /// The name of the disk being updated.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Virtual Machine Disk operation.
 /// </param>
 /// <returns>
 /// A virtual machine disk associated with your subscription.
 /// </returns>
 public static VirtualMachineDiskUpdateResponse UpdateDisk(this IVirtualMachineDiskOperations operations, string name, VirtualMachineDiskUpdateParameters parameters)
 {
     try
     {
         return(operations.UpdateDiskAsync(name, parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Initializes a new instance of the ComputeManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private ComputeManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._deployments              = new DeploymentOperations(this);
     this._hostedServices           = new HostedServiceOperations(this);
     this._loadBalancers            = new LoadBalancerOperations(this);
     this._operatingSystems         = new OperatingSystemOperations(this);
     this._serviceCertificates      = new ServiceCertificateOperations(this);
     this._virtualMachineDisks      = new VirtualMachineDiskOperations(this);
     this._virtualMachineExtensions = new VirtualMachineExtensionOperations(this);
     this._virtualMachines          = new VirtualMachineOperations(this);
     this._virtualMachineOSImages   = new VirtualMachineOSImageOperations(this);
     this._virtualMachineVMImages   = new VirtualMachineVMImageOperations(this);
     this._apiVersion = "2014-05-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <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, VirtualMachineDataDiskUpdateParameters parameters)
 {
     try
     {
         return(operations.UpdateDataDiskAsync(serviceName, deploymentName, roleName, logicalUnitNumber, parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The List Disks operation retrieves a list of the disks in your
 /// image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157176.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <returns>
 /// The List Disks operation response.
 /// </returns>
 public static VirtualMachineDiskListResponse ListDisks(this IVirtualMachineDiskOperations operations)
 {
     try
     {
         return(operations.ListDisksAsync().Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Get Disk operation retrieves a disk from the user image
 /// repository. The disk can be an operating system disk or a data
 /// disk.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157178.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='name'>
 /// The name of the disk.
 /// </param>
 /// <returns>
 /// A virtual machine disk associated with your subscription.
 /// </returns>
 public static VirtualMachineDiskGetResponse GetDisk(this IVirtualMachineDiskOperations operations, string name)
 {
     try
     {
         return(operations.GetDiskAsync(name).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Delete Disk operation deletes the specified data or operating
 /// system disk from your image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157200.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='name'>
 /// The name of the disk to delete.
 /// </param>
 /// <param name='deleteFromStorage'>
 /// Optional. Specifies that the source blob for the disk should also
 /// be deleted from storage.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse DeleteDisk(this IVirtualMachineDiskOperations operations, string name, bool deleteFromStorage)
 {
     try
     {
         return(operations.DeleteDiskAsync(name, deleteFromStorage).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Delete Data Disk operation removes the specified data disk from
 /// a virtual machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157179.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 delete the data disk from.
 /// </param>
 /// <param name='logicalUnitNumber'>
 /// The logical unit number of the disk.
 /// </param>
 /// <param name='deleteFromStorage'>
 /// Optional. Specifies that the source blob for the disk should also
 /// be deleted from storage.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse BeginDeletingDataDisk(this IVirtualMachineDiskOperations operations, string serviceName, string deploymentName, string roleName, int logicalUnitNumber, bool deleteFromStorage)
 {
     try
     {
         return(operations.BeginDeletingDataDiskAsync(serviceName, deploymentName, roleName, logicalUnitNumber, deleteFromStorage).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Exemple #15
0
 /// <summary>
 /// The Add Disk operation adds a disk to the user image repository.
 /// The disk can be an operating system disk or a data disk.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157178.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Virtual Machine Disk operation.
 /// </param>
 /// <returns>
 /// A virtual machine disk associated with your subscription.
 /// </returns>
 public static VirtualMachineDiskCreateDiskResponse CreateDisk(this IVirtualMachineDiskOperations operations, VirtualMachineDiskCreateDiskParameters parameters)
 {
     try
     {
         return(operations.CreateDiskAsync(parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Exemple #16
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'>
 /// Required. The name of your service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of the deployment.
 /// </param>
 /// <param name='roleName'>
 /// Required. The name of the role to add the data disk to.
 /// </param>
 /// <param name='logicalUnitNumber'>
 /// Required. The logical unit number of the disk.
 /// </param>
 /// <param name='parameters'>
 /// Required. 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 <AzureOperationResponse> UpdateDataDiskAsync(this IVirtualMachineDiskOperations operations, string serviceName, string deploymentName, string roleName, int logicalUnitNumber, VirtualMachineDataDiskUpdateParameters parameters)
 {
     return(operations.UpdateDataDiskAsync(serviceName, deploymentName, roleName, logicalUnitNumber, parameters, CancellationToken.None));
 }
Exemple #17
0
 /// <summary>
 /// The Add Disk operation adds a disk to the user image repository.
 /// The disk can be an operating system disk or a data disk.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157178.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='name'>
 /// Required. The name of the disk being updated.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Update Virtual Machine Disk
 /// operation.
 /// </param>
 /// <returns>
 /// A virtual machine disk associated with your subscription.
 /// </returns>
 public static Task <VirtualMachineDiskUpdateResponse> UpdateDiskAsync(this IVirtualMachineDiskOperations operations, string name, VirtualMachineDiskUpdateParameters parameters)
 {
     return(operations.UpdateDiskAsync(name, parameters, CancellationToken.None));
 }
Exemple #18
0
 /// <summary>
 /// The Get Disk operation retrieves a disk from the user image
 /// repository. The disk can be an operating system disk or a data
 /// disk.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157178.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='name'>
 /// Required. The name of the disk.
 /// </param>
 /// <returns>
 /// A virtual machine disk associated with your subscription.
 /// </returns>
 public static Task <VirtualMachineDiskGetResponse> GetDiskAsync(this IVirtualMachineDiskOperations operations, string name)
 {
     return(operations.GetDiskAsync(name, CancellationToken.None));
 }
Exemple #19
0
 /// <summary>
 /// The List Disks operation retrieves a list of the disks in your
 /// image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157176.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <returns>
 /// The List Disks operation response.
 /// </returns>
 public static Task <VirtualMachineDiskListResponse> ListDisksAsync(this IVirtualMachineDiskOperations operations)
 {
     return(operations.ListDisksAsync(CancellationToken.None));
 }
Exemple #20
0
 /// <summary>
 /// The Get Data Disk operation retrieves the specified data disk from
 /// a virtual machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157180.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of your service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of the deployment.
 /// </param>
 /// <param name='roleName'>
 /// Required. The name of the role.
 /// </param>
 /// <param name='logicalUnitNumber'>
 /// Required. The logical unit number of the disk.
 /// </param>
 /// <returns>
 /// The Get Data Disk operation response.
 /// </returns>
 public static Task <VirtualMachineDataDiskGetResponse> GetDataDiskAsync(this IVirtualMachineDiskOperations operations, string serviceName, string deploymentName, string roleName, int logicalUnitNumber)
 {
     return(operations.GetDataDiskAsync(serviceName, deploymentName, roleName, logicalUnitNumber, CancellationToken.None));
 }
Exemple #21
0
 /// <summary>
 /// The Delete Disk operation deletes the specified data or operating
 /// system disk from your image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157200.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='name'>
 /// Required. The name of the disk to delete.
 /// </param>
 /// <param name='deleteFromStorage'>
 /// Required. Specifies that the source blob for the disk should also
 /// be deleted from storage.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteDiskAsync(this IVirtualMachineDiskOperations operations, string name, bool deleteFromStorage)
 {
     return(operations.DeleteDiskAsync(name, deleteFromStorage, CancellationToken.None));
 }
Exemple #22
0
 /// <summary>
 /// The Delete Data Disk operation removes the specified data disk from
 /// a virtual machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157179.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of your service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of the deployment.
 /// </param>
 /// <param name='roleName'>
 /// Required. The name of the role to delete the data disk from.
 /// </param>
 /// <param name='logicalUnitNumber'>
 /// Required. The logical unit number of the disk.
 /// </param>
 /// <param name='deleteFromStorage'>
 /// Required. Specifies that the source blob for the disk should also
 /// be deleted from storage.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static Task <OperationStatusResponse> DeleteDataDiskAsync(this IVirtualMachineDiskOperations operations, string serviceName, string deploymentName, string roleName, int logicalUnitNumber, bool deleteFromStorage)
 {
     return(operations.DeleteDataDiskAsync(serviceName, deploymentName, roleName, logicalUnitNumber, deleteFromStorage, CancellationToken.None));
 }
Exemple #23
0
 /// <summary>
 /// The Create Disk operation adds a disk to the user image repository.
 /// The disk can be an operating system disk or a data disk.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157178.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Create Virtual Machine Disk
 /// operation.
 /// </param>
 /// <returns>
 /// A virtual machine disk associated with your subscription.
 /// </returns>
 public static Task <VirtualMachineDiskCreateResponse> CreateDiskAsync(this IVirtualMachineDiskOperations operations, VirtualMachineDiskCreateParameters parameters)
 {
     return(operations.CreateDiskAsync(parameters, CancellationToken.None));
 }
Exemple #24
0
 /// <summary>
 /// The Create Data Disk operation adds a data disk to a virtual
 /// machine. There are three ways to create the data disk using the
 /// Add Data Disk operation. Option 1 - Attach an empty data disk to
 /// the role by specifying the disk label and location of the disk
 /// image. Do not include the DiskName and SourceMediaLink elements in
 /// the request body. Include the MediaLink element and reference a
 /// blob that is in the same geographical region as the role. You can
 /// also omit the MediaLink element. In this usage, Azure will create
 /// the data disk in the storage account configured as default for the
 /// role. Option 2 - Attach an existing data disk that is in the image
 /// repository. Do not include the DiskName and SourceMediaLink
 /// elements in the request body. Specify the data disk to use by
 /// including the DiskName element. Note: If included the in the
 /// response body, the MediaLink and LogicalDiskSizeInGB elements are
 /// ignored. Option 3 - Specify the location of a blob in your storage
 /// account that contain a disk image to use. Include the
 /// SourceMediaLink element. Note: If the MediaLink element
 /// isincluded, it is ignored.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157199.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of your service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of the deployment.
 /// </param>
 /// <param name='roleName'>
 /// Required. The name of the role to add the data disk to.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Create Virtual Machine Data
 /// Disk operation.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static Task <OperationStatusResponse> CreateDataDiskAsync(this IVirtualMachineDiskOperations operations, string serviceName, string deploymentName, string roleName, VirtualMachineDataDiskCreateParameters parameters)
 {
     return(operations.CreateDataDiskAsync(serviceName, deploymentName, roleName, parameters, CancellationToken.None));
 }