30 Commits

Author SHA1 Message Date
Jenkins
f802d1ae1a Merge "deprecate command cinder endpoints" 2016-08-19 08:55:37 +00:00
Steve Martinelli
7a566e6915 deprecate command cinder endpoints
The command `cinder endpoints` will now print a warning message,
indicating that users should use openstackclient instead.
This has already been done in nova's CLI [1].

Related-Bug: 1608166

[1] https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/shell.py#L4071-L4072

Change-Id: If68b40cf8116aa0ec386d8067c58703cb7b7c0da
2016-08-17 14:18:29 -07:00
Cao Shufeng
b76f594413 Add "start_version" and "end_version" support to argparse
Now, "cinder help subcommand" can not show whether an argument
is supported for a specific microversion.
With this change, developers only need to add a start_version or
end_version in the utils.arg wrap, cinderclient will support
the microversion for that arguement.

    @utils.arg(
    '--foo',
    start_version='3.1')
    @utils.arg(
    '--bar',
    start_version='3.2',
    end_version='3.5')
    def do_some_action():
        ......

In previous example, an exception will be raised for such command:
   $ cinder --os-volume-api-version 3.6 --bar some-ation

And only "--foo" will show up for such help command:
   $ cinder --os-volume-api-version 3.1 help some-ation

Change-Id: I74137486992846bbf9fdff53c009851db2356eef
Partial-Bug: #1600567
Co-Authored-By: Nate Potter <nathaniel.potter@intel.com>
2016-08-16 16:16:13 +00:00
Jenkins
8f1bfce806 Merge "Add backup-update" 2016-08-16 01:15:58 +00:00
lisali
0c016c8b96 Add backup-update
Add backup-update command to update name and description
of a backup.

DocImpact

Change-Id: Ie24b2a13f8d1132b65f30e95059479e532fad41a
2016-08-05 09:33:34 +08:00
scottda
af4cfb0f64 Change api-version help to indicate server API
The help for the 'api-version' command should state that
it is displaying the api-version info for the server, not the
client:
Display the server API version information.

Change-Id: Ia4380871ddca1b7ff41a5e6c8cf86488626e69fc
2016-08-04 16:52:19 -06:00
Jenkins
4e0476507c Merge "Add cluster related commands" 2016-08-04 19:58:07 +00:00
Jenkins
cb24088fea Merge "Changed backup-restore to accept backup name" 2016-08-03 12:34:54 +00:00
Jenkins
4aa7e60c5f Merge "Add tenant_id parameter to limits." 2016-08-02 14:29:40 +00:00
Steve Martinelli
f66b0d57d1 print endpoints using new keystoneauth catalog object
cinderclient was assuming an identity v2 styled service catalog
would always be returned (when using `cinder endpoints`).

keystoneclient would return either a v2 or v3 styled catalog,
whereas keystoneauth abstracts out the differences and handles
them internally. the result is that there is no need to look
for specific ['serviceCatalog'] or ['catalog'] keys in the
dictionary returned from keystoneauth.

it should be noted that perhaps cinderclient should deprecate
the ability to list endpoints since that is mostly an identity
and admin level operation, and likely an artifact from early
openstack days, it should now be handled by openstackclient.
further, it's not clear whether the command is meant to list all
endpoints or just the endpoints in the user's token (which it does
now).

Change-Id: Ibfcccedee5baf43f5b5c517d37e3f046c8743078
Closes-Bug: 1608166
2016-07-30 21:06:16 -07:00
Dimitri Mazmanov
1a973235f0 Add tenant_id parameter to limits.
Cinder API allows specifying tenant_id to get tenant
specific resource usage. This was missing in the client.
This fix should allow fetching tenant specific resource usage
directly from the client. Added tenant argument to the limits CLI.

Closes-Bug: #1580562
Change-Id: I3fbd6341f6d018a79e7c343107ac974b6fbb9239
2016-07-29 12:41:44 +02:00
Ellen Leahy
2b0bd49b24 Changed backup-restore to accept backup name
Edited do_backup_restore function to accept the name of the backup
as well as its id. Changed the test to comply with this.

DocImpact

Closes-Bug: #1604892

Change-Id: Iaec69dd053a119366fa5a8437701a6f7c3da2235
2016-07-29 09:54:19 +01:00
Jenkins
3722a2a9d5 Merge "Support name option for volume restore" 2016-07-28 18:37:55 +00:00
scottda
09b51a294e Add api-version to get server versions
Mitaka Cinder added an API to return Versions from the base
endpoint URL:
http://<url>:8776/
This patch exposes that API for /v3 endpoint microversions 3.0 and
above with the command:
cinder api-version

Implements: blueprint add-get-server-versions

Change-Id: Ieb1a56b28188ec17946fe5564b28c165833ffc24
2016-07-11 10:44:12 -06:00
Jenkins
7d136caf48 Merge "Fix output error for type-show command" 2016-07-08 04:40:28 +00:00
Huanxuan Ao
724901e374 Fix output error for type-show command
Before this patch, the output of "extra_specs"
in type-show command is this:
| extra_specs | {u'Alpha': u'a'} |
Becuase the type of "extra_specs" is not a string
and need to use unicode_key_value_to_string()
method to change it to string.

This patch add formatters and call
unicode_key_value_to_string() mothod for
"extra_specs" and change the output to this:
| extra_specs | {'Alpha': 'a'} |

