VILLASnode API (0.10.0)
Download OpenAPI specification:Download
A HTTP/REST API for controlling VILLASnode remotely without the need to restart the daemon.
Response samples
- 200
{- "state": "running",
- "version": "v0.10.0",
- "release": "1.node_uuid_unique_debug.20201015git335440d",
- "build_id": "v0.10.0-335440d-debug",
- "build_date": "20201015",
- "hostname": "ernie",
- "uuid": "c9d64cc7-c6e1-4dd4-8873-126318e9d42c",
- "time_now": 1602765814.9240997,
- "time_started": 1602765814.3103526,
- "timezone": {
- "name": "CEST",
- "offset": -3600,
- "dst": true
}, - "kernel": {
- "sysname": "Linux",
- "nodename": "ernie",
- "release": "5.6.17-rt10",
- "version": "#5 SMP Fri Jul 10 14:02:33 CEST 2020",
- "machine": "x86_64",
- "domainname": "(none)"
}, - "system": {
- "cores_configured": 28,
- "cores": 28,
- "processes": 780,
- "uptime": 1379600,
- "load": [
- 1.66259765625,
- 1.271484375,
- 1.18701171875
], - "ram": {
- "total": 269994606592,
- "free": 262204465152,
- "shared": 44191744,
- "buffer": 130211840
}, - "swap": {
- "total": 4294963200,
- "free": 4294963200
}, - "highmem": {
- "total": 0,
- "free": 0
}
}
}
Response samples
- 200
{- "hooks": [
- "average",
- "cast",
- "decimate",
- "dp",
- "drop",
- "dump",
- "ebm",
- "fix",
- "gate",
- "jitter_calc",
- "limit_rate",
- "pps_ts",
- "print",
- "restart",
- "scale",
- "shift_seq",
- "shift_ts",
- "skip_first",
- "stats",
- "ts"
], - "node-types": [
- "amqp",
- "can",
- "ethercat",
- "example",
- "exec",
- "file",
- "influxdb",
- "kafka",
- "loopback",
- "loopback_internal",
- "mqtt",
- "ngsi",
- "redis",
- "shmem",
- "signal",
- "socket",
- "stats",
- "temper",
- "test_rtt",
- "websocket",
- "zeromq"
], - "apis": [
- "capabilities",
- "config",
- "node",
- "node/file",
- "node/pause",
- "node/restart",
- "node/resume",
- "node/start",
- "node/stats",
- "node/stats/reset",
- "node/stop",
- "nodes",
- "path",
- "path/start",
- "path/stop",
- "paths",
- "restart",
- "shutdown",
- "status"
], - "formats": [
- "csv",
- "gtnet",
- "iotagent_ul",
- "json",
- "json.kafka",
- "json.reserve",
- "raw",
- "tsv",
- "value",
- "villas.binary",
- "villas.human",
- "villas.web"
]
}
Response samples
- 200
{- "nodes": {
- "udp_node1": {
- "type": "socket",
- "layer": "udp",
- "in": {
- "address": "*:12000",
- "signals": {
- "count": 8,
- "type": "float"
}
}, - "out": {
- "address": "127.0.0.1:12001"
}
}, - "web_node1": {
- "type": "websocket",
- "vectorize": 2,
- "series": [
- {
- "label": "Random walk",
- "unit": "V"
}, - {
- "label": "Sine",
- "unit": "A"
}, - {
- "label": "Rect",
- "unit": "Var"
}, - {
- "label": "Ramp",
- "unit": "°C"
}
]
}
}, - "paths": [
- {
- "in": [
- "udp_node1"
], - "out": [
- "web_node1"
], - "hooks": [
- {
- "type": "decimate",
- "ratio": 2
}
]
}, - {
- "in": [
- "web_node1"
], - "out": [
- "udp_node1"
]
}
]
}
Restart the VILLASnode instance.
Request Body schema: application/json
URL (string) or VILLASnode configuration file (object) | |
One of string (URL) An optional path or URI to a new configuration file which should be loaded after restarting the node. The file referenced by the URL must be a VILLASnode configuration file |
Responses
Request samples
- Payload
{
}
Response samples
- 200
{- "restarts": 5,
}
Get a graph representation of the currently loaded configuration.
path Parameters
format | string Enum: "ps" "eps" "txt" "svg" "svgz" "gif" "png" "jpg" "jpeg" "bmp" "dot" "fig" "json" "pdf" The image format of the generated graph. |
query Parameters
layout | string Enum: "circo" "dot" "fdp" "neato" "nop" "nop1" "nop2" "osage" "patchwork" "sfdp" "twopi" The Graphviz layout engine used for rendering the graph. |
Responses
Get the information of a specific node.
path Parameters
required | string or string Either a UUID or node-name |
Responses
Response samples
- 200
{- "name": "udp_node1",
- "uuid": "b3df1d73-f483-f16c-5936-4ea48295615c",
- "state": "running",
- "affinity": -1,
- "in": {
- "address": "*:12000",
- "signals": {
- "count": 8,
- "type": "float"
}
}, - "out": {
- "address": "127.0.0.1:12001"
}, - "type": "socket",
- "layer": "udp"
}
Get the statistics of a node.
path Parameters
required | string or string Either a UUID or node-name |
Responses
Response samples
- 200
{- "rtp.jitter": {
- "low": 1.3293196e-316,
- "high": 0,
- "total": 0
}, - "rtp.pkts_lost": {
- "low": 1.3285797e-316,
- "high": 1.3290532e-316,
- "total": 0
}, - "rtp.loss_fraction": {
- "low": 3e-323,
- "high": 1.32907453e-316,
- "total": 0
}, - "age": {
- "low": 1.3288619e-316,
- "high": 1.32909588e-316,
- "total": 0
}, - "owd": {
- "low": 3e-323,
- "high": 3e-322,
- "total": 144,
- "higher": 0,
- "lower": 0,
- "highest": 0.099986117,
- "lowest": 0.09990915800000001,
- "mean": 0.09998063221527778,
- "variance": 7.736879555478282e-11,
- "stddev": 0.000008795953362472019,
- "buckets": [
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
]
}, - "gap_received": {
- "low": 0,
- "high": 1.32743107e-316,
- "total": 144,
- "higher": 0,
- "lower": 0,
- "highest": 0.10000411000000001,
- "lowest": 0.09999650900000001,
- "mean": 0.09999998652777778,
- "variance": 5.701784607620545e-13,
- "stddev": 7.551016228045431e-7,
- "buckets": [
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
]
}, - "gap_sent": {
- "low": 1.58e-321,
- "high": 1.3292848e-316,
- "total": 144,
- "higher": 0,
- "lower": 0,
- "highest": 0.10004273400000001,
- "lowest": 0.09926839700000001,
- "mean": 0.09999436691666665,
- "variance": 3.7637473716438304e-9,
- "stddev": 0.00006134938770390321,
- "buckets": [
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
]
}, - "reordered": {
- "low": 8.28904606e-315,
- "high": 1.32930615e-316,
- "total": 0
}, - "skipped": {
- "low": 1.32879865e-316,
- "high": 1.3293275e-316,
- "total": 0
}
}
Rewind the playback file to the beginning.
path Parameters
required | string or string Either a UUID or node-name |
Request Body schema: application/json
Sample position in file
position required | integer Skip the first nth samples in the file. |
Responses
Request samples
- Payload
{- "position": 123
}
Response samples
- 200
[- {
- "uuid": "251c99af-4b05-9de4-367e-2bb550412e56",
- "state": "running",
- "mode": "any",
- "enabled": true,
- "builtin": true,
- "reverse": false,
- "original_sequence_no": true,
- "last_sequence": false,
- "poll": false,
- "queuelen": 1024,
- "signals": [ ],
- "hooks": [ ],
- "in": [
- "udp_node1"
], - "out": [
- "web_node1"
]
}, - {
- "uuid": "61b5674b-95fa-b35f-bff8-c877acf21e3b",
- "state": "running",
- "mode": "any",
- "enabled": true,
- "builtin": true,
- "reverse": false,
- "original_sequence_no": true,
- "last_sequence": false,
- "poll": false,
- "queuelen": 1024,
- "signals": [ ],
- "hooks": [ ],
- "in": [
- "web_node1"
], - "out": [
- "udp_node1"
]
}
]
Get details of a single path.
path Parameters
uuid required | string <uuid> A globally unique identifier for each path. |
Responses
Response samples
- 200
{- "uuid": "251c99af-4b05-9de4-367e-2bb550412e56",
- "state": "running",
- "mode": "any",
- "enabled": true,
- "builtin": true,
- "reverse": false,
- "original_sequence_no": true,
- "last_sequence": false,
- "poll": false,
- "queuelen": 1024,
- "signals": [ ],
- "hooks": [ ],
- "in": [
- "udp_node1"
], - "out": [
- "web_node1"
]
}
This section decribes the schema of the VILLASnode configuration file.
Please use the >
to expand the individual sub-sections.
required | object (Node list) A list of nodes to/from which this instance sends/receives sample data. |
Array of objects (Path list) Default: [] A list of uni-directional paths which connect the nodes defined in the | |
object (http) | |
object (Logging configuration) | |
hugepages | integer (Number of reserved hugepages) Default: 100 The number of hugepages which will be reservered by the system. See: https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt A value of zero will disable the use of huge pages. |
stats | number (Statistics interval) Default: 1 Specifies the rate at which statistics about the active paths will be periodically printed to the screen. Setting this value to 5, will print 5 lines per second. A line includes information such as:
|
affinity | integer (Task/Process affinity mask) Default: 0 Restricts the exeuction of the daemon to certain CPU cores. This technique, also called 'pinning', improves the determinism of the server by isolating the daemon processes on exclusive cores. A value of |
priority | integer Default: 0 Adjusts the scheduling priority of the deamon processes. By default, the daemon uses a real-time optimized FIFO scheduling algorithm. A value of |
idle_stop | boolean Default: false |
uuid | string <uuid> (Super-node UUID) Default: "randomly generated" Each VILLASnode instance is identified by a globally unique indentifier / UUID. This UUID can be queried by the API. If the setting is not provided, a UUID will be generated by hashing the active VILLASnode configuration. This ensures that restarting the VILLASnode instance with the identical configuration will yield always the same UUID. |
{- "nodes": {
- "node-name1": {
- "type": "string"
}, - "node-name2": {
- "type": "string"
}
}, - "paths": [ ],
- "http": {
- "port": 80,
- "ssl_cert": "/etc/ssl/certs/mycert.pem",
- "ssl_private_key": "/etc/ssl/private/mykey.pem"
}, - "logging": {
- "level": "trace",
- "file": "string",
- "syslog": false,
- "expressions": [
- {
- "name": "string",
- "level": "trace"
}
]
}, - "hugepages": 100,
- "stats": 1,
- "affinity": 0,
- "priority": 0,
- "idle_stop": false,
- "uuid": "randomly generated"
}
created required | number (Sampling timestamp) >= 0 A timestamps in miliseconds since 1970-01-01 00:00:00 |
additional property | number or integer or boolean or object Key-value pairs of measurements |
[- {
- "created": 1633791645123,
- "signal0": 123.456,
- "signal1": true,
- "signal2": 1234,
- "signal3": {
- "real": 1234.4556,
- "imag": 23232.12312
}
}
]
device required | string ID for measurement device |
timestamp required | string^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?... Timestamp of measurement in ISO 8601 format |
required | Array of objects |
{- "device": "device1",
- "timestamp": "2020-05-20T10:27:57.980802+00:00",
- "readings": [
- {
- "channel": "BUS1-VA",
- "magnitude": 9.171,
- "phase": 0.8305,
- "frequency": 50.1,
- "rocof": 0.11
}, - {
- "channel": "BUS1-IA",
- "magnitude": 9.171,
- "phase": 0.8305,
- "frequency": 50.1,
- "rocof": 0.11
}, - {
- "channel": "BUS1-VB",
- "magnitude": 9.171,
- "phase": 0.8305,
- "frequency": 50.1,
- "rocof": 0.11
}, - {
- "channel": "BUS1-IB",
- "magnitude": 9.171,
- "phase": 0.8305,
- "frequency": 50.1,
- "rocof": 0.11
}, - {
- "channel": "BUS1-VC",
- "magnitude": 9.171,
- "phase": 0.8305,
- "frequency": 50.1,
- "rocof": 0.11
}, - {
- "channel": "BUS1-IC",
- "magnitude": 9.171,
- "phase": 0.8305,
- "frequency": 50.1,
- "rocof": 0.11
}, - {
- "channel": "BUS1-VN",
- "magnitude": 9.171,
- "phase": 0.8305,
- "frequency": 50.1,
- "rocof": 0.11
}, - {
- "channel": "BUS1-IN",
- "magnitude": 9.171,
- "phase": 0.8305,
- "frequency": 50.1,
- "rocof": 0.11
}
]
}
device required | string ID for measurement device |
timestamp required | string^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?... Timestamp of measurement in ISO 8601 format |
required | Array of objects |
{- "device": "device1",
- "timestamp": "2020-05-20T10:27:57.980802+00:00",
- "readings": [
- {
- "component": "BUS1",
- "measurand": "voltmagnitude",
- "phase": "A",
- "data": 123
}, - {
- "component": "BUS2",
- "measurand": "voltmagnitude",
- "phase": "A",
- "data": 123
}
]
}
device required | string ID for measurement device |
timestamp required | string^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?... Timestamp of measurement in ISO 8601 format |
component required | string <uuid> ID (uuid) from CIM document |
measurand required | string Enum: "voltmagnitude" "voltangle" "currmagnitude" "currangle" "activepower" "reactivepower" "apparentpower" "frequency" |
phase required | string Enum: "A" "B" "C" |
data required | number Measurement value as in the following format depending on value of measurand:
|
{- "device": "pmu-abc0",
- "timestamp": "2021-10-07T10:11:12.1231241+02:00",
- "component": "7a30b61a-2913-11ec-9621-0242ac130002",
- "measurand": "voltagemagnitude",
- "phase": "A",
- "data": 123124
}