From 82a28e3eedae7c93e839115d9411a39c7eb52e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Sun, 26 Jul 2020 17:51:21 +0200 Subject: [PATCH] rework mqtt api --- birbnetes.yml | 91 +++++++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 39 deletions(-) diff --git a/birbnetes.yml b/birbnetes.yml index 824fc96..2e21cb5 100644 --- a/birbnetes.yml +++ b/birbnetes.yml @@ -1,7 +1,7 @@ asyncapi: 2.0.0 info: title: Birbnetes API - version: '2.0.0' + version: '2.0.1' description: | Async messages sent between major components of the Birbnetes system. contact: @@ -105,7 +105,7 @@ channels: operationId: sendprobability message: $ref: '#/components/messages/output' - device/sensor: + device/sensor/{deviceID}/{sensorID}: bindings: mqt: qos: 1 @@ -124,7 +124,7 @@ channels: operationId: sendSensorData message: $ref: '#/components/messages/sensor' - device/control: + device/control/{deviceID}: bindings: mqt: qos: 2 @@ -132,18 +132,37 @@ channels: bindingVersion: 0.1.0 description: Command messages sent by the cloud subscribe: - summary: Recieve control messages - description: Shutdown and powerof messages sent by cloud - operationId: recieveCommand + summary: Recieve control messages of device + description: Shutdown and powerof messages sent by cloud to a particular device + operationId: recieveDeviceCommand message: $ref: '#/components/messages/controlmessage' publish: - summary: Send control messages - description: Send shutdown and poweron commands to a device or sensor. - operationId: sendCommand + summary: Send control messages to device + description: Send shutdown and poweron commands to a device. + operationId: sendDeviceCommand message: $ref: '#/components/messages/controlmessage' - device/status: + device/control/{deviceID}/{sensorID}: + bindings: + mqt: + qos: 2 + retain: true + bindingVersion: 0.1.0 + description: Command messages sent by the cloud + 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}: bindings: mqt: qos: 0 @@ -151,18 +170,36 @@ channels: bindingVersion: 0.1.0 description: Status messages of a device subscribe: - summary: Recieve device status messages + summary: Recieve device status messages of device description: Operation faliure or device status information operationId: recieveStatusMessage message: $ref: '#/components/messages/statusmessage' publish: - summary: Send status messages - description: Send operational messages to interested parties + summary: Send status messages of device + description: Send operational messages of a device to interested parties + operationId: sendStatusMessage + 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 + subscribe: + summary: Recieve device status messages of sensor + description: Operation faliure or sensor status information + operationId: recieveStatusMessage + message: + $ref: '#/components/messages/statusmessage' + publish: + summary: Send status messages of sensor + description: Send operational messages of a sensor to interested parties operationId: sendStatusMessage message: $ref: '#/components/messages/statusmessage' - components: securitySchemes: user_pass: @@ -242,41 +279,17 @@ components: samplePayload: type: object properties: - deviceID: - type: string - format: uuid - summary: Unique ID used to identify a particular device in the system. - sensorID: - type: string - format: uuid - summary: Unique ID used to identify a particular sensor on a device. measurement: type: string summary: Measurement data controlPayload: type: object properties: - deviceID: - type: string - format: uuid - summary: Unique ID used to identify a particular device in the system. - sensorID: - type: string - format: uuid - summary: Unique ID used to identify a particular sensor on a device. (May be wildcard or empty) command: type: string enum: ["online", "offline", "doAlert"] statusPayload: type: object properties: - deviceID: - type: string - format: uuid - summary: Unique ID used to identify a particular device in the system. - sensorID: - type: string - format: uuid - summary: Unique ID used to identify a particular sensor on a device. (May be wildcard or empty) status: - type: string \ No newline at end of file + type: string