Change-Id: Ia2e2633068ce5b5e6622474b145a1d4f074fd551
Closes-Bug: #1589461
2016-07-07 22:37:33 +08:00
xiexs
e5e0a7ee49 Add strict Boolean checking
Because of lack of strict boolean checking, the unexpected
'False' value will always be send to server if invalid bool
value is specifed.
For instance:
  the parameter 'is-public' of cinder type-update,
  the parameter 'force' of cinder qos-delete
as so forth.

This patch tries to add a strict checking for them
to prevent invalid bool value.

Change-Id: I896ddbb6ec4760bfd4d721db960138e2df0b86e1
Closes-Bug: #1596418
2016-06-27 08:41:11 -04:00
Jenkins
63b3087c57 Merge "Fixing parsing problem of cascade in client" 2016-06-24 22:51:49 +00:00
Gorka Eguileor
25bc7e7402 Add cluster related commands
This patch updates client to support cluster related changes on the API
done on microversion 3.7.

Service listing will include "cluster_name" field and we have 4 new
commands, "cluster-list", "cluster-show", "cluster-enable" and
"cluster-disable".

Specs: https://review.openstack.org/327283
Implements: blueprint cinder-volume-active-active-support
Depends-On: If1ef3a80900ca6d117bf854ad3de142d93694adf
Change-Id: I824f46b876e21e552d9f0c5cd3e836f35ea31837
2016-06-21 19:02:15 +02:00
wanghao
86fe5617aa Fixing parsing problem of cascade in client
We have implemented cascade deleting volume in CLI now,
but there's still something that should be improved:

1. A parsing problem of cascade is existing that always
evaluate parameter to True.

So now change the cascade parameter to a flag that don't
accept value anymore.

If user want to delete volume with snapshot, just need to
use 'cinder delete --cascade [volume_id]'.

Change-Id: I92e9400d5d7fbb741607bdbde7ac0c0667fca85d
Closes-Bug: #1585441
Implements: blueprint support-deleting-vols-with-snps-in-cli
2016-06-16 07:20:58 +00:00
Mitsuhiro Tanino
df63cd03d5 Support name option for volume restore
Volume restore API supports name option to specify volume name
for new volume creation, but CLI doesn't support this option.
This change simply add name option for backup-restore command.

Change-Id: I22ccc303c86b958cb21862f718ef89f57234a027
Partial-Bug: #1539667
2016-06-02 17:10:27 -04:00
Jenkins
3d06d358ad Merge "Support for snapshot force delete" 2016-06-02 19:44:24 +00:00
Sheel Rana
699a2f5dce Support for snapshot force delete
Cinder snapshot force delete is supported from cinder server
side but cinderclient support is not present.

This patchset adds support for cinder snapshot force delete
from cinderclient side.

Closes-Bug:#1418353

Change-Id: I8c4f02f9c3b855d44b1a3c7da7083d87b3b70da9
Implements: Blueprint snapshot-backup-force-delete
2016-05-29 08:53:28 +00:00
Jenkins
1aa45d8474 Merge "Support for cinder backup force delete" 2016-05-23 19:30:08 +00:00
Sheel Rana
11010ec9eb Support for cinder backup force delete
Cinder backup force delete is supported from cinder server
side but cinderclient support is not present.

This patchset adds support for cinder backup force delete
from cinderclient side.

Closes-Bug:#1567243

Partially-Implements: blueprint snapshot-backup-force-delete

Change-Id: I4ec38376d57ef6f74fefdd3bd2fea7a10bc51672
2016-05-21 12:30:18 +00:00
Mitsuhiro Tanino
729b8f8474 Don't reset volume status when resetting migration status
In case of failed volume migration, status of the volume is
still in-use and the migration status is set to error.

Current reset-migration-status command resets not only
migration status but also volume status. However the volume
status should not reset because the volume is still attached.

Closes-Bug #1552058
Change-Id: I9a8a5ed6a00bdcffecbf98862fe60aee373f5e9b
2016-05-18 15:43:54 -04:00
Jenkins
9f3c8952a1 Merge "Add options when uploading images to Glance" 2016-05-17 22:46:38 +00:00
Nathaniel Potter
7590fe4b7d Add options when uploading images to Glance
Added --visibility and --protected options
when uploading volumes to the image service.

DocImpact

Change-Id: Ie639179c5bbbaca4de62b42b368830afcfd8f7ac
Closes-Bug: #1288131
Depends-On: I6e6b2276af22b7809ea88289427c6873211b3faf
Signed-off-by: Nathaniel Potter <nathaniel.potter@intel.com>
2016-04-21 17:51:43 +00:00
Eric Harney
2f00cf8857 Only print volume ID in migration messages
This displays the volume id rather than <Volume: id>.

Change-Id: Iff4096a86d0fd403ee1b56d76ec78e879eee331b
Closes-Bug: #1573094
2016-04-21 11:42:36 -04:00
scottda
27e6f6f7f8 Add /v3 endpoint support for cinderclient
Add support for Cinder API /v3 endpoint.
A couple of unit tests for /v3 endpoint were added to v3/test_shell.py
to ensure that the v3 shell works, and to also test that modules work
with:
from cinderclient.v2.availability_zones import *
syntax.

Change-Id: I6ae0ada221bebb4ab1850d9c99b10fcbb585201f
Implements: https://blueprints.launchpad.net/python-cinderclient/+spec/add-v3-endpoint-support
2016-04-18 10:49:51 -06:00