126 Commits

Author SHA1 Message Date
Gloria Gu
bc2b8bf1be Added type description for volume type client
This patch added client handling and unit tests for volume type description:

* Added 2 client methods for volume type.
  default: to get the default volume type
  update: to upate an existing volume type to update description

* Added 2 new command-line operations.
  type-update (adminitrator only)
  type-default

* type-list should display description.

* type-create should have an option for entering the description.

The corresponding cinder APIs change volume-type-description:
https://review.openstack.org/#/c/131871/

Implements: blueprint volume-type-description
Change-Id: I2735d7050d90589d19f45e21096577febdcca8bb
2014-12-17 07:27:38 -08:00
Jenkins
9295913779 Merge "Add ability to create volume from image by image name" 2014-12-04 00:19:06 +00:00
Duncan Thomas
4ccb70a90f Support Volume Backup Quota
Python-cinderclient support update volume backup quota.

Cinder server side commit for this feature was:
https://review.openstack.org/#/c/111460/

blueprint volume-backup-quota

Change-Id: I1fceeb9fc0eb92370e249c46749a61e4b11420b0
2014-11-30 19:37:10 +02:00
Sean McGinnis
616b982b7d Add ability to create volume from image by image name
Follow on change from cinder code to all specifying an
image by either its name or ID for creating a volume.

This patch adds the --image option that will take either
ID or name as input. The service then will attempt to
locate the image to use and make sure there are not
multiple images with the same name.

If both --image-id and --image are used it will favor
the more explicit ID.

DocImpact
Closes-Bug: 1377823

Change-Id: I77d58258144970fac47da6da6b7870f2931e1823
2014-11-25 12:39:17 -06:00
Jenkins
8428ffd099 Merge "Fix volume name support of unmanage and replication commands" 2014-10-14 20:31:35 +00:00
Mitsuhiro Tanino
20df1cb7a7 Fix volume name support of unmanage and replication commands
Volume not found error occurs when running these commands via cinderclient
with volume name as an argument.
unmanage, replication-promote, replication-reenable

However in their help text, it is described that Name and ID are supported.
Therefore, this patch fixes volume name support to their argument.

Closes-bug: #1374211
Change-Id: I8b90523d8e79a65eb27ff4e99820e8cb3feb3120
2014-10-02 15:24:01 -04:00
John Griffith
1cb1350d16 Simplify cinder manage command args
The 'cinder manage' command argumenst are kind of a disaster.
The positionals are <host> <id> where <id> is undefined/free form
K/V pairs.  On top of it we then have --source-name and --source-id
optional arguments available.  There absolutely no way to tell from
the help what one should be entering here without referring to the
code, and even then it's not quite clear how the options work and
which one will be used.

To clean this up, change the positionals to <host> <identifier>
where both are strings.  Remove --source-name and --source-id
and consolidate those options with --id-type.

id-type will allow a user to specify the type of identifier
(source-name, source-id, or whatever), but defaults to
source-name which is most commonly used currently.

* NOTE *
Ideally we'd just do away with the designator source-name/source-id
altogether and just have an <identifier> positional arg.  Each driver
would then be responsible for figuring out what was passed an how to
deal with it.  This however requires changes in all of the drivers and
broader changes on the Cinder side which I don't think are warranted
during RC.

During Kilo we should clean all of this up, but for now at least the
syntax is somewhat ready for human consumption and a bit easier than
what we introduced.

Change-Id: I07696648ae647f17ab9180cd87b25f8cb888f5d6
Closes-Bug: 1376311
2014-10-02 14:58:19 +00:00
Jenkins
26e19ff186 Merge "Docstring of unmanage subcommand is missing" 2014-10-01 15:24:48 +00:00
Jenkins
5922af5441 Merge "Ability to pass metadata during snapshot create" 2014-09-30 03:47:30 +00:00
Mitsuhiro Tanino
1dc808124b Docstring of unmanage subcommand is missing
cinder unmanage is missing docstring.
This patch adds description of unmanage to python-cinderclient.

