def request_pause(liveaction, requester):
    """
    Request pause for a running action execution.

    :return: (liveaction, execution)
    :rtype: tuple
    """
    # Validate that the runner type of the action supports pause.
    action_db = action_utils.get_action_by_ref(liveaction.action)

    if not action_db:
        raise ValueError(
            'Unable to pause liveaction "%s" because the action "%s" '
            "is not found." % (liveaction.id, liveaction.action)
        )

    if action_db.runner_type["name"] not in action_constants.WORKFLOW_RUNNER_TYPES:
        raise runner_exc.InvalidActionRunnerOperationError(
            'Unable to pause liveaction "%s" because it is not supported by the '
            '"%s" runner.' % (liveaction.id, action_db.runner_type["name"])
        )

    if (
        liveaction.status == action_constants.LIVEACTION_STATUS_PAUSING
        or liveaction.status == action_constants.LIVEACTION_STATUS_PAUSED
    ):
        execution = ActionExecution.get(liveaction__id=str(liveaction.id))
        return (liveaction, execution)

    if liveaction.status != action_constants.LIVEACTION_STATUS_RUNNING:
        raise runner_exc.UnexpectedActionExecutionStatusError(
            'Unable to pause liveaction "%s" because it is not in a running state.'
            % liveaction.id
        )

    liveaction.context["paused_by"] = get_requester(requester)
    liveaction = update_status(
        liveaction,
        action_constants.LIVEACTION_STATUS_PAUSING,
        context=liveaction.context,
    )

    execution = ActionExecution.get(liveaction__id=str(liveaction.id))

    return (liveaction, execution)

    Request pause for a running action execution.

    :return: (liveaction, execution)
    :rtype: tuple
    
st2common/st2common/services/action.py