700 Commits

Author SHA1 Message Date
Ankit Agrawal
c49fce3909 Add request_ids attribute to resource objects
Added request_ids attribute to resource object for all the
volume_backups, volume_encryption_types and volume_transfers
APIs by updating following APIs:

volume_backups: reset_state, delete, export_record, import_record
volume_transfers: delete
volume_encryption_types: list

Returning list with request_ids as attribute in case of 'list' API
for volume_encryption_types.

These changes are required to return 'request_id' from client to log
request_id mappings of cross projects.

For more details on how request_id will be returned to the caller,
please refer to the approved blueprint [1] discussed with the
cross-project team.
[1] http://specs.openstack.org/openstack/openstack-specs/specs/return-request-id.html

DocImpact
'request-ids' will be returned as an attribute with response object.
User can access it using 'res.request_ids' where 'res' is a
response object.

Change-Id: I2197ca38f6c9a8b0ced5c82d29676b49c9700b09
Partial-Implements: blueprint return-request-id-to-caller
2016-02-16 00:34:58 -08:00
Ankit Agrawal
b2fc77f731 Provide consistency for Wrapper classes
Updated TupleWithMeta class to make it consistent with other Meta
classes in order to avoid confusion. Also made provision to call
TupleWithMeta with a tuple containing one or more elements.

For more details on how request_id will be returned to the caller,
please refer to the approved blueprint [1] discussed with the
cross-project team.
[1] http://specs.openstack.org/openstack/openstack-specs/specs/return-request-id.html

Change-Id: I5a79a4ed8cb4dc83ea3b64499df191750462100d
Partial-Implements: blueprint return-request-id-to-caller
2016-02-15 23:41:31 -08:00
Jenkins
77cbff6639 Merge "Allow "cinder backup-delete" to delete multiple backups in one request" 2016-02-14 16:59:58 +00:00
Jenkins
9095a00f3d Merge "Pass insecure option to HTTPClient" 2016-02-12 00:10:03 +00:00
Shilpa Jagannath
a3dca1599f Allow "cinder backup-delete" to delete multiple backups in one request
While "cinder snapshot-delete" and "cinder delete" allow multiple resources to be deleted in a single command, "cinder backup-delete" request can only delete one backup at a time. Adding this capability to backups in cinderclient. Enables "cinder backup-delete" to delete multiple backups in a single command.

With this change the command can be run as below:

cinder backup-delete <backup> [<backup>...]

DocImpact
Closes-Bug: #1543056
Implements: blueprint cli-backup-multiple-deletes

Change-Id: I767710bda3b7c358c6525c9a9f074010084e411d
2016-02-11 10:40:05 +00:00
Jenkins
c56c1d47b4 Merge "Fix some flake8 violations" 2016-02-11 03:24:06 +00:00
Jenkins
0f26309f58 Merge "Return wrapper classes with request_ids attribute" 2016-02-11 01:58:45 +00:00
Jenkins
c297452aab Merge "Add Wrapper classes for list, dict, tuple" 2016-02-10 16:16:21 +00:00
Jenkins
77feadd6a0 Merge "Remove debug statement" 2016-02-09 21:38:42 +00:00
Chaozhe.Chen
9e60e4a592 Fix some flake8 violations
1. Wrong use of 'noqa'. "# flake8: noqa" option disables all checks
for the whole file.
2. Remove exclusion of 'tools' and '*openstack/common*' in flake8 and
fix the violations.

Change-Id: I153e992ffd6a80e70a99d7066c503c34326c93ab
Closes-bug: #1540254
2016-02-09 20:28:30 +08:00
Jenkins
64138007bd Merge "Bootable filter for listening volumes from CLI" 2016-02-08 16:49:49 +00:00
Sheel Rana
3dec787a52 Bootable filter for listening volumes from CLI
This fix depends upon fix proposed in cinder.

Depends-On: I1f1ec20441b28e01bf07bc4f60d848b653e58d58

DocImpact

Implements : blueprint select-volume-through-bootable-option

