1012 Commits

Author SHA1 Message Date
Jenkins
29099bbc68 Merge "Wrap cluster related function with api_version" 2016-09-01 04:01:05 +00:00
Jenkins
099a135bef Merge "Wrap group type and group spec with api_version" 2016-09-01 02:23:44 +00:00
Jenkins
1637071327 Merge "Wrap volume_backup's update function with api_version" 2016-09-01 02:23:39 +00:00
Cao Shufeng
23aa30f025 Wrap cluster related function with api_version
Cluster related functions only support 3.11 microversion
or higher. So it should be wrapped like like one[1],
otherwise these fuctions may be exposed to lib users with
old microversion.

[1]: https://github.com/openstack/python-cinderclient/blob/master/cinderclient/v3/services.py#L82

Change-Id: I20d508c2694cf7e052d709548b9709df0561e2c3
2016-09-01 01:45:05 +00:00
Cao Shufeng
654f71208b Wrap volume_backup's update function with api_version
Volume backup's update function only supports 3.9 microversion
or higher. So it should be wrapped like like this one[1],
otherwise these fuctions may be exposed to lib users with old
microversion.

[1]: https://github.com/openstack/python-cinderclient/blob/master/cinderclient/v3/services.py#L82

Change-Id: I2c800099e8ae707135417f9821f14d1a9e69586e
2016-08-30 08:27:12 -04:00
Cao Shufeng
1abc4b0b44 Wrap group type and group spec with api_version
Group type and group sepc functions only support 3.11 microversion
or higher. So it should be wrapped like like one[1], otherwise
these fuctions may be exposed to lib users with old microversion.

[1]: https://github.com/openstack/python-cinderclient/blob/master/cinderclient/v3/services.py#L82

Change-Id: I2ddac90cd483c456a5e88a3952017a77a543f995
2016-08-30 08:22:08 -04:00
Jenkins
4f794410f1 Merge "Replace functions 'Dict.get' and 'del' with 'Dict.pop'" 2016-08-30 02:58:10 +00:00
Jenkins
85b10686bb Merge "Fix NoneType error for cinderclient v1" 2016-08-29 22:30:02 +00:00
bhagyashris
0504354233 Replace functions 'Dict.get' and 'del' with 'Dict.pop'
Refactoring code: Making dicts to use single instruction: pop()
rather than two instructions: get() and del, giving the codes
a format that carries through.

TrivialFix

Change-Id: Ie404888ccf257978e0ac491165926dfde9a3e6d6
2016-08-29 11:35:02 +05:30
Jenkins
8db4ca1d90 Merge "Update the home-page with developer documentation" 2016-08-28 19:32:27 +00:00
Jenkins
e8d272a167 Merge "Changed backup-restore to accept backup name" 2016-08-26 16:13:16 +00:00
Ellen Leahy
4f833eeaff Changed backup-restore to accept backup name
Beckup-restore does not currently accept the name of the backup,
however other backup actions do and according to its description
backup-restore should as well.

Change-Id: I26d8d2f1fe6cf7362d23d9b9668936dbb0509251
Closes-Bug: #1604892
2016-08-25 15:48:43 +01:00
Cao Shufeng
cbe6c59d9a Enhance help message of upload_to_image
Following the commit fb2c434c2461a25193067104de766fc1142a6024 in
the cinder repo the --force option to upload-to-image is ignored
by default. To enable it the config option enable_force_upload
must be set to true.

The help text for upload-to-image in the python cinderclient
should remind user that --force may not work in some cloud now.

Closes-Bug: #1611667
Change-Id: Ib56fb2016d933a9bbbcb0185c50e33d2166b34e6
2016-08-25 10:02:25 +00:00
Rui Chen
639831b096 Fix NoneType error for cinderclient v1
Request-id log is recorded in SessionClient.request() method,
but None is used as logger, that causes all the v1 commands
to be broken. This patch fixes the issue and updates the related
unit tests.

