14 Commits

Author SHA1 Message Date
Valeriy Ponomaryov
8c2f3c3a9b Define experimental API header on python client level instead of CLI
For the moment we cannot use experimental APIs using "python" client.
It is possible only if we use shell client (CLI).
It means, we cannot use "share replication", "share migration" and
"consistency groups" APIs of python manilaclient from other apps
such as Manila UI. So, add special experimental header on python
client level instead of CLI.

Change-Id: I6eed5dcfd1cb309817e083856b40e10cc6f970f6
Closes-Bug: #1599586
2016-07-13 18:42:39 +03:00
nidhimittalhada
3a7609d8fa manila list --all-tenants should display projectID
Both 'manila list --all-tenants' and 'manila list --public'
should show column Project ID. Project/Tenant ownership of
shares is vital information, e.g. when working with project
quota allocations.

'manila list' doesn't show public shares of other projects.
Without '--all-tenants' and without '--public' the result
is scoped to the project/tenant of the user issuing the command.
So, it would be redundant to display a column for this.

Same fix has been put for snapshot-list --all-tenants too.

DocImpact
Change-Id: I7afae542c391041d48c28e268ab59c83447bb940
Closes-Bug: #1570085
2016-06-23 13:30:04 +00:00
Daniel Gonzalez
0cf64700c3 Handle error for missing minor api version
Change the api version regex to forbid empty minor versions,
thereby ensuring that manilaclient raises an UnsupportedVersion
exception as one would expect in this case.

Change-Id: I93268b15ec0b5ee95ea3599bb75bf6fa364e0b91
Closes-Bug: #1590409
2016-06-10 13:51:49 +02:00
Chuck Fouts
8143f7aa1c UnsupportedVersion Thrown for Supported Version
If the maximum client version is higher than the maximum server version,
but the server version is otherwise valid, an UnsupportedVersion
exception is thrown. This bug fixes this issue by downgrading the
requested version, during API version discovery, from the maximum
client version to the maximum server version. The maximum server version
must be supported by the client. If all conditions are properly met the
client will continue to use the maximum server version for the remainder
of the request.

In order to log that the client version is being downgraded to match
the server version, when using the --debug flag, it was necessary to
update the logging configuration. Logging can now be used anywhere in
manilaclient as needed.

Change-Id: I96d273071966d2dc63de40c6f1b777fbb34a50fa
Closes-Bug: 1559290
2016-03-30 17:59:23 +00:00
Rodrigo Barbieri
110c505e11 Added new CLI commands for Share migration
- Notify parameter on Migrate Share (for 1-phase migration)
- Cancel migration (only during copying)
- Reset Task State field
- Get Migration Progress (only during copying)
- Complete Migration (2nd phase migration)

Implements: blueprint data-service-migration-api
Depends-On: I1d65aac2f36942cd70eb214be561d59a15a4ba26
Change-Id: I468c866b563598871692d25acfd98751c76d46f9
2016-03-03 15:53:39 -03:00
Clinton Knight
00e359f953 Support preferred export locations in Manila CLI
This patch displays the preferred flag for share export
locations, adjusts the other values displayed for export
locations to match the updated summary views from the server,
and updates the minimum microversion to match the server.

Change-Id: I40b236b38a97146dfb6aa2b7f20648c5e1ffa81c
Implements: blueprint update-export-location-retrieval-apis
2016-03-02 13:59:05 -05:00
cFouts
e4b4296083 Client Support for Manila Share Replication
Add a new resource class called ShareReplicas
to support the new Manila API calls.

Add commands to create, delete, list, show,
promote, resync, reset-state, reset-replica-state
and force-delete share replicas.

Co-Authored-By: Goutham Pacha Ravi <gouthamr@netapp.com>

Implements: blueprint manilaclient-share-replication

Change-Id: Ibb9802a80ffd78ef5c80782396b14bea11a6282a
2016-02-29 00:57:41 +00:00
Valeriy Ponomaryov
17f9908ce2 Add support of export location metadata feature
Add support of new Manila APIs for listing share and share instance
export locations. CLI looks like following:

