1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

add new openapi spec

This commit is contained in:
Steffen Vogel 2021-11-18 12:10:36 +01:00
parent fcbc15e85a
commit e3c0bdb6f6
124 changed files with 4042 additions and 1031 deletions

6
doc/.gitignore vendored
View file

@ -1,3 +1,9 @@
html/
doxygen_sqlite3.db
warnings.log
# Dir for bundles
dist
node_modules
dist.yaml
redoc-static.html

14
doc/.redocly.yaml Normal file
View file

@ -0,0 +1,14 @@
# See https://redoc.ly/docs/cli/configuration/ for more information.
apiDefinitions:
main: openapi/openapi.yaml
lint:
extends:
- recommended
rules:
no-unused-components: warning
referenceDocs:
htmlTemplate: ./index.html
theme:
colors:
primary:
main: "#32329f"

Binary file not shown.

BIN
doc/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

24
doc/index.html Normal file
View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>API Reference | ReDoc</title>
<!-- needed for adaptive design -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="favicon.png">
<!--
ReDoc uses font options from the parent element
So override default browser styles
-->
<style>
body {
margin: 0;
padding: 0;
}
</style>
{{{redocHead}}}
</head>
<body>
{{{redocHTML}}}
</body>
</html>

View file

@ -1,798 +0,0 @@
---
openapi: '3.0.0'
info:
title: VILLASnode API
version: 0.10.0
description: 'A HTTP/REST API for controlling VILLASnode remotely without the need to restart the daemon.'
termsOfService: 'https://www.fein-aachen.org/projects/villas-node/'
contact:
name: 'Steffen Vogel'
email: svogel2@eonerc.rwth-aachen.de
url: 'https://fein-aachen.org/contact/'
license:
name: GPL-v3
url: 'https://www.gnu.org/licenses/gpl-3.0.en.html'
externalDocs:
url: 'https://villas.fein-aachen.org/doc/node.html'
servers:
- url: "https://villas.k8s.eonerc.rwth-aachen.de/api/v2"
description: "The production API server in our EONERC OpenStack Kubernetes"
tags:
- name: super-node
description: Global super-node related operations.
- name: nodes
description: Node related operations.
- name: paths
description: Path related operations.
components:
parameters:
node-uuid:
name: uuid
description: A globally unique identifier for each node.
in: path
required: true
schema:
type: string
format: uuid
path-uuid:
name: uuid
description: A globally unique identifier for each path.
in: path
required: true
schema:
type: string
format: uuid
node-uuid-name:
name: uuid-or-name
description: Either a UUID or node-name
in: path
required: true
schema:
oneOf:
- type: string
format: uuid
- type: string
pattern: "[a-z0-9_-]{2,32}"
paths:
"/status":
get:
summary: Get the current status of the VILLASnode instance.
tags:
- super-node
responses:
'200':
description: Success
content:
application/json:
examples:
example1:
value:
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
"/capabilities":
get:
summary: Get the capabilities of the VILLASnode instance.
tags:
- super-node
responses:
'200':
description: Success
content:
application/json:
examples:
example1:
value:
hooks:
- average
- 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
"/config":
get:
summary: Get the currently loaded configuration.
tags:
- super-node
responses:
'200':
description: Success
content:
application/json:
examples:
example1:
value:
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":
post:
summary: Restart the VILLASnode instance.
tags:
- super-node
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
config:
oneOf:
- type: string
example: "http://example.com/path/to/config.json"
description: An optional path or URI to a new configuration file which should be loaded after restarting the node.
- type: object
description: An optional JSON object containing thenew configuration which should be loaded
responses:
'200':
description: Success. The instance has been restarted.
content:
application/json:
examples:
example1:
value:
restarts: 5
config: http://example.com/path/to/config.json
"/shutdown":
post:
summary: Shutdown the VILLASnode instance.
tags:
- super-node
responses:
'200':
description: Success. The instance has been shut down.
"/nodes":
get:
summary: Get a list of all configure node instances.
tags:
- nodes
responses:
'200':
description: Success
content:
application/json:
examples:
example1:
value:
- 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
- name: web_node1
uuid: 19c84350-c83a-8a3b-224b-43fa591c8998
state: running
affinity: -1
in:
vectorize: 2
signals:
- type: float
enabled: true
name: signal0
- type: float
enabled: true
name: signal1
- type: float
enabled: true
name: signal2
- type: float
enabled: true
name: signal3
out:
vectorize: 2
signals:
- type: float
enabled: true
name: signal0
- type: float
enabled: true
name: signal1
- type: float
enabled: true
name: signal2
type: websocket
vectorize: 2
series:
- label: Random walk
unit: V
- label: Sine
unit: A
- label: Rect
unit: Var
- label: Ramp
unit: °C
"/node/{uuid-or-name}":
get:
summary: Get the information of a specific node.
tags:
- nodes
parameters:
- $ref: '#/components/parameters/node-uuid-name'
responses:
'200':
description: Success
content:
application/json:
examples:
example1:
value:
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
'404':
description: Error. There is no node with the given UUID or the node does not collect statistics.
"/node/{uuid-or-name}/stats":
get:
summary: Get the statistics of a node.
tags:
- nodes
parameters:
- $ref: "#/components/parameters/node-uuid-name"
responses:
'200':
description: Success
content:
application/json:
examples:
example1:
value:
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: 3.0e-323
high: 1.32907453e-316
total: 0
age:
low: 1.3288619e-316
high: 1.32909588e-316
total: 0
owd:
low: 3.0e-323
high: 3.0e-322
total: 144
higher: 0
lower: 0
highest: 0.099986117
lowest: 0.09990915800000001
mean: 0.09998063221527778
variance: 7.736879555478282e-11
stddev: 8.795953362472019e-06
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-07
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-09
stddev: 6.134938770390321e-05
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
'404':
description: Error. There is no node with the given UUID or the node does not collect statistics.
"/node/{uuid-or-name}/stats/reset":
post:
summary: Reset the statistics counters for a specific node.
tags:
- nodes
parameters:
- $ref: "#/components/parameters/node-uuid-name"
responses:
'200':
description: Success. The statistics of the node have been reset.
'404':
description: Error. There is no node with the given UUID.
"/node/{uuid-or-name}/start":
post:
summary: Start a node.
tags:
- nodes
parameters:
- $ref: "#/components/parameters/node-uuid-name"
responses:
'200':
description: Success. The node has been started.
'404':
description: Error. There is no node with the given UUID.
"/node/{uuid-or-name}/stop":
post:
summary: Stop a node.
tags:
- nodes
parameters:
- $ref: "#/components/parameters/node-uuid-name"
responses:
'200':
description: Success. The node has been stopped.
'404':
description: Error. There is no node with the given UUID.
"/node/{uuid-or-name}/pause":
post:
summary: Pause a node.
tags:
- nodes
parameters:
- $ref: "#/components/parameters/node-uuid-name"
responses:
'200':
description: Success. The node has been paused.
'404':
description: Error. There is no node with the given UUID.
"/node/{uuid-or-name}/resume":
post:
summary: Resume a node.
tags:
- nodes
parameters:
- $ref: "#/components/parameters/node-uuid-name"
responses:
'200':
description: Success. The node has been resumed.
'404':
description: Error. There is no node with the given UUID.
"/node/{uuid-or-name}/restart":
post:
summary: Retart a node.
tags:
- nodes
parameters:
- $ref: "#/components/parameters/node-uuid-name"
responses:
'200':
description: Success. The node has been restarted.
'404':
description: Error. There is no node with the given UUID.
"/node/{uuid-or-name}/file/rewind":
post:
summary: Rewind the playback file to the beginning.
tags:
- nodes
parameters:
- $ref: "#/components/parameters/node-uuid-name"
responses:
'200':
description: Success. The file has been rewound.
'404':
description: Error. There is no node with the given UUID.
"/node/{uuid-or-name}/file/seek":
post:
summary: Rewind the playback file to the beginning.
tags:
- nodes
parameters:
- $ref: "#/components/parameters/node-uuid-name"
requestBody:
description: Sample position in file
required: true
content:
application/json:
schema:
type: object
required:
- position
properties:
position:
type: integer
example: 123
description: Skip the first nth samples in the file.
responses:
'200':
description: Success. The read-pointer of the file has been changed.
'404':
description: Error. There is no node with the given UUID.
"/paths":
get:
summary: Get a list of all paths.
tags:
- paths
responses:
'200':
description: Success
content:
application/json:
examples:
example1:
value:
- 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
"/path/{uuid}":
post:
summary: Get details of a single path.
tags:
- paths
parameters:
- $ref: "#/components/parameters/path-uuid"
responses:
'200':
description: Success
content:
application/json:
examples:
example1:
value:
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
'404':
description: Error. There is no path with the given UUID.
"/path/{uuid}/start":
post:
summary: Start a path.
tags:
- paths
parameters:
- $ref: "#/components/parameters/path-uuid"
responses:
'200':
description: Success. The path has been started.
'404':
description: Error. There is no path with the given UUID.
"/path/{uuid}/stop":
post:
summary: Start a path.
tags:
- paths
parameters:
- $ref: "#/components/parameters/path-uuid"
responses:
'200':
description: Success. The path has been stopped.
'404':
description: Error. There is no path with the given UUID.
"/graph.{format}":
get:
summary: Get a graph representation of the currently loaded configuration.
tags:
- super-node
parameters:
- in: path
name: format
schema:
type: string
description: The image format of the generated graph.
enum:
- ps
- eps
- txt
- svg
- svgz
- gif
- png
- jpg
- jpeg
- bmp
- dot
- fig
- json
- pdf
- in: query
name: layout
schema:
type: string
description: The Graphviz layout engine used for rendering the graph.
enum:
- circo
- dot
- fdp
- neato
- nop
- nop1
- nop2
- osage
- patchwork
- sfdp
- twopi