Closes-Bug: #1373662
Change-Id: I3ae8ee714507b82c661360e86136dab5ef461ce3
2014-09-24 20:03:58 -04:00
Jenkins
d904b6509a Merge "Make <volume-types> required option for create cg" 2014-09-12 08:41:57 +00:00
Xing Yang
40f06b8be5 Make <volume-types> required option for create cg
Change-Id: I101ec89ab95cedd8b55247301c1c3b9cba2645c5
2014-09-10 13:58:46 -04:00
Jenkins
6f6d828795 Merge "Cinder Client for Consistency Groups" 2014-09-09 07:17:30 +00:00
Jenkins
42d13be346 Merge "Quotaset update does not return result" 2014-09-08 20:26:05 +00:00
Xing Yang
9fc64a52b1 Cinder Client for Consistency Groups
This patch implements CLI commands for the Consistency Groups
feature. Only snapshots for CGs will be implemented in phase 1.

Change-Id: I447555fd8a92bceecf6f40be59030d65461e4cbb
Implements: blueprint consistency-groups
2014-09-08 10:37:04 -04:00
Subhadeep De
4a7014a46e Ability to pass metadata during snapshot create
Metadata as a parameter is supported by the underlying cinder driver.
This is not exposed by the python client. It is helpful to store additional information
for snapshots and can be used for decision within cinder driver during snapshot creation.
Similar functionality exists for volume creation in cinder client and cinder driver.
Updating cli(shell) to accomodate the new metadata parameter
Adding above change for v2

Change-Id: I002221efea1b9994da4a8d200544a88b0ed26277
Closes-Bug: #1341424
2014-08-29 00:09:43 -07:00
Ronen Kat
953ac3ec6d Add client support in Cinder for volume replication
Provide Cinder client support to manage volume replication.
Cinder-specs available at https://review.openstack.org/#/c/98308/

Change-Id: Id60bacbcc113d42730e822b29b2fa78be94d3276
Implements: blueprint volume-replication
2014-08-27 06:38:50 +03:00
Jenkins
0c5f0a92b4 Merge "Avoid extra lookups in extra-specs-list" 2014-08-23 15:27:05 +00:00
JordanP
6565e275fd Avoid extra lookups in extra-specs-list
extra-specs-list used to use the extra-specs cinder extension
to get information on volume type extra specs. This information
is publicly available through the volume-type API [1] thus we
can avoid the extra-lookups of querying the extra-specs extension.

As the extra-spec info is publicly available, remove the part of
the docstring of cinder extra-specs-list that says 'admin only'.

[1] http://docs.openstack.org/api/openstack-block-storage/2.0/content/GET_getVolumeTypes__v2__tenant_id__types_Volume_Types.html

Change-Id: I9a8256a044511ac5233d8170fc57118ccaa1e217
Closes-Bug: 1343876
2014-08-05 11:28:09 +02:00
liyingjun
f7e9ece40b Support pagination for volume list
Since v2 api supports pagination, we should add this support in
cinderclient too.

Change-Id: I9d4cb9e192523c14cf7df043deabe156dbb8e216
Closes-bug: 1325773
2014-08-02 00:08:08 +08:00
Jenkins
88ee3b385c Merge "Fix the return code of the command reset-state" 2014-08-03 17:14:06 +00:00
Jenkins
172d0ea018 Merge "Add tenant uuid when running cinder list --all-tenants" 2014-07-30 19:01:34 +00:00
Juan Manuel Olle
02b32c8aed Quotaset update does not return result
This patch adds the updated quota values to the output shell

Closes-Bug: #1316474
Change-Id: I95bbefa5fdee316a3a3ba77a5b3067345da3344f
2014-07-29 17:56:07 +00:00
Zhengguang
bf8fa0b606 Fix the return code of the command reset-state
Currently, the command reset-state return code is zero if it
failed for any of volumes, it should be nonzero.

Change-Id: Ic6da238861fd003375003399bc6def6bf860a015
Closes-Bug: #1339643
2014-07-28 09:08:36 -04:00
Jenkins
ba826fbf3c Merge "Add commands for managing and unmanaging volumes" 2014-07-24 19:06:06 +00:00
Jenkins
15cbd66138 Merge "Optional size parameter for volume creation" 2014-07-24 16:01:34 +00:00
Geraint North
4d3b9bcea3 Add commands for managing and unmanaging volumes
Add manage and unmanage commands.

Cinder code: https://review.openstack.org/#/c/72501

