ConoHaNet.OpenStackMember.DeleteNetworkSecurityGroupRule C# (CSharp) Method

DeleteNetworkSecurityGroupRule() public method

public DeleteNetworkSecurityGroupRule ( string networkSecurityRuleId ) : bool
networkSecurityRuleId string
return bool
        public bool DeleteNetworkSecurityGroupRule(string networkSecurityRuleId)
        {
            return NetworksProvider.DeleteSecurityRule(networkSecurityRuleId, 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::DeleteNetworkSecurityGroupRule
OpenStackMember