Skip to content

Commit 265ca58

Browse files
author
Steve Martinelli
committed
Command docs: volume
Change-Id: Id1e500d5fb19ffdeb0d1bde9e22c3143c0873d0c
1 parent ca92608 commit 265ca58

3 files changed

Lines changed: 213 additions & 23 deletions

File tree

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
======
2+
volume
3+
======
4+
5+
Volume v1
6+
7+
volume create
8+
-------------
9+
10+
Create new volume
11+
12+
.. program:: volume create
13+
.. code:: bash
14+
15+
os volume create
16+
--size <size>
17+
[--snapshot-id <snapshot-id>]
18+
[--description <description>]
19+
[--type <volume-type>]
20+
[--user <user>]
21+
[--project <project>]
22+
[--availability-zone <availability-zone>]
23+
[--image <image>]
24+
[--source <volume>]
25+
[--property <key=value> [...] ]
26+
<name>
27+
28+
.. option:: --size <size> (required)
29+
30+
New volume size in GB
31+
32+
.. option:: --snapshot-id <snapshot-id>
33+
34+
Use <snapshot-id> as source of new volume
35+
36+
.. option:: --description <description>
37+
38+
New volume description
39+
40+
.. option:: --type <volume-type>
41+
42+
Use <volume-type> as the new volume type
43+
44+
.. option:: --user <user>
45+
46+
Specify an alternate user (name or ID)
47+
48+
.. option:: --project <project>
49+
50+
Specify an alternate project (name or ID)
51+
52+
.. option:: --availability-zone <availability-zone>
53+
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)
63+
64+
.. option:: --property <key=value>
65+
66+
Set a property on this volume (repeat option to set multiple properties)
67+
68+
.. describe:: <name>
69+
70+
New volume name
71+
72+
The :option:`--project` and :option:`--user` options are typically only
73+
useful for admin users, but may be allowed for other users depending on
74+
the policy of the cloud and the roles granted to the user.
75+
76+
volume delete
77+
-------------
78+
79+
Delete volume(s)
80+
81+
.. program:: volume delete
82+
.. code:: bash
83+
84+
os volume delete
85+
[--force]
86+
<volume> [<volume> ...]
87+
88+
.. option:: --force
89+
90+
Attempt forced removal of volume(s), regardless of state (defaults to False)
91+
92+
.. describe:: <volume>
93+
94+
Volume(s) to delete (name or ID)
95+
96+
volume list
97+
-----------
98+
99+
List volumes
100+
101+
.. program:: volume list
102+
.. code:: bash
103+
104+
os volume list
105+
[--status <status>]
106+
[--name <name>]
107+
[--all-projects]
108+
[--long]
109+
110+
.. option:: --status <status>
111+
112+
Filter results by status
113+
114+
.. option:: --name <name>
115+
116+
Filter results by name
117+
118+
.. option:: --all-projects
119+
120+
Include all projects (admin only)
121+
122+
.. option:: --long
123+
124+
List additional fields in output
125+
126+
volume set
127+
----------
128+
129+
Set volume properties
130+
131+
.. program:: volume set
132+
.. code:: bash
133+
134+
os volume set
135+
[--name <name>]
136+
[--description <description>]
137+
[--property <key=value> [...] ]
138+
<volume>
139+
140+
.. option:: --name <name>
141+
142+
New volume name
143+
144+
.. option:: --description <description>
145+
146+
New volume description
147+
148+
.. option:: --property <key=value>
149+
150+
Property to add or modify for this volume (repeat option to set multiple properties)
151+
152+
.. describe:: <volume>
153+
154+
Volume to modify (name or ID)
155+
156+
volume show
157+
-----------
158+
159+
Show volume details
160+
161+
.. program:: volume show
162+
.. code:: bash
163+
164+
os volume show
165+
<volume>
166+
167+
.. describe:: <volume>
168+
169+
Volume to display (name or ID)
170+
171+
volume unset
172+
------------
173+
174+
Unset volume properties
175+
176+
.. program:: volume unset
177+
.. code:: bash
178+
179+
os volume unset
180+
[--property <key>]
181+
<volume>
182+
183+
.. option:: --property <key>
184+
185+
Property to remove from volume (repeat option to remove multiple properties)
186+
187+
.. describe:: <volume>
188+
189+
Volume to modify (name or ID)

