Coverage for manila/api/v1/share_snapshots.py: 100%

20 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2026-02-18 22:19 +0000

1# Copyright 2013 NetApp 

2# All Rights Reserved. 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); you may 

5# not use this file except in compliance with the License. You may obtain 

6# a copy of the License at 

7# 

8# http://www.apache.org/licenses/LICENSE-2.0 

9# 

10# Unless required by applicable law or agreed to in writing, software 

11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 

12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 

13# License for the specific language governing permissions and limitations 

14# under the License. 

15 

16"""The share snapshots api.""" 

17 

18from oslo_log import log 

19 

20from manila.api.openstack import wsgi 

21from manila.api.v2 import share_snapshots 

22from manila.api.views import share_snapshots as snapshot_views 

23from manila import share 

24 

25LOG = log.getLogger(__name__) 

26 

27 

28class ShareSnapshotsController( 

29 share_snapshots.ShareSnapshotMixin, wsgi.Controller, 

30 wsgi.AdminActionsMixin 

31): 

32 """The Share Snapshots API controller for the OpenStack API.""" 

33 

34 resource_name = 'share_snapshot' 

35 _view_builder_class = snapshot_views.ViewBuilder 

36 

37 def __init__(self): 

38 super(ShareSnapshotsController, self).__init__() 

39 self.share_api = share.API() 

40 

41 @wsgi.action('os-reset_status') 

42 def snapshot_reset_status_legacy(self, req, id, body): 

43 return self._reset_status(req, id, body) 

44 

45 @wsgi.action('os-force_delete') 

46 def snapshot_force_delete_legacy(self, req, id, body): 

47 return self._force_delete(req, id, body) 

48 

49 

50def create_resource(): 

51 return wsgi.Resource(ShareSnapshotsController())