13
doc/openapi/README.md Normal file
View file

@ -0,0 +1,13 @@
## The `openapi` folder
This folder contains your entrypoint `openapi.yaml`.
That file contains references to the entire API definition.
Here are some sections to pay attention to:
* Top-level **description**: this accepts markdown, and Redoc and Redocly API Reference will render it at the top of the docs. Consider maintaining your markdown in a separate file and [embedding it](https://redoc.ly/docs/api-reference-docs/embedded-markdown/). Note to Redoc community edition users, the special tags are only available to the Redocly API Reference users, but you can still embed markdown.
* Security schemes: you will define the scheme(s) your API uses for security (eg OAuth2, API Key, etc...). The security schemes are used by the Redocly API Reference "Try It" API console feature.
* [Paths](paths/README.md): this defines each endpoint. A path can have one operation per http method.
* Tags: it's a good idea to organize each operation. Each tag can have a description. The description is used as a section description within the reference docs.
* Servers: a list of your servers, each with a URL.

View file

@ -0,0 +1,14 @@
Reusable components
===========
* You can create the following folders here:
- `schemas` - reusable [Schema Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject)
- `responses` - reusable [Response Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject)
- `parameters` - reusable [Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject)
- `examples` - reusable [Example Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject)
- `headers` - reusable [Header Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#headerObject)
- `requestBodies` - reusable [Request Body Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#requestBodyObject)
- `links` - reusable [Link Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#linkObject)
- `callbacks` - reusable [Callback Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#callbackObject)
- `securitySchemes` - reusable [Security Scheme Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#securitySchemeObject)
* Filename of files inside the folders represent component name, e.g. `Customer.yaml`

View file

@ -0,0 +1,10 @@
name: uuid-or-name
description: Either a UUID or node-name
in: path
required: true
schema:
oneOf:
- type: string
format: uuid
- type: string
pattern: '[a-z0-9_-]{2,32}'

View file

@ -0,0 +1,7 @@
name: uuid
description: A globally unique identifier for each node.
in: path
required: true
schema:
type: string
format: uuid

View file

@ -0,0 +1,7 @@
name: uuid
description: A globally unique identifier for each path.
in: path
required: true
schema:
type: string
format: uuid

View file

@ -0,0 +1,39 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
title: VILLASnode configuration file
description: Schema of the VILLASnode configuration file.
allOf:
- type: object
required:
- nodes
additionalProperties: false
properties:
nodes:
type: object
title: Node list
description: |
A list of nodes to/from which this instance sends/receives sample data.
additionalProperties:
x-additionalPropertiesName: node-name
$ref: ./config/node.yaml
paths:
title: Path list
description: |
A list of uni-directional paths which connect the nodes defined in the `nodes` list.
type: array
default: []
items:
$ref: config/path.yaml
http:
$ref: config/http.yaml
logging:
$ref: config/logging.yaml
- $ref: config/global.yaml

View file

@ -0,0 +1,30 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
type: object
required:
- type
properties:
type:
type: string
discriminator:
propertyName: type
mapping:
csv: formats/csv.yaml
iotagent_ul: formats/iotagent_ul.yaml
json: formats/json.yaml
json.reserve: formats/json_reserve.yaml
json.kafka: formats/json_kafka.yaml
json.edgeflex: formats/json_edgeflex.yaml
gtnet: formats/gtnet.yaml
protobuf: formats/protobuf.yaml
raw: formats/raw.yaml
tsv: formats/tsv.yaml
value: formats/value.yaml
villas.binary: formats/villas_binary.yaml
villas.human: formats/villas_human.yaml
villas.web: formats/villas_web.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: line.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: column.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: raw.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../format.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../format.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: json.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: json.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: json.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../format.yaml
- type: object
properties:
separator:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../format.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../format.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: column.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../format.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../format.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: line.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: villas_binary.yaml
- type: object
properties:
delimiter:
type: string

View file

@ -0,0 +1,20 @@
---
oneOf:
- $ref: format.yaml
- type: string
enum:
- csv
- gtnet
- iotagent_ul
- json
- json.edgeflex
- json.kafka
- json.reserve
- protobuf
- raw
- tsv
- value
- villas.binary
- villas.human
- villas.web

View file

@ -0,0 +1,69 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
type: object
properties:
hugepages:
type: integer
default: 100
title: Number of reserved hugepages
description: |
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:
type: number
default: 1.0
title: Statistics interval
description: |
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:
- Source and Destination of path
- Messages received
- Messages sent
- Messages dropped
affinity:
type: integer
default: 0
title: Task/Process affinity mask
description: |
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 `0` will not change the affinity of the process.
priority:
type: integer
default: 0
description: |
Adjusts the scheduling priority of the deamon processes.
By default, the daemon uses a real-time optimized FIFO scheduling algorithm.
A value of `0` will not change the priority of the process.
idle_stop:
type: boolean
default: false
uuid:
type: string
format: uuid
title: Super-node UUID
default: 'randomly generated'
description: |
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.

View file

@ -0,0 +1,48 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
type: object
title: Hook
required:
- type
properties:
type:
type: string
enabled:
type: boolean
default: true
priority:
type: integer
discriminator:
propertyName: type
mapping:
average: hooks/average.yaml
cast: hooks/cast.yaml
decimate: hooks/decimate.yaml
dp: hooks/dp.yaml
dump: hooks/dump.yaml
ebm: hooks/ebm.yaml
fix: hooks/fix.yaml
gate: hooks/gate.yaml
jitter_calc: hooks/jitter_calc.yaml
limit_rate: hooks/limit_rate.yaml
limit_value: hooks/limit_value.yaml
lua: hooks/lua.yaml
ma: hooks/ma.yaml
pmu_dft: hooks/pmu_dft.yaml
pps_ts: hooks/pps_ts.yaml
print: hooks/print.yaml
restart: hooks/restart.yaml
rms: hooks/rms.yaml
scale: hooks/scale.yaml
shift_seq: hooks/shift_seq.yaml
shift_ts: hooks/shift_ts.yaml
skip_first: hooks/skip_first.yaml
stats: hooks/stats.yaml
ts: hooks/ts.yaml

View file

@ -0,0 +1,36 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
type: array
items:
oneOf:
- $ref: hook.yaml
- type: string
title: Hook Name
description: Only the hook type is provided. No other settings can be configured.
enum:
- average
- cast
- decimate
- dp
- drop
- dump
- ebm
- fix
- gate
- jitter_calc
- limit_rate
- limit_value
- lua
- ma
- pmu_dft
- pps_ts
- print
- restart
- rms
- scale
- shift_seq
- shift_ts
- skip_first
- stats
- ts

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties:
ratio:
type: integer

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,11 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties:
prefix:
type: string
default: ''

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../hook.yaml
- type: object
properties: {}

View file

@ -0,0 +1,23 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
type: object
properties:
port:
type: integer
default: 80
title: Listening port
description: |
Listening port for HTTP connections.
ssl_cert:
type: string
title: SSL Certificate Path
description: Path to an SSL certificate
example: /etc/ssl/certs/mycert.pem
ssl_private_key:
type: string
title: SSL Private Key Path
description: Path to an SSL private key
example: /etc/ssl/private/mykey.pem

View file

@ -0,0 +1,70 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
type: object
title: Logging configuration
properties:
level:
title: The log level
description: |
This setting expects one of the allowed strings to adjust the logging level.
Use this with care! Producing a lot of IO by enabling the debug output might decrease the performance of the server.
type: string
default: info
enum:
- trace
- debug
- info
- warning
- error
- critical
- 'off'
file:
type: string
title: Log file name
description: |
Write all log messages to a file.
syslog:
type: boolean
default: false
title: Enable syslog logging
description: |
If enabled VILLASnode will log to the [system log](https://en.wikipedia.org/wiki/Syslog).
expressions:
title: Logging expressions
description: |
The logging expression allow for a fine grained control of log levels per individual logger instance.
Expressions are provided as a list of logger name pattern and the desired level.
**Note:** The expressions are evaluated in the order of their appearance in the list.
type: array
items:
type: object
required:
- name
- level
properties:
name:
type: string
title: Logger name filter
description:
The [glob](https://man7.org/linux/man-pages/man7/glob.7.html)-style pattern to match the names of the loggers for which the level should be adjusted.
level:
type: string
title: Log level
description: |
The level which should be used for the matched loggers.
enum:
- trace
- debug
- info
- warning
- error
- critical
- 'off'

View file

@ -0,0 +1,52 @@
---
type: object
properties:
enabled:
type: boolean
default: true
delay:
type: number
default: 0
description: |
Delay packets in microseconds.
jitter:
type: number
default: 0
title: Jitter
description: |
Apply a jitter to the packet delay (in microseconds).
distribution:
type: string
title: Delay distribution
description: |
One of the delay distributions supported by the `tc` command (see [tc-netem(8)](https://man7.org/linux/man-pages/man8/tc-netem.8.html)).
enum:
- uniform
- normal
- pareto
- paretonormal
loss:
type: number
default: 0
title: Packet Loss Percentage
description: |
Percentage of packets which will be dropped.
duplicate:
type: number
default: 0
title: Packet Duplication Percentage
description: |
Percentage of packets which will be duplicated.
corrupt:
type: number
default: 0
title: Packet Corruption Percentage
description: |
Percentage of packets which will be corrupted.

View file

@ -0,0 +1,97 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
type: object
title: Node
required:
- type
properties:
type:
type: string
description: |
Specifies which protocol should be used by this node.
For a complete list of supported node-types run `villas node --help`.
In addition to the node settings described in this section, every node type has its own specific settings
vectorize:
type: integer
default: 1
description: |
This setting allows to send multiple samples in a single message to the destination nodes.
The value of this setting determines how many samples will be combined into one packet.
hooks:
$ref: hooklist.yaml
builtin:
type: boolean
default: true
title: Builtin hook functions
description: |
By default, each node and paths has a couple of default hooks attached to them. With this setting the attachment of built-in hooks can be disabled.
in:
type: object
properties:
vectorize:
type: integer
minimum: 1
signals:
$ref: signallist.yaml
hooks:
$ref: hooklist.yaml
out:
type: object
properties:
vectorize:
type: integer
hooks:
$ref: hooklist.yaml
netem:
$ref: netem.yaml
discriminator:
propertyName: type
mapping:
amqp: nodes/amqp.yaml
can: nodes/can.yaml
comedi: nodes/comedi.yaml
ethercat: nodes/ethercat.yaml
exec: nodes/exec.yaml
file: nodes/file.yaml
fpga: nodes/fpga.yaml
iec61850-8-1: nodes/iec61850-8-1.yaml
iec61850-9-2: nodes/iec61850-9-2.yaml
infiniband: nodes/infiniband.yaml
influxdb: nodes/influxdb.yaml
kafka: nodes/kafka.yaml
loopback: nodes/loopback.yaml
mqtt: nodes/mqtt.yaml
nanomsg: nodes/nanomsg.yaml
ngsi: nodes/ngsi.yaml
opal: nodes/opal.yaml
redis: nodes/redis.yaml
rtp: nodes/rtp.yaml
shmem: nodes/shmem.yaml
signal.v2: nodes/signal_v2.yaml
signal: nodes/signal.yaml
socket: nodes/socket.yaml
stats: nodes/stats.yaml
temper: nodes/temper.yaml
test_rtt: nodes/test_rtt.yaml
uldaq: nodes/uldaq.yaml
websocket: nodes/websocket.yaml
zeromq: nodes/zeromq.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../formatspec.yaml

View file

@ -0,0 +1,89 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
type: object
title: The first anyOf schema
description: An explanation about the purpose of this instance.
required:
- in
properties:
in:
description: |
The in settings expects the name of one or more source nodes or mapping expressions.
oneOf:
- type: string
- type: array
items:
type: string
out:
description: |
The out setting expects the name of one or more destination nodes. Each sample which is processed by the path will be sent to each of the destination nodes.
oneOf:
- type: string
- type: array
items:
type: string
enabled:
type: boolean
default: true
description: |
The optional enabled setting can be used to temporarily disable a path.
reverse:
type: boolean
default: false
description: |
By default, the path is unidirectional.
Meaning, that it only forwards samples from the source to the destination.
Sometimes a bidirectional path is needed. This can be accomplished by setting reverse to true.
mode:
type: string
default: any
enum:
- any
- all
description: |
The mode setting specifies under which condition a path is triggered.
A triggered path will multiplex / merge samples from its input nodes and run the configured hook functions on them.
Afterwards the processed and merged samples will be send to all output nodes.
Two modes are currently supported:
- `any``: The path will trigger the path as soon as any of the masked (see `mask`) input nodes received new samples.
- `all``: The path will trigger the path as soon as all input nodes received at least one new sample.
mask:
description: |
This setting allows masking the the input nodes which can trigger the path.
See also `mode` setting.
type: array
items:
type: string
description: A node-name
rate:
type: number
minimum: 0
default: 0
description: |
A non-zero value will periodically trigger the path and resend the last sample again.
A value of zero will disable this feature.
original_sequence_no:
type: boolean
default: false
description: |
When this flag is set, the original sequence number from the source node will be used when multiplexing the nodes.
hooks:
$ref: hooklist.yaml

View file

@ -0,0 +1,54 @@
---
type: object
properties:
name:
type: string
title: Signal name
description: |
A name which describes the signal.
example: Bus123_U
unit:
type: string
title: Signal unit
description:
The unit of the signal.
example: V
type:
type: string
title: Signal data-type
description: |
The data-type of the signal.
default: float
enum:
- integer
- float
- boolean
- complex
init:
title: Initial signal value.
description: |
The initial value of the signal.
oneOf:
- type: integer
- type: number
- type: boolean
- type: object
required:
- real
- imag
additionalProperties: false
properties:
real:
type: number
imag:
type: number
enabled:
type: boolean
default: true
description: |
Signals can be disabled which causes them to be ignored.

View file

@ -0,0 +1,43 @@
---
title: Signal list
description: |
Each node should define a list of signals which it receives.
There are three ways to specify the input signals of a node:
oneOf:
- type: array
title: List of signal definition objects
items:
$ref: signaldef.yaml
- type: object
title: Signal definition with `count`
allOf:
- $ref: signaldef.yaml
- type: object
required:
- count
properties:
count:
type: integer
minimum: 1
default: 64
- type: string
title: Signal format string
example: '64f'
description: |
The easiest way to specify the signals, is by using a format string.
The format string consists of one ore more characters which define the type for the signal corresponding to the position of the character in the string.
| Character | Type | Setting for full and list mode |
|:--- |:--- |:--- |
| `f` | Floating point | "float" |
| `b` | Boolean | "boolean" |
| `i` | Integer | "integer" |
| `c` | Complex Floating point | "complex" |
Optionally, the characters can be prefixed by an integer for easier repetition.
**Example:** `12f3i` defines 15 signals, of which the first 12 are floating point and the last 3 are integer values.

View file

@ -1,23 +1,23 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
$schema: 'http://json-schema.org/draft-07/schema'
$id: 'https://villas.fein-aachen.org/formats/edgeflex.json'
title: PMU measurements as used in the EdgeFlex project by Manuel
description: |
VILLASnode does not support deseralization (yet)
VILLASnode does not support deseralization (yet).
type: object
required:
- created
properties:
created:
title: Sampling timestamp
description: A timestamps in miliseconds since 1970-01-01 00:00:00
type: number
min: 0
minimum: 0
additionalItems:
additionalProperties:
description: Key-value pairs of measurements
anyOf:
- type: number
@ -31,12 +31,12 @@ additionalItems:
imag:
type: number
examples:
- - signal0: 123.456
signal1: true
signal2: 1234
signal3:
real: 1234.4556
imag: 23232.12312
created: 1633791645123
example:
- created: 1633791645123
signal0: 123.456
signal1: true
signal2: 1234
signal3:
real: 1234.4556
imag: 23232.12312

View file

@ -1,13 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
$schema: 'http://json-schema.org/draft-07/schema'
$id: 'https://villas.fein-aachen.org/formats/edgeflex.json'
title: PMU format used by Igor
examples:
- device: device1
example:
device: device1
timestamp: '2020-05-20T10:27:57.980802+00:00'
readings:
- channel: BUS1-VA
@ -70,22 +67,25 @@ properties:
readings:
type: array
items:
channel:
type: string
description: Name of the monitored bus
magnitude:
type: number
description: Amplitude of the measured signal [V]
type: object
properties:
phase:
type: number
description: Phase of the measured signal [radian]
frequency:
type: number
description: Frequency of the line signal [Hz]
channel:
type: string
description: Name of the monitored bus
rocof:
type: number
description: Rate of change of frequency [Hz/s]
magnitude:
type: number
description: Amplitude of the measured signal [V]
phase:
type: number
description: Phase of the measured signal [radian]
frequency:
type: number
description: Frequency of the line signal [Hz]
rocof:
type: number
description: Rate of change of frequency [Hz/s]

View file

@ -60,10 +60,10 @@ properties:
- apparentpower: single phase power, unit voltampere
- frequency: unit hertz
examples:
- device: pmu-abc0
timestamp: '2021-10-07T10:11:12.1231241+02:00'
component: 7a30b61a-2913-11ec-9621-0242ac130002
measurand: voltagemagnitude
phase: A
data: 123124
example:
device: pmu-abc0
timestamp: '2021-10-07T10:11:12.1231241+02:00'
component: 7a30b61a-2913-11ec-9621-0242ac130002
measurand: voltagemagnitude
phase: A
data: 123124

View file

@ -1,13 +1,10 @@
---
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
$schema: 'http://json-schema.org/draft-07/schema'
$id: 'https://villas.fein-aachen.org/formats/edgeflex.json'
title: PMU format used in SOGNO LF project
examples:
- device: device1
example:
device: device1
timestamp: '2020-05-20T10:27:57.980802+00:00'
readings:
- component: BUS1

146
doc/openapi/openapi.yaml Normal file
View file

@ -0,0 +1,146 @@
---
openapi: 3.0.3
info:
title: VILLASnode API
version: 0.10.0
description: >-
A HTTP/REST API for controlling VILLASnode remotely without the need to
restart the daemon.
termsOfService: 'https://www.fein-aachen.org/projects/villas-node/'
contact:
name: Steffen Vogel
email: svogel2@eonerc.rwth-aachen.de
url: 'https://fein-aachen.org/contact/'
license:
name: GPL-v3
url: 'https://www.gnu.org/licenses/gpl-3.0.en.html'
externalDocs:
url: 'https://villas.fein-aachen.org/doc/node.html'
servers:
- url: 'https://villas.k8s.eonerc.rwth-aachen.de/api/v2'
description: The production API server in our EONERC OpenStack Kubernetes
- url: 'http://localhost:8080'
description: Your local host
tags:
- name: super-node
x-displayName: Super Node
description: Global super-node related operations.
- name: nodes
x-displayName: Nodes
description: Node related operations.
- name: paths
x-displayName: Paths
description: Path related operations.
- name: config
x-displayName: VILLASnode configuration file
description: |
This section decribes the schema of the VILLASnode configuration file.
Please use the `>` to expand the individual sub-sections.
<SchemaDefinition schemaRef="#/components/schemas/config" />
- name: format-edgeflex
x-displayName: Edgeflex Format
description: |
<SchemaDefinition schemaRef="#/components/schemas/FormatEdgeflex" />
- name: format-igor
x-displayName: Igor's Format
description: |
<SchemaDefinition schemaRef="#/components/schemas/FormatIgor" />
- name: format-sogno
x-displayName: SOGNO Format
description: |
<SchemaDefinition schemaRef="#/components/schemas/FormatSogno" />
- name: format-sogno-old
x-displayName: Old SOGNO Format
description: |
<SchemaDefinition schemaRef="#/components/schemas/FormatSognoOld" />
x-tagGroups:
- name: VILLASnode APIs
tags:
- super-node
- nodes
- paths
- name: Configuration Files
tags:
- config
- name: Format Schemas
tags:
- format-edgeflex
- format-igor
- format-sogno
- format-sogno-old
paths:
/status:
$ref: paths/status.yaml
/capabilities:
$ref: paths/capabilities.yaml
/config:
$ref: paths/config.yaml
/restart:
$ref: paths/restart.yaml
/shutdown:
$ref: paths/shutdown.yaml
/nodes:
$ref: paths/nodes.yaml
'/node/{uuid-or-name}':
$ref: 'paths/node/node@{uuid-or-name}.yaml'
'/node/{uuid-or-name}/stats':
$ref: 'paths/node/node@{uuid-or-name}@stats.yaml'
'/node/{uuid-or-name}/stats/reset':
$ref: 'paths/node/node@{uuid-or-name}@stats@reset.yaml'
'/node/{uuid-or-name}/start':
$ref: 'paths/node/node@{uuid-or-name}@start.yaml'
'/node/{uuid-or-name}/stop':
$ref: 'paths/node/node@{uuid-or-name}@stop.yaml'
'/node/{uuid-or-name}/pause':
$ref: 'paths/node/node@{uuid-or-name}@pause.yaml'
'/node/{uuid-or-name}/resume':
$ref: 'paths/node/node@{uuid-or-name}@resume.yaml'
'/node/{uuid-or-name}/restart':
$ref: 'paths/node/node@{uuid-or-name}@restart.yaml'
'/node/{uuid-or-name}/file/rewind':
$ref: 'paths/node/node@{uuid-or-name}@file@rewind.yaml'
'/node/{uuid-or-name}/file/seek':
$ref: 'paths/node/node@{uuid-or-name}@file@seek.yaml'
/paths:
$ref: paths/paths.yaml
'/path/{uuid}':
$ref: 'paths/path/path@{uuid}.yaml'
'/path/{uuid}/start':
$ref: 'paths/path/path@{uuid}@start.yaml'
'/path/{uuid}/stop':
$ref: 'paths/path/path@{uuid}@stop.yaml'
'/graph.{format}':
$ref: 'paths/graph.{format}.yaml'
components:
schemas:
Config:
$ref: components/schemas/config.yaml
FormatEdgeflex:
$ref: components/schemas/formats/edgeflex.yaml
FormatIgor:
$ref: components/schemas/formats/igor.yaml
FormatSognoOld:
$ref: components/schemas/formats/sogno-old.yaml
FormatSogno:
$ref: components/schemas/formats/sogno.yaml

105
doc/openapi/paths/README.md Normal file
View file

@ -0,0 +1,105 @@
Paths
=====
Organize your path definitions within this folder. You will reference your paths from your main `openapi.yaml` entrypoint file.
It may help you to adopt some conventions:
* path separator token (e.g. `@`) or subfolders
* path parameter (e.g. `{example}`)
* file-per-path or file-per-operation
There are different benefits and drawbacks to each decision.
You can adopt any organization you wish. We have some tips for organizing paths based on common practices.
## Each path in a separate file
Use a predefined "path separator" and keep all of your path files in the top level of the `paths` folder.
```
# todo: insert tree view of paths folder
```
Redocly recommends using the `@` character for this case.
In addition, Redocly recommends placing path parameters within `{}` curly braces if you adopt this style.
#### Motivations
* Quickly see a list of all paths. Many people think in terms of the "number" of "endpoints" (paths), and not the "number" of "operations" (paths * http methods).
* Only the "file-per-path" option is semantically correct with the OpenAPI Specification 3.0.2. However, Redocly's openapi-cli will build valid bundles for any of the other options too.
#### Drawbacks
* This may require multiple definitions per http method within a single file.
* It requires settling on a path separator (that is allowed to be used in filenames) and sticking to that convention.
## Each operation in a separate file
You may also place each operation in a separate file.
In this case, if you want all paths at the top-level, you can concatenate the http method to the path name. Similar to the above option, you can
### Files at top-level of `paths`
You may name your files with some concatenation for the http method. For example, following a convention such as: `<path with allowed separator>-<http-method>.yaml`.
#### Motivations
* Quickly see all operations without needing to navigate subfolders.
#### Drawbacks
* Adopting an unusual path separator convention, instead of using subfolders.
### Use subfolders to mirror API path structure
Example:
```
GET /customers
/paths/customers/get.yaml
```
In this case, the path id defined within subfolders which mirror the API URL structure.
Example with path parameter:
```
GET /customers/{id}
/paths/customers/{id}/get.yaml
```
#### Motivations
It matches the URL structure.
It is pretty easy to reference:
```yaml
paths:
'/customers/{id}':
get:
$ref: ./paths/customers/{id}/get.yaml
put:
$ref: ./paths/customers/{id}/put.yaml
```
#### Drawbacks
If you have a lot of nested folders, it may be confusing to reference your schemas.
Example
```
file: /paths/customers/{id}/timeline/{messageId}/get.yaml
# excerpt of file
headers:
Rate-Limit-Remaining:
$ref: ../../../../../components/headers/Rate-Limit-Remaining.yaml
```
Notice the `../../../../../` in the ref which requires some attention to formulate correctly. While openapi-cli has a linter which suggests possible refs when there is a mistake, this is still a net drawback for APIs with deep paths.

Some files were not shown because too many files have changed in this diff Show more