Projekt

Obecné

Profil

Stáhnout (6.02 KB) Statistiky
| Větev: | Tag: | Revize:
1 6b3c455c hlavja
openapi: 3.0.1
2
info:
3
  title: SensLog
4
  description: 'ASWI semestral project of CodeBakers.'
5
  version: 1.0.0
6
externalDocs:
7
  description: Find out more about Swagger
8 f86d42a9 hlavja
  url: https://swagger.io
9 f8b9a3a2 hlavja
10 6b3c455c hlavja
tags:
11
- name: login
12
  description: Login process
13
  externalDocs:
14
    description: Find out more
15
    url: https://www.senslog.org/api/v1/
16
- name: group
17
  description: Groups endpoints
18 1d6ec56f hlavja
- name: data
19
  description: Data endpoints
20 db9d0213 hlavja
- name: observation
21
  description: Observations endpoints
22 1d6ec56f hlavja
23 6b3c455c hlavja
paths:
24 f8b9a3a2 hlavja
  /senslog1/ControllerServlet:
25 6b3c455c hlavja
    post:
26
      tags:
27
      - login
28
      summary: Authorize login
29
      operationId: login
30 f8b9a3a2 hlavja
      parameters:
31 6b3c455c hlavja
        - in: query
32 f8b9a3a2 hlavja
          name: username
33 6b3c455c hlavja
          schema:
34
            type: string
35
          description: User login
36
        - in: query
37
          name: password
38
          schema:
39
            type: string
40
          description: User password
41
      responses:
42
        200:
43
          description: successful operation
44
          content:
45
            application/json:
46
              schema:
47 f8b9a3a2 hlavja
                $ref: '#/components/schemas/UserInfo'
48
49
  /senslog1/GroupService:
50 6b3c455c hlavja
    get:
51
      tags:
52
      - group
53
      summary: Get groups
54
      operationId: getGroups
55
      parameters:
56
        - in: query
57 f8b9a3a2 hlavja
          name: Operation
58 6b3c455c hlavja
          required: true
59
          schema:
60
            type: string
61
            default: GetGroups
62
            enum:
63
            - GetGroups
64
            - GetSuperGroups
65
            - GetSubGroups
66
          description: Group operation
67
        - in: query
68
          name: parent_group
69
          schema:
70
            type: integer
71
      responses:
72
        200:
73
          description: successful operation
74
          content:
75
            application/json:
76
              schema:
77
                type: array
78
                items:
79
                  $ref: '#/components/schemas/Group'
80 f8b9a3a2 hlavja
81 db9d0213 hlavja
  /senslog1/SensorService?Operation=GetObservations:
82
    get:
83
      tags:
84
        - observation
85
      summary: Get observation
86
      operationId: getObservation
87
      parameters:
88
        - in: query
89
          name: unit_id
90
          required: true
91
          schema:
92
            type: integer
93
        - in: query
94
          name: sensor_id
95
          required: true
96
          schema:
97
            type: integer
98
        - in: query
99
          name: from
100
          schema:
101
            type: string
102
        - in: query
103
          name: to
104
          schema:
105
            type: string
106
      responses:
107
        200:
108
          description: Get observation for unitId and sensorId
109
          content:
110
            application/json:
111
              schema:
112
                type: array
113
                items:
114
                  $ref: '#/components/schemas/Observation'
115
116 1d6ec56f hlavja
  /senslog1/DataService?Operation=GetUnits:
117
    get:
118
      tags:
119
        - data
120
      summary: Get data
121
      operationId: getData
122
      responses:
123
        200:
124
          description: successful operation
125
          content:
126
            application/json:
127
              schema:
128
                type: array
129
                items:
130
                  oneOf:
131
                    - type: object
132
                      properties:
133
                        drivers:
134
                          $ref: '#/components/schemas/Drivers'
135
                        generalInfo:
136
                          $ref: '#/components/schemas/GeneralInfo'
137
                        holder:
138
                          nullable: true
139
                        lastpos:
140
                          $ref: '#/components/schemas/Lastpos'
141
                        sensors:
142
                          type: array
143
                          items:
144
                            $ref: '#/components/schemas/Sensor'
145
                        unit:
146
                          $ref: '#/components/schemas/Unit'
147
148 6b3c455c hlavja
components:
149
  schemas:
150 f8b9a3a2 hlavja
    UserInfo:
151 6b3c455c hlavja
      type: object
152
      properties:
153
        sessionid:
154
          type: string
155
        language:
156
          type: string
157
        audio:
158
          type: boolean
159 1d6ec56f hlavja
        rights:
160
          type: integer
161 f8b9a3a2 hlavja
162 6b3c455c hlavja
    Group:
163
      type: object
164
      properties:
165
        id:
166
          type: integer
167
        parent_group_id:
168
          type: integer
169
        group_name:
170
          type: string
171
        has_children:
172
          type: boolean
173 1d6ec56f hlavja
174
    Unit:
175
      type: object
176
      properties:
177
        description:
178
          type: string
179
        holderId:
180
          type: integer
181
        unitId:
182
          type: integer
183
184
    Phenomenon:
185
      type: object
186
      properties:
187
        phenomenonId:
188
          type: string
189
        phenomenonName:
190
          type: string
191
        unit:
192
          type: string
193
194
    Sensor:
195
      type: object
196
      properties:
197
        firstObservationTime:
198
          type: string
199
          format: date-time
200
        lastObservationTime:
201
          type: string
202
          format: date-time
203
        phenomenon:
204
          $ref: '#/components/schemas/Phenomenon'
205
        sensorId:
206
          type: integer
207
        sensorName:
208
          type: string
209
        sensorType:
210
          type: string
211
212
    Position:
213
      type: object
214
      properties:
215
        SRID:
216
          type: string
217
        gid:
218
          type: integer
219
        group_id:
220
          type: integer
221
        postgisGeomString:
222
          type: string
223
        postgisString:
224
          type: string
225
        speed:
226
          type: integer
227
        time_stamp:
228
          type: string
229
          format: date-time
230
        unit_id:
231
          type: integer
232
        x:
233
          type: number
234
        y:
235
          type: number
236
237
    Attributes:
238
      type: object
239
      properties:
240
        is_online:
241
          type: boolean
242
        is_moving:
243
          type: boolean
244
    #TODO
245
    AlertEvents:
246
      type: array
247
248
    Lastpos:
249
      type: object
250
      properties:
251
        alertEvents:
252
          $ref: '#/components/schemas/AlertEvents'
253
        attributes:
254
          $ref: '#/components/schemas/Attributes'
255
        position:
256
          $ref: '#/components/schemas/Position'
257
    #TODO
258
    GeneralInfo:
259
      type: array
260
    #TODO
261
    Drivers:
262
      type: array
263
264 db9d0213 hlavja
    Observation:
265
      type: object
266
      properties:
267
        gid:
268
          type: integer
269
        time:
270
          type: string
271
          format: date-time
272
        value:
273
          type: number
274