python-manilaclient/manilaclient/v2/share_instance_export_locations.py
ChangBo Guo(gcb) c8bb1a2755 Remove copy of incubated Oslo code
The Oslo team has moved all previously incubated code from the
openstack/oslo-incubator repository into separate library repositories
and released those libraries to the Python Package Index. Many of our
big tent project teams are still using the old, unsupported, incubated
versions of the code. The Oslo team has been working to remove that
incubated code from projects, and the time has come to finish that work.

As one of community-wide goals in Ocata, please see:
https://github.com/openstack/governance/blob/master/goals/ocata/remove-incubated-oslo-code.rst

Note: This commit also fix pep8 violations.
Change-Id: I03288adb94c702d1d63df88ef9ba33a2ff59eaa3
2016-09-28 10:06:45 +08:00

55 lines
2.0 KiB
Python

# Copyright 2015 Mirantis inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from manilaclient import api_versions
from manilaclient import base
from manilaclient.common.apiclient import base as common_base
class ShareInstanceExportLocation(common_base.Resource):
"""Resource class for a share export location."""
def __repr__(self):
return "<ShareInstanceExportLocation: %s>" % self.id
def __getitem__(self, key):
return self._info[key]
class ShareInstanceExportLocationManager(base.ManagerWithFind):
"""Manage :class:`ShareInstanceExportLocation` resources."""
resource_class = ShareInstanceExportLocation
@api_versions.wraps("2.9")
def list(self, share_instance):
"""List all share export locations."""
share_instance_id = common_base.getid(share_instance)
return self._list(
"/share_instances/%s/export_locations" % share_instance_id,
"export_locations")
@api_versions.wraps("2.9")
def get(self, share_instance, export_location):
"""Get a share export location."""
share_instance_id = common_base.getid(share_instance)
export_location_id = common_base.getid(export_location)
return self._get(
("/share_instances/%(share_instance_id)s/export_locations/"
"%(export_location_id)s") % {
"share_instance_id": share_instance_id,
"export_location_id": export_location_id,
},
"export_location")