UpdatePort() public method

public UpdatePort ( string portId, bool adminStateUp = null, string securityGroups = null, FixedIp fixedIps = null, AllowedAddressPair allowedAddressPairs = null ) : Port
portId string
adminStateUp bool
securityGroups string
fixedIps FixedIp
allowedAddressPairs AllowedAddressPair
return Port
        public void UpdatePortTest()
        {
            var os = new OpenStackMember(UserName, Password, TenantName, TenantId);
            // string tenantId = os.IdentityProvider.GetToken(os.Identity).Tenant.Id;

            // create network
            string network_name = GetTesterNameByEnv();
            bool adminStateUp = true;
            string networkType = "vxlan";
            string segmentationId = null;
            var n = os.CreateNetwork(network_name, adminStateUp, networkType, segmentationId);
            Assert.IsNotNull(n);

            try
            {
                // create port
                string port_name = GetTesterNameByEnv();
                string networkId = n.Id;
                var port = os.CreatePort(networkId, tenantId: TenantId);
                Assert.IsNotNull(port);

                Trace.WriteLine(string.Format("portStatus : {0}", port.Status));
                Assert.AreEqual(port.Status, "DOWN");

                try
                {
                    // update port
                    string newName = "new-name";
                    port = os.UpdatePort(port.Id, adminStateUp);
                    Assert.IsNotNull(port);
                    Assert.AreEqual(port.Name, newName);

                    newName = "日本語";
                    port = os.UpdatePort(port.Id, adminStateUp);
                    //Assert.IsNotNull(port);
                    //Assert.AreEqual(port.Name, newName);

                    Trace.WriteLine(string.Format("portId : {0}", port.Id));
                    Trace.WriteLine(string.Format("portName : {0}", port.Name));
                    Trace.WriteLine(string.Format("portMacAddress : {0}", port.MacAddress));
                    Trace.WriteLine(string.Format("portnetworkId : {0}", port.NetworkId));
                    Trace.WriteLine(string.Format("portTenantId : {0}", port.TenantId));
                    Trace.WriteLine(string.Format("portStatus : {0}", port.Status));
                    Trace.WriteLine(string.Format("portSecurityGroups : {0}", string.Join(",", port.SecurityGroups)));

                }
                finally
                {
                    Assert.IsTrue(os.DeletePort(port.Id));
                }
            }
            finally
            {
                Assert.IsTrue(os.DeleteNetwork(n.Id));
            }
        }