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

openapi: add missing OpenAPI docs

This commit is contained in:
Steffen Vogel 2022-04-05 17:32:37 +02:00
parent 14483da3f9
commit 5feb82e7a3
63 changed files with 393 additions and 74 deletions

View file

@ -2,8 +2,9 @@
---
allOf:
- $ref: line.yaml
- type: object
properties:
delimiter:
type: string
- $ref: line.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: column.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: ../format.yaml

View file

@ -38,4 +38,5 @@ allOf:
default: false
description:
Escape the `/` characters in strings with `\/`.
- $ref: ../format.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: json.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: json.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: json.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
separator:
type: string
- $ref: ../format.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
dev_id:
type: integer
- $ref: ../format.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: ../format.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: column.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: ../format.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: ../format.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: line.yaml

View file

@ -6,4 +6,5 @@ allOf:
properties:
delimiter:
type: string
- $ref: villas_binary.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: multi.yaml
- type: object
required:
- offset
@ -17,3 +15,5 @@ allOf:
- `0` inserts the averaged signal before all other signals in the sample
- `1` inserts the averaged signal after the first signal.
- $ref: common.yaml
- $ref: multi.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: multi.yaml
- type: object
properties:
new_type:
@ -23,3 +21,6 @@ allOf:
type: string
description: The new unit of the casted signal.
example: V
- $ref: common.yaml
- $ref: multi.yaml

View file

@ -2,7 +2,6 @@
---
allOf:
- $ref: common.yaml
- type: object
required:
- ratio
@ -11,4 +10,5 @@ allOf:
type: integer
description: The decimation ratio. A value of 4 will skip every, but the 4th sample in a row.
example: 4
- $ref: common.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: single.yaml
- type: object
required:
- f0
@ -31,3 +29,5 @@ allOf:
type: boolean
default: false
- $ref: common.yaml
- $ref: single.yaml

View file

@ -3,4 +3,3 @@
allOf:
- $ref: common.yaml

View file

@ -3,4 +3,3 @@
allOf:
- $ref: common.yaml

View file

@ -2,7 +2,6 @@
---
allOf:
- $ref: common.yaml
- type: object
required:
- phases
@ -20,3 +19,5 @@ allOf:
maxItems: 2
items:
type: integer
- $ref: common.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: single.yaml
- type: object
properties:
mode:
@ -25,3 +23,6 @@ allOf:
samples:
description: The number if samples for which the gate opens when the triggering condition is met. Exclusive with the `duration` setting.
type: number
- $ref: common.yaml
- $ref: single.yaml

View file

@ -3,4 +3,3 @@
allOf:
- $ref: common.yaml

View file

@ -2,7 +2,6 @@
---
allOf:
- $ref: common.yaml
- type: object
required:
- rate
@ -18,3 +17,5 @@ allOf:
- local
- received
- origin
- $ref: common.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: multi.yaml
- type: object
required:
- min
@ -15,3 +13,6 @@ allOf:
max:
description: The largest value which will pass through the hook before getting clipped.
type: number
- $ref: common.yaml
- $ref: multi.yaml

View file

@ -2,7 +2,6 @@
---
allOf:
- $ref: common.yaml
- type: object
additionalProperties:
description: |
@ -79,3 +78,5 @@ allOf:
An arbitrary Lua expression which will be evaluated and used for the value of the signal.
Note you can access the current sample using the global Lua variable `smp`.
- $ref: ../signal_spec.yaml
- $ref: common.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: multi.yaml
- type: object
properties:
window_size:
@ -12,3 +10,6 @@ allOf:
example: 100
default: 0
minimum: 0
- $ref: common.yaml
- $ref: multi.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: multi.yaml
- type: object
required:
- sample_rate
@ -106,3 +104,6 @@ allOf:
default: 0.0
example: 1.0
description: An offset added to the calculated RoCoF. This setting does not really make sense but is available for completeness reasons"
- $ref: common.yaml
- $ref: multi.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: single.yaml
- type: object
required:
- expected_smp_rate
@ -28,3 +26,6 @@ allOf:
horizon_compensation:
type: integer
default: 10
- $ref: common.yaml
- $ref: single.yaml

