All python modules in "manilaclient/v1" override v2 modules with v2 modules
and v1 modules do not provide APIs at all. So, fix those imports and add
test coverage.
Change-Id: I24835745d028fa50252207cb02304e73657696e5
Closes-Bug: #1535692
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
"Export Locations" is a plural field. As discussed,
"list" operation should not show "export locations" anymore.
Hence, removed displaying of it in default mode of list operation.
Still, it can be displayed, if specified explicitly, with --columns,
wherein a string of comma separated column names can be given.
Change-Id: I4ae0cd3760088f1982301aa6f23a5c2d40be2455
Closes-Bug: #1438365
Manila has API to enable or disable its services for long time.
Since fork from Cinder. But manilaclient does not have support for it.
So, add it.
Change-Id: I797e2e4201ba5d2d85d397834aeb0bee5e4240f5
Closes-Bug: #1499247
Keystone is used for authentication in Manila and the latter's
client does not support latest version of it that exists for long time.
So, add support of Keystone v3 API and make Manila client to use it
at first priority if it is available.
Change-Id: I3e2f505f46f7ab60c66bcb0b1d65a38bea602df4
Closes-Bug: #1499260
Change 'class-name' argument to 'class_name' to avoid
AttributeError.
Add alias '--share_network' to command-line args.
Add argument 'snapshot_gigabytes' to 'update' function of
QuotaClassSetManager.
Closes-bug: #1498457
Change-Id: Ifbf1d8391c8b3cccaa0b20990133d4a68818d811
Manilaclient ignores --os-region-param now. Change client from
'manilaclient/v1/client.py' to use first endpoint with a matching region.
Closes-bug: #1450613
Change-Id: I7fd76b0d874a91952513c40b4a7bdb0c45241dad
For the moment, share can not be neither created with CG nor deleted
if belongs to some CG.
So, add experimental header to 'share create' operation to fix
the former case and update 'delete share' operation to make it support
deletion of shares that belongs to CG in general.
Change-Id: I497a9ab845552fd7e0d66e7352d637c6a86082af
Closes-Bug: #1496518
Closes-Bug: #1497215
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
Added Share Migration CLI entry point to Manila Client,
use the following command:
"manila migrate <share> <host#pool> [--force-host-copy]"
The force-host-copy parameter forces Generic Migration approach,
bypassing driver optimization migration if present.
Please note that the above command is an admin only command.
Implements: blueprint share-migration-client
Change-Id: I00b51106b1736559b40d101d6d3609db84f8635d
Depends-On: I8dde892cb7c0180b2b56d8c7d680dfe2320c2ec7
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
On last midcycle meetup was decided to make snapshots optional feature.
So, add following features:
- Allow to setup 'snapshot_support' extra spec in share type creation
request. Make it optional key with default 'True' value.
- Display this extra spec with 'type list' command as part of 'optional'
extra specs.
Change-Id: Id8e11b591a713654f7237cb1b66aeeaebfbf5871
Implements blueprint snapshots-optional
It is impossible to unset some value from security service if it was set.
Allow user to set security service params (dns_ip, server, domain,
user, password, name, description) to empty value.
Closes-bug: #1446696
Change-Id: Ifea8f49b2007358565686f90a5d56476c4913c86
It is impossible to unset some value from share network if it was set.
Allow user to set share network params (name, description, neutron_net_id,
neutron_subnet_id) to empty value.
Closes-bug: #1446695
Change-Id: I43315d49a3b721db9619812656702c1865155338
This change makes the extra spec "spec_driver_handles_share_servers"
required for the type-create command in the Manila Client as opposed
to being listed as an optional argument that was in fact required. I
had to remove a no longer valid test case in the unit test suite,
but it was done because instead of throwing an exception, the
argparser will just exit(2).
Change-Id: I0dc58cdfe10493a8eb736fa1bd0cd196bb0f5c05
Closes-Bug: #1484156
Implement API method and shell command for shrinking
shares:
"manila shrink <share-id> <new-size>"
Change-Id: I46890171174541b5392cfbabee53ad044041ae68
Implement API method and shell command for extending
shares similar to Cinder:
"manila extend <share-id> <new-size>"
Change-Id: I1fadd514de4d9ae000cf0921262edd2bb111f5c5
Currently user can specify only 'input_auth_token' parameter
and get attribute error in the client. To fix this issue we should
validate that user provides both arguments: 'input_auth_token'
and 'service_catalog_url'.
Change-Id: Ie783f1d7e091138671c54be899ca84c6a28c9f9b
Closes-Bug: #1439683
Modules 'manilaclient.v1.shares' and 'manilaclient.v1.share_snapshots' have
improper docstrings for various methods about expected parameters.
So, update them. Also make some improvements to handling of these parameters
that make various method consistent with each other about same parameters.
Add unit test coverage to updated methods.
Change-Id: I634de686f400b5df257c33e25c948ea509110e01
Closes-Bug: #1439690
- Add ShareTypeAccessManager to client
- Add type-access-list, type-access-add, type-access-remove
shell commands
- Add additional parameters to type-add and type-list commands
- Add appropriate unit tests
Implementation details and unit tests were mostly adapted
from Cinder and Nova access extensions.
Change-Id: Iaef80b85d413d7e7bb27ebd5cccae6bea30cb446
Add new param '--public' to 'manila list' which would allow user
to list public shares from all projects along with shares for current project.
Rename 'manila rename' to 'manila update'. Add '--public' param to 'manila create'
and 'manila update'.
Add unit tests.
Implements bp level-of-visibility-for-shares
Change-Id: I69aafa32754f037f573b73e79d9cb6a6084d165e
The pools feature of Manila core added an API to list existing
pools, needed by a few admin-only features such as manage/unmanage.
But like Cinder, no CLI command was added to provide easy access
to the feature. This is rectified in this patch with a pool-list
command and associated unit and functional tests.
Closes-Bug: #1422043
Change-Id: I4613feafa4ca79400a7419be488252b3324cc231
This workaround is not required any more, because
appropriate change already have merged to manila.
Change-Id: Ifdad13c047de07d85078fe86f8c9bc3f8d2130ec
Manage share functionality adds possibility to add existing
shares to manila. On other hand unmanage functionality adds
possibility to remove share from manila, but without physical
removal from share backend.
- Add manage() and unmanage() methods to share manager
- Add manage and unmanage shell commands
- Add appropriate unit tests.
Partially implements bp manage-shares
Change-Id: I7f8c4cbea6b699c468a8e85104cbe4111f796eb1
The access-allow CLI command should accept backslash characters so
that one may enter a Windows domain user, such as MYDOMAIN\Administrator.
This must also be fixed in the server.
Change-Id: I55be8a54feac011a5e573b25c484ac5a6494d2a0
Closes-Bug: #1426100
Currently, the driver_handles_share_servers is an optional extra_spec
on each share_type that allows the scheduler to filter. We want to
make this a required extra spec, so that every share type has this
value set to true or false. It's not be possible to remove that extra
spec. Modifying the extra spec is allowed as long as the value
remains either true or false.
- Add required argument "spec_driver_handles_share_servers" to
"type_create" command
- Add column "required_extra_specs" to columns printed by command
"type-list"
- Change title of column "extra_specs" to "all_extra_specs" in
"extra-specs-list" command
- Add appropriate unit tests
Partially implements bp share-type-require-driver-mode
Change-Id: I9bd3855e8a51159cf5ccc282bcbef688f7268e5e
In most cases ShareType resource already has all needed data,
that's why get_keys() do redundant calls to API.
Change-Id: I280c8919c29a19767d8bc0b5b9c1f217628b7357
Currently python-manilaclient doesn't support keystone sessions
unlike to others clients. keystoneclient.session.Session gives
end-user possibility to share common authentication and request
parameters between a variety of services.
- Add python-keystoneclient to requirements.txt
- Move authentication logic to v1/client.py
- Move HttpClient to separate module
- Simplify SecretsHelper in shell.py
- Replace service_catalog module by keystoneclient.service_catalog
- Add appropriate unit tests
Implements bp add-keystone-session-support
Change-Id: I7d1c50fa31d9e2f32bb518a78a02bc12b114d0ab
This change renames support for volume_type to share_type.
The manila client will send data to Manila API using share_type, but
passes both share_type and volume_type values returned from API call to users
of the python binding; however, CLI output will only print the value of
share_type. This change ensures that --volume-type (and its other
permutations) are aliases of --share-type, thus providing backwards
compatibility for command line arguments of the shell.
Change-Id: Id40eea27c2c5b44e1d01c061a48e1658ba800f43
Add new option 'access_level' to manilaclient's access-allow function.
Manila API of share access should allow user to choose one of the following
access modes: 'ro' and 'rw'.
Add new field 'access_level' to result of 'access-list' function.
Fix unit tests and add new ones.
Implements bp level-of-access-for-shares
Change-Id: I96bf7a1b8a8fe9013d0c8b6e63d312a2134bd3e0