public void UpdatePoolTest() { var os = new OpenStackMember(UserName, Password, TenantName, TenantId); // string tenantId = os.IdentityProvider.GetToken(os.Identity).Tenant.Id; // create pool string pool_name = GetTesterNameByEnv(); string TokyoLBaas_subnetId = GetSubnetIdByRegion(region: null); string[] lbMethods = { "ROUND_ROBIN", "LEAST_CONNECTIONS" }; string protocol = "TCP"; foreach (var lbMethod in lbMethods) { var p = os.CreatePool(pool_name, TokyoLBaas_subnetId, lbMethod, protocol); Trace.WriteLine(string.Format("pool Status : {0}", p.Status)); System.Threading.Thread.Sleep(1000 * 10); Trace.WriteLine(string.Format("pool Status : {0}", p.Status)); try { foreach (var newLbMethod in lbMethods) { os.UpdatePool(p.Id, "newName", newLbMethod); // not tested yet. //os.UpdatePool(p.Id, "日本語", lbMethod); //os.UpdatePool(p.Id, "//", lbMethod); } } finally { Assert.IsTrue(os.DeletePool(p.Id)); } } }
public void CreatePoolTest() { var osm = new OpenStackMember(UserName, Password, TenantName, TenantId); // create pool string pool_name = GetTesterNameByEnv(); string TokyoLBaas_subnetId = GetSubnetIdByRegion(region: null); string[] lbMethods = { "ROUND_ROBIN", "LEAST_CONNECTIONS" }; string protocol = "TCP"; foreach (var lbMethod in lbMethods) { var p = osm.CreatePool(pool_name, TokyoLBaas_subnetId, lbMethod, protocol); try { Assert.IsNotNull(p); Trace.WriteLine(string.Format("pool Name : {0}", p.Name)); Trace.WriteLine(string.Format("pool Id : {0}", p.Id)); Trace.WriteLine(string.Format("pool Protocol : {0}", p.Protocol)); Trace.WriteLine(string.Format("pool Description : {0}", p.Description)); Trace.WriteLine(string.Format("pool LbMethod : {0}", p.LbMethod)); Trace.WriteLine(string.Format("pool HealthMonitors : {0}", string.Join(",", p.HealthMonitors))); Trace.WriteLine(string.Format("pool Members : {0}", string.Join(",", p.Members))); } finally { Assert.IsTrue(osm.DeletePool(p.Id)); } } }