Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #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)
Beispiel #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)
Beispiel #5
0
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)
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)
Beispiel #7
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)
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)
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)
Beispiel #10
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)