See also adding support for "bootable" flag for volume manage,
and changing the LVM backend to use the source-volume-name key
as part of the existing-ref structure, to make the CLI easier
to use:
https://review.openstack.org/#/c/108488/

Implements: blueprint add-export-import-volumes

Change-Id: I27d0d3396d80063a51b0fe56d2d3c92931fa9c6c
2014-07-24 11:16:57 +01:00
Jenkins
0c4010e7fb Merge "Add set-bootable command" 2014-07-16 22:30:28 +00:00
Juan Manuel Olle
bd361644f7 Optional size parameter for volume creation
This patch makes optional the parameter size
for creating a volume from a snapshot or other
volume.
The parameter is still required for other
kind of volume creation.

Change-Id: I75dcf0e647f6e82a2407bcf23ef359f5f87323e8
Closes-Bug: #1304463
2014-07-08 17:51:15 -03:00
liyingjun
ae04b4b099 Add tenant uuid when running cinder list --all-tenants
Add the tenant uuid to the output when running cinder list --all-tenants,
since this is an admin command any way, it would help to list the tenant
UUID so we do not have to run cinder show to see the tenant uuid when we
have further queries to run.

Change-Id: I661789e957fa00947c4d5595f7e0515c27963735
Closes-bug: 1333257
2014-06-27 03:29:27 +08:00
Eric Harney
811af8f374 Remove "OPTIONAL:" from optional argument help text
All arguments starting with '--' are optional and listed
under the 'Optional arguments:' header by argparse.  Remove
the extra note shown for each argument.

Change-Id: Ic361a3bdbd1f1669458e16b99995f0f108400699
2014-05-22 15:43:31 -04:00
Diane Fleming
0d2bf657ae Update help strings for cinder client
Make text consistent and clear.
Add periods to end of sentences.
Adjust test suite for change

Closes-Bug: #1275881

Change-Id: I1dfde51636e8dc4b42e4c4810c27c1c4ac513d82
2014-04-23 09:06:21 -05:00
Jenkins
71daa36023 Merge "Accept deleting multiple snapshots in one shot" 2014-04-17 19:21:42 +00:00
Jenkins
fc2c916ce4 Merge "CLI for disable service reason" 2014-04-04 07:16:50 +00:00
Xavier Queralt
5a080b4d47 Accept deleting multiple snapshots in one shot
In bug 1241941 the delete and force-delete commands were updated to
accept multiple volumes for deleting in the same call. This patch adds
the same behaviour to the snapshot-delete command.

Closes-Bug: #1284540
Change-Id: I5e4bf8641d7fd261fa24b03832bad08007e43c12
2014-04-03 10:21:23 +02:00
HiroyukiEguchi
c364372477 Add set-bootable command
Bootable Status is set to "True" automatically when user
create a volume from a image. But user have to set bootable
status manually when creating a bootable volume manually.

blueprint add-bootable-option

this commit is related to https://review.openstack.org/#/c/84057/

Change-Id: Ib4a44334001b7b9e3b896c2e44607c414e75e952
2014-04-02 09:50:48 +09:00
Sergio Cazzolato
5278bdb0c5 Add quota-delete command to cinder client
Add the command quota-delete <tenant_id> to the client.

This change depends on the cinder change:
Ia040a20abb831c311eb13624ddecbbf0f12fdd9f

DocImpact

Implements blueprint quota-delete
Change-Id: I1e5c98154dc3c6de168747eb912b45265cd1b9db
2014-04-01 12:58:41 +00:00
Jay Lau
8a59f2ca57 CLI for disable service reason
Adds cli option to allow users to give reason
for service-disable. Also adds disabled reason
as a column in service list, so any disabled service
can be seen with reason.

A recent cinder change that allows disable-log-reason
allows users to provide reason for disabling service.
This just adds the cli option for the method.

Implements bp record-reason-for-disabling-service

Change-Id: I90f4566764790eeb0c047c4a0fd0108050ab6ad9
2014-03-16 09:34:09 +08:00
Jenkins
bd98d3264b Merge "Import access module from keystoneclient to handle V3 endpoints" 2014-03-13 23:05:32 +00:00
Jenkins
de4f9c42cd Merge "Client support for export and import backup service metadata" 2014-03-12 02:13:16 +00:00
Ronen Kat
c48e41b8b7 Client support for export and import backup service metadata
Add client code to a new admin API for backup-export and
backup-import allowing an admin to copy the backup metadata
details.

