public static WebFarmManager CreateWebFarmManager() { WebFarmManager manager = new WebFarmManager(CakeHelper.CreateEnvironment(), new DebugLog()); manager.SetServer(); return manager; }
public static WebFarmManager CreateWebFarmManager() { WebFarmManager manager = new WebFarmManager(CakeHelper.CreateEnvironment(), new DebugLog()); manager.SetServer(); return(manager); }
static void DeleteWebFarm() { //WebFarmManager is the class that manages several web farms. WebFarmManager webFarmManager = new WebFarmManager(); //This will delete a web farm and all the connections to //the servers in the farm. webFarmManager.WebFarms.RemoveWebFarm("MyWebFarm"); //The changes will take effect only after committing the changes. //This is a MUST call. webFarmManager.CommitChanges(); }
public void Should_Set_Server_Unavailable() { // Arrange var settings = CakeHelper.GetWebFarmSettings(); CakeHelper.CreateWebFarm(settings); // Act WebFarmManager manager = CakeHelper.CreateWebFarmManager(); manager.SetServerUnavailable(settings.Name, settings.Servers[0]); // Assert Assert.True(manager.GetServerState(settings.Name, settings.Servers[0]) == "Unavailable"); }
public void Should_Create_WebFarm() { // Arrange var settings = CakeHelper.GetWebFarmSettings(); CakeHelper.DeleteWebFarm(settings.Name); // Act WebFarmManager manager = CakeHelper.CreateWebFarmManager(); manager.Create(settings); // Assert Assert.NotNull(CakeHelper.GetWebFarm(settings.Name)); }
public void Should_Set_Server_Unavailable_Gracefully() { // Arrange var settings = CakeHelper.GetWebFarmSettings(); CakeHelper.CreateWebFarm(settings); // Act WebFarmManager manager = CakeHelper.CreateWebFarmManager(); manager.SetServerUnavailableGracefully(settings.Name, settings.Servers[0]); // Assert manager.GetServerState(settings.Name, settings.Servers[0]).ShouldBe("Unavailable"); }
static void CreateWebFarm() { //WebFarmManager is the class that manages several web farms. WebFarmManager webFarmManager = new WebFarmManager(); //Create a new WebFarm WebFarm myWebFarm = webFarmManager.WebFarms.CreateNewWebFarm("MyWebFarm"); //Provide user name and password for the webfarm. Note that these credentials are //used for sync up and load balancing the farm. All the servers in the farms should //recognize the credentials. myWebFarm.AdminUserName = "******"; myWebFarm.AdminPassword = "******"; //Optionally you can also specify how many number of servers must be online //at any given point of time and also how many servers could be stopped at any //given point of time. //myWebFarm.MinimumServers = 1; //myWebFarm.MaximumStoppedServers = 2; //This will enable the agent service automatically on the servers myWebFarm.AutoEnableAgent = true; //Now add a new server to the web farm Server srv1 = myWebFarm.Servers.CreateNewServer("MyServer1"); //Make MyServer1 as Primary server. During the provisioning of application or platform //Primary server is used as the primary server from which the application or platforms //are provisioned. myWebFarm.PrimaryServer = srv1; //Add more servers. MyServer2 and MyServer3 acts as secondary servers //These two servers gets provisioned before loadbalancing. Server srv2 = myWebFarm.Servers.CreateNewServer("MyServer2"); Server srv3 = myWebFarm.Servers.CreateNewServer("MyServer3"); //The changes will take effect only after committing the changes. //This is a MUST call. webFarmManager.CommitChanges(); }
//WebFarm public static void CreateWebFarm(WebFarmSettings settings) { WebFarmManager manager = CakeHelper.CreateWebFarmManager(); manager.Create(settings); }
protected override void ProcessRecord() { var farmManager = new WebFarmManager(Name, null, false); WriteObject(farmManager.Farms, true); }