Change-Id: I46b973f2baca8d7402a39e0d15dbd8da38f4e590
Closes-Bug: #1616070
2016-08-25 01:59:20 +00:00
Jenkins
ca24fd41e2 Merge "Fix useless api_version of Manager class" 2016-08-24 10:03:24 +00:00
Cao ShuFeng
09a76374c3 Fix useless api_version of Manager class
Manager's api_version property is used by api_version.wraps. It
should not be an "empty" class and the real api_version can be
read from Client class.

The 3.0 version's upload-to-image doesn't work as excepted because
of this useless api_version of VolumeManager class. This patch also
fix it and update some unit tests for it, because the changes are
co-dependent on one another.

Co-Authored-By: Nate Potter <nathaniel.potter@intel.com>

Change-Id: I398cbd02b61f30918a427291d1d3ae00435e0f4c
Closes-Bug: #1573414
Closes-Bug: #1589040
2016-08-23 05:32:00 +00:00
Jenkins
f802d1ae1a Merge "deprecate command cinder endpoints" 2016-08-19 08:55:37 +00:00
venkatamahesh
d3c0d22405 Update the home-page with developer documentation
Change-Id: I22e1e72077d1fe277678f85592dcf1bfb798edfe
2016-08-18 01:47:12 +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
0daa4aa023 Merge "Tests for testing volume-create command" 2016-08-16 01:16:16 +00:00
Jenkins
8f1bfce806 Merge "Add backup-update" 2016-08-16 01:15:58 +00:00
Sergii Turivnyi
a4687688ee Tests for testing volume-create command
Positive tests for the cinder CLI commands which check actions with
volume create command like create volume from snapshot,
create volume from volume.

Change-Id: I77912d413ac061eb8376233dfef772c55265d135
2016-08-09 09:27:18 -04:00
Jenkins
09d7e92dbc Merge "Change api-version help to indicate server API" 2016-08-09 10:54:36 +00:00
OpenStack Proposal Bot
931f847dc6 Updated from global requirements
Change-Id: I0b41e0ab210da31590ff21280bc5b9f342659302
2016-08-08 18:14:52 +00:00
dineshbhor
a635fd2199 Use 'six' instead of oslo_utils.strutils.six
'six' is an independent third party module so it doesn't
need to be imported and used from oslo_utils.strutils.

TrivialFix

Change-Id: Icb3232bb1ebae0e8332e66c5806474d7f9dfd6df
2016-08-08 09:22:29 +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
7167efce67 Merge "Replace OpenStack LLC with OpenStack Foundation" 2016-08-02 22:51:26 +00:00
Jenkins
4aa7e60c5f Merge "Add tenant_id parameter to limits." 2016-08-02 14:29:40 +00:00
Jenkins
efc9922776 Merge "print endpoints using new keystoneauth catalog object" 2016-08-01 16:16:51 +00:00
dineshbhor
29028b86b9 Use self.ks_logger instead of ks_logger
Currently with '--debug' option any cinder command only logs the
request from keystoneauth and not the main cinder service request.

Added keystoneauth logger to self.ks_logger so that logs can be
logged as expected.

Closes-Bug: #1606814

Change-Id: I7193aa6f43cb3186c49fc409b6e1ce7a36f596f9
2016-08-01 11:11:47 +05:30
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
Jenkins
762212f7fe Merge "Switch to keystoneauth" 2016-07-26 18:59:30 +00:00
Jenkins
3464a88a70 Merge "Make sure --bypass-url honored if specified" 2016-07-26 17:29:02 +00:00
dineshbhor
1f372ebcc7 Replace OpenStack LLC with OpenStack Foundation
Change-Id: Icf7d5b9f8887e75532ebf5b17835a2b1b22be3c3
Closes-Bug: #1214176
2016-07-26 14:51:33 +05:30
Steve Martinelli
16f83c4a53 Switch to keystoneauth
move cinderclient to keystoneauth as keystoneclient's auth session,
plugins and adapter code has been deprecated.

Co-Authored-By: Paulo Ewerton <pauloewerton@lsd.ufcg.edu.br>
Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: Jamie Lennox <jamielennox@gmail.com>

