Creating Module YAML

Guide for a Module YAML file.

Introduction

YAML is a human-friendly data serialization language for all programming languages. At weeve we use it to create a module dashboard in Edge Application Designer section of weeve Platform, which allows a designer to choose environment variables and other settings for the module.
Module settings pane created with YAML

Required fields

The following fields are required in Module.yaml file:
  • displayName - display name for the module that will be displayed in the UI.
  • moduleName - module name that will be used to reference the module, and uniquely identify the module and its versions.
  • description - module description that will be displayed in the UI.
  • versionName - module version name that will be used to reference the module version, and uniquely identify the module version with a common name.
  • isPublic - boolean value that indicates if the module is Public or Private.
  • categories - array of category that will be used to group the module in the UI, i.e. Egress, Filter, Aggregation, Alert, etc.
  • type - module type (Input, Processing, Output) that will be used to group modules in the UI.
  • image - module's Docker image information
    • name - image name from the Docker registry.
    • tag - image tag from the Docker registry.
    • homepage - image homepage from the Docker registry.
  • repository - repository URL to source code.
  • envs - array of environment variables that will be used to configure the module. Also used to show related fields on the UI in module's pane.
    • name - name of the field to be displayed on the UI.
    • key - key to set in the environment variables.
    • description - description/helper text for the field.
    • value - value to be set in the environment variables.
    • type - type of the field. Possible values are: ['text', 'select', 'date', 'time', 'dateTime-local', 'number', 'multiple', 'CSV', 'file']
    • options - options for the field if it is a select or multiple select. An array of string options.
    • dependencies - list of dependencies for the field. This field is only displayed if all the dependencies are met.
  • ports - array of ports that will be exposed by the module.
  • mounts - array of mounts
  • tags - array of module's tags
  • icon - icon URL that will be displayed in the UI, for tips on creating module's icon refer here.

Module YAML Validation

Use our Module YAML File Validator to check if your YAML file is synchronized with weeve system. You can also use this free online tool to check your YAML file syntax - YAML Lint.

Example

Bellow is an example of Module YAML file for weeve Comparison Filter module:
displayName: 'Comparison Filter'
moduleName: 'comparison-filter'
description: 'Filtering data according to query'
versionName: 'v1.0.0'
isPublic: true
categories:
- 'Filter'
type: 'Processing'
image:
name: 'weevenetwork/comparison-filter'
tag: 'v1.0.0'
homepage: 'https://hub.docker.com/r/weevenetwork/comparison-filter'
repository: 'https://github.com/weeve-modules/comparison-filter'
envs:
- name: Input Label
key: INPUT_LABEL
description: The field to apply filter on
value: 'temperature'
type: 'text'
options: []
dependencies: []
- name: Condition
key: CONDITION
description: Query (condition) for filtering the data
value: 'No condition'
options:
- No condition
- (==) equal to
- (!=) not equal to
- (>) greater than
- (>=) greater than or equal to
- (<) less than
- (<=) less than or equal to
dependencies: []
- name: Compare Value
key: COMPARE_VALUE
description: The value to compare with
value: 20
type: 'number'
options: []
dependencies: []
ports: []
mounts: []
tags:
- 'Python'
- 'Processing'
- 'Filter'
- 'process'
- 'Filtering'
- 'data'
- 'according'
- 'query'
icon: 'https://images.s3.us-south-2.amazon.com/comparison_filter.png'
And it creates the following module dashboard when implemented by weeve FrontEnd UI: