yaml data source

blackstork/builtin, v0.4.2

Description

Loads YAML files with the names that match provided glob pattern or a single file from provided pathvalue.

Either glob or path argument must be set.

When path argument is specified, the data source returns only the content of a file. When glob argument is specified, the data source returns a list of dicts that contain the content of a file and file’s metadata. For example:

[
  {
	"file_path": "path/file-a.yaml",
	"file_name": "file-a.yaml",
	"content": {
	  "foo": "bar"
	}
  },
  {
	"file_path": "path/file-b.yaml",
	"file_name": "file-b.yaml",
	"content": [
	  {"x": "y"}
	]
  }
]

The yaml data source is built into the BlackStork engine. It is available out-of-the-box and requires no installation or dependency declaration.

Configuration

This data source does not accept any configuration arguments.

Usage

This data source accepts the following arguments within a data yaml block:

data yaml {
  # A glob pattern to select YAML files to read
  #
  # Optional string.
  #
  # For example:
  # glob = "path/to/file*.yaml"
  #
  # Default value:
  glob = null

  # A file path to a YAML file to read
  #
  # Optional string.
  #
  # For example:
  # path = "path/to/file.yaml"
  #
  # Default value:
  path = null
}