salt.modules.baredoc module

Baredoc walks the installed module and state directories and generates dictionaries and lists of the function names and their arguments.

New in version Neon.

salt.modules.baredoc.modules_and_args(modules=True, states=False, names_only=False)

Walk the Salt install tree and return a dictionary or a list of the functions therein as well as their arguments.

Parameters
  • modules -- Walk the modules directory if True

  • states -- Walk the states directory if True

  • names_only -- Return only a list of the callable functions instead of a dictionary with arguments

Returns

An OrderedDict with callable function names as keys and lists of arguments as values (if names_only == False) or simply an ordered list of callable function nanes (if names_only == True).

CLI Example: (example truncated for brevity)

salt myminion baredoc.modules_and_args

myminion:
    ----------
[...]
    at.atrm:
    at.jobcheck:
    at.mod_watch:
        - name
    at.present:
        - unique_tag
        - name
        - timespec
        - job
        - tag
        - user
    at.watch:
        - unique_tag
        - name
        - timespec
        - job
        - tag
        - user
[...]
salt.modules.baredoc.modules_with_test()

Return a list of callable functions that have a test= flag.

CLI Example:

(results trimmed for brevity)

salt myminion baredoc.modules_with_test

myminion:
    ----------
    - boto_elb.set_instances
    - netconfig.managed
    - netconfig.replace_pattern
    - pkg.install
    - salt.state
    - state.high
    - state.highstate