View file

@ -2,7 +2,6 @@
---
allOf:
- $ref: common.yaml
- type: object
properties:
output:
@ -15,4 +14,5 @@ allOf:
type: string
default: ''
description: An optional prefix which will be prepended to each line written by this hook to the output
- $ref: common.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: multi.yaml
- type: object
properties:
window_size:
@ -12,3 +10,6 @@ allOf:
example: 100
default: 0
minimum: 0
- $ref: common.yaml
- $ref: multi.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: multi.yaml
- type: object
properties:
precision:
@ -11,3 +9,6 @@ allOf:
default: 0
example: 4
description: The number of decimal digits to which the singal is rounded.
- $ref: common.yaml
- $ref: multi.yaml

View file

@ -2,8 +2,6 @@
---
allOf:
- $ref: common.yaml
- $ref: multi.yaml
- type: object
properties:
offset:
@ -17,4 +15,5 @@ allOf:
example: 1e3
description: The gain which is mulitplied to the signal before the offset is added.
- $ref: common.yaml
- $ref: multi.yaml

View file

@ -2,7 +2,6 @@
---
allOf:
- $ref: common.yaml
- type: object
required:
- offset
@ -11,3 +10,4 @@ allOf:
type: integer
description: The offset which is added to the sequence number of each processed sample.
- $ref: common.yaml

View file

@ -2,7 +2,6 @@
---
allOf:
- $ref: common.yaml
- type: object
required:
- offset
@ -16,3 +15,5 @@ allOf:
offset:
type: number
description: The offset in seconds which is added to the timestamp field of each processed sample.
- $ref: common.yaml

View file

@ -2,7 +2,6 @@
---
allOf:
- $ref: common.yaml
- type: object
properties:
samples:
@ -11,3 +10,5 @@ allOf:
seconds:
type: number
description: The number of seconds for which this hook should initially drop samples after a start or restart of the node/path.
- $ref: common.yaml

View file

@ -2,7 +2,6 @@
---
allOf:
- $ref: common.yaml
- type: object
properties:
format:
@ -23,3 +22,5 @@ allOf:
type: string
description: The file where you want to write the report to. If omitted, stdout (the terminal) will be used.
default: '/dev/stdout'
- $ref: common.yaml

View file

@ -10,4 +10,5 @@ allOf:
```bash
curl http://localhost:80/api/v2/universal/api_node_name/config
```
- $ref: ../node.yaml

View file

@ -3,5 +3,25 @@
allOf:
- type: object
properties: {}
properties:
interface_name:
type: string
description: Name of the Socket CAN interface
in:
type: object
properties:
signals:
type: array
items:
$ref: ./signals/can.yaml
out:
type: object
properties:
signals:
type: array
items:
$$ref: ./signals/can.yaml
- $ref: ../node.yaml

View file

@ -3,7 +3,37 @@
allOf:
- type: object
required:
- rate
- signals
properties:
format:
$ref: ../format_spec.yaml
subdevice:
type: integer
bufsize:
type: integer
default: 16
signals:
type: array
items:
type: object
required:
- channel
- range
- aref
properties:
channel:
type: integer
range:
type: integer
aref:
type: integer
rate:
type: integer
- $ref: ../node.yaml

View file

@ -2,8 +2,39 @@
---
allOf:
- $ref: ../node.yaml
- type: object
properties:
format:
$ref: ../format_spec.yaml
rate:
type: number
in:
type: object
properties:
num_channels:
type: integer
range:
type: number
product_code:
type: integer
vendor_id:
type: integer
out:
type: object
properties:
num_channels:
type: integer
range:
type: number
product_code:
type: integer
vendor_id:
type: integer
- $ref: ../node.yaml

View file

@ -19,7 +19,7 @@ allOf:
exec:
description: |
The program which should be execed in the sub-process.
The program which should be executed in the sub-process.
The option is passed to the system shell for execution.
@ -43,7 +43,6 @@ allOf:
environment:
type: object
description: |
A object of key/value pairs of environemnt variables which should be passed to the sub-process in addition to the parent environment.
A object of key/value pairs of environment variables which should be passed to the sub-process in addition to the parent environment.
- $ref: ../node.yaml

