private static void InitBaremetalServer() { var baremetalModels = client.Servers.GetBaremetal(); var appliances = client.ServerAppliances.Get(null, null, null, "centos", null); if (appliances == null || !appliances.Any()) { appliance = client.ServerAppliances.Get().FirstOrDefault(a => a.ServerTypeCompatibility.Contains(ServerTypeCompatibility.baremetal)); } else { appliance = appliances.FirstOrDefault(a => a.ServerTypeCompatibility.Contains(ServerTypeCompatibility.baremetal)); } var result = client.Servers.Create(new POCO.Requests.Servers.CreateServerRequest() { ApplianceId = appliance?.Id, Name = "baremetal .net", Description = "baremetal server test .net", Hardware = new POCO.Requests.Servers.HardwareRequest() { BaremetalModelId = baremetalModels.FirstOrDefault()?.Id }, PowerOn = false, ServerType = ServerType.baremetal }); Config.waitServerReady(result.Id); baremetalServer = client.Servers.ShowBaremetal(result.Id); serverIds.Add(baremetalServer.Id); }
private static void InitCloudServer() { int vcore = 4; int CoresPerProcessor = 2; var appliances = client.ServerAppliances.Get(null, null, null, "centos", null); if (appliances == null || !appliances.Any()) { appliance = client.ServerAppliances.Get().FirstOrDefault(a => a.ServerTypeCompatibility.Contains(ServerTypeCompatibility.cloud)); } else { appliance = appliances.FirstOrDefault(a => a.ServerTypeCompatibility.Contains(ServerTypeCompatibility.cloud)); } var result = client.Servers.Create(new POCO.Requests.Servers.CreateServerRequest() { ApplianceId = appliance != null ? appliance.Id : null, Name = "main server test .net2", Description = "desc", Hardware = new POCO.Requests.Servers.HardwareRequest() { CoresPerProcessor = CoresPerProcessor, Hdds = new List <POCO.Requests.Servers.HddRequest>() { { new POCO.Requests.Servers.HddRequest() { IsMain = true, Size = 20, } }, { new POCO.Requests.Servers.HddRequest() { IsMain = false, Size = 20, } } }, Ram = 4, Vcore = vcore }, PowerOn = false, ServerType = ServerType.cloud }); Config.waitServerReady(result.Id); server = client.Servers.Show(result.Id); serverIds.Add(server.Id); //creating three servers, Private networks requires 3 servers to be created for (int i = 0; i < 2; i++) { Thread.Sleep(5000); var additional = Config.CreateTestServer("PN test .net" + i, false); Config.waitServerReady(additional.Id); serverIds.Add(additional.Id); } }
static public void ServerHardwareInit(TestContext context) { int vcore = 4; int CoresPerProcessor = 2; var appliances = client.ServerAppliances.Get(null, null, null, "ubuntu", null); POCO.Response.ServerAppliances.ServerAppliancesResponse appliance = null; if (appliances == null || !appliances.Any()) { appliance = client.ServerAppliances.Get().FirstOrDefault(a => a.ServerTypeCompatibility.Contains(ServerTypeCompatibility.cloud)); } else { appliance = appliances.FirstOrDefault(a => a.ServerTypeCompatibility.Contains(ServerTypeCompatibility.cloud)); } var result = client.Servers.Create(new POCO.Requests.Servers.CreateServerRequest() { ApplianceId = appliance != null ? appliance.Id : null, Name = "server hardware test .net", Description = "desc", Hardware = new POCO.Requests.Servers.HardwareRequest() { CoresPerProcessor = CoresPerProcessor, Hdds = new List <POCO.Requests.Servers.HddRequest>() { { new POCO.Requests.Servers.HddRequest() { IsMain = true, Size = 20, } }, { new POCO.Requests.Servers.HddRequest() { IsMain = false, Size = 20, } } }, Ram = 4, Vcore = vcore }, PowerOn = true, ServerType = ServerType.cloud }); Config.waitServerReady(result.Id); server = client.Servers.Show(result.Id); }
public static ServerResponse CreateTestServer(string serverName, bool powerON = true) { var client = OneAndOneClient.Instance(Configuration); int vcore = 4; int CoresPerProcessor = 2; var appliances = client.ServerAppliances.Get(null, null, null, "coreos", null); POCO.Response.ServerAppliances.ServerAppliancesResponse appliance = null; if (appliances == null || !appliances.Any()) { appliance = client.ServerAppliances.Get().FirstOrDefault(a => a.ServerTypeCompatibility.Contains(ServerTypeCompatibility.cloud)); } else { appliance = appliances.FirstOrDefault(a => a.ServerTypeCompatibility.Contains(ServerTypeCompatibility.cloud)); } var result = client.Servers.Create(new POCO.Requests.Servers.CreateServerRequest() { ApplianceId = appliance != null ? appliance.Id : null, Name = serverName, Description = "desc", Hardware = new POCO.Requests.Servers.HardwareRequest() { CoresPerProcessor = CoresPerProcessor, Hdds = new List <POCO.Requests.Servers.HddRequest>() { { new POCO.Requests.Servers.HddRequest() { IsMain = true, Size = 20, } } }, Ram = 4, Vcore = vcore }, ServerType = ServerType.cloud, PowerOn = powerON, }); return(client.Servers.Show(result.Id)); }
static public void ServerInit(TestContext context) { int vcore = 4; int CoresPerProcessor = 2; var appliances = client.ServerAppliances.Get(null, null, null, "ubuntu", null); POCO.Response.ServerAppliances.ServerAppliancesResponse appliance = null; if (appliances == null || appliances.Count() == 0) { appliance = client.ServerAppliances.Get().FirstOrDefault(); } else { appliance = appliances.FirstOrDefault(ap => ap.Type == "IMAGE"); } var result = client.Servers.Create(new POCO.Requests.Servers.CreateServerRequest() { ApplianceId = appliance != null ? appliance.Id : null, Name = "server ip test .net1", Description = "desc", Hardware = new POCO.Requests.Servers.HardwareRequest() { CoresPerProcessor = CoresPerProcessor, Hdds = new List <POCO.Requests.Servers.HddRequest>() { { new POCO.Requests.Servers.HddRequest() { IsMain = true, Size = 20, } } }, Ram = 4, Vcore = vcore }, PowerOn = true, }); Config.waitServerReady(result.Id); server = client.Servers.Show(result.Id); }