/// <summary> /// The List Extensions operation lists all of the extensions that were /// added to a cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169561.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <returns> /// The List Extensions operation response. /// </returns> public static HostedServiceListExtensionsResponse ListExtensions(this IHostedServiceOperations operations, string serviceName) { return(Task.Factory.StartNew((object s) => { return ((IHostedServiceOperations)s).ListExtensionsAsync(serviceName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// The Update Hosted Service operation can update the label or /// description of a cloud service in Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/gg441303.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Update Hosted Service /// operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static AzureOperationResponse Update(this IHostedServiceOperations operations, string serviceName, HostedServiceUpdateParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IHostedServiceOperations)s).UpdateAsync(serviceName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// The Begin Deleting Extension operation deletes the specified /// extension from a cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169560.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <param name='extensionId'> /// Required. The identifier that was assigned to the extension when it /// was added to the cloud service /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static AzureOperationResponse BeginDeletingExtension(this IHostedServiceOperations operations, string serviceName, string extensionId) { return(Task.Factory.StartNew((object s) => { return ((IHostedServiceOperations)s).BeginDeletingExtensionAsync(serviceName, extensionId); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <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 List Extensions operation lists all of the extensions that were /// added to a cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169561.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// The name of the cloud service. /// </param> /// <returns> /// The List Extensions operation response. /// </returns> public static HostedServiceListExtensionsResponse ListExtensions(this IHostedServiceOperations operations, string serviceName) { try { return(operations.ListExtensionsAsync(serviceName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The Create Hosted Service operation creates a new cloud service in /// Windows Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/gg441304.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='parameters'> /// Parameters supplied to the Create Hosted Service operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse Create(this IHostedServiceOperations operations, HostedServiceCreateParameters parameters) { try { return(operations.CreateAsync(parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The Get Extension operation retrieves information about a specified /// extension that was added to a cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169557.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// The name of the cloud service. /// </param> /// <param name='extensionId'> /// The identifier that was assigned to the extension when it was added /// to the cloud service /// </param> /// <returns> /// The Get Extension operation response. /// </returns> public static HostedServiceGetExtensionResponse GetExtension(this IHostedServiceOperations operations, string serviceName, string extensionId) { try { return(operations.GetExtensionAsync(serviceName, extensionId).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The List Hosted Services operation lists the cloud services /// available under the current subscription. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460781.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <returns> /// The Get Hosted Service operation response. /// </returns> public static HostedServiceListResponse List(this IHostedServiceOperations operations) { try { return(operations.ListAsync().Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The Get Hosted Service Properties operation retrieves system /// properties for the specified cloud service. These properties /// include the service name and service type; the name of the /// affinity group to which the service belongs, or its location if it /// is not part of an affinity group; and information on the /// deployments of the service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460806.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// The name of the cloud service. /// </param> /// <returns> /// The detailed Get Hosted Service operation response. /// </returns> public static HostedServiceGetDetailedResponse GetDetailed(this IHostedServiceOperations operations, string serviceName) { try { return(operations.GetDetailedAsync(serviceName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The Add Extension operation adds an available extension to your /// cloud service. In Windows Azure, a process can run as an extension /// of a cloud service. For example, Remote Desktop Access or the /// Windows Azure Diagnostics Agent can run as extensions to the cloud /// service. You can find the available extension by using the List /// Available Extensions operation. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169558.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// The name of the cloud service. /// </param> /// <param name='parameters'> /// Parameters supplied to the Add Extension 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 also includes error /// information regarding the failure. /// </returns> public static ComputeOperationStatusResponse AddExtension(this IHostedServiceOperations operations, string serviceName, HostedServiceAddExtensionParameters parameters) { try { return(operations.AddExtensionAsync(serviceName, parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The Delete Hosted Service operation deletes the specified cloud /// service from Windows Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/gg441305.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// The name of the cloud service. /// </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 also includes error /// information regarding the failure. /// </returns> public static ComputeOperationStatusResponse DeleteAll(this IHostedServiceOperations operations, string serviceName) { try { return(operations.DeleteAllAsync(serviceName).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 Delete Hosted Service operation deletes the specified cloud /// service from Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/gg441305.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> DeleteAsync(this IHostedServiceOperations operations, string serviceName) { return(operations.DeleteAsync(serviceName, CancellationToken.None)); }
/// <summary> /// The Create Hosted Service operation creates a new cloud service in /// Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/gg441304.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Create Hosted Service /// operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> CreateAsync(this IHostedServiceOperations operations, HostedServiceCreateParameters parameters) { return(operations.CreateAsync(parameters, CancellationToken.None)); }
/// <summary> /// The Add Extension operation adds an available extension to your /// cloud service. In Windows Azure, a process can run as an extension /// of a cloud service. For example, Remote Desktop Access or the /// Windows Azure Diagnostics Agent can run as extensions to the cloud /// service. You can find the available extension by using the List /// Available Extensions operation. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169558.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// The name of the cloud service. /// </param> /// <param name='parameters'> /// Parameters supplied to the Add Extension 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 also includes error /// information regarding the failure. /// </returns> public static Task <ComputeOperationStatusResponse> AddExtensionAsync(this IHostedServiceOperations operations, string serviceName, HostedServiceAddExtensionParameters parameters) { return(operations.AddExtensionAsync(serviceName, parameters, CancellationToken.None)); }
/// <summary> /// The List Extension Versions operation lists the versions of an /// extension that are available to add to a cloud service. In Azure, /// a process can run as an extension of a cloud service. For example, /// Remote Desktop Access or the Azure Diagnostics Agent can run as /// extensions to the cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn495437.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='providerNamespace'> /// Required. The provider namespace. /// </param> /// <param name='extensionType'> /// Required. The extension type name. /// </param> /// <returns> /// The List Available Extensions operation response. /// </returns> public static Task <HostedServiceListAvailableExtensionsResponse> ListExtensionVersionsAsync(this IHostedServiceOperations operations, string providerNamespace, string extensionType) { return(operations.ListExtensionVersionsAsync(providerNamespace, extensionType, CancellationToken.None)); }
/// <summary> /// The Delete Hosted Service operation deletes the specified cloud /// service from Windows Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/gg441305.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// The name of the cloud service. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> BeginDeletingAllAsync(this IHostedServiceOperations operations, string serviceName) { return(operations.BeginDeletingAllAsync(serviceName, CancellationToken.None)); }
/// <summary> /// The Get Extension operation retrieves information about a specified /// extension that was added to a cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169557.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <param name='extensionId'> /// Required. The identifier that was assigned to the extension when it /// was added to the cloud service /// </param> /// <returns> /// The Get Extension operation response. /// </returns> public static Task <HostedServiceGetExtensionResponse> GetExtensionAsync(this IHostedServiceOperations operations, string serviceName, string extensionId) { return(operations.GetExtensionAsync(serviceName, extensionId, CancellationToken.None)); }
/// <summary> /// The Delete Extension operation deletes the specified extension from /// a cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169560.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <param name='extensionId'> /// Required. The identifier that was assigned to the extension when it /// was added to the cloud service /// </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> DeleteExtensionAsync(this IHostedServiceOperations operations, string serviceName, string extensionId) { return(operations.DeleteExtensionAsync(serviceName, extensionId, CancellationToken.None)); }
/// <summary> /// The Get Detailed Hosted Service Properties operation retrieves /// system properties for the specified cloud service. These /// properties include the service name and service type; the name of /// the affinity group to which the service belongs, or its location /// if it is not part of an affinity group; and information on the /// deployments of the service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460806.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <returns> /// The detailed Get Hosted Service operation response. /// </returns> public static Task <HostedServiceGetDetailedResponse> GetDetailedAsync(this IHostedServiceOperations operations, string serviceName) { return(operations.GetDetailedAsync(serviceName, CancellationToken.None)); }
/// <summary> /// The Update Hosted Service operation can update the label or /// description of a cloud service in Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/gg441303.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Update Hosted Service /// operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> UpdateAsync(this IHostedServiceOperations operations, string serviceName, HostedServiceUpdateParameters parameters) { return(operations.UpdateAsync(serviceName, parameters, CancellationToken.None)); }
/// <summary> /// The List Hosted Services operation lists the cloud services /// available under the current subscription. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460781.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <returns> /// The List Hosted Service operation response. /// </returns> public static Task <HostedServiceListResponse> ListAsync(this IHostedServiceOperations operations) { return(operations.ListAsync(CancellationToken.None)); }
/// <summary> /// The Begin Adding Extension operation adds an available extension to /// your cloud service. In Azure, a process can run as an extension of /// a cloud service. For example, Remote Desktop Access or the Azure /// Diagnostics Agent can run as extensions to the cloud service. You /// can find the available extension by using the List Available /// Extensions operation. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169558.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Begin Adding Extension /// operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> BeginAddingExtensionAsync(this IHostedServiceOperations operations, string serviceName, HostedServiceAddExtensionParameters parameters) { return(operations.BeginAddingExtensionAsync(serviceName, parameters, CancellationToken.None)); }
/// <summary> /// The List Extensions operation lists all of the extensions that were /// added to a cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169561.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <returns> /// The List Extensions operation response. /// </returns> public static Task <HostedServiceListExtensionsResponse> ListExtensionsAsync(this IHostedServiceOperations operations, string serviceName) { return(operations.ListExtensionsAsync(serviceName, CancellationToken.None)); }
/// <summary> /// The List Extension Versions operation lists the versions of an /// extension that are available to add to a cloud service. In Windows /// Azure, a process can run as an extension of a cloud service. For /// example, Remote Desktop Access or the Windows Azure Diagnostics /// Agent can run as extensions to the cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn495437.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='providerNamespace'> /// The provider namespace. /// </param> /// <param name='extensionType'> /// The extension type name. /// </param> /// <returns> /// The List Available Extensions operation response. /// </returns> public static HostedServiceListAvailableExtensionsResponse ListExtensionVersions(this IHostedServiceOperations operations, string providerNamespace, string extensionType) { try { return(operations.ListExtensionVersionsAsync(providerNamespace, extensionType).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The List Available Extensions operation lists the extensions that /// are available to add to your cloud service. In Windows Azure, a /// process can run as an extension of a cloud service. For example, /// Remote Desktop Access or the Azure Diagnostics Agent can run as /// extensions to the cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169559.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <returns> /// The List Available Extensions operation response. /// </returns> public static Task <HostedServiceListAvailableExtensionsResponse> ListPublisherExtensionsAsync(this IHostedServiceOperations operations) { return(operations.ListPublisherExtensionsAsync(CancellationToken.None)); }
/// <summary> /// The Begin Deleting Extension operation deletes the specified /// extension from a cloud service. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn169560.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The name of the cloud service. /// </param> /// <param name='extensionId'> /// Required. The identifier that was assigned to the extension when it /// was added to the cloud service /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> BeginDeletingExtensionAsync(this IHostedServiceOperations operations, string serviceName, string extensionId) { return(operations.BeginDeletingExtensionAsync(serviceName, extensionId, CancellationToken.None)); }
/// <summary> /// The Check Hosted Service Name Availability operation checks for the /// availability of the specified cloud service name. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154116.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// Required. The cloud service name that you would like to use. /// </param> /// <returns> /// The Check Hosted Service Name Availability operation response. /// </returns> public static Task <HostedServiceCheckNameAvailabilityResponse> CheckNameAvailabilityAsync(this IHostedServiceOperations operations, string serviceName) { return(operations.CheckNameAvailabilityAsync(serviceName, CancellationToken.None)); }
/// <summary> /// The Check Hosted Service Name Availability operation checks for the /// availability of the specified cloud service name. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154116.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations. /// </param> /// <param name='serviceName'> /// The cloud service name that you would like to use. /// </param> /// <returns> /// The Check Hosted Service Name Availability operation response. /// </returns> public static HostedServiceCheckNameAvailabilityResponse CheckNameAvailability(this IHostedServiceOperations operations, string serviceName) { try { return(operations.CheckNameAvailabilityAsync(serviceName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }