Support retrieving shares filtered by export-location¶
Currently we can only filter the shares by share name, status, share type, extra specs, share server id, metadata, snapshot, host, share network, project id, and consistency group, but this is too limited for user’s various cases. Manila doesn’t support filtering the shares by export location. This spec intends to add the ability for Manila.
It’s a common use case to list NAS shares with filters, and Manila has the API to cover this, but it does not satisfy the situation when export location filter is desired. The main problem is that having export location we don’t have possibility to get to know which manila share owns it.
When user has a share that it has been mounted in VM, and user only knows the share export location path. User often wants to quickly filter a share by share export location in Manila. This change will help him achieve this.
The modified version of shares and share-instances list will be identical at the most part, except for the parts mentioned below:
A query parameter ‘export_location’ will be introduced to shares and share-instances list API (GET shares and GET shares/detail, GET share-instances and GET share-instances/detail).
In the API service, the export_location will be added in share and share instance search options. In Manila DB’s method, will add a new export location filter in SQLAlchemy API, and add a new logic which would filter all the shares or share instances with the export location.
The Manila client will also add one argument ‘–export_location’ to support this.
We could get share instance ID from share export location path, and use “share-instance-show <instance>” command to find out associated share.
Data model impact¶
REST API impact¶
The API microversion will have to be bumped up for the new APIs below.
Share and share-instances list API will accept new query string parameter ‘export_location’. Administrators can pass path and id of export_location to retrieve shares filtered.
Detailed share and share-instance list API will also accept new query string parameter ‘export_location’. Administrator can pass path and id of the export location to retrieve shares filtered.
The search will be among “allowed”, for user, shares - all his shares and public ones.
Manila client impact¶
Manila client will add a new parameter ‘–export_location <export-location>’ to command ‘list’, the modified version of command will be like:
* list --export_location <export-location> <other existing command arguments> * share-instance-list --export_location <export-location> <other existing command arguments>
Other end user impact¶
Other deployer impact¶
- Primary assignee:
Add ‘export_location’ parameter to ‘list’ collection.
Add related tests in Manila.
Add documentation in Manila.
Add new argument for command ‘list’ in Manila client.
Add related tests in Manila client.
Unit and tempest tests whether new API works correctly.
Manila client’s unit tests and functional tests on new added argument.
The Manila API documentation will need to be updated to reflect the REST API changes.