-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.yml
170 lines (169 loc) · 3.37 KB
/
server.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
swagger: "2.0"
info:
title: Jupiter
version: 0.1.0
consumes:
- application/json
produces:
- application/json
schemes:
- http
paths:
/sensors:
get:
description: Returns the list of sensors
operationId: getSensorsList
responses:
200:
description: Success
schema:
$ref: '#/definitions/SensorList'
default:
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
/sensors/{sensorId}:
parameters:
- name: sensorId
type: string
in: path
required: true
get:
description: Returns the data of a particular sensor
operationId: getSensorData
responses:
200:
description: Success
schema:
$ref: '#/definitions/SensorResponse'
404:
description: Sensor not found.
504:
description: Sensor is not available.
default:
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
/sensors/{sensorId}/raw:
parameters:
- name: sensorId
type: string
in: path
required: true
get:
description: Returns the data of a particular sensor in simple JSON
operationId: getSensorDataRaw
responses:
200:
description: Success
schema:
$ref: '#/definitions/SensorResponseRaw'
404:
description: Sensor not found.
504:
description: Sensor is not available.
default:
description: Error
schema:
$ref: "#/definitions/ErrorResponse"
definitions:
SensorList:
type: object
required:
- data
properties:
data:
type: array
items:
$ref: '#/definitions/SensorCard'
links:
$ref: '#/definitions/GenericLinks'
SensorCard:
type: object
required:
- id
- name
- links
properties:
id:
type: string
name:
type: string
links:
$ref: '#/definitions/GenericLinks'
SensorResponse:
type: object
required:
- data
properties:
data:
$ref: '#/definitions/SensorData'
links:
$ref: '#/definitions/GenericLinks'
SensorData:
type: object
required:
- id
- name
- temperature
- humidity
- timestamp
- deltaTime
- stale
properties:
id:
type: string
name:
type: string
temperature:
type: number
humidity:
type: number
heatIndex:
type: number
timestamp:
type: string
format: date-time
deltaTime:
type: integer
stale:
type: boolean
SensorResponseRaw:
type: object
required:
- temperature
- humidity
properties:
temperature:
type: number
humidity:
type: number
GenericLinks:
type: object
required:
- self
properties:
self:
type: string
ErrorResponse:
type: object
required:
- errors
properties:
errors:
type: array
items:
$ref: '#/definitions/ErrorObject'
ErrorObject:
type: object
required:
- id
properties:
id:
type: string
title:
type: string
detail:
type: string
code:
type: string