def stop_instance()

in ec2stack/providers/cloudstack/instances.py [0:0]


def stop_instance():
    """
    Stop an instance.

    @return: Response.
    """
    helpers.require_parameters(['InstanceId.1'])
    instance_id = helpers.get('InstanceId.1')
    previous_state = describe_instance_by_id(instance_id)
    new_state = _stop_instance_request(instance_id)
    return _modify_instance_state_response(
        'StopInstancesResponse',
        previous_state,
        new_state
    )