‎doc/source/commands.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ referring to both Compute and Volume quotas.
112112
* ``usage``: (**Compute**) display host resources being consumed
113113
* ``user``: (**Identity**) individual cloud resources users
114114
* ``user role``: (**Identity**) roles assigned to a user
115-
* ``volume``: Volume - block volumes
115+
* ``volume``: (**Volume**) block volumes
116116
* ``volume type``: (**Volume**) deployment-specific types of volumes available
117117

118118
Actions

‎openstackclient/volume/v1/volume.py‎

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ def get_parser(self, prog_name):
3636
parser.add_argument(
3737
'name',
3838
metavar='<name>',
39-
help='Name of the new volume',
39+
help='New volume name',
4040
)
4141
parser.add_argument(
4242
'--size',
4343
metavar='<size>',
4444
required=True,
4545
type=int,
46-
help='New volume size',
46+
help='New volume size in GB',
4747
)
4848
parser.add_argument(
4949
'--snapshot-id',
@@ -53,45 +53,45 @@ def get_parser(self, prog_name):
5353
parser.add_argument(
5454
'--description',
5555
metavar='<description>',
56-
help='Description of the volume',
56+
help='New volume description',
5757
)
5858
parser.add_argument(
5959
'--type',
6060
metavar='<volume-type>',
61-
help='Type of volume',
61+
help='Use <volume-type> as the new volume type',
6262
)
6363
parser.add_argument(
6464
'--user',
6565
metavar='<user>',
66-
help='Specify a different user (admin only)',
66+
help='Specify an alternate user (name or ID)',
6767
)
6868
parser.add_argument(
6969
'--project',
7070
metavar='<project>',
71-
help='Specify a different project (admin only)',
71+
help='Specify an alternate project (name or ID)',
7272
)
7373
parser.add_argument(
7474
'--availability-zone',
7575
metavar='<availability-zone>',
7676
help='Create new volume in <availability-zone>',
7777
)
78-
parser.add_argument(
79-
'--property',
80-
metavar='<key=value>',
81-
action=parseractions.KeyValueAction,
82-
help='Property to store for this volume '
83-
'(repeat option to set multiple properties)',
84-
)
8578
parser.add_argument(
8679
'--image',
8780
metavar='<image>',
88-
help='Use <image> as source of new volume',
81+
help='Use <image> as source of new volume (name or ID)',
8982
)
9083
parser.add_argument(
9184
'--source',
9285
metavar='<volume>',
9386
help='Volume to clone (name or ID)',
9487
)
88+
parser.add_argument(
89+
'--property',
90+
metavar='<key=value>',
91+
action=parseractions.KeyValueAction,
92+
help='Set a property on this volume '
93+
'(repeat option to set multiple properties)',
94+
)
9595

9696
return parser
9797

@@ -172,7 +172,8 @@ def get_parser(self, prog_name):
172172
dest='force',
173173
action='store_true',
174174
default=False,
175-
help='Attempt forced removal of volume(s), regardless of state',
175+
help='Attempt forced removal of volume(s), regardless of state '
176+
'(defaults to False)',
176177
)
177178
return parser
178179

@@ -216,7 +217,7 @@ def get_parser(self, prog_name):
216217
'--long',
217218
action='store_true',
218219
default=False,
219-
help='Display properties',
220+
help='List additional fields in output',
220221
)
221222
return parser
222223

@@ -318,19 +319,19 @@ def get_parser(self, prog_name):
318319
)
319320
parser.add_argument(
320321
'--name',
321-
metavar='<new-name>',
322+
metavar='<name>',
322323
help='New volume name',
323324
)
324325
parser.add_argument(
325326
'--description',
326-
metavar='<new-description>',
327+
metavar='<description>',
327328
help='New volume description',
328329
)
329330
parser.add_argument(
330331
'--property',
331332
metavar='<key=value>',
332333
action=parseractions.KeyValueAction,
333-
help='Property to add/change for this volume '
334+
help='Property to add or modify for this volume '
334335
'(repeat option to set multiple properties)',
335336
)
336337
return parser
@@ -400,15 +401,15 @@ def get_parser(self, prog_name):
400401
parser.add_argument(
401402
'volume',
402403
metavar='<volume>',
403-
help='Volume to change (name or ID)',
404+
help='Volume to modify (name or ID)',
404405
)
405406
parser.add_argument(
406407
'--property',
407408
metavar='<key>',
408409
action='append',
409410
default=[],
410-
help='Property key to remove from volume '
411-
'(repeat to set multiple values)',
411+
help='Property to remove from volume '
412+
'(repeat option to remove multiple properties)',
412413
)
413414
return parser
414415

0 commit comments

Comments
 (0)