generator.reports

Generator file

type

object

properties

  • dataSources

Define a map of sources to gather the necessary data the template expects. The key value represent the key used by the template to access the data and the value represent the source of this data.

A source can be from three type:

  • Alarm: request alarms with a filter id

  • Collection: request collections with a filter id

  • Value: define list of accessible values

Each one of the defined sources will be accessible from the associated key. For example:

{
    "alarms": {
        "type": "Alarm",
        "filterId": "root.alarms.filter"
    }
}

will be accessible from the template as alarms

type

object

additionalProperties

oneOf

Alarm

Analytics

Collection

Values

  • isTemplateGeneratedByOspComposer

Name of the playbook that generated this file. If present, the file is managed by the Composer and may be overwritten on regeneration. Used for selective clean. Do not edit or set manually.

type

string

  • moduleId

The id of the reports module

type

string

  • template

The Item Id to the template that reports will be generated from by this generator

type

string

  • templateId

The id of the template to use for this file

type

string

  • templateVariables

The variables and their values to be replaced from the template

type

object

additionalProperties

  • variablesFiles

The variables files to use to replace the variables. The first file of the list will take precedence over the following one. Template variables take precedence over the contents of the files.

type

array

items

type

string

additionalProperties

False

Alarm

type

object

properties

  • type

type

string

enum

Alarm

default

Alarm

  • filter

The reference to the filter to link with this source

type

string

  • range

Range (start <-> end) to get the data from. Both parts can be left undefined, meaning the range will be start <-> now, now <-> end or now <-> now.

SourceRange

  • view

The reference to the view to link with this source

type

string

additionalProperties

False

SourceRange

type

object

properties

  • end

End of the range. Defined by a value and a unit.

End of the range is calculate by getting NOW as nanoseconds and adding value amount of time.

End is either in the past or the future depending if value is negative or positive. For example:

  • if end is {value: -5, unit: DAYS} and NOW is 15.11.2024, then end will become 10.11.2024.

  • if end is {value: 5, unit: DAYS} and NOW is 15.11.2024, then end will become 20.11.2024.

If null, end of range will be NOW.

SourceRangeDuration

  • field

Field name of the collection schema to compare the range with. Must be a number field. Default value depends on type of the source.

  • Alarm: default value is firstTimestamp

  • Collection: default value is __created_at

type

string

  • start

Start of the range. Defined by a value and a unit.

Start of the range is calculate by getting NOW as nanoseconds and adding value amount of time.

Start is either in the past or the future depending if value is negative or positive. For example:

  • if start is {value: -5, unit: DAYS} and NOW is 15.11.2024, then start will become 10.11.2024.

  • if start is {value: 5, unit: DAYS} and NOW is 15.11.2024, then start will become 20.11.2024.

If null, start of range will be NOW.

SourceRangeDuration

additionalProperties

False

SourceRangeDuration

type

object

properties

  • unit

The unit of time expressed with the value. The available units are :

  • SECONDS: value are expressed as seconds. For example, value as 5 -> 5 seconds

  • MINUTES: value are expressed as minutes. For example, value as 5 -> 5 minutes

  • HOURS: value are expressed as hours. For example, value as 5 -> 5 hours

  • DAYS: value are expressed as days. For example, value as 5 -> 5 days

  • WEEKS: value are expressed as weeks. For example, value as 5 -> 5 weeks (5 * 7 days)

  • MONTHS: value are expressed as months. For example, if value is -1 and current date is 27.03.2024, final date will be 27.02.2024

  • YEARS: value are expressed as years. For example, if value is -1 and current date is 27.03.2024, final date will be 27.03.2023

type

string

enum

SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS, YEARS

  • value

The amount of time expressed with the unit.

If value is positive, it represents a point in the future after the amount of time expressed. If value is negative, it represent a point in the past corresponding to the amount of time expressed.

type

integer

additionalProperties

False

Analytics

type

object

properties

  • type

type

string

enum

Analytics

default

Analytics

  • query

The reference to the query to link with this source

type

string

additionalProperties

False

Collection

type

object

properties

  • type

type

string

enum

Collection

default

Collection

  • filter

The id to the filter to link with this source

type

string

  • range

Range (start <-> end) to get the data from. Both parts can be left undefined, meaning the range will be start <-> now, now <-> end or now <-> now.

SourceRange

  • schema

The reference to the schema to link with this source

type

string

  • view

The id to the view to link with this source

type

string

additionalProperties

False

Values

type

object

properties

  • type

type

string

enum

Values

default

Values

  • accessedValues

The list of values associated at this source.

Final object given to the template will be a map with keys representing the id of one of the values and the value as a whole associated to this key.

For example, a source as:

{
    "myValues": {
        "type": "Values",
        "accessedValues": [
            "root.values.one",
            "root.values.two"
        ]
    }
}

will generate the following map:

{
    "myValues": {
        "root.values.one": {
            "name": "Value One"
            "type": "TEXT",
            "content": "example",
            "error": ""
        },
        "root.values.two": {
            "name": "Value Two"
            "type": "DECIMAL",
            "content": 10.0,
            "error": ""
        }
    }
}

The wildcard ‘*’ can be used to match multiple value (For example, ‘root.*.test’ will match ‘root.device.1.test’, ‘root.server.test’).

type

array

items

type

string

additionalProperties

False