Skip to content

Commit a3a2a7e

Browse files
author
Dean Troyer
committed
Docs cleanup: volume command help
This formats the volume command help text consistent with the rest of OSC, adds some reference targets and some explanation text to some commands. No functional changes have been made, only cosmetic/help output. Change-Id: Ib86ec3ca58bdea5f33078ced3ec3583b2be0e89a
1 parent 5f55e99 commit a3a2a7e

3 files changed

Lines changed: 106 additions & 88 deletions

File tree

doc/source/command-objects/volume.rst

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,45 @@ Create new volume
1414
1515
os volume create
1616
--size <size>
17+
[--type <volume-type>]
18+
[--image <image>]
1719
[--snapshot <snapshot>]
20+
[--source <volume>]
1821
[--description <description>]
19-
[--type <volume-type>]
2022
[--user <user>]
2123
[--project <project>]
2224
[--availability-zone <availability-zone>]
23-
[--image <image>]
24-
[--source <volume>]
2525
[--property <key=value> [...] ]
2626
<name>
2727
2828
.. option:: --size <size> (required)
2929

30-
New volume size in GB
30+
Volume size in GB
31+
32+
.. option:: --type <volume-type>
33+
34+
Set the type of volume
35+
36+
Select :option:`\<volume-type\>` from the available types as shown
37+
by ``volume type list``.
38+
39+
.. option:: --image <image>
40+
41+
Use :option:`\<image\>` as source of volume (name or ID)
42+
43+
This is commonly used to create a boot volume for a server.
3144

3245
.. option:: --snapshot <snapshot>
3346

34-
Use <snapshot> as source of new volume
47+
Use :option:`\<snapshot\>` as source of volume (name or ID)
3548

36-
.. option:: --description <description>
49+
.. option:: --source <source>
3750

38-
New volume description
51+
Volume to clone (name or ID)
3952

40-
.. option:: --type <volume-type>
53+
.. option:: --description <description>
4154

42-
Use <volume-type> as the new volume type
55+
Volume description
4356

4457
.. option:: --user <user>
4558

@@ -51,23 +64,16 @@ Create new volume
5164

5265
.. option:: --availability-zone <availability-zone>
5366

54-
Create new volume in <availability-zone>
55-
56-
.. option:: --image <image>
57-
58-
Use <image> as source of new volume (name or ID)
59-
60-
.. option:: --source <source>
61-
62-
Volume to clone (name or ID)
67+
Create volume in :option:`\<availability-zone\>`
6368

6469
.. option:: --property <key=value>
6570

6671
Set a property on this volume (repeat option to set multiple properties)
6772

73+
.. _volume_create-name:
6874
.. describe:: <name>
6975

70-
New volume name
76+
Volume name
7177

7278
The :option:`--project` and :option:`--user` options are typically only
7379
useful for admin users, but may be allowed for other users depending on
@@ -83,12 +89,13 @@ Delete volume(s)
8389
8490
os volume delete
8591
[--force]
86-
<volume> [<volume> ...]
92+
<volume> [<volume> ...]
8793
8894
.. option:: --force
8995

9096
Attempt forced removal of volume(s), regardless of state (defaults to False)
9197

98+
.. _volume_delete-volume:
9299
.. describe:: <volume>
93100

94101
Volume(s) to delete (name or ID)
@@ -102,35 +109,37 @@ List volumes
102109
.. code:: bash
103110
104111
os volume list
105-
[--all-projects]
106112
[--project <project> [--project-domain <project-domain>]]
107113
[--user <user> [--user-domain <user-domain>]]
108114
[--name <name>]
109115
[--status <status>]
116+
[--all-projects]
110117
[--long]
111118
112119
.. option:: --project <project>
113120
114-
Filter results by project (name or ID) (admin only)
121+
Filter results by :option:`\<project\>` (name or ID) (admin only)
115122
116123
*Volume version 2 only*
117124
118125
.. option:: --project-domain <project-domain>
119126
120127
Domain the project belongs to (name or ID).
128+
121129
This can be used in case collisions between project names exist.
122130
123131
*Volume version 2 only*
124132
125133
.. option:: --user <user>
126134
127-
Filter results by user (name or ID) (admin only)
135+
Filter results by :option:`\<user\>` (name or ID) (admin only)
128136
129137
*Volume version 2 only*
130138
131139
.. option:: --user-domain <user-domain>
132140
133141
Domain the user belongs to (name or ID).
142+
134143
This can be used in case collisions between user names exist.
135144
136145
*Volume version 2 only*
@@ -161,8 +170,8 @@ Set volume properties
161170
162171
os volume set
163172
[--name <name>]
164-
[--description <description>]
165173
[--size <size>]
174+
[--description <description>]
166175
[--property <key=value> [...] ]
167176
[--image-property <key=value> [...] ]
168177
<volume>
@@ -171,25 +180,30 @@ Set volume properties
171180
172181
New volume name
173182
174-
.. option:: --description <description>
175-
176-
New volume description
177-
178183
.. option:: --size <size>
179184
180185
Extend volume size in GB
181186
187+
.. option:: --description <description>
188+
189+
New volume description
190+
182191
.. option:: --property <key=value>
183192
184-
Property to add or modify for this volume (repeat option to set multiple properties)
193+
Set a property on this volume (repeat option to set multiple properties)
185194
186195
.. option:: --image-property <key=value>
187196
188-
To add or modify image properties for this volume.
197+
Set an image property on this volume
189198
(repeat option to set multiple image properties)
190199
200+
Image properties are copied along with the image when creating a volume
201+
using :option:`--image`. Note that these properties are immutable on the
202+
image itself, this option updates the copy attached to this volume.
203+
191204
*Volume version 2 only*
192205
206+
.. _volume_set-volume:
193207
.. describe:: <volume>
194208
195209
Volume to modify (name or ID)
@@ -205,6 +219,7 @@ Show volume details
205219
os volume show
206220
<volume>
207221
222+
.. _volume_show-volume:
208223
.. describe:: <volume>
209224
210225
Volume to display (name or ID)
@@ -224,13 +239,16 @@ Unset volume properties
224239
225240
.. option:: --property <key>
226241
227-
Property to remove from volume (repeat option to remove multiple properties)
242+
Remove a property from volume (repeat option to remove multiple properties)
228243
229244
.. option:: --image-property <key>
230245
231-
To remove image properties from volume
246+
Remove an image property from volume
232247
(repeat option to remove multiple image properties)
233248
249+
*Volume version 2 only*
250+
251+
.. _volume_unset-volume:
234252
.. describe:: <volume>
235253
236254
Volume to modify (name or ID)

openstackclient/volume/v1/volume.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,45 @@ def get_parser(self, prog_name):
3131
parser.add_argument(
3232
'name',
3333
metavar='<name>',
34-
help='New volume name',
34+
help='Volume name',
3535
)
3636
parser.add_argument(
3737
'--size',
3838
metavar='<size>',
3939
required=True,
4040
type=int,
41-
help='New volume size in GB',
41+
help='Volume size in GB',
42+
)
43+
parser.add_argument(
44+
'--type',
45+
metavar='<volume-type>',
46+
help="Set the type of volume",
47+
)
48+
parser.add_argument(
49+
'--image',
50+
metavar='<image>',
51+
help='Use <image> as source of volume (name or ID)',
4252
)
4353
snapshot_group = parser.add_mutually_exclusive_group()
4454
snapshot_group.add_argument(
4555
'--snapshot',
4656
metavar='<snapshot>',
47-
help='Use <snapshot> as source of new volume',
57+
help='Use <snapshot> as source of volume (name or ID)',
4858
)
4959
snapshot_group.add_argument(
5060
'--snapshot-id',
5161
metavar='<snapshot-id>',
5262
help=argparse.SUPPRESS,
5363
)
5464
parser.add_argument(
55-
'--description',
56-
metavar='<description>',
57-
help='New volume description',
65+
'--source',
66+
metavar='<volume>',
67+
help='Volume to clone (name or ID)',
5868
)
5969
parser.add_argument(
60-
'--type',
61-
metavar='<volume-type>',
62-
help='Use <volume-type> as the new volume type',
70+
'--description',
71+
metavar='<description>',
72+
help='Volume description',
6373
)
6474
parser.add_argument(
6575
'--user',
@@ -74,17 +84,7 @@ def get_parser(self, prog_name):
7484
parser.add_argument(
7585
'--availability-zone',
7686
metavar='<availability-zone>',
77-
help='Create new volume in <availability-zone>',
78-
)
79-
parser.add_argument(
80-
'--image',
81-
metavar='<image>',
82-
help='Use <image> as source of new volume (name or ID)',
83-
)
84-
parser.add_argument(
85-
'--source',
86-
metavar='<volume>',
87-
help='Volume to clone (name or ID)',
87+
help='Create volume in <availability-zone>',
8888
)
8989
parser.add_argument(
9090
'--property',
@@ -308,7 +308,7 @@ def get_parser(self, prog_name):
308308
parser.add_argument(
309309
'volume',
310310
metavar='<volume>',
311-
help='Volume to change (name or ID)',
311+
help='Volume to modify (name or ID)',
312312
)
313313
parser.add_argument(
314314
'--name',
@@ -330,7 +330,7 @@ def get_parser(self, prog_name):
330330
'--property',
331331
metavar='<key=value>',
332332
action=parseractions.KeyValueAction,
333-
help='Property to add or modify for this volume '
333+
help='Set a property on this volume '
334334
'(repeat option to set multiple properties)',
335335
)
336336
return parser
@@ -411,7 +411,7 @@ def get_parser(self, prog_name):
411411
metavar='<key>',
412412
action='append',
413413
default=[],
414-
help='Property to remove from volume '
414+
help='Remove a property from volume '
415415
'(repeat option to remove multiple properties)',
416416
required=True,
417417
)

0 commit comments

Comments
 (0)