# salt.modules.out

## Output Module

Added in version 2018.3.0.

Execution module that processes JSON serializable data and returns string having the format as processed by the outputters.

Although this does not bring much value on the CLI, it turns very handy in applications that require human readable data rather than Python objects.

For example, inside a Jinja template:

    {{ salt.out.string_format(complex_object, out='highstate') }}

salt.modules.out.html_format(data, out='nested', opts=None, **kwargs)

  Return the formatted string as HTML.

  data

    The JSON serializable object.

  out: `nested`

    The name of the output to use to transform the data. Default: `nested`.

  opts

    Dictionary of configuration options. Default: `__opts__`.

  kwargs

    Arguments to sent to the outputter module.

  CLI Example:

      salt '*' out.html_format "{'key': 'value'}" out=yaml

salt.modules.out.out_format(data, out='nested', opts=None, **kwargs)

  Return the formatted outputter string for the Python object.

  data

    The JSON serializable object.

  out: `nested`

    The name of the output to use to transform the data. Default: `nested`.

  opts

    Dictionary of configuration options. Default: `__opts__`.

  kwargs

    Arguments to sent to the outputter module.

  CLI Example:

      salt '*' out.out_format "{'key': 'value'}"

salt.modules.out.string_format(data, out='nested', opts=None, **kwargs)

  Return the outputter formatted string, removing the ANSI escape sequences.

  data

    The JSON serializable object.

  out: `nested`

    The name of the output to use to transform the data. Default: `nested`.

  opts

    Dictionary of configuration options. Default: `__opts__`.

  kwargs

    Arguments to sent to the outputter module.

  CLI Example:

      salt '*' out.string_format "{'key': 'value'}" out=table