Puppet Function: vector::dump_config

Defined in:
functions/dump_config.pp
Function type:
Puppet Language

Overview

vector::dump_config(Hash $data, Vector::ValidConfigFormat $format = 'toml')String

vector::dump_config

Parameters:

  • data (Hash)

    A puppet hash representing the configuration of some vector entity (source, transform, sink, etc)

  • format (Vector::ValidConfigFormat) (defaults to: 'toml')

    What format to dump the $data parameter as (json, toml, yaml, yml)

Returns:

  • (String)

    A String representing the dumped configuration



10
11
12
13
14
15
16
17
18
19
# File 'functions/dump_config.pp', line 10

function vector::dump_config(
  Hash $data,
  Vector::ValidConfigFormat $format = 'toml',
) >> String {
  case $format {
    /ya?ml/ : { to_yaml($data) }
    'toml'  : { to_toml($data) }
    default : { to_json($data) }
  }
}