/// <summary>
 /// Gets a list of virtual machine images.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='parameters'>
 /// Optional.
 /// </param>
 /// <returns>
 /// A list of virtual machine image resource information.
 /// </returns>
 public static VirtualMachineImageResourceList List(this IVirtualMachineImageOperations operations, VirtualMachineImageListParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualMachineImageOperations)s).ListAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Пример #2
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);
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the ComputeManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public ComputeManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._availabilitySets = new AvailabilitySetOperations(this);
     this._usage            = new UsageOperations(this);
     this._virtualMachineExtensionImages = new VirtualMachineExtensionImageOperations(this);
     this._virtualMachineExtensions      = new VirtualMachineExtensionOperations(this);
     this._virtualMachineImages          = new VirtualMachineImageOperations(this);
     this._virtualMachines     = new VirtualMachineOperations(this);
     this._virtualMachineSizes = new VirtualMachineSizeOperations(this);
     this._apiVersion          = "2015-06-15";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// The Add OS Image operation adds an operating system image that is
 /// stored in a storage account and is available from the image
 /// repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157192.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Virtual Machine Image operation.
 /// </param>
 /// <returns>
 /// Parameters returned from the Create Virtual Machine Image operation.
 /// </returns>
 public static VirtualMachineImageCreateResponse Create(this IVirtualMachineImageOperations operations, VirtualMachineImageCreateParameters parameters)
 {
     try
     {
         return operations.CreateAsync(parameters).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The List OS Images operation retrieves a list of the operating
 /// system images from the image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157191.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <returns>
 /// The List OS Images operation response.
 /// </returns>
 public static VirtualMachineImageListResponse List(this IVirtualMachineImageOperations operations)
 {
     try
     {
         return operations.ListAsync().Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Get OS Image operation retrieves the details for an operating
 /// system image from the image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157191.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='imageName'>
 /// The name of the OS image to retrieve.
 /// </param>
 /// <returns>
 /// A virtual machine image associated with your subscription.
 /// </returns>
 public static VirtualMachineImageGetResponse Get(this IVirtualMachineImageOperations operations, string imageName)
 {
     try
     {
         return operations.GetAsync(imageName).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Delete OS Image operation deletes the specified OS image from
 /// your image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157203.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='imageName'>
 /// The name of the image to delete.
 /// </param>
 /// <param name='deleteFromStorage'>
 /// Optional. Specifies that the source blob for the image should also
 /// be deleted from storage.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse Delete(this IVirtualMachineImageOperations operations, string imageName, bool deleteFromStorage)
 {
     try
     {
         return operations.DeleteAsync(imageName, deleteFromStorage).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Add OS Image operation adds an operating system image that is
 /// stored in a storage account and is available from the image
 /// repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157192.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Virtual Machine Image operation.
 /// </param>
 /// <returns>
 /// Parameters returned from the Create Virtual Machine Image operation.
 /// </returns>
 public static Task<VirtualMachineImageCreateResponse> CreateAsync(this IVirtualMachineImageOperations operations, VirtualMachineImageCreateParameters parameters)
 {
     return operations.CreateAsync(parameters, CancellationToken.None);
 }
 /// <summary>
 /// The Update OS Image operation updates an OS image that in your
 /// image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157198.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='imageName'>
 /// The name of the virtual machine image to be updated.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Virtual Machine Image operation.
 /// </param>
 /// <returns>
 /// Parameters returned from the Create Virtual Machine Image operation.
 /// </returns>
 public static Task<VirtualMachineImageUpdateResponse> UpdateAsync(this IVirtualMachineImageOperations operations, string imageName, VirtualMachineImageUpdateParameters parameters)
 {
     return operations.UpdateAsync(imageName, parameters, CancellationToken.None);
 }
 /// <summary>
 /// The List OS Images operation retrieves a list of the operating
 /// system images from the image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157191.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <returns>
 /// The List OS Images operation response.
 /// </returns>
 public static Task<VirtualMachineImageListResponse> ListAsync(this IVirtualMachineImageOperations operations)
 {
     return operations.ListAsync(CancellationToken.None);
 }
 /// <summary>
 /// The Get OS Image operation retrieves the details for an operating
 /// system image from the image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157191.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='imageName'>
 /// The name of the OS image to retrieve.
 /// </param>
 /// <returns>
 /// A virtual machine image associated with your subscription.
 /// </returns>
 public static Task<VirtualMachineImageGetResponse> GetAsync(this IVirtualMachineImageOperations operations, string imageName)
 {
     return operations.GetAsync(imageName, CancellationToken.None);
 }
 /// <summary>
 /// The Delete OS Image operation deletes the specified OS image from
 /// your image repository.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157203.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='imageName'>
 /// The name of the image to delete.
 /// </param>
 /// <param name='deleteFromStorage'>
 /// Optional. Specifies that the source blob for the image should also
 /// be deleted from storage.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task<OperationResponse> DeleteAsync(this IVirtualMachineImageOperations operations, string imageName, bool deleteFromStorage)
 {
     return operations.DeleteAsync(imageName, deleteFromStorage, CancellationToken.None);
 }
 /// <summary>
 /// Gets a virtual machine image.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='parameters'>
 /// Optional.
 /// </param>
 /// <returns>
 /// The get vm image operation response.
 /// </returns>
 public static Task <VirtualMachineImageGetResponse> GetAsync(this IVirtualMachineImageOperations operations, VirtualMachineImageGetParameters parameters)
 {
     return(operations.GetAsync(parameters, CancellationToken.None));
 }
 /// <summary>
 /// Gets a list of virtual machine image skus.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineImageOperations.
 /// </param>
 /// <param name='parameters'>
 /// Optional.
 /// </param>
 /// <returns>
 /// A list of virtual machine image resource information.
 /// </returns>
 public static Task <VirtualMachineImageResourceList> ListSkusAsync(this IVirtualMachineImageOperations operations, VirtualMachineImageListSkusParameters parameters)
 {
     return(operations.ListSkusAsync(parameters, CancellationToken.None));
 }