Commit Graph

7 Commits

Author SHA1 Message Date
Stephen Finucane 8b148ebd41 db: Rename 'share_export_location_*' to 'export_location_*'
This better aligns with 'export_location_metadata_*' APIs. The plural
'export_locations_get*' APIs are renamed to 'export_location_get_all*'.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I14f2b834e7ac2d8be86f9d7e381706cadbb79eb8
2023-09-27 16:31:07 +01:00
Felipe Rodrigues a65dffc0c7 Fix Manila API error message
Some Manila error messages were wrongly returning the string marker
"%s" instead of the string content. This patch fixes them.

Closes-Bug: #2007060
Change-Id: Ib68f71e19f2ec1190cc431f029d996193008d557
2023-02-12 23:49:00 -03:00
haixin 03fea855d9 remove usage of six library in api layer
Replace six with Python 3 style code.

Change-Id: I091a45c04686ac8d036107618945fea65fb4a2cf
2021-12-22 10:08:11 +08:00
Tom Barron 84daeb481d Enforce policy checks for share export locations
Closes-bug: #1654598
Change-Id: I5f358266739f1c42343d5a0c5ec8109c8fcaac4d
2020-03-23 17:27:13 +00:00
Goutham Pacha Ravi fd23a6387c Use class name in invocation of super
Fix pylint E103 warning raised by usage of
self.__class__ to refer to the derived class
in super() methods.

self.__class__ is a reasonable first argument
to super() in any method of a class, as long
as the method is not going to be invoked in
derived classes.

Python3 removes this ambiguity by not requiring
arguments for the super() method.

[1] https://docs.pylint.org/en/1.6.0/features.html#id33

Change-Id: I6071b6cfd8cff2be3853d739f71b94da990cda97
2018-06-06 17:47:18 -07:00
Clinton Knight 55777cfb4e Update export location retrieval APIs
Update the export location retrieval APIs for shares and share
instances to do the following:

1. Restore the API-to-view-builder calling convention of
index-->summary and show-->detail. In so doing, modify which
values are returned by the list commands (currently, all but
the timestamps). The admin context from the request determines
whether the admin-only values are returned.

2. Report the UUID field from the export location table as
'id' to be consistent will all other objects returned via the
Manila REST API.

3. Add the preferred flag to the output of the API. Drivers
can report preferred:True or preferred:False in their export
location metadata, and this standard flag will be returned
via the REST interface, like this:

+-------------------+--------------------------------------+
| Property          | Value                                |
+-------------------+--------------------------------------+
| is_admin_only     | False                                |
| uuid              | df828d44-0b04-47fa-8ee5-516ffc199ca7 |
| share_instance_id | 1b40e873-331e-4e1c-ab53-38ec95b3bfcc |
| path              | 10.0.0.100:/share_1b40e873           |
| created_at        | 2016-02-18T21:12:51.000000           |
| updated_at        | 2016-02-18T21:12:51.000000           |
| preferred         | True                                 |
+-------------------+--------------------------------------+

APIImpact
Implements: blueprint update-export-location-retrieval-apis
Change-Id: Ia63477d4f3e28ab4f53d7b9d51756cc798c977b9
2016-03-02 09:32:28 -05:00
Valeriy Ponomaryov dcbdcf3534 Implement export location metadata feature
Some upcoming features require more than one export location and
possibility to mark them with specific labels like fast/slow or
rw/ro.

So, implement 'export locations metadata' feature:
- It allows to set any key-value pairs for each export location.
- These key-value pairs can be set only by share manager using
  response from various share driver methods.
- Example of update is implemented using Generic driver
  "create_instance" method.
- Metadata can be updated for any export location in any place
  of share manager where db function "share_export_locations_update"
  is called.
- Keys from export location metadata table will be added to 'share' and
  'share instances' views as export location attributes.

Also:
- Add new attr 'is_admin_only' for existing export locations model.
  If set to True, then only admins will be able to see them. Unless
  policy is changed.
- Add APIs for reading export locations by share and share instance IDs.
- Remove 'export_location' and 'export_locations' attrs
  from 'share' and 'share instance' views.
- Bump microversion as new APIs implemented.

APIImpact

Implements bp export-location-metadata

Change-Id: I36d1aa8d9302e097ffb08d239cf7a81101d2c1cb
2016-01-15 12:29:12 +02:00