mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 04:20:17 +00:00
a0c40ba462
* chore(license): update copyright notices Add CI check for non go files to check that the files contain a license Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * fix(ci): log failed files When the CI fails during check for license header, log the failed file to console so that someone can check on the actual file. Also simplify the grep check to make it more human readable and understandable Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
113 lines
3.0 KiB
YAML
113 lines
3.0 KiB
YAML
# Copyright (c) Abstract Machines
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
asyncapi: '2.6.0'
|
|
id: 'https://github.com/absmach/magistrala/blob/master/api/asyncapi/mqtt.yml'
|
|
info:
|
|
title: Magistrala MQTT Adapter
|
|
version: '1.0.0'
|
|
contact:
|
|
name: Magistrala Team
|
|
url: 'https://github.com/absmach/magistrala'
|
|
email: info@mainflux.com
|
|
description: |
|
|
MQTT adapter provides an MQTT API for sending messages through the platform. MQTT adapter uses [mProxy](https://github.com/magistrala/mproxy) for proxying traffic between client and MQTT broker.
|
|
Additionally, the MQTT adapter and the message broker are replicating the traffic between brokers.
|
|
|
|
license:
|
|
name: Apache 2.0
|
|
url: 'https://github.com/absmach/magistrala/blob/master/LICENSE'
|
|
|
|
|
|
defaultContentType: application/json
|
|
|
|
servers:
|
|
dev:
|
|
url: localhost:{port}
|
|
protocol: mqtt
|
|
description: Test broker
|
|
variables:
|
|
port:
|
|
description: Secure connection (TLS) is available through port 8883.
|
|
default: '1883'
|
|
enum:
|
|
- '1883'
|
|
- '8883'
|
|
security:
|
|
- user-password: []
|
|
|
|
channels:
|
|
channels/{channelID}/messages/{subtopic}:
|
|
parameters:
|
|
channelID:
|
|
$ref: '#/components/parameters/channelID'
|
|
in: path
|
|
required: true
|
|
subtopic:
|
|
$ref: '#/components/parameters/subtopic'
|
|
in: path
|
|
required: false
|
|
|
|
publish:
|
|
traits:
|
|
- $ref: '#/components/operationTraits/mqtt'
|
|
message:
|
|
$ref: '#/components/messages/jsonMsg'
|
|
subscribe:
|
|
traits:
|
|
- $ref: '#/components/operationTraits/mqtt'
|
|
message:
|
|
$ref: '#/components/messages/jsonMsg'
|
|
|
|
components:
|
|
messages:
|
|
jsonMsg:
|
|
title: JSON Message
|
|
summary: Arbitrary JSON array or object.
|
|
contentType: application/json
|
|
payload:
|
|
$ref: "#/components/schemas/jsonMsg"
|
|
|
|
schemas:
|
|
jsonMsg:
|
|
type: object
|
|
description: Arbitrary JSON object or array. SenML format is recommended.
|
|
example: |
|
|
### SenML
|
|
```json
|
|
[{"bn":"some-base-name:","bt":1641646520, "bu":"A","bver":5, "n":"voltage","u":"V","v":120.1}, {"n":"current","t":-5,"v":1.2}, {"n":"current","t":-4,"v":1.3}]
|
|
```
|
|
### JSON
|
|
```json
|
|
{"field_1":"val_1", "t": 1641646525}
|
|
```
|
|
### JSON Array
|
|
```json
|
|
[{"field_1":"val_1", "t": 1641646520},{"field_2":"val_2", "t": 1641646522}]
|
|
```
|
|
|
|
parameters:
|
|
channelID:
|
|
description: Channel ID connected to the Thing ID defined in the username.
|
|
schema:
|
|
type: string
|
|
format: uuid
|
|
subtopic:
|
|
description: Arbitrary message subtopic.
|
|
schema:
|
|
type: string
|
|
default: ''
|
|
|
|
securitySchemes:
|
|
user-password:
|
|
type: userPassword
|
|
description: |
|
|
username is thing ID connected to the channel defined in the mqtt topic and
|
|
password is thing key corresponding to the thing ID
|
|
|
|
operationTraits:
|
|
mqtt:
|
|
bindings:
|
|
mqtt:
|
|
qos: 2
|