/// <summary>
 /// The List Resource Extensions operation lists the resource
 /// extensions that are available to add to a Virtual Machine. In
 /// Azure, a process can run as a resource extension of a Virtual
 /// Machine. For example, Remote Desktop Access or the Azure
 /// Diagnostics Agent can run as resource extensions to the Virtual
 /// Machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn495441.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <returns>
 /// The List Resource Extensions operation response.
 /// </returns>
 public static VirtualMachineExtensionListResponse List(this IVirtualMachineExtensionOperations operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualMachineExtensionOperations)s).ListAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Example #2
0
 /// <summary>
 /// The operation to get an extension along with its instance view.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// Required. The name of the virtual machine containing the extension.
 /// </param>
 /// <param name='vmExtensionName'>
 /// Required. The name of the virtual machine extension.
 /// </param>
 /// <returns>
 /// The Get VM-Extension operation response.
 /// </returns>
 public static VirtualMachineExtensionGetResponse GetWithInstanceView(this IVirtualMachineExtensionOperations operations, string resourceGroupName, string vmName, string vmExtensionName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualMachineExtensionOperations)s).GetWithInstanceViewAsync(resourceGroupName, vmName, vmExtensionName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Example #3
0
 /// <summary>
 /// The operation to create or update the extension.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// Required. The name of the virtual machine where the extension
 /// should be create or updated.
 /// </param>
 /// <param name='extensionParameters'>
 /// Required. Parameters supplied to the Create Virtual Machine
 /// Extension operation.
 /// </param>
 /// <returns>
 /// The Compute service response for long-running operations.
 /// </returns>
 public static ComputeLongRunningOperationResponse CreateOrUpdate(this IVirtualMachineExtensionOperations operations, string resourceGroupName, string vmName, VirtualMachineExtension extensionParameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IVirtualMachineExtensionOperations)s).CreateOrUpdateAsync(resourceGroupName, vmName, extensionParameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Example #4
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);
 }
Example #5
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);
 }
Example #6
0
 /// <summary>
 /// The List Resource Extensions operation lists the resource
 /// extensions that are available to add to a Virtual Machine. In
 /// Windows Azure, a process can run as a resource extension of a
 /// Virtual Machine. For example, Remote Desktop Access or the Windows
 /// Azure Diagnostics Agent can run as resource extensions to the
 /// Virtual Machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn495441.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <returns>
 /// The List Resource Extensions operation response.
 /// </returns>
 public static VirtualMachineExtensionListResponse List(this IVirtualMachineExtensionOperations operations)
 {
     try
     {
         return(operations.ListAsync().Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Example #7
0
 /// <summary>
 /// The List Resource Extension Versions operation lists the versions
 /// of a resource extension that are available to add to a Virtual
 /// Machine. In Windows Azure, a process can run as a resource
 /// extension of a Virtual Machine. For example, Remote Desktop Access
 /// or the Windows Azure Diagnostics Agent can run as resource
 /// extensions to the Virtual Machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn495440.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <param name='publisherName'>
 /// The name of the publisher.
 /// </param>
 /// <param name='extensionName'>
 /// The name of the extension.
 /// </param>
 /// <returns>
 /// The List Resource Extensions operation response.
 /// </returns>
 public static VirtualMachineExtensionListResponse ListVersions(this IVirtualMachineExtensionOperations operations, string publisherName, string extensionName)
 {
     try
     {
         return(operations.ListVersionsAsync(publisherName, extensionName).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 List Resource Extensions operation lists the resource
 /// extensions that are available to add to a Virtual Machine. In
 /// Azure, a process can run as a resource extension of a Virtual
 /// Machine. For example, Remote Desktop Access or the Azure
 /// Diagnostics Agent can run as resource extensions to the Virtual
 /// Machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn495441.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <returns>
 /// The List Resource Extensions operation response.
 /// </returns>
 public static Task <VirtualMachineExtensionListResponse> ListAsync(this IVirtualMachineExtensionOperations operations)
 {
     return(operations.ListAsync(CancellationToken.None));
 }
 /// <summary>
 /// The List Resource Extension Versions operation lists the versions
 /// of a resource extension that are available to add to a Virtual
 /// Machine. In Azure, a process can run as a resource extension of a
 /// Virtual Machine. For example, Remote Desktop Access or the Azure
 /// Diagnostics Agent can run as resource extensions to the Virtual
 /// Machine.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn495440.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <param name='publisherName'>
 /// Required. The name of the publisher.
 /// </param>
 /// <param name='extensionName'>
 /// Required. The name of the extension.
 /// </param>
 /// <returns>
 /// The List Resource Extensions operation response.
 /// </returns>
 public static Task <VirtualMachineExtensionListResponse> ListVersionsAsync(this IVirtualMachineExtensionOperations operations, string publisherName, string extensionName)
 {
     return(operations.ListVersionsAsync(publisherName, extensionName, CancellationToken.None));
 }
Example #11
0
 /// <summary>
 /// The operation to create or update the extension.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// Required. The name of the virtual machine where the extension
 /// should be create or updated.
 /// </param>
 /// <param name='extensionParameters'>
 /// Required. Parameters supplied to the Create Virtual Machine
 /// Extension operation.
 /// </param>
 /// <returns>
 /// The compute long running operation response.
 /// </returns>
 public static Task <VirtualMachineExtensionCreateOrUpdateResponse> BeginCreatingOrUpdatingAsync(this IVirtualMachineExtensionOperations operations, string resourceGroupName, string vmName, VirtualMachineExtension extensionParameters)
 {
     return(operations.BeginCreatingOrUpdatingAsync(resourceGroupName, vmName, extensionParameters, CancellationToken.None));
 }
Example #12
0
 /// <summary>
 /// The operation to get an extension along with its instance view.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// Required. The name of the virtual machine containing the extension.
 /// </param>
 /// <param name='vmExtensionName'>
 /// Required. The name of the virtual machine extension.
 /// </param>
 /// <returns>
 /// The Get VM-Extension operation response.
 /// </returns>
 public static Task <VirtualMachineExtensionGetResponse> GetWithInstanceViewAsync(this IVirtualMachineExtensionOperations operations, string resourceGroupName, string vmName, string vmExtensionName)
 {
     return(operations.GetWithInstanceViewAsync(resourceGroupName, vmName, vmExtensionName, CancellationToken.None));
 }
Example #13
0
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// Required. The name of the virtual machine where the extension
 /// should be deleted.
 /// </param>
 /// <param name='vmExtensionName'>
 /// Required. The name of the virtual machine extension.
 /// </param>
 /// <returns>
 /// The compute long running operation response.
 /// </returns>
 public static Task <DeleteOperationResponse> DeleteAsync(this IVirtualMachineExtensionOperations operations, string resourceGroupName, string vmName, string vmExtensionName)
 {
     return(operations.DeleteAsync(resourceGroupName, vmName, vmExtensionName, CancellationToken.None));
 }
Example #14
0
 /// <summary>
 /// The operation to create or update the extension.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineExtensionOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// Required. The name of the virtual machine where the extension
 /// should be create or updated.
 /// </param>
 /// <param name='extensionParameters'>
 /// Required. Parameters supplied to the Create Virtual Machine
 /// Extension operation.
 /// </param>
 /// <returns>
 /// The Compute service response for long-running operations.
 /// </returns>
 public static Task <ComputeLongRunningOperationResponse> CreateOrUpdateAsync(this IVirtualMachineExtensionOperations operations, string resourceGroupName, string vmName, VirtualMachineExtension extensionParameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, vmName, extensionParameters, CancellationToken.None));
 }