@utils.arg('secgroup', metavar='<secgroup>', help=_('ID or name of security group.'))
@utils.arg('ip_proto', metavar='<ip-proto>', help=_('IP protocol (icmp, tcp, udp).'))
@utils.arg('from_port', metavar='<from-port>', help=_('Port at start of range.'))
@utils.arg('to_port', metavar='<to-port>', help=_('Port at end of range.'))
@utils.arg('cidr', metavar='<cidr>', help=_('CIDR for address range.'))
@deprecated_network
def do_secgroup_add_rule(cs, args):
 secgroup = _get_secgroup(cs, args.secgroup)
 rule = cs.security_group_rules.create(secgroup.id, args.ip_proto, args.from_port, args.to_port, args.cidr)
 _print_secgroup_rules([rule])

@ utils . arg ( 'secgroup' , metavar = '<secgroup>' , help = _ ( 'ID or name of security group.' ) ) @ utils . arg ( 'ip_proto' , metavar = '<ip-proto>' , help = _ ( 'IP protocol (icmp, tcp, udp).' ) ) @ utils . arg ( 'from_port' , metavar = '<from-port>' , help = _ ( 'Port at start of range.' ) ) @ utils . arg ( 'to_port' , metavar = '<to-port>' , help = _ ( 'Port at end of range.' ) ) @ utils . arg ( 'cidr' , metavar = '<cidr>' , help = _ ( 'CIDR for address range.' ) ) @ deprecated_network def do_secgroup_add_rule ( cs , args ) : secgroup = _get_secgroup ( cs , args . secgroup ) rule = cs . security_group_rules . create ( secgroup . id , args . ip_proto , args . from_port , args . to_port , args . cidr ) _print_secgroup_rules ( [ rule ] )
add a rule to a security group .