Closes-Bug: #1535749

Change-Id: Ibf3eadc95307e0c803ad9fa449578f8ca6f654d0
2016-02-04 15:11:24 +00:00
Jay S Bryant
5523e32dc8 Remove debug statement
We found in a recent review that one of my debug
print statements was accidentally let in an
earlier patch.  This patch removes my debug code.

Change-Id: I1d1baaed4362d499b1c141f0eba36dfe883d0e3a
2016-02-03 15:08:01 -06:00
Jenkins
bdeab3af0e Merge "CLI for backup snapshots" 2016-02-03 16:12:01 +00:00
Sheel Rana
7d1e4d9baf is_public=N/A in output of cinder type-update
In output of cinder type-update execution, is_public field
always displays N/A.
This is due to wrong usage of @property for is_public field
in code.

Change-Id: I1d76c3d5c937f5c16c668bd114e2df7dfc62f2f8
Closes-Bug: #1538412
2016-02-02 09:04:05 +00:00
Ankit Agrawal
ef151618e1 Return wrapper classes with request_ids attribute
Return appropriate wrapper classes with request_ids attribute from
base class.

Note:
In cinderclient/base.py->_update method will return None for
qos_specs->unset_keys method and for all other cases it returns body
of type dict. At few places, wherever the _update method is called,
it converts the return value back to the resource class and in all
other cases the same return value is returned back to the caller.
It's not possible to return request_ids with None so for all cases
object of DictWithMeta will be returned from this method. Second
approach would be to return (resp, body) tuple from _update method
and wherever this method is called, return the appropriate object.
These changes will affect v1 version and since v1 is already
deprecated the above approach sounds logical.

This change is required to return 'request_id' from client to log
request_id mappings of cross projects.

Change-Id: If73c47ae2c99dea2a0b1f25771f081bb4bbc26f1
Partial-Implements: blueprint return-request-id-to-caller
2016-01-28 23:19:57 -08:00
Cory Stone
b670b73e44 Pass insecure option to HTTPClient
This option was silently being ignored.

Closes-Bug: #1538648
Change-Id: I3a1b5268e87cbc9803924be95b374d76b72a3a5d
2016-01-27 15:11:41 -06:00
Ankit Agrawal
1619f11b9c Add Wrapper classes for list, dict, tuple
Added wrapper classes which are inherited from base data types list,
tuple and dict. Each of these wrapper classes contains a 'request_ids'
attribute which will be populated with a 'x-openstack-request_id'
received in a header from a response body.

This change is required to return 'request_id' from
client to log request_id mappings of cross projects.

Partial-Implements: blueprint return-request-id-to-caller
Change-Id: I3aadb4d8bf675e20f2094b66a23ac20f455a99eb
2016-01-24 22:53:27 -08:00
LisaLi
c18f9073a4 Fix sort problem in snapshot and backup list
The sort in command snapshot-list and backup-list
doesn't work, and they show same results.

The patch is to fix the problem, and transfer
sortby_index as None in utils.print_list.

Closes-Bug: #1536054

Change-Id: I00760fd4b395b04b95a8139224e18ea8d649d377
2016-01-20 08:53:38 +00:00
LiuNanke
d4aaafbd9f Keep py3.X compatibility for urllib
Use six.moves.urllib.parse instead of urllib.
For urllib2 compatibility, it need to sync policy
module from oslo first. Then six.moves.urllib.request
can replace urllib2.

Change-Id: Ia351cd3088dd64fd8c8ce4ca8b9a5889c574888e
Partial-Bug: #1280105
2016-01-14 02:22:53 +08:00
Ivan Kolodyazhny
ef7485df77 Change extension module naming to a shorter one
This patch changes extension suffix from 'python_cinderclient_ext' to
'cinderclient_ext' to get more shorter module names.

Change-Id: Id78e05646d2bc4fda758710eb630dca5eefa457f
2016-01-13 15:09:01 +02:00
Herman Ge
0e9e2849f6 Word Misspelling
Word misspelling in following message:

1. shell.py

