Skip to content

Commit 41133fb

Browse files
committed
Doc: Add security group and security group rule
Add missing command list documentation for the 'security group' and 'security group rule' commands. In addition, update the command description and argument help to fix minor issues and use consistent terminology. Change-Id: I9f4a3fbac5637289f19511874e16391d3fe27132
1 parent 42a5909 commit 41133fb

3 files changed

Lines changed: 170 additions & 10 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
===================
2+
security group rule
3+
===================
4+
5+
Compute v2
6+
7+
security group rule create
8+
--------------------------
9+
10+
Create a new security group rule
11+
12+
.. program:: security group rule create
13+
.. code:: bash
14+
15+
os security group rule create
16+
[--proto <proto>]
17+
[--src-ip <ip-address>]
18+
[--dst-port <port-range>]
19+
<group>
20+
21+
.. option:: --proto <proto>
22+
23+
IP protocol (icmp, tcp, udp; default: tcp)
24+
25+
.. option:: --src-ip <ip-address>
26+
27+
Source IP (may use CIDR notation; default: 0.0.0.0/0)
28+
29+
.. option:: --dst-port <port-range>
30+
31+
Destination port, may be a range: 137:139 (default: 0; only required for proto tcp and udp)
32+
33+
.. describe:: <group>
34+
35+
Create rule in this security group (name or ID)
36+
37+
security group rule delete
38+
--------------------------
39+
40+
Delete a security group rule
41+
42+
.. program:: security group rule delete
43+
.. code:: bash
44+
45+
os security group rule delete
46+
<rule>
47+
48+
.. describe:: <rule>
49+
50+
Security group rule to delete (ID only)
51+
52+
security group rule list
53+
------------------------
54+
55+
List security group rules
56+
57+
.. program:: security group rule list
58+
.. code:: bash
59+
60+
os security group rule list
61+
<group>
62+
63+
.. describe:: <group>
64+
65+
List all rules in this security group (name or ID)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
==============
2+
security group
3+
==============
4+
5+
Compute v2
6+
7+
security group create
8+
---------------------
9+
10+
Create a new security group
11+
12+
.. program:: security group create
13+
.. code:: bash
14+
15+
os security group create
16+
[--description <description>]
17+
<name>
18+
19+
.. option:: --description <description>
20+
21+
Security group description
22+
23+
.. describe:: <name>
24+
25+
New security group name
26+
27+
security group delete
28+
---------------------
29+
30+
Delete a security group
31+
32+
.. program:: security group delete
33+
.. code:: bash
34+
35+
os security group delete
36+
<group>
37+
38+
.. describe:: <group>
39+
40+
Security group to delete (name or ID)
41+
42+
security group list
43+
-------------------
44+
45+
List security groups
46+
47+
.. program:: security group list
48+
.. code:: bash
49+
50+
os security group list
51+
[--all-projects]
52+
53+
.. option:: --all-projects
54+
55+
Display information from all projects (admin only)
56+
57+
security group set
58+
------------------
59+
60+
Set security group properties
61+
62+
.. program:: security group set
63+
.. code:: bash
64+
65+
os security group set
66+
[--name <new-name>]
67+
[--description <description>]
68+
<group>
69+
70+
.. option:: --name <new-name>
71+
72+
New security group name
73+
74+
.. option:: --description <description>
75+
76+
New security group description
77+
78+
.. describe:: <group>
79+
80+
Security group to modify (name or ID)
81+
82+
security group show
83+
-------------------
84+
85+
Display security group details
86+
87+
.. program:: security group show
88+
.. code:: bash
89+
90+
os security group show
91+
<group>
92+
93+
.. describe:: <group>
94+
95+
Security group to display (name or ID)

openstackclient/compute/v2/security_group.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def get_parser(self, prog_name):
103103
parser.add_argument(
104104
'group',
105105
metavar='<group>',
106-
help='Name or ID of security group to delete',
106+
help='Security group to delete (name or ID)',
107107
)
108108
return parser
109109

@@ -120,7 +120,7 @@ def take_action(self, parsed_args):
120120

121121

122122
class ListSecurityGroup(lister.Lister):
123-
"""List all security groups"""
123+
"""List security groups"""
124124

125125
log = logging.getLogger(__name__ + ".ListSecurityGroup")
126126

@@ -185,7 +185,7 @@ def get_parser(self, prog_name):
185185
parser.add_argument(
186186
'group',
187187
metavar='<group>',
188-
help='Name or ID of security group to change',
188+
help='Security group to modify (name or ID)',
189189
)
190190
parser.add_argument(
191191
'--name',
@@ -195,7 +195,7 @@ def get_parser(self, prog_name):
195195
parser.add_argument(
196196
"--description",
197197
metavar="<description>",
198-
help="New security group name",
198+
help="New security group description",
199199
)
200200
return parser
201201

@@ -227,7 +227,7 @@ def take_action(self, parsed_args):
227227

228228

229229
class ShowSecurityGroup(show.ShowOne):
230-
"""Show a specific security group"""
230+
"""Display security group details"""
231231

232232
log = logging.getLogger(__name__ + '.ShowSecurityGroup')
233233

@@ -236,7 +236,7 @@ def get_parser(self, prog_name):
236236
parser.add_argument(
237237
'group',
238238
metavar='<group>',
239-
help='Name or ID of security group to change',
239+
help='Security group to display (name or ID)',
240240
)
241241
return parser
242242

@@ -275,7 +275,7 @@ def get_parser(self, prog_name):
275275
parser.add_argument(
276276
'group',
277277
metavar='<group>',
278-
help='Create rule in this security group',
278+
help='Create rule in this security group (name or ID)',
279279
)
280280
parser.add_argument(
281281
"--proto",
@@ -333,7 +333,7 @@ def get_parser(self, prog_name):
333333
parser.add_argument(
334334
'rule',
335335
metavar='<rule>',
336-
help='Security group rule ID to delete',
336+
help='Security group rule to delete (ID only)',
337337
)
338338
return parser
339339

@@ -346,7 +346,7 @@ def take_action(self, parsed_args):
346346

347347

348348
class ListSecurityGroupRule(lister.Lister):
349-
"""List all security group rules"""
349+
"""List security group rules"""
350350

351351
log = logging.getLogger(__name__ + ".ListSecurityGroupRule")
352352

@@ -355,7 +355,7 @@ def get_parser(self, prog_name):
355355
parser.add_argument(
356356
'group',
357357
metavar='<group>',
358-
help='List all rules in this security group',
358+
help='List all rules in this security group (name or ID)',
359359
)
360360
return parser
361361

0 commit comments

Comments
 (0)