def show_image(kwargs, call=None): """ Show the details of an image """ if call != 'function': raise SaltCloudSystemExit( 'The show_image action must be called with -f or --function.') name = kwargs['image'] log.info("Showing image %s", name) machine = vb_get_machine(name) ret = {machine["name"]: treat_machine_dict(machine)} del machine["name"] return ret
def stop(name, call=None): """ Stop a running machine. @param name: Machine to stop @type name: str @param call: Must be "action" @type call: str """ if call != 'action': raise SaltCloudSystemExit( 'The instance action must be called with -a or --action.') log.info("Stopping machine: %s", name) vb_stop_vm(name) machine = vb_get_machine(name) del machine["name"] return treat_machine_dict(machine)
def start(name, call=None): """ Start a machine. @param name: Machine to start @type name: str @param call: Must be "action" @type call: str """ if call != "action": raise SaltCloudSystemExit( "The instance action must be called with -a or --action.") log.info("Starting machine: %s", name) vb_start_vm(name) machine = vb_get_machine(name) del machine["name"] return treat_machine_dict(machine)
def show_image(kwargs, call=None): """ Show the details of an image """ if call != 'function': raise SaltCloudSystemExit( 'The show_image action must be called with -f or --function.' ) name = kwargs['image'] log.info("Showing image %s", name) machine = vb_get_machine(name) ret = { machine["name"]: treat_machine_dict(machine) } del machine["name"] return ret
def stop(name, call=None): """ Stop a running machine. @param name: Machine to stop @type name: str @param call: Must be "action" @type call: str """ if call != 'action': raise SaltCloudSystemExit( 'The instance action must be called with -a or --action.' ) log.info("Stopping machine: %s", name) vb_stop_vm(name) machine = vb_get_machine(name) del machine["name"] return treat_machine_dict(machine)