help='A unqiue identifier that represents a failover target.'

2. volumes.py

:param secondary: A unqiue identifier that represents a failover

Should change the word 'unqiue' to 'unique'.

Change-Id: I44a94b403f0bb71864d03683bdaf3b98f4d73bb1
2016-01-11 10:30:36 -05:00
LiuNanke
c297309aff Replace assertTrue(isinstance()) by optimal assert
assertTrue(isinstance(A, B)) or assertEqual(type(A), B) in tests
should be replaced by assertIsInstance(A, B) provided by testtools.
Related-bug: #1268480

Change-Id: I755702d0f6e982d7cba173fbbdb86feb8ab384a0
2016-01-10 03:18:08 +08:00
huangtianhua
aa06b2dd54 Make _discover_extensions public
Heat wants to use
`cinderclient.shell.OpenStackCinderShell._discover_extensions`
function (https://bugs.launchpad.net/heat/+bug/1527071),
which is private currently. It's better to change this method
to public for public use.
This change will do it as novaclient did.

Change-Id: Iaaa4cab530fd495877e15a372fff1354ddbeaa17
Closes-Bug: #1527169
2016-01-06 01:30:46 +00:00
Jenkins
7476dbd8dc Merge "Add to_dict method to Resource class" 2016-01-05 21:15:49 +00:00
Jenkins
e22907a120 Merge "Set default service type to 'volumev2'" 2016-01-04 21:08:15 +00:00
Jenkins
fa18f8e171 Merge "Fix for 'quota-delete' call to API v2" 2015-12-31 20:08:06 +00:00
Ivan Kolodyazhny
1396308631 Set default service type to 'volumev2'
We are already use Cinder API v2 by default so it sould be consistent to
use 'volumev2' service type by default

Change-Id: I9f2da310f6ad53a40d476ede62369cc364371064
2015-12-29 16:56:10 +00:00
Jenkins
77fc5c1717 Merge "Fix help message in backup reset-state" 2015-12-23 23:45:02 +00:00
Jenkins
e01fd78458 Merge "Remove the mutable default arguments "[]"" 2015-12-23 18:18:50 +00:00
Jenkins
0b3afcc7d7 Merge "support for snapshot management" 2015-12-21 22:41:35 +00:00
LisaLi
35b5e6f4af Fix help message in backup reset-state
Refer the source code
https://github.com/openstack/cinder/blob/master/cinder/api/contrib/admin_actions.py#L367
backup reset-state only supports valid state as available and error.

Change-Id: I783e08170f4a2e56959918b62b424f43c1c93fb5
2015-12-21 15:11:44 +08:00
Shaojiang Deng
6305abbbf8 Remove the mutable default arguments "[]"
Remove the default arguments "[]" when the function is defined.

Ref: http://docs.python-guide.org/en/latest/writing/gotchas/

Change-Id: I92340596a6c9d1489b428b23adbfbddf2c5f4e59
2015-12-18 16:58:37 +08:00
Ivan Kolodyazhny
73f442380c Do not require functional_creds.conf for functional tests
Pass OS_* env variables for functional tests to use environment
variables if they are available instead of config file

Change-Id: Ic1b4752bf558c57974b5f2a4d5a45aee4a940bbb
2015-12-17 13:41:37 +02:00
Szymon Borkowski
f39a383ed9 Fix for 'quota-delete' call to API v2
Before, when API in cinderclient was set to v2, the issued call
used to fail with an error message, that the call is connecting
to the endpoint compatible to API v1, when other quota calls
were connecting to the proper, v2 enpoint.

Change-Id: I99a16e93ed15e3819d48d193b550c786012462d8
Closes-Bug: 1526829
2015-12-16 16:19:00 +01:00
wanghao
bb0f484898 Add to_dict method to Resource class
Many clients have to_dict method in Resource class.
It is needed to get full info about resource.
So it would be nice to add to_dict method in
cinder client too.

Now openstack/common has graduated from oslo-incubator.
So we just modify it cinderclient.

Changes merged with this patch:
---------------------
apiclient/base.py
  ---add to_dict function in class Resource.
unit/test_base.py
  ---add unit test case.

change-Id: I81add424bcdd667ba271adb7d5b1ceb504120f93
2015-12-14 16:27:21 +08:00
Sean McGinnis
423db4b32c Add reno for release notes management
Adopt reno for release notes like we have done for cinder.
One difference for the client is we will not be backporting
to Liberty per recommendation here [1].

[1] http://lists.openstack.org/pipermail/openstack-dev/2015-November/080694.html

Change-Id: Icb2520cfa249d104674eb42b5ac93a50a6ce34b4
2015-12-13 19:56:41 -06:00
Jenkins
24a8efcbde Merge "Add functional tests: backup creation and deletion" 2015-12-10 21:44:52 +00:00
Jenkins
484c6e3a9c Merge "Add optional argument to list subcommand" 2015-12-09 00:19:40 +00:00
Jenkins
b5f3675687 Merge "Fix comma location in comment" 2015-12-09 00:19:36 +00:00
Jenkins
bad3a09ba8 Merge "Remove ureachable code in fakes.py" 2015-12-08 22:07:47 +00:00
Jenkins
186dfb4165 Merge "Add the version attribute to the Client class" 2015-12-08 20:13:33 +00:00
Mitsuhiro Tanino
c38b35cb61 Add optional argument to list subcommand
Cinder list command was intended to show summary of
volumes, but currently the command shows many entries
than we expected.

This patch adds these two fixes to show volume list
more simply.

- Remove 'migration status' and 'multiattach' from
  default list view.

- Add '--field' optional argument to 'list' subcommand.
  This argument allows users to show only specified
  entries. Unavailable fields will be ignored from
  the list result.

DocImpact
Change-Id: Iad4bf76e87f84b6e57ec59d134b9413fcad16ce8
Closes-Bug: #1502639
2015-12-04 11:43:06 -05:00
wanghao
948e90010f support for snapshot management
Add support to manage/unmanage snapshot

cinder snapshot-manage volume identifier
option args is --id-type, --name, --description,
--metadata.

cinder snapshot-unmanage snapshot

DocImpact

Implements: blueprint support-for-snapshot-management
Change-Id: Id4d73fa0ff0c0c05c0c69924968aa2154da64118
2015-12-02 10:07:11 +08:00
Atsushi SAKAI
a2ccc85a73 Fix comma location in comment
comment message effects to CLI-reference message.

Change-Id: I6d76d6bc6077b4915aaa74968e294abbc3f72f30
2015-12-02 10:15:56 +09:00
Jenkins
7f9a81bb1b Merge "Adds v2 replication support" 2015-11-30 20:33:11 +00:00
Jenkins
37ea6acad7 Merge "Use oslo_utils encodeutils and strutils" 2015-11-27 22:58:42 +00:00
abhishekkekane
5626d8af58 Remove ureachable code in fakes.py
TrivialFix
Closes-Bug: #1520078

Change-Id: Ie406dc5f6a66db48e85ba9d0327fcf7ea73bc1f3
2015-11-25 22:38:46 -08:00
Alex O'Rourke
b8e118f5c2 Adds v2 replication support
v2 replication has been merged in cinder, but there is no way to call
the api methods. This patch allows the following methods to be called
in order to fully support v2 replication:
  - os-enable_replication
  - os-disable_replication
  - os-list_replication_targets
  - os-failover_replication

Change-Id: Ic3cf082916bdf089de05eebce456dff8cdc11f7c
Implements: blueprint replication-v2
2015-11-24 13:13:23 -08:00
Ryan McNair
294acfd5c4 Fix v2 qos-key command
As part of commit 0d2bf657ae5271a01e9ec84d379d17910b263b7e,
qos-key command's v2 support got broken again reintroducing
bug #1284321.

Change-Id: I30d60b060bd1b161bc96c4a529f4732b9ceef90d
Closes-Bug: 1284321
2015-11-24 17:01:54 +00:00