-
Notifications
You must be signed in to change notification settings - Fork 0
/
asyncapi.yaml
58 lines (52 loc) · 1.32 KB
/
asyncapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
asyncapi: '2.6.0'
info:
title: Streetlights MQTT API
version: '1.0.0'
servers:
production:
url: test.mosquitto.org:1883
protocol: mqtt
description: Test broker
defaultContentType: application/json
channels:
smartylighting/streetlights/1/0/action/{streetlightId}/turn/on:
parameters:
streetlightId:
$ref: '#/components/parameters/streetlightId'
subscribe:
operationId: sendTurnOnOff
message:
$ref: '#/components/messages/turnOnOff'
publish:
operationId: recieveTurnOnOff
message:
$ref: '#/components/messages/turnOnOff'
components:
messages:
turnOnOff:
name: turnOnOff
title: Turn on/off
summary: Command a particular streetlight to turn the lights on or off.
payload:
$ref: "#/components/schemas/turnOnOffPayload"
schemas:
turnOnOffPayload:
type: object
properties:
command:
type: string
enum:
- on
- off
description: Whether to turn on or off the light.
sentAt:
$ref: "#/components/schemas/sentAt"
sentAt:
type: string
format: date-time
description: Date and time when the message was sent.
parameters:
streetlightId:
description: The ID of the streetlight.
schema:
type: string