コード例 #1
0
ファイル: images.py プロジェクト: maduhu/cloudstack-gcestack
def listimages(projectid, authorization):
    args = {'templatefilter': 'executable', 'command': 'listTemplates'}
    items = controllers.describe_items(authorization, args, 'template',
                                       _cloudstack_template_to_gce, **{})

    populated_response = _create_populated_image_response(projectid, items)
    return helpers.create_response(data=populated_response)
コード例 #2
0
ファイル: images.py プロジェクト: grze/gstack
def listimages(projectid, authorization):
    args = {'templatefilter': 'executable', 'command': 'listTemplates'}
    items = controllers.describe_items(
        authorization, args, 'template',
        _cloudstack_template_to_gce, **{})

    populated_response = _create_populated_image_response(projectid, items)
    return helpers.create_response(data=populated_response)
コード例 #3
0
def listnetworks(projectid, authorization):
    args = {'command': 'listSecurityGroups'}
    kwargs = {}
    items = controllers.describe_items(
        authorization, args, 'securitygroup',
        _cloudstack_network_to_gce, **kwargs)

    populated_response = _create_populated_network_response(
        projectid,
        items
    )
    return helpers.create_response(data=populated_response)
コード例 #4
0
def listregions(projectid, authorization):
    args = {'command': 'listRegions'}
    kwargs = {}
    items = controllers.describe_items(authorization, args, 'region',
                                       _cloudstack_account_to_gce, **kwargs)

    populated_response = {
        'kind': 'compute#regionList',
        'id': 'projects/' + projectid + '/regions',
        'selfLink': request.base_url,
        'items': items
    }
    return helpers.create_response(data=populated_response)
コード例 #5
0
ファイル: disks.py プロジェクト: maduhu/cloudstack-gcestack
def listdisks(projectid, authorization, zone):
    args = {'command': 'listVolumes'}
    kwargs = {'projectid': projectid, 'zone': zone}
    items = controllers.describe_items(authorization, args, 'volume',
                                       _cloudstack_volume_to_gce, **kwargs)

    populated_response = {
        'kind': 'compute#imageList',
        'selfLink': urllib.unquote_plus(request.base_url),
        'id': 'projects/' + projectid + '/global/images',
        'items': items
    }

    return helpers.create_response(data=populated_response)
コード例 #6
0
def listsecuritygroups(projectid, authorization):
    args = {'command': 'listSecurityGroups'}
    items = controllers.describe_items(
        authorization, args, 'securitygroup',
        _cloudstack_securitygroup_to_gce, **{})

    populated_response = {
        'kind': 'compute#firewallList',
        'id': 'projects/' + projectid + '/global/firewalls',
        'selfLink': request.base_url,
        'items': items
    }

    return helpers.create_response(data=populated_response)
コード例 #7
0
ファイル: regions.py プロジェクト: apache/cloudstack-gcestack
def listregions(projectid, authorization):
    args = {'command': 'listRegions'}
    kwargs = {}
    items = controllers.describe_items(
        authorization, args, 'region',
        _cloudstack_account_to_gce, **kwargs)

    populated_response = {
        'kind': 'compute#regionList',
        'id': 'projects/' + projectid + '/regions',
        'selfLink': request.base_url,
        'items': items
    }
    return helpers.create_response(data=populated_response)
コード例 #8
0
def listinstances(authorization, projectid, zone):
    args = {'command': 'listVirtualMachines'}
    kwargs = {'projectid': projectid, 'zone': zone}
    items = controllers.describe_items(authorization, args, 'virtualmachine',
                                       _cloudstack_virtual_machine_to_gce,
                                       **kwargs)

    populated_response = {
        'kind': 'compute#instance_list',
        'id': 'projects/' + projectid + '/instances',
        'selfLink': request.base_url,
        'items': items
    }

    return helpers.create_response(data=populated_response)
コード例 #9
0
def listmachinetype(projectid, authorization, zone):
    args = {'command': 'listServiceOfferings'}
    kwargs = {'projectid': projectid, 'zone': zone}
    items = controllers.describe_items(
        authorization, args, 'serviceoffering',
        _cloudstack_service_offering_to_gce, **kwargs)

    populated_response = {
        'kind': 'compute#imageList',
        'selfLink': urllib.unquote_plus(request.base_url),
        'id': 'projects/' + projectid + '/global/images',
        'items': items
    }

    return helpers.create_response(data=populated_response)
コード例 #10
0
ファイル: instances.py プロジェクト: grze/gstack
def listinstances(authorization, projectid, zone):
    args = {'command': 'listVirtualMachines'}
    kwargs = {'projectid': projectid, 'zone': zone}
    items = controllers.describe_items(
        authorization, args, 'virtualmachine',
        _cloudstack_virtual_machine_to_gce, **kwargs)

    populated_response = {
        'kind': 'compute#instance_list',
        'id': 'projects/' + projectid + '/instances',
        'selfLink': request.base_url,
        'items': items
    }

    return helpers.create_response(data=populated_response)