Skip to content

Commit b0b8aec

Browse files
authored
Merge pull request #199 from TheTransitClock/tc_issue_198
Update traccar swagger file to latest version.
2 parents 9e2e648 + 316b12c commit b0b8aec

File tree

1 file changed

+198
-20
lines changed

1 file changed

+198
-20
lines changed

transitclockTraccarClient/src/main/resources/swagger.json

Lines changed: 198 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"swagger": "2.0",
33
"info": {
4-
"version": "3.15",
4+
"version": "4.8",
55
"title": "traccar"
66
},
77
"host": "demo.traccar.org",
@@ -168,11 +168,22 @@
168168
{
169169
"name": "deviceId",
170170
"in": "query",
171+
"description" : "Internal device identifier. Only works if device has already reported some locations",
172+
"required" : false,
171173
"type": "integer"
172174
},
175+
{
176+
"name": "protocol",
177+
"in": "query",
178+
"description" : "Protocol name. Can be used instead of device id",
179+
"required" : false,
180+
"type": "string"
181+
},
173182
{
174183
"name": "textChannel",
175184
"in": "query",
185+
"description" : "When `true` return SMS commands. If not specified or `false` return data commands",
186+
"required" : false,
176187
"type": "boolean"
177188
}
178189
],
@@ -286,9 +297,9 @@
286297
}
287298
}
288299
},
289-
"/devices/{id}/distance": {
300+
"/devices/{id}/accumulators": {
290301
"put": {
291-
"summary": "Update the distance counter of the Device",
302+
"summary": "Update total distance and hours of the Device",
292303
"parameters": [
293304
{
294305
"$ref": "#/parameters/entityId"
@@ -298,7 +309,7 @@
298309
"in": "body",
299310
"required": true,
300311
"schema": {
301-
"$ref": "#/definitions/DeviceTotalDistance"
312+
"$ref": "#/definitions/DeviceAccumulators"
302313
}
303314
}
304315
],
@@ -1350,6 +1361,90 @@
13501361
}
13511362
}
13521363
}
1364+
},
1365+
"/maintenance": {
1366+
"get": {
1367+
"summary": "Fetch a list of Maintenance",
1368+
"description": "Without params, it returns a list of Maintenance the user has access to",
1369+
"parameters": [
1370+
{
1371+
"$ref": "#/parameters/all"
1372+
},
1373+
{
1374+
"$ref": "#/parameters/userId"
1375+
},
1376+
{
1377+
"$ref": "#/parameters/deviceId"
1378+
},
1379+
{
1380+
"$ref": "#/parameters/groupId"
1381+
},
1382+
{
1383+
"$ref": "#/parameters/refresh"
1384+
}
1385+
],
1386+
"responses": {
1387+
"200": {
1388+
"description": "OK",
1389+
"schema": {
1390+
"type": "array",
1391+
"items": {
1392+
"$ref": "#/definitions/Maintenance"
1393+
}
1394+
}
1395+
}
1396+
}
1397+
},
1398+
"post": {
1399+
"summary": "Create a Maintenance",
1400+
"parameters": [
1401+
{
1402+
"$ref": "#/parameters/Maintenance"
1403+
}
1404+
],
1405+
"responses": {
1406+
"200": {
1407+
"description": "OK",
1408+
"schema": {
1409+
"$ref": "#/definitions/Maintenance"
1410+
}
1411+
}
1412+
}
1413+
}
1414+
},
1415+
"/maintenance/{id}": {
1416+
"put": {
1417+
"summary": "Update a Maintenance",
1418+
"parameters": [
1419+
{
1420+
"$ref": "#/parameters/entityId"
1421+
},
1422+
{
1423+
"$ref": "#/parameters/Maintenance"
1424+
}
1425+
],
1426+
"responses": {
1427+
"200": {
1428+
"description": "OK",
1429+
"schema": {
1430+
"$ref": "#/definitions/Maintenance"
1431+
}
1432+
}
1433+
}
1434+
},
1435+
"delete": {
1436+
"summary": "Delete a Maintenance",
1437+
"parameters": [
1438+
{
1439+
"$ref": "#/parameters/entityId"
1440+
}
1441+
],
1442+
"responses": {
1443+
"204": {
1444+
"description": "No Content"
1445+
}
1446+
}
1447+
}
13531448
}
13541449
},
13551450
"definitions": {
@@ -1408,9 +1503,13 @@
14081503
"type": "number"
14091504
},
14101505
"network": {
1411-
"type": "string"
1506+
"type": "object",
1507+
"additionalProperties": true
14121508
},
1413-
"attributes": {}
1509+
"attributes": {
1510+
"type": "object",
1511+
"additionalProperties": true
1512+
}
14141513
}
14151514
},
14161515
"User": {
@@ -1427,7 +1526,7 @@
14271526
"readonly": {
14281527
"type": "boolean"
14291528
},
1430-
"admin": {
1529+
"administrator": {
14311530
"type": "boolean"
14321531
},
14331532
"map": {
@@ -1471,10 +1570,16 @@
14711570
"limitCommands": {
14721571
"type": "boolean"
14731572
},
1573+
"poiLayer": {
1574+
"type": "string"
1575+
},
14741576
"token": {
14751577
"type": "string"
14761578
},
1477-
"attributes": {}
1579+
"attributes": {
1580+
"type": "object",
1581+
"additionalProperties": true
1582+
}
14781583
}
14791584
},
14801585
"Server": {
@@ -1503,6 +1608,9 @@
15031608
"mapUrl": {
15041609
"type": "string"
15051610
},
1611+
"poiLayer": {
1612+
"type": "string"
1613+
},
15061614
"latitude": {
15071615
"type": "number"
15081616
},
@@ -1524,7 +1632,10 @@
15241632
"coordinateFormat": {
15251633
"type": "string"
15261634
},
1527-
"attributes": {}
1635+
"attributes": {
1636+
"type": "object",
1637+
"additionalProperties": true
1638+
}
15281639
}
15291640
},
15301641
"Command": {
@@ -1541,7 +1652,10 @@
15411652
"type": {
15421653
"type": "string"
15431654
},
1544-
"attributes": {}
1655+
"attributes": {
1656+
"type": "object",
1657+
"additionalProperties": true
1658+
}
15451659
}
15461660
},
15471661
"Device": {
@@ -1558,6 +1672,9 @@
15581672
"status": {
15591673
"type": "string"
15601674
},
1675+
"disabled": {
1676+
"type": "boolean"
1677+
},
15611678
"lastUpdate": {
15621679
"type": "string",
15631680
"format": "date-time",
@@ -1587,7 +1704,10 @@
15871704
"type": "integer"
15881705
}
15891706
},
1590-
"attributes": {}
1707+
"attributes": {
1708+
"type": "object",
1709+
"additionalProperties": true
1710+
}
15911711
}
15921712
},
15931713
"Group": {
@@ -1601,7 +1721,10 @@
16011721
"groupId": {
16021722
"type": "integer"
16031723
},
1604-
"attributes": {}
1724+
"attributes": {
1725+
"type": "object",
1726+
"additionalProperties": true
1727+
}
16051728
}
16061729
},
16071730
"Permission": {
@@ -1624,7 +1747,7 @@
16241747
"type": "integer"
16251748
},
16261749
"calendarId": {
1627-
"description": "Geofence Id, can be second parameter only and only in combination with userId",
1750+
"description": "Calendar Id, can be second parameter only and only in combination with userId",
16281751
"type": "integer"
16291752
},
16301753
"attributeId": {
@@ -1665,7 +1788,10 @@
16651788
"calendarId": {
16661789
"type": "integer"
16671790
},
1668-
"attributes": {}
1791+
"attributes": {
1792+
"type": "object",
1793+
"additionalProperties": true
1794+
}
16691795
}
16701796
},
16711797
"Notification": {
@@ -1688,7 +1814,13 @@
16881814
"sms": {
16891815
"type": "boolean"
16901816
},
1691-
"attributes": {}
1817+
"calendarId": {
1818+
"type": "integer"
1819+
},
1820+
"attributes": {
1821+
"type": "object",
1822+
"additionalProperties": true
1823+
}
16921824
}
16931825
},
16941826
"NotificationType": {
@@ -1720,7 +1852,13 @@
17201852
"geofenceId": {
17211853
"type": "integer"
17221854
},
1723-
"attributes": {}
1855+
"maintenanceId": {
1856+
"type": "integer"
1857+
},
1858+
"attributes": {
1859+
"type": "object",
1860+
"additionalProperties": true
1861+
}
17241862
}
17251863
},
17261864
"ReportSummary": {
@@ -1878,14 +2016,17 @@
18782016
}
18792017
}
18802018
},
1881-
"DeviceTotalDistance": {
2019+
"DeviceAccumulators": {
18822020
"properties": {
18832021
"deviceId": {
18842022
"type": "integer"
18852023
},
18862024
"totalDistance": {
18872025
"type": "number",
18882026
"description": "in meters"
2027+
},
2028+
"hours": {
2029+
"type": "number"
18892030
}
18902031
}
18912032
},
@@ -1901,7 +2042,10 @@
19012042
"type": "string",
19022043
"description": "base64 encoded in iCalendar format"
19032044
},
1904-
"atributes": {}
2045+
"attributes": {
2046+
"type": "object",
2047+
"additionalProperties": true
2048+
}
19052049
}
19062050
},
19072051
"Attribute": {
@@ -1935,7 +2079,33 @@
19352079
"uniqueId": {
19362080
"type": "string"
19372081
},
1938-
"atributes": {}
2082+
"attributes": {
2083+
"type": "object",
2084+
"additionalProperties": true
2085+
}
2086+
}
2087+
},
2088+
"Maintenance": {
2089+
"properties": {
2090+
"id": {
2091+
"type": "integer"
2092+
},
2093+
"name": {
2094+
"type": "string"
2095+
},
2096+
"type": {
2097+
"type": "string"
2098+
},
2099+
"start": {
2100+
"type": "number"
2101+
},
2102+
"period": {
2103+
"type": "number"
2104+
},
2105+
"attributes": {
2106+
"type": "object",
2107+
"additionalProperties": true
2108+
}
19392109
}
19402110
}
19412111
},
@@ -2056,6 +2226,14 @@
20562226
"$ref": "#/definitions/Notification"
20572227
}
20582228
},
2229+
"Maintenance": {
2230+
"name": "body",
2231+
"in": "body",
2232+
"required": true,
2233+
"schema": {
2234+
"$ref": "#/definitions/Maintenance"
2235+
}
2236+
},
20592237
"deviceIdArray": {
20602238
"name": "deviceId",
20612239
"in": "query",
@@ -2097,4 +2275,4 @@
20972275
"description": "Basic HTTP authorization with _email_ and _password_"
20982276
}
20992277
}
2100-
}
2278+
}

0 commit comments

Comments
 (0)