Merge "Doc: Add security group and security group rule"

This commit is contained in:
Jenkins 2015-11-24 21:21:20 +00:00 committed by Gerrit Code Review
commit 11ea5b31af
3 changed files with 170 additions and 10 deletions

View File

@ -0,0 +1,65 @@
===================
security group rule
===================
Compute v2
security group rule create
--------------------------
Create a new security group rule
.. program:: security group rule create
.. code:: bash
os security group rule create
[--proto <proto>]
[--src-ip <ip-address>]
[--dst-port <port-range>]
<group>
.. option:: --proto <proto>
IP protocol (icmp, tcp, udp; default: tcp)
.. option:: --src-ip <ip-address>
Source IP (may use CIDR notation; default: 0.0.0.0/0)
.. option:: --dst-port <port-range>
Destination port, may be a range: 137:139 (default: 0; only required for proto tcp and udp)
.. describe:: <group>
Create rule in this security group (name or ID)
security group rule delete
--------------------------
Delete a security group rule
.. program:: security group rule delete
.. code:: bash
os security group rule delete
<rule>
.. describe:: <rule>
Security group rule to delete (ID only)
security group rule list
------------------------
List security group rules
.. program:: security group rule list
.. code:: bash
os security group rule list
<group>
.. describe:: <group>
List all rules in this security group (name or ID)

View File

@ -0,0 +1,95 @@
==============
security group
==============
Compute v2
security group create
---------------------
Create a new security group
.. program:: security group create
.. code:: bash
os security group create
[--description <description>]
<name>
.. option:: --description <description>
Security group description
.. describe:: <name>
New security group name
security group delete
---------------------
Delete a security group
.. program:: security group delete
.. code:: bash
os security group delete
<group>
.. describe:: <group>
Security group to delete (name or ID)
security group list
-------------------
List security groups
.. program:: security group list
.. code:: bash
os security group list
[--all-projects]
.. option:: --all-projects
Display information from all projects (admin only)
security group set
------------------
Set security group properties
.. program:: security group set
.. code:: bash
os security group set
[--name <new-name>]
[--description <description>]
<group>
.. option:: --name <new-name>
New security group name
.. option:: --description <description>
New security group description
.. describe:: <group>
Security group to modify (name or ID)
security group show
-------------------
Display security group details
.. program:: security group show
.. code:: bash
os security group show
<group>
.. describe:: <group>
Security group to display (name or ID)

View File

@ -103,7 +103,7 @@ class DeleteSecurityGroup(command.Command):
parser.add_argument( parser.add_argument(
'group', 'group',
metavar='<group>', metavar='<group>',
help='Name or ID of security group to delete', help='Security group to delete (name or ID)',
) )
return parser return parser
@ -120,7 +120,7 @@ class DeleteSecurityGroup(command.Command):
class ListSecurityGroup(lister.Lister): class ListSecurityGroup(lister.Lister):
"""List all security groups""" """List security groups"""
log = logging.getLogger(__name__ + ".ListSecurityGroup") log = logging.getLogger(__name__ + ".ListSecurityGroup")
@ -185,7 +185,7 @@ class SetSecurityGroup(show.ShowOne):
parser.add_argument( parser.add_argument(
'group', 'group',
metavar='<group>', metavar='<group>',
help='Name or ID of security group to change', help='Security group to modify (name or ID)',
) )
parser.add_argument( parser.add_argument(
'--name', '--name',
@ -195,7 +195,7 @@ class SetSecurityGroup(show.ShowOne):
parser.add_argument( parser.add_argument(
"--description", "--description",
metavar="<description>", metavar="<description>",
help="New security group name", help="New security group description",
) )
return parser return parser
@ -227,7 +227,7 @@ class SetSecurityGroup(show.ShowOne):
class ShowSecurityGroup(show.ShowOne): class ShowSecurityGroup(show.ShowOne):
"""Show a specific security group""" """Display security group details"""
log = logging.getLogger(__name__ + '.ShowSecurityGroup') log = logging.getLogger(__name__ + '.ShowSecurityGroup')
@ -236,7 +236,7 @@ class ShowSecurityGroup(show.ShowOne):
parser.add_argument( parser.add_argument(
'group', 'group',
metavar='<group>', metavar='<group>',
help='Name or ID of security group to change', help='Security group to display (name or ID)',
) )
return parser return parser
@ -275,7 +275,7 @@ class CreateSecurityGroupRule(show.ShowOne):
parser.add_argument( parser.add_argument(
'group', 'group',
metavar='<group>', metavar='<group>',
help='Create rule in this security group', help='Create rule in this security group (name or ID)',
) )
parser.add_argument( parser.add_argument(
"--proto", "--proto",
@ -333,7 +333,7 @@ class DeleteSecurityGroupRule(command.Command):
parser.add_argument( parser.add_argument(
'rule', 'rule',
metavar='<rule>', metavar='<rule>',
help='Security group rule ID to delete', help='Security group rule to delete (ID only)',
) )
return parser return parser
@ -346,7 +346,7 @@ class DeleteSecurityGroupRule(command.Command):
class ListSecurityGroupRule(lister.Lister): class ListSecurityGroupRule(lister.Lister):
"""List all security group rules""" """List security group rules"""
log = logging.getLogger(__name__ + ".ListSecurityGroupRule") log = logging.getLogger(__name__ + ".ListSecurityGroupRule")
@ -355,7 +355,7 @@ class ListSecurityGroupRule(lister.Lister):
parser.add_argument( parser.add_argument(
'group', 'group',
metavar='<group>', metavar='<group>',
help='List all rules in this security group', help='List all rules in this security group (name or ID)',
) )
return parser return parser