ConoHaNet.OpenStackMember.CreateNetworkSecurityGroup C# (CSharp) Method

CreateNetworkSecurityGroup() public method

public CreateNetworkSecurityGroup ( string name, string description ) : NetworkSecurityGroup
name string
description string
return NetworkSecurityGroup
        public NetworkSecurityGroup CreateNetworkSecurityGroup(string name, string description)
        {
            return NetworksProvider.CreatSecurityGroup(name, description, this.DefaultRegion, this.Identity);
        }

Usage Example

        public void CreateNetworkSecurityRuleTest()
        {

            string name = TesterName;
            string description = null;
            var os = new OpenStackMember(UserName, Password, TenantName, TenantId);
            var group = os.CreateNetworkSecurityGroup(name, description);
            Assert.IsNotNull(group);
            try
            {
                string direction = "ingress"; // "ingress" or "egress"
                string etherType = "IPv4"; // "IPv4" or "IPv6"
                string portRangeMin = null;
                string portRangeMax = null;
                string protocol = null;
                string remoteGroupId = null;
                string remoteIpPrefix = null;

                var rule = os.CreateNetworkSecurityGroupRule(group.Id, direction, etherType, portRangeMin, portRangeMax, protocol, remoteGroupId, remoteIpPrefix);
                Assert.IsNotNull(rule);

                Assert.IsTrue(os.DeleteNetworkSecurityGroupRule(rule.Id));
            }
            finally
            {
                Assert.IsTrue(os.DeleteNetworkSecurityGroup(group.Id));
            }
        }
All Usage Examples Of ConoHaNet.OpenStackMember::CreateNetworkSecurityGroup
OpenStackMember