/// <summary> /// You can swap a web site from one slot to the production slot. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// Required. The name of the web space. /// </param> /// <param name='webSiteName'> /// Required. The name of the web site. /// </param> /// <param name='slotName'> /// Required. The name of the web site slot to swap with the production /// slot. /// </param> /// <returns> /// The response body contains the status of the specified long-running /// operation, indicating whether it has succeeded, is inprogress, has /// timed out, or has failed. Note that this status is distinct from /// the HTTP status code returned for the Get Operation Status /// operation itself. If the long-running operation failed, the /// response body includes error information regarding the failure. /// </returns> public static WebSiteOperationStatusResponse BeginSwapingSlots(this IWebSiteOperations operations, string webSpaceName, string webSiteName, string slotName) { return(Task.Factory.StartNew((object s) => { return ((IWebSiteOperations)s).BeginSwapingSlotsAsync(webSpaceName, webSiteName, slotName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// List the Web Sites in a resource group. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='parameters'> /// Optional. Additional parameters. /// </param> /// <returns> /// The List Web Sites operation response. /// </returns> public static WebSiteListResponse List(this IWebSiteOperations operations, string resourceGroupName, WebSiteListParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IWebSiteOperations)s).ListAsync(resourceGroupName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Determines if a host name is available. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSiteName'> /// Required. The name of the web site. /// </param> /// <returns> /// The Is Hostname Available Web Site operation response. /// </returns> public static WebSiteIsHostnameAvailableResponse IsHostnameAvailable(this IWebSiteOperations operations, string webSiteName) { return(Task.Factory.StartNew((object s) => { return ((IWebSiteOperations)s).IsHostnameAvailableAsync(webSiteName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Get a web site's current usage metrics. The metrics returned /// include CPU Time, Data In, Data Out, Local bytes read, Local bytes /// written, Network bytes read, Network bytes written, WP stop /// requests, Memory Usage, CPU Time - Minute Limit, and File System /// Storage. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166991.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='webSiteName'> /// Required. The name of the web site. /// </param> /// <returns> /// The Get Web Site Usage Metrics operation response. /// </returns> public static WebSiteGetUsageMetricsResponse GetUsageMetrics(this IWebSiteOperations operations, string resourceGroupName, string webSiteName) { return(Task.Factory.StartNew((object s) => { return ((IWebSiteOperations)s).GetUsageMetricsAsync(resourceGroupName, webSiteName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// A web site repository is essentially a Git repository that you can /// use to manage your web site content. By using Git source control /// tools, you can push or pull version-controlled changes to your /// site. This API executes a repository sync operation. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// Required. The name of the web space. /// </param> /// <param name='webSiteName'> /// Required. The name of the web site. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse SyncRepository(this IWebSiteOperations operations, string webSpaceName, string webSiteName) { return(Task.Factory.StartNew((object s) => { return ((IWebSiteOperations)s).SyncRepositoryAsync(webSpaceName, webSiteName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// You can update the settings for a web site by using the HTTP PUT /// method and by specifying the settings in the request body. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn167005.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// Required. The name of the web space. /// </param> /// <param name='webSiteName'> /// Required. The name of the web site. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Update Web Site operation. /// </param> /// <returns> /// The Update Web Site operation response. /// </returns> public static WebSiteUpdateResponse Update(this IWebSiteOperations operations, string webSpaceName, string webSiteName, WebSiteUpdateParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IWebSiteOperations)s).UpdateAsync(webSpaceName, webSiteName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the WebSiteManagementClient class. /// </summary> private WebSiteManagementClient() : base() { this._serverFarms = new ServerFarmOperations(this); this._webSites = new WebSiteOperations(this); this._webSpaces = new WebSpaceOperations(this); this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes a new instance of the WebSiteManagementClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> private WebSiteManagementClient(HttpClient httpClient) : base(httpClient) { this._webHostingPlans = new WebHostingPlanOperations(this); this._webSites = new WebSiteOperations(this); this._apiVersion = "2014-04-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes a new instance of the WebSiteManagementClient class. /// </summary> private WebSiteManagementClient() : base() { this._serverFarms = new ServerFarmOperations(this); this._webSites = new WebSiteOperations(this); this._apiVersion = "2014-04-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes a new instance of the WebSiteManagementClient class. /// </summary> public WebSiteManagementClient() : base() { this._sourceControls = new SourceControlOperations(this); this._webHostingPlans = new WebHostingPlanOperations(this); this._webSites = new WebSiteOperations(this); this._apiVersion = "2014-06-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// You can swap a web site from one slot to the production slot. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <param name='slotName'> /// The name of the web site slot to swap with the production slot. /// </param> /// <returns> /// The response body contains the status of the specified long-running /// operation, indicating whether it has succeeded, is inprogress, has /// time dout, or has failed. Note that this status is distinct from /// the HTTP status code returned for the Get Operation Status /// operation itself. If the long-running operation failed, the /// response body includes error information regarding the failure. /// </returns> public static WebSiteOperationStatusResponse SwapSlots(this IWebSiteOperations operations, string webSpaceName, string webSiteName, string slotName) { try { return(operations.SwapSlotsAsync(webSpaceName, webSiteName, slotName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// You can retrieve details for a web site by issuing an HTTP GET /// request. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn167007.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <param name='parameters'> /// Additional parameters. /// </param> /// <returns> /// The Get Web Site Details operation response. /// </returns> public static WebSiteGetResponse Get(this IWebSiteOperations operations, string webSpaceName, string webSiteName, WebSiteGetParameters parameters) { try { return(operations.GetAsync(webSpaceName, webSiteName, parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// You can restart a web site by issuing an HTTP POST request. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn236425.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse Restart(this IWebSiteOperations operations, string webSpaceName, string webSiteName) { try { return(operations.RestartAsync(webSpaceName, webSiteName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Determines if a hostname is available /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <returns> /// The Is Hostname Available operation response. /// </returns> public static WebSiteIsHostnameAvailableResponse IsHostnameAvailable(this IWebSiteOperations operations, string webSiteName) { try { return(operations.IsHostnameAvailableAsync(webSiteName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Determines if a hostname is available /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <returns> /// The Is Hostname Available operation response. /// </returns> public static Task <WebSiteIsHostnameAvailableResponse> IsHostnameAvailableAsync(this IWebSiteOperations operations, string webSiteName) { return(operations.IsHostnameAvailableAsync(webSiteName, CancellationToken.None)); }
/// <summary> /// You can retrieve a site's current usage metrics by issuing an HTTP /// GET request. The metrics returned include CPU Time, Data In, Data /// Out, Local bytes read, Local bytes written, Network bytes read, /// Network bytes written, WP stop requests, Memory Usage, CPU Time - /// Minute Limit, and File System Storage. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166991.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <returns> /// The Get Web Site Usage Metrics operation response. /// </returns> public static Task <WebSiteGetUsageMetricsResponse> GetUsageMetricsAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName) { return(operations.GetUsageMetricsAsync(webSpaceName, webSiteName, CancellationToken.None)); }
/// <summary> /// You can retrieve the publish settings information for a web site by /// issuing an HTTP GET request. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166996.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <returns> /// The Get Web Site Publish Profile operation response. /// </returns> public static Task <WebSiteGetPublishProfileResponse> GetPublishProfileAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName) { return(operations.GetPublishProfileAsync(webSpaceName, webSiteName, CancellationToken.None)); }
/// <summary> /// You can retrieve historical usage metrics for a site by issuing an /// HTTP GET request. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166964.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <param name='parameters'> /// The Get Web Site Historical Usage Metrics parameters. /// </param> /// <returns> /// The Get Web Site Historical Usage Metrics operation response. /// </returns> public static Task <WebSiteGetHistoricalUsageMetricsResponse> GetHistoricalUsageMetricsAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName, WebSiteGetHistoricalUsageMetricsParameters parameters) { return(operations.GetHistoricalUsageMetricsAsync(webSpaceName, webSiteName, parameters, CancellationToken.None)); }
/// <summary> /// A web site repository is essentially a GIT repository that you can /// use to manage your web site content. By using GIT source control /// tools, you can push or pull version controlled changes to your /// site. You can create a repository for your web site by issuing an /// HTTP POST request, or retrieve information about the repository by /// using HTTP GET. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='webSiteName'> /// Required. The name of the web site. /// </param> /// <returns> /// The Get Web Site Repository operation response. /// </returns> public static Task <WebSiteGetRepositoryResponse> GetRepositoryAsync(this IWebSiteOperations operations, string resourceGroupName, string webSiteName) { return(operations.GetRepositoryAsync(resourceGroupName, webSiteName, CancellationToken.None)); }
/// <summary> /// You can create a web site by using a POST request that includes the /// name of the web site and other information in the request body. /// (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166986.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Create Web Site operation. /// </param> /// <returns> /// The Create Web Space operation response. /// </returns> public static Task <WebSiteCreateResponse> CreateOrUpdateAsync(this IWebSiteOperations operations, string resourceGroupName, WebSiteCreateResourceParameters parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, parameters, CancellationToken.None)); }
/// <summary> /// You can delete a web site by issuing an HTTP DELETE request. If the /// web site being deleted is the only site remaining in a server /// farm, you can optionally delete the server farm as well by using /// the deleteEmptyServerFarm parameter. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn236430.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <param name='parameters'> /// The parameters to delete a web site. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> DeleteAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName, WebSiteDeleteParameters parameters) { return(operations.DeleteAsync(webSpaceName, webSiteName, parameters, CancellationToken.None)); }
/// <summary> /// You can retrieve the config settings for a web site by issuing an /// HTTP GET request, or update them by using HTTP PUT with a request /// body that contains the settings to be updated. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166985.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <param name='parameters'> /// The Update Web Site Configuration parameters. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> UpdateConfigurationAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName, WebSiteUpdateConfigurationParameters parameters) { return(operations.UpdateConfigurationAsync(webSpaceName, webSiteName, parameters, CancellationToken.None)); }
/// <summary> /// You can swap a web site from one slot to the production slot. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <param name='slotName'> /// The name of the web site slot to swap with the production slot. /// </param> /// <returns> /// The response body contains the status of the specified long-running /// operation, indicating whether it has succeeded, is inprogress, has /// time dout, or has failed. Note that this status is distinct from /// the HTTP status code returned for the Get Operation Status /// operation itself. If the long-running operation failed, the /// response body includes error information regarding the failure. /// </returns> public static Task <WebSiteOperationStatusResponse> SwapSlotsAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName, string slotName) { return(operations.SwapSlotsAsync(webSpaceName, webSiteName, slotName, CancellationToken.None)); }
/// <summary> /// You can generate a new random password for publishing a site by /// issuing an HTTP POST request. Tip: If you want to verify that the /// publish password has changed, call HTTP GET on /publishxml before /// calling /newpassword. In the publish XML, note the hash value in /// the userPWD attribute. After calling /newpassword, call /// /publishxml again. You can then compare the new value of userPWD /// in the Publish XML with the one you noted earlier. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn236428.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='webSiteName'> /// Required. The name of the web site. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> GeneratePasswordAsync(this IWebSiteOperations operations, string resourceGroupName, string webSiteName) { return(operations.GeneratePasswordAsync(resourceGroupName, webSiteName, CancellationToken.None)); }
/// <summary> /// You can retrieve the config settings for a web site by issuing an /// HTTP GET request, or update them by using HTTP PUT with a request /// body that contains the settings to be updated. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166985.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='webSiteName'> /// Required. The name of the web site. /// </param> /// <param name='parameters'> /// Optional. Additional parameters. /// </param> /// <returns> /// The Get Web Site Configuration operation response. /// </returns> public static Task <WebSiteGetConfigurationResponse> GetConfigurationAsync(this IWebSiteOperations operations, string resourceGroupName, string webSiteName, WebSiteGetConfigurationParameters parameters) { return(operations.GetConfigurationAsync(resourceGroupName, webSiteName, parameters, CancellationToken.None)); }
/// <summary> /// You can restart a web site by issuing an HTTP POST request. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn236425.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> RestartAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName) { return(operations.RestartAsync(webSpaceName, webSiteName, CancellationToken.None)); }
/// <summary> /// A web site repository is essentially a GIT repository that you can /// use to manage your web site content. By using GIT source control /// tools, you can push or pull version controlled changes to your /// site. You can create a repository for your web site by issuing an /// HTTP POST request, or retrieve information about the repository by /// using HTTP GET. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <returns> /// The Delete Web Site Repository operation response. /// </returns> public static Task <WebSiteDeleteRepositoryResponse> DeleteRepositoryAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName) { return(operations.DeleteRepositoryAsync(webSpaceName, webSiteName, CancellationToken.None)); }
/// <summary> /// List the Web Sites in a resource group. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='parameters'> /// Optional. Additional parameters. /// </param> /// <returns> /// The List Web Sites operation response. /// </returns> public static Task <WebSiteListResponse> ListAsync(this IWebSiteOperations operations, string resourceGroupName, WebSiteListParameters parameters) { return(operations.ListAsync(resourceGroupName, parameters, CancellationToken.None)); }