def validate_action(action_api, runner_type_db=None):
    """
    :param runner_type_db: RunnerTypeDB object belonging to this action. If not provided, it's
                           retrieved from the database.
    :type runner_type_db: :class:`RunnerTypeDB`
    """
    if not runner_type_db:
        runner_db = get_runner_model(action_api)
    else:
        runner_db = runner_type_db

    # Check if pack is valid.
    if not _is_valid_pack(action_api.pack):
        packs_base_paths = get_packs_base_paths()
        packs_base_paths = ",".join(packs_base_paths)
        msg = (
            'Content pack "%s" is not found or doesn\'t contain actions directory. '
            "Searched in: %s" % (action_api.pack, packs_base_paths)
        )
        raise ValueValidationException(msg)

    # Check if parameters defined are valid.
    action_ref = ResourceReference.to_string_reference(
        pack=action_api.pack, name=action_api.name
    )
    _validate_parameters(action_ref, action_api.parameters, runner_db.runner_parameters)

    :param runner_type_db: RunnerTypeDB object belonging to this action. If not provided, it's
                           retrieved from the database.
    :type runner_type_db: :class:`RunnerTypeDB`
    
st2common/st2common/validators/api/action.py