Exemple #1
0
 public static bool StartSite(this ICakeContext context, string server, string name)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .Start(name));
     }
 }
 public static bool AddServer(this ICakeContext context, string server, string farm, WebFarmServerSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(WebFarmManager
                .Using(context.Environment, context.Log, manager)
                .AddServer(farm, settings));
     }
 }
 public static bool DeleteWebFarm(this ICakeContext context, string server, string name)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(WebFarmManager
                .Using(context.Environment, context.Log, manager)
                .Delete(name));
     }
 }
Exemple #4
0
 public static void RemoveSiteVirtualDirectory(this ICakeContext context, string server, VirtualDirectorySettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         WebsiteManager
         .Using(context.Environment, context.Log, manager)
         .RemoveVirtualDirectory(settings);
     }
 }
Exemple #5
0
 public static void RemoveSiteApplication(this ICakeContext context, string server, ApplicationSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         WebsiteManager
         .Using(context.Environment, context.Log, manager)
         .RemoveApplication(settings);
     }
 }
 public static string GetServerState(this ICakeContext context, string server, string farm, string address)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(WebFarmManager
                .Using(context.Environment, context.Log, manager)
                .GetServerState(farm, address));
     }
 }
 public static void SetServerUnavailable(this ICakeContext context, string server, string farm, string address)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         WebFarmManager
         .Using(context.Environment, context.Log, manager)
         .SetServerUnavailable(farm, address);
     }
 }
 public static void CreatePool(this ICakeContext context, string server, ApplicationPoolSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         ApplicationPoolManager
         .Using(context.Environment, context.Log, manager)
         .Create(settings);
     }
 }
Exemple #9
0
 public static void RemoveBinding(this ICakeContext context, string server, string siteName, BindingSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         WebsiteManager
         .Using(context.Environment, context.Log, manager)
         .RemoveBinding(siteName, settings);
     }
 }
 public static bool PoolExists(this ICakeContext context, string server, string name)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(ApplicationPoolManager
                .Using(context.Environment, context.Log, manager)
                .Exists(name));
     }
 }
Exemple #11
0
 public static void CreateWebFarm(this ICakeContext context, string server, WebFarmSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         WebFarmManager
         .Using(context.Environment, context.Log, manager)
         .Create(settings);
     }
 }
Exemple #12
0
 public static bool SiteVirtualDirectoryExists(this ICakeContext context, string server, VirtualDirectorySettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .VirtualDirectoryExists(settings));
     }
 }
Exemple #13
0
 public static bool SiteApplicationExists(this ICakeContext context, string server, ApplicationSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .ApplicationExists(settings));
     }
 }
Exemple #14
0
 public static void CreateRewriteRule(this ICakeContext context, string server, RewriteRuleSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         RewriteManager
         .Using(context.Environment, context.Log, manager)
         .CreateRule(settings);
     }
 }
Exemple #15
0
        public static void AddSiteApplication(this ICakeContext context, string server, ApplicationSettings settings)
        {
            using (ServerManager manager = BaseManager.Connect(server))
            {
                settings.ComputerName = server;

                WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .AddApplication(settings);
            }
        }
Exemple #16
0
        public static void CreateFtpsite(this ICakeContext context, string server, FtpsiteSettings settings)
        {
            using (ServerManager manager = BaseManager.Connect(server))
            {
                settings.ComputerName = server;

                FtpsiteManager
                .Using(context.Environment, context.Log, manager)
                .Create(settings);
            }
        }
Exemple #17
0
        public static void AddSiteVirtualDirectory(this ICakeContext context, string server, VirtualDirectorySettings settings)
        {
            using (ServerManager manager = BaseManager.Connect(server))
            {
                settings.ComputerName = server;

                WebsiteManager
                .Using(context.Environment, context.Log, manager)
                .AddVirtualDirectory(settings);
            }
        }
Exemple #18
0
        public static bool RestartSite(this ICakeContext context, string server, string name)
        {
            using (ServerManager manager = BaseManager.Connect(server))
            {
                WebsiteManager webManager = WebsiteManager.Using(context.Environment, context.Log, manager);

                if (webManager.Stop(name))
                {
                    return(webManager.Start(name));
                }
                else
                {
                    return(false);
                }
            }
        }
        public static bool RestartPool(this ICakeContext context, string server, string name)
        {
            using (ServerManager manager = BaseManager.Connect(server))
            {
                ApplicationPoolManager poolManager = ApplicationPoolManager.Using(context.Environment, context.Log, manager);

                if (poolManager.Stop(name))
                {
                    return(poolManager.Start(name));
                }
                else
                {
                    return(false);
                }
            }
        }
Exemple #20
0
 /// <summary>
 /// Set the IIS ServerManager
 /// </summary>
 /// <param name="server">The name of the server to connect to.</param>
 public void SetServer(string server)
 {
     this.SetServer(BaseManager.Connect(server));
 }
Exemple #21
0
 /// <summary>
 /// Set the IIS ServerManager
 /// </summary>
 public void SetServer()
 {
     this.SetServer(BaseManager.Connect(""));
 }