コード例 #1
0
ファイル: zones.py プロジェクト: maduhu/ec2stack
def get_zone(zone_name):
    args = {'name': zone_name, 'command': 'listZones'}
    response = cloudstack.describe_item_request(
        args, 'zone', errors.invalid_zone
    )

    return response
コード例 #2
0
ファイル: disk_offerings.py プロジェクト: vogxn/ec2stack
def get_disk_offering(disk_name):
    args = {'name': disk_name, 'command': 'listDiskOfferings'}
    response = cloudstack.describe_item_request(
        args, 'diskoffering', errors.invalid_disk_offering_name
    )

    return response
コード例 #3
0
def describe_image_by_id(image_id):
    args = {
        'id': image_id,
        'templatefilter': 'executable',
        'command': 'listTemplates'}
    response = cloudstack.describe_item_request(
        args, 'template', errors.invalid_image_id
    )
    return response
コード例 #4
0
def describe_instance_by_id(instance_id):
    """
    Describe an instance by Id.

    @param instance_id: Id of the instance.
    @return: Response.
    """
    args = {'id': instance_id, 'command': 'listVirtualMachines'}
    response = cloudstack.describe_item_request(args, 'virtualmachine',
                                                errors.invalid_instance_id)
    return response
コード例 #5
0
def get_zone(zone_name):
    """
    Get the zone with the specified name.

    @param zone_name: The name of the zone to get.
    @return: Response.
    """
    args = {'name': zone_name, 'command': 'listZones'}
    response = cloudstack.describe_item_request(args, 'zone',
                                                errors.invalid_zone)

    return response
コード例 #6
0
def _get_security_group(args):
    """
    Get the security group with the specified name.

    @param args: Arguments to pass to request.
    @return: Response.
    """
    args['command'] = 'listSecurityGroups'
    response = cloudstack.describe_item_request(args, 'securitygroup',
                                                errors.invalid_security_group)

    return response
コード例 #7
0
def get_disk_offering(disk_name):
    """
    Get the disk offering with the specified name.

    @param disk_name: Name of the disk offering to get.
    @return: Response.
    """
    args = {'name': disk_name, 'command': 'listDiskOfferings'}
    response = cloudstack.describe_item_request(
        args, 'diskoffering', errors.invalid_disk_offering_name)

    return response
コード例 #8
0
ファイル: instances.py プロジェクト: ninetian/ec2stack
def describe_instance_by_id(instance_id):
    """
    Describe an instance by Id.

    @param instance_id: Id of the instance.
    @return: Response.
    """
    args = {'id': instance_id, 'command': 'listVirtualMachines'}
    response = cloudstack.describe_item_request(
        args, 'virtualmachine', errors.invalid_instance_id
    )
    return response
コード例 #9
0
def _get_security_group(args):
    """
    Get the security group with the specified name.

    @param args: Arguments to pass to request.
    @return: Response.
    """
    args['command'] = 'listSecurityGroups'
    response = cloudstack.describe_item_request(
        args, 'securitygroup', errors.invalid_security_group
    )

    return response
コード例 #10
0
def get_disk_offering(disk_name):
    """
    Get the disk offering with the specified name.

    @param disk_name: Name of the disk offering to get.
    @return: Response.
    """
    args = {'name': disk_name, 'command': 'listDiskOfferings'}
    response = cloudstack.describe_item_request(
        args, 'diskoffering', errors.invalid_disk_offering_name
    )

    return response
コード例 #11
0
ファイル: zones.py プロジェクト: BillTheBest/ec2stack
def get_zone(zone_name):
    """
    Get the zone with the specified name.

    @param zone_name: The name of the zone to get.
    @return: Response.
    """
    args = {'name': zone_name, 'command': 'listZones'}
    response = cloudstack.describe_item_request(
        args, 'zone', errors.invalid_zone
    )

    return response
コード例 #12
0
def describe_image_by_id(image_id):
    """
    Describe an image by Id.

    @param image_id: Id of the image.
    @return: Response.
    """
    args = {
        'id': image_id,
        'templatefilter': 'executable',
        'command': 'listTemplates'}
    response = cloudstack.describe_item_request(
        args, 'template', errors.invalid_image_id
    )
    return response
コード例 #13
0
ファイル: disk_offerings.py プロジェクト: maduhu/ec2stack
def get_disk_offering(disk_name):
    args = {'name': disk_name, 'command': 'listDiskOfferings'}
    response = cloudstack.describe_item_request(
        args, 'diskoffering', errors.invalid_disk_offering_name)

    return response
コード例 #14
0
ファイル: security_groups.py プロジェクト: vogxn/ec2stack
def _get_security_group(args):
    args["command"] = "listSecurityGroups"
    response = cloudstack.describe_item_request(args, "securitygroup", errors.invalid_security_group)

    return response
コード例 #15
0
ファイル: instances.py プロジェクト: maduhu/ec2stack
def describe_instance_by_id(instance_id):
    args = {'id': instance_id, 'command': 'listVirtualMachines'}
    response = cloudstack.describe_item_request(
        args, 'virtualmachine', errors.invalid_instance_id
    )
    return response
コード例 #16
0
ファイル: security_groups.py プロジェクト: maduhu/ec2stack
def _get_security_group(args):
    args['command'] = 'listSecurityGroups'
    response = cloudstack.describe_item_request(args, 'securitygroup',
                                                errors.invalid_security_group)

    return response