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 OpenAPI specs for configuration of more node-types

This commit is contained in:
Steffen Vogel 2022-04-01 10:24:59 +02:00
parent f2c9acb536
commit e2931907d1
8 changed files with 285 additions and 22 deletions

View file

@ -3,7 +3,5 @@
allOf:
- type: object
properties:
format:
$ref: ../format_spec.yaml
properties: {}
- $ref: ../node.yaml

View file

@ -7,26 +7,113 @@ allOf:
format:
$ref: ../format_spec.yaml
uri:
type: string
format: uri
description: |
Specifies the URI to a file from which is written to or read from depending in which group (`in`or `out`) is used.
uri:
type: string
format: uri
description: |
Specifies the URI to a file from which is written to or read from depending in which group (`in`or `out`) is used.
This setting allows to add special paceholders for time and date values.
See [strftime(3)](http://man7.org/linux/man-pages/man3/strftime.3.html) for a list of supported placeholder.
This setting allows to add special paceholders for time and date values.
See [strftime(3)](http://man7.org/linux/man-pages/man3/strftime.3.html) for a list of supported placeholder.
**Example**:
**Example**:
```
uri = "logs/measurements_%Y-%m-%d_%H-%M-%S.log"
```
```
uri = "logs/measurements_%Y-%m-%d_%H-%M-%S.log"
```
will create a file called:
will create a file called:
```
./logs/measurements_2015-08-09_22-20-50.log
```
```
./logs/measurements_2015-08-09_22-20-50.log
```
in:
type: object
properties:
epoch:
type: number
epoch_mode:
type: string
enum:
- direct
- wait
- relative
- absolute
description: |
The *epoch* describes the point in time when the first message will be read from the file.
This setting allows to select the behavior of the following `epoch` setting.
It can be used to adjust the point in time when the first value should be read.
The behavior of `epoch` is depending on the value of `epoch_mode`.
To facilitate the following description of supported `epoch_mode`'s, we will introduce some intermediate variables (timestamps).
Those variables will also been displayed during the startup phase of the server to simplify debugging.
- `epoch` is the value of the `epoch` setting.
- `first` is the timestamp of the first message / line in the input file.
- `offset` will be added to the timestamps in the file to obtain the real time when the message will be sent.
- `start` is the point in time when the first message will be sent (`first + offset`).
- `eta` the time to wait until the first message will be send (`start - now`)
The supported values for `epoch_mode`:
| `epoch_mode` | `offset` | `start = first + offset` |
| :-- | :-- | :-- |
| `direct` | `now - first + epoch` | `now + epoch` |
| `wait` | `now + epoch` | `now + first` |
| `relative` | `epoch` | `first + epoch` |
| `absolute` | `epoch - first` | `epoch` |
| `original` | `0` | immediately |
rate:
type: number
default: 0
description: |
By default `send_rate` has the value `0` which means that the time between consecutive samples is the same as in the `in` file based on the timestamps in the first column.
If this setting has a non-zero value, the default behavior is overwritten with a fixed rate.
eof:
type: string
default: exit
enum:
- rewind
- wait
- exit
description: |
Defines the behavior if the end of file of the input file is reached.
- `rewind` will rewind the file pointer and restart reading samples from the beginning of the file.
- `exit` will terminated the program.
- `wait` will periodically test if there are new samples which have been appended to the file.
buffer_size:
type: integer
min: 0
default: 0
description: |
Similar to the [`out.buffer_size` setting](#out-buffer_size). This means that the data is loaded into the buffer before it is passed on to the node.
If `in.buffer_size = 0`, no buffer will be generated.
out:
type: object
properties:
flush:
type: boolean
description: |
With this setting enabled, the outgoing file is flushed whenever new samples have been written to it.
buffer_size:
type: integer
default: 0
min: 0
description: |
If this is set to a positive value `<X>`, the node will generate a full [stream buffer](https://linux.die.net/man/3/setvbuf) with a size of `<X>` bytes. This means that the data is buffered and not written until the buffer is full or until the node is stopped.
If `out.buffer_size = 0`, no buffer will be generated.
- $ref: ../node.yaml

View file

@ -4,7 +4,27 @@
allOf:
- type: object
properties:
format:
$ref: ../format_spec.yaml
queuelen:
type: integer
min: 0
description: The queue length of the internal queue which buffers the samples.
samplelen:
type: integer
min: 0
description: The number of values each buffered sample can store.
mode:
type: string
enum:
- pthread
- polling
- pipe
- eventfd
- auto
default: auto
description: Specify the synchronization mode of the internal queue.
- $ref: ../node.yaml

View file

@ -7,4 +7,24 @@ allOf:
format:
$ref: ../format_spec.yaml
publish:
description: A single endpoint URI or list of URIs on which this node should listen for subscribers.
oneOf:
- type: string
format: uri
- type: array
items:
type: string
format: uri
subscribe:
description: A single endpoint URI or list of URIs pointing to which this node should connect to as a subscriber.
oneOf:
- type: string
format: uri
- type: array
items:
type: string
format: uri
- $ref: ../node.yaml

View file

@ -4,7 +4,13 @@
allOf:
- type: object
properties:
format:
$ref: ../format_spec.yaml
send_id:
type: integer
recv_id:
type: integer
reply:
type: boolean
- $ref: ../node.yaml

View file

@ -7,4 +7,68 @@ allOf:
format:
$ref: ../format_spec.yaml
layer:
type: string
enum:
- udp
- ip
- eth
default: udp
description: |
Select the network layer which should be used for the socket. Please note that `eth` can only be used locally in a LAN as it contains no routing information for the internet.
verify_source:
type: boolean
default: false
description: |
Check if source address of incoming packets matches the remote address.
in:
type: object
required:
- address
properties:
address:
type: string
description: |
The local address and port number this node should listen for incoming packets.
Use `*` to listen on all interfaces: `local = "*:12000"`.
out:
type: object
properties:
address:
type: string
description: |
The remote address and port number to which this node will send data.
netem:
$ref: ../netem.yaml
multicast:
type: object
properties:
enabled:
type: boolean
default: true
description: |
Weather or not multicast group subscription is active.
group:
type: string
description: |
The multicast group. Must be within 224.0.0.0/4
ttl:
type: integer
min: 0
description: |
The time to live for outgoing multicast packets.
loop:
type: boolean
- $ref: ../node.yaml

View file

@ -7,4 +7,25 @@ allOf:
format:
$ref: ../format_spec.yaml
destinations:
description: |
During startup connect to those WebSocket servers as a client.
Each URI must use the following scheme:
```
protocol://host:port/nodename
```
It starts with a protocol which must be one of `ws` (unencrypted) or `wss` (SSL).
The host name or IP address is separated by `://`.
The optional port number is separated by a colon `:`.
The node name is separated by a slash `/`.
type: array
items:
type: string
format: uri
description: A WebSocket URI
- $ref: ../node.yaml

View file

@ -7,4 +7,51 @@ allOf:
format:
$ref: ../format_spec.yaml
filter:
type: string
enum:
- pubsub
- radiodish
publish:
type: string
format: uri
subscribe:
oneOf:
- type: string
format: uri
- type: array
items:
type: string
format: uri
ipv6:
type: boolean
default: false
curve:
title: CurveZMQ cryptography
description: |
**Note:** This feature is currently broken.
You can use the [`villas zmq-keygen`](../usage/villas-zmq-keygen.md) command to create a new keypair for the following configuration options:
type: object
properties:
enabled:
type: boolean
description: Whether or not the encryption is enabled.
public_key:
type: string
description: |
The public key of the server.
private_key:
type: string
description: |
The private key of the server.
- $ref: ../node.yaml