示例#1
0
def getregion(projectid, authorization, region):
    func_route = url_for('getregion', projectid=projectid, region=region)
    args = {'command': 'listRegions'}
    return controllers.get_item_with_name_or_error(authorization, region, args,
                                                   'region', func_route,
                                                   _cloudstack_account_to_gce,
                                                   **{})
示例#2
0
def getnetwork(projectid, authorization, network):
    func_route = url_for('getnetwork', projectid=projectid, network=network)
    args = {'command': 'listSecurityGroups'}
    kwargs = {}
    return controllers.get_item_with_name_or_error(
        authorization, network, args, 'securitygroup', func_route,
        _cloudstack_network_to_gce, **kwargs)
示例#3
0
def getzone(projectid, authorization, zone):
    func_route = url_for('getzone', projectid=projectid, zone=zone)
    args = {'command': 'listZones'}
    return controllers.get_item_with_name_or_error(authorization, zone, args,
                                                   'zone', func_route,
                                                   _cloudstack_zone_to_gce,
                                                   **{})
示例#4
0
文件: instances.py 项目: grze/gstack
def getinstance(projectid, authorization, zone, instance):
    func_route = url_for('getinstance', projectid=projectid, zone=zone, instance=instance)
    args = {'command': 'listVirtualMachines'}
    kwargs = {'projectid': projectid, 'zone': zone}
    return controllers.get_item_with_name_or_error(
        authorization, instance, args, 'virtualmachine', func_route,
        _cloudstack_virtual_machine_to_gce, **kwargs)
示例#5
0
def getdisk(projectid, authorization, zone, disk):
    func_route = url_for('getdisk', projectid=projectid, zone=zone, disk=disk)
    args = {'command': 'listVolumes'}
    kwargs = {'projectid': projectid, 'zone': zone}
    return controllers.get_item_with_name_or_error(authorization, disk, args,
                                                   'volume', func_route,
                                                   _cloudstack_volume_to_gce,
                                                   **kwargs)
def getmachinetype(projectid, authorization, zone, machinetype):
    func_route = url_for(
        'getmachinetype', projectid=projectid, zone=zone, machinetype=machinetype)
    args = {'command': 'listServiceOfferings'}
    kwargs = {'projectid': projectid, 'zone': zone}
    return controllers.get_item_with_name_or_error(
        authorization, machinetype, args, 'serviceoffering', func_route,
        _cloudstack_service_offering_to_gce, **kwargs)
示例#7
0
def getinstance(projectid, authorization, zone, instance):
    func_route = url_for('getinstance',
                         projectid=projectid,
                         zone=zone,
                         instance=instance)
    args = {'command': 'listVirtualMachines'}
    kwargs = {'projectid': projectid, 'zone': zone}
    return controllers.get_item_with_name_or_error(
        authorization, instance, args, 'virtualmachine', func_route,
        _cloudstack_virtual_machine_to_gce, **kwargs)
示例#8
0
def getmachinetype(projectid, authorization, zone, machinetype):
    func_route = url_for('getmachinetype',
                         projectid=projectid,
                         zone=zone,
                         machinetype=machinetype)
    args = {'command': 'listServiceOfferings'}
    kwargs = {'projectid': projectid, 'zone': zone}
    return controllers.get_item_with_name_or_error(
        authorization, machinetype, args, 'serviceoffering', func_route,
        _cloudstack_service_offering_to_gce, **kwargs)
示例#9
0
def getzone(projectid, authorization, zone):
    func_route = url_for('getzone', projectid=projectid, zone=zone)
    args = {'command': 'listZones'}
    return controllers.get_item_with_name_or_error(
        authorization, zone, args, 'zone', func_route,
        _cloudstack_zone_to_gce, **{})
示例#10
0
文件: images.py 项目: grze/gstack
def getimage(projectid, authorization, image):
    func_route = url_for('getimage', projectid=projectid, image=image)
    args = {'templatefilter': 'executable', 'command': 'listTemplates'}
    return controllers.get_item_with_name_or_error(
        authorization, image, args, 'template', func_route,
        _cloudstack_template_to_gce, **{})
示例#11
0
def getimage(projectid, authorization, image):
    func_route = url_for('getimage', projectid=projectid, image=image)
    args = {'templatefilter': 'executable', 'command': 'listTemplates'}
    return controllers.get_item_with_name_or_error(
        authorization, image, args, 'template', func_route,
        _cloudstack_template_to_gce, **{})
示例#12
0
def getregion(projectid, authorization, region):
    func_route = url_for('getregion', projectid=projectid, region=region)
    args = {'command': 'listRegions'}
    return controllers.get_item_with_name_or_error(
        authorization, region, args, 'region', func_route,
        _cloudstack_account_to_gce, **{})