public void UpdateLBMemberTest() { var osm = new OpenStackMember(UserName, Password, TenantName, TenantId); // get server SimpleServer ss = osm.ListServers().FirstOrDefault(s => s.GetDetails().Status == ServerState.Active); // get ipv4, sometimes server does not have network interface. ServerAddresses addresses = ss.GetDetails().ListAddresses(); Assert.IsNotNull(addresses["default_global"]); Assert.IsTrue(addresses["default_global"].Count() > 0); var ip = addresses["default_global"]. Where(a => a.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) .First <System.Net.IPAddress>(); // create pool string pool_name = GetTesterNameByEnv(); string TokyoLBaas_subnetId = GetSubnetIdByRegion(region: null); int weight = 1; string[] lbMethods = { "ROUND_ROBIN", "LEAST_CONNECTIONS" }; string protocol = "TCP"; foreach (var lbMethod in lbMethods) { // create pool var p = osm.CreatePool(pool_name, TokyoLBaas_subnetId, lbMethod, protocol); try { // create member string address = ip.ToString(); // ip address virtual machine is having. ? string protocolPort = "80"; // a valid value is from 0 to 65535. var member = osm.CreateLBMember(p.Id, address, protocolPort, weight); Assert.IsNotNull(member); try { // update member(toggle adminStateUp) var updatedMember = osm.UpdateLBMember(member.Id, (weight == 1 ? 0 : 1)); Assert.IsNotNull(updatedMember); Assert.IsTrue(updatedMember.Weight != (weight == 1 ? 0 : 1)); } finally { // delete member Assert.IsTrue(osm.DeleteLBMember(member.Id)); } } finally { // Assert.IsTrue(os.DeletePool(p.Id)); } } }