Add support share Recycle Bin, the end user can soft delete
share to Recycle Bin, and can restore the share within 7 days,
otherwise the share will be deleted automatically.
DocImpact
APIImpact
Partially-Implements: blueprint manila-share-support-recycle-bin
Change-Id: Ic838eec5fea890be6513514053329b1d2d86b3ba
if we failed to manage a share, we don't need to commit the quota usages. so
we should skip quota usages cuts when delete or unmange the share with
status of "error_manage". and the size of error_manage share should be
zero.
Closes-Bug:#1883506
Change-Id: I5c81dd6780890c55c8c6a92491c3f4f507531fdb
This patch adds Manage/Unmanage of share servers in
Manila. It also updates the Manage Share API to accept
a "share_server_id" parameter, and updates Unmanage
of Share and Snapshots API to allow unmanaging of
shares and snapshots in DHSS=True.
Managed share servers are not deleted automatically
by manila, and if a single share is unmanaged in
DHSS=True, the respective share server will not be
deleted automatically as well.
Managing share servers require that the driver
implements 2 functions:
- get_share_server_network_info: obtain IPs from
share server.
- manage_server: perform required operations to
manage and return dict of backend_details.
Unmanaging share servers require that the driver
overrides unmanage_server function.
The IPs obtained from the backend are validated
by the Network plugin, so ports with the exact
IPs must exist in the subnet and admin subnet
associated with the share network specified
when managing the share server (unless
StandaloneNetworkPlugin is used).
It is recommended to rename the backend resource
if possible when managing the share server, to
prevent issues with re-managing a share server
that has already been managed.
This patch bumps the API microversion to 2.49.
APIImpact
DocImpact
Depends-On: I17c74b2aa242918188eeff368232c762a4b31093
Partially-implements: bp manage-unmanage-with-share-servers
Change-Id: I108961e7436ba13550ef2b8f02079c6e599a6166
Managing a share with a share type that has replication_type
extra_spec must be allowed. Drivers are expected to fail
this operation if the share was part of a replication relationship
that Manila does not know about.
Unmanaging a share with replicas must not be permitted
until all replicas are removed.
Managing and unmanaging of snapshots must not
be permitted for a share that has replicas.
Modify the NetApp driver for manage_existing to check
for existing replicas.
Also fix issue with manage retry where the share
data was being altered inappropriately by a DB API.
Closes-Bug: #1561641
Closes-Bug: #1565903
Co-Authored-By: Goutham Pacha Ravi <gouthamr@netapp.com>
Change-Id: I82f1fef1e30114e017efd00fa7da70aceecab94c
The API code emits a ton of deprecation warnings from the view builder
code using deprecated properties on the share DB object which proxies
to the share instance, so this changes the code to use the share.instance
property instead.
Note that since the tests are mocking out the share as a dict in a lot of
places, we have to handle accessing the instance as a dict entry rather
than an attribute on a sqlalchemy object. Because of this, the wrapper
class in the stubs module needed to be updated to actually work like a
dict container. This is done by extending the abstract base class
collections.Mapping and overriding the update method. Now the runtime
code can access attributes on the share like a dict (which old tests are
still using outside of the stubs module) or an attribute like would be
the case with the sqlalchemy object.
Partial-Bug: #1510507
Change-Id: I114b67dfeef0f46022230f91c6807a69ea9175a2
Almost every API method written in Manila performs
a policy check against relevant policies in etc/policy.json.
A method - authorize() was introduced in
manila/api/openstack/wsgi.py
in commit e4428f5e6c
to perform these policy checks.
This patch refactors the authorize() method as a decorator
for consistency and easy usage in APIs that choose to
implement the policy check prior to any core logic.
Prior unit tests are modified for the APIs impacted through
this change.
The Cgsnapshots controller's policies are corrected for
name consistency without impacting behavior.
Change-Id: Ib34e166ab65513f8f02215c6569175fc9a913244
Closes-Bug: #1515397
Changes:
- Register manage/unmanage API extension as core API using old links.
- Remove extensions code.
- Leave rename of API urls for future update which will be done with
bump of microversion after port of all extensions to core API.
Partially implements bp ext-to-core
Change-Id: I773398f13f4b3e4637599cb482a5a2c189958656