View file

@ -12,7 +12,7 @@ allOf:
signals:
type: array
items:
$ref: ../iec61850_signal.yaml
$ref: ./signals/iec61850.yaml
out:
type: object
@ -23,7 +23,7 @@ allOf:
signals:
type: array
items:
$ref: ../iec61850_signal.yaml
$ref: ./signals/iec61850.yaml
svid:
type: string
@ -47,8 +47,6 @@ allOf:
vlan_priority:
type: integer
interface:
type: string
description: Name of network interface to/from which this node will publish/subscribe for SV frames.

View file

@ -75,8 +75,4 @@ allOf:
description: A timeout in seconds for the broker connection.
default: 1.0
- $ref: ../node.yaml

View file

@ -26,5 +26,4 @@ allOf:
default: auto
description: Specify the synchronization mode of the internal queue.
- $ref: ../node.yaml

View file

@ -18,9 +18,9 @@ allOf:
ssl_verify:
type: boolean
description: Verify SSL certificate against local trust store.
timeout:
type: number
- $ref: ../node.yaml

View file

@ -60,7 +60,6 @@ allOf:
See: https://redis.io/commands/auth
db:
type: integer
default: 0
@ -126,8 +125,4 @@ allOf:
type: string
description: A path to the private key file.
- $ref: ../node.yaml

View file

@ -7,6 +7,46 @@ allOf:
format:
$ref: ../format_spec.yaml
rtcp:
type: boolean
description: Enable Real-time Control Protocol (RTCP)
aimd:
type: object
properties:
a:
type: number
default: 10
b:
type: number
default: 0.5
Kp:
type: number
default: 1.0
Ki:
type: number
default: 0.0
Kd:
type: number
default: 0.0
rate_min:
type: number
default: 1
rate_source:
type: number
default: 2000
rate_init:
type: number
log:
type: string
hook_type:
type: string
default: disabled
enum:
- decimate
- limit_rate
- disabled
out:
type: object
properties:

View file

@ -56,7 +56,6 @@ allOf:
default: 0.0
description: Tha pase of the signal when the `signal` setting is one of `sine` or `pulse`.
pulse_width:
type: number
default: 1.0

View file

@ -4,7 +4,33 @@
allOf:
- type: object
properties:
format:
$ref: ../format_spec.yaml
realtime:
type: boolean
default: true
description: Pace the generation of samples by the `rate` setting.
limit:
type: integer
default: 0
description: Stop the node after the provided number of samples.
rate:
type: number
description: The rate at which the samples are generated if operating in real-time mode (See `realtime` option).
monitor_missed:
type: boolean
default: false
description: Raise warnings if the signal generator fails to operate in real-time due to missed deadlines.
in:
type: object
required:
- signals
properties:
signals:
type: array
items:
$ref: ./signals/generator.yaml
- $ref: ../node.yaml

View file

@ -0,0 +1,16 @@
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
---
type: object
properties:
can_id:
type: integer
default: 0
can_size:
type: integer
default: 8
can_offset:
type: integer
default: 0

View file

@ -1,4 +1,6 @@
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
---
type: object
properties:
name:

View file

