Example #1
0
# See the License for the specific language governing permissions and
# limitations under the License.
# =========================================================================

from oslo_log import log as logging
import webob

from nova.api.qingcloud_openstack import extensions
from nova.api.qingcloud_openstack import wsgi
from nova.api.qingcloud_openstack import qingcloud_api
from nova.i18n import _



LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('compute', 'floating_ips')


#def _translate_floating_ip_view(floating_ip):
#    result = {
#        'id': floating_ip['id'],
#        'ip': floating_ip['address'],
#        'pool': floating_ip['pool'],
#    }
#    try:
#        result['fixed_ip'] = floating_ip['fixed_ip']['address']
#    except (TypeError, KeyError, AttributeError):
#        result['fixed_ip'] = None
#    try:
#        result['instance_id'] = floating_ip['fixed_ip']['instance_uuid']
#    except (TypeError, KeyError, AttributeError):
Example #2
0
import webob
from webob import exc

from nova.api.qingcloud_openstack import common
from nova.api.qingcloud_openstack import extensions
from nova.api.qingcloud_openstack import wsgi
from nova import compute
from nova import exception
from nova.i18n import _
from nova.i18n import _LI
from nova import objects
from nova import volume
import qingcloud.iaas

LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('compute', 'volumes')

authorize_attach = extensions.extension_authorizer('compute',
                                                   'volume_attachments')

conn = qingcloud.iaas.connect_to_zone(
    'gd1',
    'ABPWUVSJGOOZENGPOJSL',
    'fMsZTpw0CbXGqdsgwTv6BvdhRFUqpgCQgbdCKS6k'
)


def _translate_volume_detail_view(context, vol):
    """Maps keys for volumes details view."""

    d = _translate_volume_summary_view(context, vol)