asyncapi/birbnetes.yml

341 lines
9.3 KiB
YAML
Raw Permalink Normal View History

2020-07-06 15:59:50 +02:00
asyncapi: 2.0.0
info:
title: Birbnetes API
2020-07-26 17:51:21 +02:00
version: '2.0.1'
2020-07-06 15:59:50 +02:00
description: |
Async messages sent between major components of the Birbnetes system.
2020-07-16 14:33:45 +02:00
contact:
name: KMLabz Team
url: https://xwiki.kmlabz.com
email: birbnetes@kmlabz.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
2020-07-06 15:59:50 +02:00
servers:
2020-07-16 14:33:45 +02:00
kubernetes:
2020-07-06 15:59:50 +02:00
url: birb-rabbitmq:{port}
protocol: amqp
2020-07-16 14:33:45 +02:00
protocolVersion: "0.9.1"
2020-07-06 15:59:50 +02:00
description: RabbitMQ
2020-07-16 14:33:45 +02:00
security:
- user_pass: []
2020-07-06 15:59:50 +02:00
variables:
port:
description: Available in the birbnetes namespace of Kubernetes.
default: '5672'
2020-07-16 14:33:45 +02:00
edge:
url: activemq.kmlabz.com:{port}
protocol: secure-mqtt
protocolVersion: "3.x"
bindings:
mqtt:
clientId: iot
cleanSession: true
lastWill:
topic: /last-wills
qos: 2
message: Guest gone offline.
retain: false
keepAlive: 60
bindingVersion: 0.1.0
description: Apache ActiveMQ Artemis
variables:
port:
description: Only usable over mqtt-nio+ssl for better security.
default: '61616'
2020-07-06 15:59:50 +02:00
defaultContentType: application/json
channels:
2020-07-16 14:33:45 +02:00
kubernetes/wave:
bindings:
amqp:
queue:
name: please-declare
durable: true
autoDelete: false
vhost: /
exchange:
name: wave
type: fanout
durable: true
autoDelete: false
vhost: /
bindingVersion: 0.1.0
2020-07-06 15:59:50 +02:00
description: IDs of recieved sound files.
subscribe:
2020-07-16 14:33:45 +02:00
summary: Trigger classification
description: Used to trigger processing of recieved waveforms.
2020-07-06 15:59:50 +02:00
operationId: receiveMeasurement
message:
$ref: '#/components/messages/wave'
2020-07-16 14:33:45 +02:00
publish:
summary: Trigger classification
description: Trigger processing of a waveform.
operationId: triggerProcessing
message:
$ref: '#/components/messages/wave'
kubernetes/output:
bindings:
amqp:
ack: false
queue:
name: please-declare
durable: true
autoDelete: false
vhost: /
exchange:
name: output
type: fanout
durable: true
autoDelete: false
vhost: /
bindingVersion: 0.1.0
2020-07-06 15:59:50 +02:00
description: Confidence of AI
subscribe:
2020-07-16 14:33:45 +02:00
summary: AI Output
description: Probaility attached to a particular sample.
2020-07-06 15:59:50 +02:00
operationId: receiveProbability
message:
$ref: '#/components/messages/output'
2020-07-16 14:33:45 +02:00
publish:
summary: AI Output
description: Probaility attached to a particular sample.
operationId: sendprobability
message:
$ref: '#/components/messages/output'
2020-07-26 17:51:21 +02:00
device/sensor/{deviceID}/{sensorID}:
2020-07-16 14:33:45 +02:00
bindings:
mqt:
qos: 1
retain: true
bindingVersion: 0.1.0
description: Sensor measurement
2020-07-26 18:00:22 +02:00
parameters:
deviceID:
description: ID of an IoT device
schema:
type: string
format: uuid
sensorID:
description: ID of sensor on a device
schema:
type: string
format: uuid
2020-07-16 14:33:45 +02:00
subscribe:
summary: Recieve sensor data
description: Measurement of a sensor on a particular device.
operationId: recieveSensorData
message:
$ref: '#/components/messages/sensor'
publish:
summary: Send sensor data
description: Measurement of a sensor.
operationId: sendSensorData
message:
$ref: '#/components/messages/sensor'
2020-07-26 17:51:21 +02:00
device/control/{deviceID}:
2020-07-16 14:33:45 +02:00
bindings:
mqt:
qos: 2
retain: true
bindingVersion: 0.1.0
description: Command messages sent by the cloud
2020-07-26 18:00:22 +02:00
parameters:
deviceID:
description: ID of an IoT device
schema:
type: string
format: uuid
2020-07-16 14:33:45 +02:00
subscribe:
2020-07-26 17:51:21 +02:00
summary: Recieve control messages of device
description: Shutdown and powerof messages sent by cloud to a particular device
operationId: recieveDeviceCommand
2020-07-16 14:33:45 +02:00
message:
$ref: '#/components/messages/controlmessage'
publish:
2020-07-26 17:51:21 +02:00
summary: Send control messages to device
description: Send shutdown and poweron commands to a device.
operationId: sendDeviceCommand
2020-07-16 14:33:45 +02:00
message:
$ref: '#/components/messages/controlmessage'
2020-07-26 17:51:21 +02:00
device/control/{deviceID}/{sensorID}:
bindings:
mqt:
qos: 2
retain: true
bindingVersion: 0.1.0
description: Command messages sent by the cloud
2020-07-26 18:00:22 +02:00
parameters:
deviceID:
description: ID of an IoT device
schema:
type: string
format: uuid
sensorID:
description: ID of sensor on a device
schema:
type: string
format: uuid
2020-07-26 17:51:21 +02:00
subscribe:
summary: Recieve control messages of sensor
description: Shutdown and powerof messages sent by cloud to a sensor
operationId: recieveSensorCommand
message:
$ref: '#/components/messages/controlmessage'
publish:
summary: Send control messages to sensor
description: Send shutdown and poweron commands to a sensor.
operationId: sendSensorCommand
message:
$ref: '#/components/messages/controlmessage'
device/status/{deviceID}:
2020-07-16 14:47:48 +02:00
bindings:
mqt:
qos: 0
retain: true
bindingVersion: 0.1.0
description: Status messages of a device
2020-07-26 18:00:22 +02:00
parameters:
deviceID:
description: ID of an IoT device
schema:
type: string
format: uuid
2020-07-16 14:47:48 +02:00
subscribe:
2020-07-26 17:51:21 +02:00
summary: Recieve device status messages of device
2020-07-16 14:47:48 +02:00
description: Operation faliure or device status information
2020-07-26 18:02:58 +02:00
operationId: recieveDeviceStatusMessage
2020-07-16 14:47:48 +02:00
message:
$ref: '#/components/messages/statusmessage'
publish:
2020-07-26 17:51:21 +02:00
summary: Send status messages of device
description: Send operational messages of a device to interested parties
2020-07-26 18:02:58 +02:00
operationId: sendDeviceStatusMessage
2020-07-26 17:51:21 +02:00
message:
$ref: '#/components/messages/statusmessage'
device/status/{deviceID}/{sensorID}:
bindings:
mqt:
qos: 0
retain: true
bindingVersion: 0.1.0
description: Status messages of a device
2020-07-26 18:00:22 +02:00
parameters:
deviceID:
description: ID of an IoT device
schema:
type: string
format: uuid
sensorID:
description: ID of sensor on a device
schema:
type: string
format: uuid
2020-07-26 17:51:21 +02:00
subscribe:
summary: Recieve device status messages of sensor
description: Operation faliure or sensor status information
2020-07-26 18:02:58 +02:00
operationId: recieveSensorStatusMessage
2020-07-26 17:51:21 +02:00
message:
$ref: '#/components/messages/statusmessage'
publish:
summary: Send status messages of sensor
description: Send operational messages of a sensor to interested parties
2020-07-26 18:02:58 +02:00
operationId: sendSensorStatusMessage
2020-07-16 14:47:48 +02:00
message:
$ref: '#/components/messages/statusmessage'
2020-07-06 15:59:50 +02:00
components:
2020-07-16 14:33:45 +02:00
securitySchemes:
user_pass:
type: userPassword
description: Defined by helm chart.
2020-07-26 18:00:22 +02:00
2020-07-06 15:59:50 +02:00
messages:
wave:
name: wave
title: Recieve ID
summary: Unique ID used to identify a particular sample in the system.
contentType: application/json
2020-07-16 14:33:45 +02:00
bindings:
amqp:
bindingVersion: 0.1.0
2020-07-06 15:59:50 +02:00
payload:
$ref: "#/components/schemas/wavePayload"
output:
name: output
2020-07-16 14:33:45 +02:00
title: AI Output
summary: Confidence of AI attached to unique ID of sample.
2020-07-06 15:59:50 +02:00
contentType: application/json
2020-07-16 14:33:45 +02:00
bindings:
amqp:
bindingVersion: 0.1.0
2020-07-06 15:59:50 +02:00
payload:
$ref: "#/components/schemas/probabilityPayload"
2020-07-16 14:33:45 +02:00
sensor:
name: sensorsample
title: Sample measurement data
summary: Measurement made by a sensor on a device.
contentType: application/json
bindings:
mqtt:
bindingVersion: 0.1.0
payload:
$ref: "#/components/schemas/samplePayload"
controlmessage:
name: controlmessage
title: Control message
summary: Control message used to shut down and bring online devices
contentType: application/json
bindings:
mqtt:
bindingVersion: 0.1.0
payload:
$ref: "#/components/schemas/controlPayload"
2020-07-16 14:51:17 +02:00
statusmessage:
name: statusmessage
title: Status message
summary: Status messages sent by devices to any interested parties
contentType: application/json
bindings:
mqtt:
bindingVersion: 0.1.0
payload:
$ref: "#/components/schemas/statusPayload"
2020-07-06 15:59:50 +02:00
schemas:
wavePayload:
type: object
properties:
tag:
type: string
description: Unique ID
probabilityPayload:
type: object
properties:
tag:
type: string
summary: Unique ID used to identify a particular sample in the system.
probability:
type: number
minimum: 0
maximum: 1
summary: Probability of detection
2020-07-16 14:33:45 +02:00
samplePayload:
type: object
properties:
measurement:
type: string
summary: Measurement data
controlPayload:
type: object
properties:
command:
type: string
2020-07-18 14:38:10 +02:00
enum: ["online", "offline", "doAlert"]
2020-07-16 14:51:17 +02:00
statusPayload:
type: object
properties:
status:
2020-07-26 17:51:21 +02:00
type: string