def get_zone(zone_name): args = {'name': zone_name, 'command': 'listZones'} response = cloudstack.describe_item_request( args, 'zone', errors.invalid_zone ) return response
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
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
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
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
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
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
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
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
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
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
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
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
def _get_security_group(args): args["command"] = "listSecurityGroups" response = cloudstack.describe_item_request(args, "securitygroup", errors.invalid_security_group) return response
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
def _get_security_group(args): args['command'] = 'listSecurityGroups' response = cloudstack.describe_item_request(args, 'securitygroup', errors.invalid_security_group) return response