client code for https://review.openstack.org/#/c/69351/

blueprint cinder-backup-recover-api
DocImpact new admin API calls backup-import and backup-export

Change-Id: Id306fc9cf562a87bb6a36eae692852eefc592b74
2014-03-04 17:18:40 +02:00
Shao Kai Li
1b0ea8768c Import access module from keystoneclient to handle V3 endpoints
* service_catalog.py will be used only by nova(cinder.py), it will be removed if nova
uses access instead of service_catalog. Then service_catalog.py and
test_service_catalog.py will be removed from cinderclient if necessary.

* Some unit tests are modified.

* Because of JSON format's modification, functions that process cinder
credentials and cinder endpoints are changed.

* Add dependency for keystoneclient in requirements.txt.

Change-Id: Icf7badfdddcf5f55536d95db7242aff58aa34b6e
Closes-Bug: #1263876
bp: service-catalog
2014-03-03 01:16:26 -05:00
Peter Hamilton
3ec28c3309 Fix type-delete to allow deletion by name and ID
This change addresses bug #1286314, fixing type deletion to allow
deletion by either volume type name or ID. The former implementation
only accepted the volume type ID. Help documentation is also updated
to reflect this change.

Change-Id: I0fc66b54a7bcfa4e00a4d136ac513fa40e628dd2
Closes-Bug: #1286314
DocImpact
2014-02-28 15:48:23 -05:00
Mike Perez
7b176c6705 Set v2 commands available for v2 service_type
These commands originally were only available for v1, but this makes
them available for both v1 and v2 service_type.

Change-Id: I26e3f1997aebafa1eb784273c892397522dbbfe2
Closes-Bug: #1284321
2014-02-24 16:17:32 -08:00
Peter Hamilton
6fd8d8e12e Require ctrl_location for encryption-type-create
This bug fix addresses bug #1267168, adding a default value to the
optional control_location parameter for the encryption-type-create
command. Prior to this fix, any invocation of encryption-type-create
that omitted the control_location parameter would fail. The failure
arose from the expectations of the cinder volume encryption type
API extension, which expects to always receive a value for the
control_location on encryption type creation.

control_location indicates which service will conduct the volume
encryption for the encryption-type under consideration; valid options
are 'front-end' (i.e., nova) and 'back-end' (i.e., cinder). The new
default value is 'front-end' and is used whenever control_location
is omitted from encryption-type-create invocation. For prior
discussion and information, see the abandoned patch below:

https://review.openstack.org/#/c/58303/

blueprint encrypt-cinder-volumes
https://blueprints.launchpad.net/nova/+spec/encrypt-cinder-volumes

Change-Id: I8db80929adbf5a3d818b9d3a8115067ae8e7d9e2
Closes-Bug: #1267168
DocImpact
2014-02-12 21:38:41 +02:00
Mike Perez
e31e057ccc Revert "Update cinderclient to skip the additional GET during create"
This reverts commit 47014971b09f0334e5cc3b414bef31784f88a37d.

Conflicts:
	doc/source/index.rst

Change-Id: Ica1e526b2c181d1ce72183b7293d21119371c822
2014-02-04 14:14:22 -07:00
Andrew Kerr
019f43f63f Fixed image_name from image-name in upload-to-image
This fix addresses an issue where the variable name for image_name
was incorrect, causing the image_name parameter to be sent as null
when using "cinder upload-to-image" from cli with v2 of the API

Change-Id: I62f8bbb4397526fb291a46777d9025318da8e5b3
Closes-Bug: 1274552
2014-01-31 18:39:04 -05:00
Avishay Traeger
58d8a00a57 Add volume retype command
Add volume retype to Cinder client.
Cinder code: https://review.openstack.org/#/c/44881/

Change-Id: Ied4902da531386f744403962e4a8ddfb7587c4ef
2014-01-25 15:55:23 -07:00
Jenkins
36a92e1286 Merge "disable/enable a service has no output" 2014-01-25 14:23:20 +00:00
Jenkins
e2642796b8 Merge "Add encryption-type-delete to cinderclient" 2014-01-24 11:39:12 +00:00