/// <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> /// You can retrieve a list of all web sites in a web space by issuing /// an HTTP GET request. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn236429.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <param name='webSpaceName'> /// Required. The name of the web space. /// </param> /// <param name='parameters'> /// Optional. Additional parameters. /// </param> /// <returns> /// The List Web Sites operation response. /// </returns> public static WebSpacesListWebSitesResponse ListWebSites(this IWebSpaceOperations operations, string webSpaceName, WebSiteListParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IWebSpaceOperations)s).ListWebSitesAsync(webSpaceName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Creates a source control user with permissions to publish to this /// web space. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <param name='username'> /// Required. The user name. /// </param> /// <param name='password'> /// Required. The user password. /// </param> /// <param name='parameters'> /// Optional. Parameters supplied to the Create Publishing User /// operation. /// </param> /// <returns> /// The Create Publishing User operation response. /// </returns> public static WebSpacesCreatePublishingUserResponse CreatePublishingUser(this IWebSpaceOperations operations, string username, string password, WebSpacesCreatePublishingUserParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IWebSpaceOperations)s).CreatePublishingUserAsync(username, password, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Get the source control users allowed to publish to this web space. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <returns> /// The List Publishing Users operation response. /// </returns> public static WebSpacesListPublishingUsersResponse ListPublishingUsers(this IWebSpaceOperations operations) { return(Task.Factory.StartNew((object s) => { return ((IWebSpaceOperations)s).ListPublishingUsersAsync(); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the WebSiteManagementClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public WebSiteManagementClient(HttpClient httpClient) : base(httpClient) { this._webHostingPlans = new WebHostingPlanOperations(this); this._webSites = new WebSiteOperations(this); this._webSpaces = new WebSpaceOperations(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._webHostingPlans = new WebHostingPlanOperations(this); this._webSites = new WebSiteOperations(this); this._webSpaces = new WebSpaceOperations(this); this._apiVersion = "2013-08-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Get the source control users allowed to publish to this web space. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <returns> /// The List Publishing Users operation response. /// </returns> public static WebSpacesListPublishingUsersResponse ListPublishingUsers(this IWebSpaceOperations operations) { try { return(operations.ListPublishingUsersAsync().Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Creates a source control user allowed to publish to this web space. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <param name='username'> /// The user name. /// </param> /// <param name='password'> /// The user password. /// </param> /// <param name='parameters'> /// Parameters supplied to the Create Publishing User operation. /// </param> /// <returns> /// The Create Publishing User operation response. /// </returns> public static WebSpacesCreatePublishingUserResponse CreatePublishingUser(this IWebSpaceOperations operations, string username, string password, WebSpacesCreatePublishingUserParameters parameters) { try { return(operations.CreatePublishingUserAsync(username, password, parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// You can retrieve a list of all web sites in a web space by issuing /// an HTTP GET request. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn236429.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='parameters'> /// Additional parameters. /// </param> /// <returns> /// The List Web Sites operation response. /// </returns> public static WebSpacesListWebSitesResponse ListWebSites(this IWebSpaceOperations operations, string webSpaceName, WebSiteListParameters parameters) { try { return(operations.ListWebSitesAsync(webSpaceName, parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// You can retrieve details for a specified webspace name by issuing /// an HTTP GET request. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn167017.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <returns> /// The Get Web Space Details operation response. /// </returns> public static WebSpacesGetResponse Get(this IWebSpaceOperations operations, string webSpaceName) { try { return(operations.GetAsync(webSpaceName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Get the dns suffix for this subscription. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <returns> /// The Get DNS Suffix operation response. /// </returns> public static WebSpacesGetDnsSuffixResponse GetDnsSuffix(this IWebSpaceOperations operations) { try { return(operations.GetDnsSuffixAsync().Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Get the available geo regions for this webspace. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <returns> /// The Get DNS Suffix operation response. /// </returns> public static Task <WebSpacesListGeoRegionsResponse> ListGeoRegionsAsync(this IWebSpaceOperations operations) { return(operations.ListGeoRegionsAsync(CancellationToken.None)); }
/// <summary> /// Creates a source control user allowed to publish to this web space. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <param name='username'> /// The user name. /// </param> /// <param name='password'> /// The user password. /// </param> /// <param name='parameters'> /// Parameters supplied to the Create Publishing User operation. /// </param> /// <returns> /// The Create Publishing User operation response. /// </returns> public static Task <WebSpacesCreatePublishingUserResponse> CreatePublishingUserAsync(this IWebSpaceOperations operations, string username, string password, WebSpacesCreatePublishingUserParameters parameters) { return(operations.CreatePublishingUserAsync(username, password, parameters, CancellationToken.None)); }
/// <summary> /// You can retrieve a list of all web sites in a web space by issuing /// an HTTP GET request. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn236429.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='parameters'> /// Additional parameters. /// </param> /// <returns> /// The List Web Sites operation response. /// </returns> public static Task <WebSpacesListWebSitesResponse> ListWebSitesAsync(this IWebSpaceOperations operations, string webSpaceName, WebSiteListParameters parameters) { return(operations.ListWebSitesAsync(webSpaceName, parameters, CancellationToken.None)); }
/// <summary> /// Get the source control users allowed to publish to this web space. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <returns> /// The List Publishing Users operation response. /// </returns> public static Task <WebSpacesListPublishingUsersResponse> ListPublishingUsersAsync(this IWebSpaceOperations operations) { return(operations.ListPublishingUsersAsync(CancellationToken.None)); }
/// <summary> /// Get the dns suffix for this subscription. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <returns> /// The Get DNS Suffix operation response. /// </returns> public static Task <WebSpacesGetDnsSuffixResponse> GetDnsSuffixAsync(this IWebSpaceOperations operations) { return(operations.GetDnsSuffixAsync(CancellationToken.None)); }
/// <summary> /// You can retrieve details for a specified webspace name by issuing /// an HTTP GET request. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn167017.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSpaceOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <returns> /// The Get Web Space Details operation response. /// </returns> public static Task <WebSpacesGetResponse> GetAsync(this IWebSpaceOperations operations, string webSpaceName) { return(operations.GetAsync(webSpaceName, CancellationToken.None)); }