public static Site GetSite(this IWebsitesServiceManagement proxy, string subscriptionId, string website, string propertiesToInclude) { // Try to find webspace for site from cache Site site = Cache.GetSite(subscriptionId, website, propertiesToInclude); if (site != null) { try { return(proxy.GetSite(subscriptionId, site.WebSpace, site.Name, propertiesToInclude)); } catch { Cache.RemoveSite(subscriptionId, site); throw; } } // If site was not in cache, find out in which webspace it could be var webspaces = proxy.GetWebSpacesWithCache(subscriptionId); foreach (var webspace in webspaces) { var websites = proxy.GetSites(subscriptionId, webspace.Name, propertiesToInclude); var matchWebsite = websites.FirstOrDefault(w => w.Name.Equals(website, System.StringComparison.InvariantCultureIgnoreCase)); if (matchWebsite != null) { return(matchWebsite); } } return(null); }
/// <summary> /// Initializes a new instance of the GetAzureWebsiteLogCommand class. /// </summary> /// <param name="channel"> /// Channel used for communication with Azure's service management APIs. /// </param> /// <param name="deploymentChannel"> /// Channel used for communication with the git repository. /// </param> public GetAzureWebsiteLogCommand( IWebsitesServiceManagement channel, IDeploymentServiceManagement deploymentChannel) { Channel = channel; DeploymentChannel = deploymentChannel; WebsiteClient = null; }
public static WebSpaces GetWebSpacesWithCache(this IWebsitesServiceManagement proxy, string subscriptionId) { WebSpaces webSpaces = Cache.GetWebSpaces(subscriptionId); if (webSpaces != null && webSpaces.Count > 0) { return(webSpaces); } webSpaces = GetWebSpaces(proxy, subscriptionId); Cache.SaveSpaces(subscriptionId, webSpaces); return(webSpaces); }
public static Site GetSiteWithCache( this IWebsitesServiceManagement proxy, string subscriptionId, string website, string propertiesToInclude) { // Try to get the website's webspace from the cache Site site = Cache.GetSite(subscriptionId, website, propertiesToInclude); if (site != null) { try { return(proxy.GetSite(subscriptionId, site.WebSpace, site.Name, propertiesToInclude)); } catch { // The website is removed or it's webspace changed. Cache.RemoveSite(subscriptionId, site); throw; } } // Get all available webspace using REST API WebSpaces webspaces = proxy.GetWebSpaces(subscriptionId); // Iterate over all the webspaces until finding the website. foreach (WebSpace webspace in webspaces) { Sites websites = proxy.GetSites(subscriptionId, webspace.Name, propertiesToInclude); var matchWebsite = websites.FirstOrDefault(w => w.Name.Equals(website, System.StringComparison.InvariantCultureIgnoreCase)); if (matchWebsite != null) { return(matchWebsite); } } // The website does not exist. return(null); }
public static Site CreateSite(this IWebsitesServiceManagement proxy, string subscriptionId, string webspaceName, Site site) { return(proxy.EndCreateSite(proxy.BeginCreateSite(subscriptionId, webspaceName, site, null, null))); }
public static string[] GetSubscriptionPublishingUsers(this IWebsitesServiceManagement proxy, string subscriptionId) { return(proxy.EndGetSubscriptionPublishingUsers(proxy.BeginGetSubscriptionPublishingUsers(subscriptionId, null, null))); }
public static Site GetSite(this IWebsitesServiceManagement proxy, string subscriptionId, string webspaceName, string name, string propertiesToInclude) { return(proxy.EndGetSite(proxy.BeginGetSite(subscriptionId, webspaceName, name, propertiesToInclude, null, null))); }
public static WebSpace UpdateWebSpace(this IWebsitesServiceManagement proxy, string subscriptionId, string name, bool allowPendingState, WebSpace webSpace) { return(proxy.EndUpdateWebSpace(proxy.BeginUpdateWebSpace(subscriptionId, name, allowPendingState, webSpace, null, null))); }
public static void DeleteWebSpace(this IWebsitesServiceManagement proxy, string subscriptionId, string name) { proxy.EndDeleteWebSpace(proxy.BeginDeleteWebSpace(subscriptionId, name, null, null)); }
public static void UpdateSiteConfig(this IWebsitesServiceManagement proxy, string subscriptionId, string webspaceName, string name, SiteConfig siteConfig) { proxy.EndUpdateSiteConfig(proxy.BeginUpdateSiteConfig(subscriptionId, webspaceName, name, siteConfig, null, null)); }
/// <summary> /// Initializes a new instance of the RestoreAzureWebsiteDeploymentCommand class. /// </summary> /// <param name="channel"> /// Channel used for communication with Azure's service management APIs. /// </param> /// <param name="deploymentChannel"> /// Channel used for communication with the git repository. /// </param> public RestoreAzureWebsiteDeploymentCommand(IWebsitesServiceManagement channel, IDeploymentServiceManagement deploymentChannel) { Channel = channel; DeploymentChannel = deploymentChannel; }
public static GeoRegions GetRegions(this IWebsitesServiceManagement proxy, bool listOnlyOnline) { return(proxy.EndGetRegions(proxy.BeginGetRegions(listOnlyOnline, null, null))); }
/// <summary> /// Initializes a new instance of the GetAzureWebsiteLocationCommand class. /// </summary> /// <param name="channel"> /// Channel used for communication with Azure's service management APIs. /// </param> public GetAzureWebsiteLocationCommand(IWebsitesServiceManagement channel) { Channel = channel; }
/// <summary> /// Initializes a new instance of the NewAzureWebsiteCommand class. /// </summary> /// <param name="channel"> /// Channel used for communication with Azure's service management APIs. /// </param> /// <param name="githubChannel"> /// Channel used for communication with the github APIs. /// </param> public NewAzureWebsiteCommand(IWebsitesServiceManagement channel, IGithubServiceManagement githubChannel) { Channel = channel; GithubChannel = githubChannel; }
public DisableAzureWebsiteDiagnosticCommand(IWebsitesServiceManagement channel) { Channel = channel; }
public EnableAzureWebsiteApplicationDiagnosticCommand(IWebsitesServiceManagement channel) { Channel = channel; }
/// <summary> /// Initializes a new instance of the SaveAzureWebsiteLogCommand class. /// </summary> /// <param name="channel"> /// Channel used for communication with Azure's service management APIs. /// </param> /// <param name="deploymentChannel"> /// Channel used for communication with the git repository. /// </param> public SaveAzureWebsiteLogCommand(IWebsitesServiceManagement channel, IDeploymentServiceManagement deploymentChannel) { Channel = channel; DeploymentChannel = deploymentChannel; }
public static void DeleteSite(this IWebsitesServiceManagement proxy, string subscriptionId, string webspaceName, string name, string deleteMetrics) { proxy.EndDeleteSite(proxy.BeginDeleteSite(subscriptionId, webspaceName, name, deleteMetrics, null, null)); }
public static SiteConfig GetSiteConfig(this IWebsitesServiceManagement proxy, string subscriptionId, string webspaceName, string name) { return(proxy.EndGetSiteConfig(proxy.BeginGetSiteConfig(subscriptionId, webspaceName, name, null, null))); }
public static void CreateSiteRepository(this IWebsitesServiceManagement proxy, string subscriptionId, string webspaceName, string name) { proxy.EndCreateSiteRepository(proxy.BeginCreateSiteRepository(subscriptionId, webspaceName, name, null, null)); }
public static GeoLocations GetLocations(this IWebsitesServiceManagement proxy, string regionName) { return(proxy.EndGetLocations(proxy.BeginGetLocations(regionName, null, null))); }
/// <summary> /// Initializes a new instance of the ShowAzureWebsiteCommand class. /// </summary> /// <param name="channel"> /// Channel used for communication with Azure's service management APIs. /// </param> public ShowAzureWebsiteCommand(IWebsitesServiceManagement channel) { Channel = channel; }
public static WebSpace GetWebSpace(this IWebsitesServiceManagement proxy, string subscriptionId, string name) { return(proxy.EndGetWebSpace(proxy.BeginGetWebSpace(subscriptionId, name, null, null))); }
/// <summary> /// Initializes a new instance of the RemoveAzureWebsiteCommand class. /// </summary> /// <param name="channel"> /// Channel used for communication with Azure's service management APIs. /// </param> public RemoveAzureWebsiteCommand(IWebsitesServiceManagement channel) { Channel = channel; }