@ -0,0 +1,72 @@
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
---
type: object
required:
- signal
properties:
signal:
type: string
enum:
- random
- sine
- square
- triangle
- ramp
- counter
- constant
- mixed
- pulse
description: |
The type of signal which should be generated:
- `random`: a random walk with normal distributed step sizes will be generated.
- `sine`: a sine signal will be generated.
- `square`: a square / rectangle wave will be generated.
- `triangle`: a triangle wave will be generated.
- `ramp`: the generator will produce a ramp signal in the interval `[ 0, 1 / f ]`.
- `counter`: increasing integer counter is generated.
- `constant`: a constant value generated.
- `mixed`: the signals of of each sample are generated by cycling over all remaining signal types.
- `pulse`: generates pulses with a set frequency, phase and width
amplitude:
type: number
description: The amplitude of the signal when the `signal` setting is one of `sine`, `square` or `triangle`.
default: 1.0
frequency:
type: number
description: The frequency of the signal when the `signal` setting is one of `sine`, `square`, `triangle`,`pulse` or `ramp`.
default: 1.0
phase:
type: number
default: 0.0
description: Tha pase of the signal when the `signal` setting is one of `sine` or `pulse`.
pulse_width:
type: number
default: 1.0
description: The width of the pulse, with respect to the rate
pulse_low:
type: number
default: 0.0
description: The low value of the pulse signal.
pulse_high:
type: number
default: 1.0
description: The high value of the pulse signal.
stddev:
type: number
default: 0.2
description: The standard deviation of the normal distributed steps if the `signal` setting is set to `random`.
offset:
type: number
default: 0.0
description: Adds a constant offset to each of the generated signals.

View file

@ -1,4 +1,6 @@
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
---
title: Signal list
description: |
Each node should define a list of signals which it receives.

View file

@ -46,7 +46,6 @@ allOf:
netem:
$ref: ../netem.yaml
multicast:
type: object
properties:
@ -70,5 +69,4 @@ allOf:
loop:
type: boolean
- $ref: ../node.yaml

View file

@ -4,7 +4,17 @@
allOf:
- type: object
properties:
format:
$ref: ../format_spec.yaml
rate:
type: number
description: A rate in Hz at which the statistics are generated by this node.
in:
type: object
required: signals
properties:
signals:
type: array
items:
$ref: ./signals/stats.yaml
- $ref: ../node.yaml

View file

@ -25,5 +25,4 @@ allOf:
type: integer
description: A filter applied to the USB port number for selecting a specific sensor if multiple are available.
- $ref: ../node.yaml

View file

@ -3,8 +3,72 @@
allOf:
- type: object
required:
- cases
properties:
format:
$ref: ../format_spec.yaml
prefix:
type: string
description: A prefix which is prepended to the output file name of the RTT test result file.
example: "test_1"
output:
type: string
default: "."
description: A directory path at which the RTT test result files be placed.
cooldown:
type: number
default: 0.0
description: |
A cool-down time between consecutive test cases.
The node will insert a pause between the tests to avoid any network effects of the previous test-case to influence the upcoming test-case.
cases:
type: object
description: |
A list of test-case specifications.
The values from the `rates` and `values` settings of each-test case specification will be used to form a cross-product.
properties:
rates:
description: |
A list of sending rates in Hz.
The resulting test-case will generate samples at the given rate.
example:
- 10
- 100
- 1000
- 10000
type: array
items:
type: number
values:
description: |
A list of sample length.
The resulting test-case will generate samples with the given number of signals.
type: array
items:
type: integer
example:
- 10
- 100
limit:
description: |
The resulting test-case will send the number of samples specified by this setting.
This setting is exclusive with the `duration` setting.
type: integer
example: 10000
duration:
description: |
The resulting test-case will be stopped after the configured duration in seconds.
This setting is exclusive with the `limit` setting.
type: number
example: 60.0
- $ref: ../node.yaml

View file

@ -53,5 +53,4 @@ allOf:
description: |
The private key of the server.
- $ref: ../node.yaml

View file

@ -43,7 +43,6 @@ struct can_signal {
struct can {
/* Settings */
char *interface_name;
double *sample_rate;
struct can_signal *in;
struct can_signal *out;

View file

@ -132,9 +132,8 @@ int villas::node::can_parse(NodeCompat *n, json_t *json)
c->in = nullptr;
c->out = nullptr;
ret = json_unpack_ex(json, &err, 0, "{ s: s, s: F, s?: { s?: o }, s?: { s?: o } }",
ret = json_unpack_ex(json, &err, 0, "{ s: s, s?: { s?: o }, s?: { s?: o } }",
"interface_name", &c->interface_name,
"sample_rate", &c->sample_rate,
"in",
"signals", &json_in_signals,
"out",