$ manila share-export-location-list %share_id%
$ manila share-export-location-show %share_id% %el_uuid%

$ manila share-instance-export-location-list %si_id%
$ manila share-instance-export-location-show %si_id% %el_uuid%

Change-Id: I6ae57cb1fc1551e4d87658a16550f052d14641a0
Depends-On: I36d1aa8d9302e097ffb08d239cf7a81101d2c1cb
2016-02-02 12:45:31 +02:00
devin
ca9e0ab060 Replace deprecated LOG.warn with warning
Change-Id: I3bbc6cedf5e3de02b90f94317f30f5c8705990ce
2016-01-08 09:21:03 +08:00
nidhimittalhada
5f8ac35f99 API 'manage' can set share attr 'is_public'
This fix allows manila-manage command to explicitly
set visibility (key '--public') similar to using API
"create".
Depends-On: I8725719b8c7ff5557fa20ebbb5314f3e770ffcc0

Change-Id: I4e9be0a9c2168ab6c89a0d0e1c281e4a05a05c6b
Closes-Bug: #1436865
2015-12-10 11:12:35 +05:30
Valeriy Ponomaryov
28263b936d Add support of new API URLs after port of extensions to core API
Make manilaclient support API URLs and actions rename after port of
extensions to core API.

Depends-on: I82f00114db985b4b3bf4db0a64191559508ac600

Implements bp ext-to-core

Change-Id: I44f71ca094f230f3c22ade241884a1b23865c81a
2015-11-17 19:37:56 +02:00
cFouts
c34e3b7d2c Nova Style API Version Support for Client
The Manila client needs the following changes to support microversions:

*   Maintain backwards compatibility with Kilo. When the client detects
    that the server doesn't support microversions it will fall back to
    using the v1 API.
*   The --os-share-api-version option supports overriding the version.
*   If 1.0 is specified as the version the client will load the v1
    client and use the server's v1 API.
*   The client will send a request for the server's API version and
    determine if the client's supported versions and the server's
    supported versions overlap. If not the client will display an error
    and quit. See diagram 1 below.
*   The client supports the @wraps annotation. The annotation is used
    with the v2/shell.py commands and any class that inherits from
    the Manager class in manilaclient/base.py.
*   If an appropriate command version isn't found for commands using
    @wraps then the client will display an error and quit.

following commit: ab49d645befd04c84272f0d24e1b604012d191dd.

Diagram 1:
  Client:
         2.5           2.8
          |-------------|

  Server1:
     2.0           2.5
      |-------------|
     Client uses version 2.5

  Server2:
               2.7           2.10
                |-------------|
               Client uses version 2.8

  Server3:
                  2.9           2.12
                   |-------------|
                  Client displays error and quits

  Server4:
     1.0 (Kilo Server)
      |-|
     Client detects pre-microversion server and loads v1 client

Example usage of wraps annotation:
*   Support 2.0 - 2.4: @api_versions.wraps("2.0", "2.4")
*   Support 2.5 - latest: @api_versions.wraps("2.5")

Implements: blueprint manila-client-advanced-microversion-support

Change-Id: I3733fe85424e39566addc070d42609e508259f19
2015-11-16 19:03:55 +00:00
cFouts
556b5a65e9 Add consistency group support to manila client
Adds support for recently implemented Manila features:
    * consistency groups
    * consistency group snapshots

Enables the client to support newly available APIs which support create,
update, read, and delete operations for consistency groups and
consistency group snapshots.

Implements bp: manila-client-consistency-groups

Change-Id: Ia2760156ab289f127fd7411a7b9a13a371f5129c
2015-09-15 15:12:18 +00:00
cFouts
36384fa190 Manila REST API Microversion Support for Client
Manila client needs to provide 'X-Openstack-Manila-Api-Version' in the
HTTP request header along with the appropriate version. Manila client
also needs to provide 'X-OpenStack-Manila-API-Experimental' in the HTTP
request header for APIs that are marked as experimental. This is a
temporary fix until Manila client can support Nova style microversions.

Closes-bug: #1489450

Change-Id: I6344dfa6d272f0e813a4873c015be614ebeb4e7e
2015-09-01 21:01:18 +00:00