Change-Id: Id4bf0e2088e8ad99e83cd4f9b8549c2aca1f65a2
2016-07-23 07:35:40 +10:00
Avishay Traeger
d24ba31afa List manageable volumes and snapshots
Cinder currently has the ability to take over the management of
existing volumes and snapshots ("manage existing") and to relinquish
management of volumes and snapshots ("unmanage"). The API to manage an
existing volume takes a reference, which is a driver-specific string
that is used to identify the volume on the storage backend.  This
patch adds the client code for APIs for listing volumes and snapshots
available for management to make this flow more user-friendly.

Change-Id: Icd81a77294d9190ac6dbaa7e7d35e4dedf45e49f
Implements: blueprint list-manage-existing
2016-07-19 18:57:09 -04:00
xing-yang
f7928c4058 Add support for group snapshots
This patch adds support for group snapshots.

Server side API patch was merged:
    https://review.openstack.org/#/c/361369/

Current microversion is 3.14. The following CLI's are supported:
cinder --os-volume-api-version 3.14 group-create-from-src
    --name my_group --group-snapshot <group snapshot uuid>
cinder --os-volume-api-version 3.14 group-create-from-src
    --name my_group --source-group <source group uuid>
cinder --os-volume-api-version 3.14 group-snapshot-create
    --name <name> <group uuid>
cinder --os-volume-api-version 3.14 group-snapshot-list
cinder --os-volume-api-version 3.14 group-snapshot-show
    <group snapshot uuid>
cinder --os-volume-api-version 3.14 group-snapshot-delete
    <group snapshot uuid>

Depends-on: I2e628968afcf058113e1f1aeb851570c7f0f3a08
Partial-Implements: blueprint generic-volume-group
Change-Id: I5c311fe5a6aeadd1d4fca60493f4295dc368944c
2016-07-19 16:35:45 -04:00
xing-yang
6c5a764c77 Add generic volume groups
This patch adds support to generic volume groups.

Server patch is here: https://review.openstack.org/#/c/322459/

Current microversion is 3.13. The following CLI's are supported:
cinder --os-volume-api-version 3.13 group-create --name my_group
    <group type uuid> <volume type uuid>
cinder --os-volume-api-version 3.13 group-list
cinder --os-volume-api-version 3.13 create --group-id <group uuid>
    --volume-type <volume type uuid> <size>
cinder --os-volume-api-version 3.13 group-update <group uuid>
    --name new_name  description new_description
    --add-volumes <uuid of volume to add>
    --remove-volumes <uuid of volume to remove>
cinder --os-volume-api-version 3.13 group-show <group uuid>
cinder --os-volume-api-version 3.13 group-delete
    --delete-volumes <group uuid>

Depends-on: I35157439071786872bc9976741c4ef75698f7cb7
Change-Id: Icff2d7385bde0a7c023c2ca38fffcd4bc5460af9
Partial-Implements: blueprint generic-volume-group
2016-07-19 00:37:36 -04:00
Jenkins
1610c3d95c Merge "Make APIVersion's null check more pythonic" 2016-08-30 14:24:35 +00:00
Gorka Eguileor
8b5a772e36 Make APIVersion's null check more pythonic
Our current APIVersion object has an is_null method to check when the
version instance is null (major=0 and minor=0).

While this works it is not very pythonic, since you have to write
expressions such as:

 if not min_version and not max_version:
     return True
 elif ((min_version and max_version) and
       max_version.is_null() and min_version.is_null()):
     return True

This patch removes the is_null method and instead implements the truth
value testing to simplify expressions and make code more pythonic.

So previous code would just look like:

 if not min_version and not max_version:
     return True

Because this will work with min_version being None or being an
APIVersion instance with major=0 and minor=0.

Change-Id: I7497c5dc940c1e726507117cadbad232d8c1d80d
2016-08-29 11:41:57 +02:00
Jenkins
b61ec1e6a7 Merge "Fix string interpolation to delayed to be handled by the logging code" 2016-07-16 03:45:03 +00:00
Jenkins
38e47fec44 Merge "Add Python3.5 classifier and venv" 2016-07-16 03:44:56 +00:00
Jenkins
b3d5d5be38 Merge "Updated from global requirements" 2016-07-16 03:39:25 +00:00