aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-07-24 22:13:12 +1200
committerGitHub <noreply@github.com>2017-07-24 22:13:12 +1200
commit91c064aef1c851988fd3a3e43d2292304c4995df (patch)
treef6be0a940201debdf76008fd9db73058531ca8ba
parent4b2372336d0496c85befe099914434e5b68f05b3 (diff)
parent4292ab3b4bb638895a654e407cc548fd12ff49a8 (diff)
downloadtrackermap-server-91c064aef1c851988fd3a3e43d2292304c4995df.tar.gz
trackermap-server-91c064aef1c851988fd3a3e43d2292304c4995df.tar.bz2
trackermap-server-91c064aef1c851988fd3a3e43d2292304c4995df.zip
Merge pull request #3384 from Abyss777/actualize_swagger
Actualize swagger.json
-rw-r--r--swagger.json595
1 files changed, 303 insertions, 292 deletions
diff --git a/swagger.json b/swagger.json
index a82232f02..f4e816a5a 100644
--- a/swagger.json
+++ b/swagger.json
@@ -164,37 +164,6 @@
}
}
},
- "/devices/geofences": {
- "post": {
- "summary": "Link a Geofence to a Device",
- "parameters": [
- {
- "$ref": "#/parameters/DeviceGeofence"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/DeviceGeofence"
- }
- }
- }
- },
- "delete": {
- "summary": "Remove a Geofence from a Device",
- "parameters": [
- {
- "$ref": "#/parameters/DeviceGeofence"
- }
- ],
- "responses": {
- "204": {
- "description": "No Content"
- }
- }
- }
- },
"/groups": {
"get": {
"summary": "Fetch a list of Groups",
@@ -273,50 +242,19 @@
}
}
},
- "/groups/geofences": {
+ "/permissions": {
"post": {
- "summary": "Link a Geofence to a Group",
+ "summary": "Link an Object to another Object",
"parameters": [
{
- "$ref": "#/parameters/GroupGeofence"
+ "$ref": "#/parameters/Permission"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/GroupGeofence"
- }
- }
- }
- },
- "delete": {
- "summary": "Remove a Geofence from a Group",
- "parameters": [
- {
- "$ref": "#/parameters/GroupGeofence"
- }
- ],
- "responses": {
- "204": {
- "description": "No Content"
- }
- }
- }
- },
- "/permissions/devices": {
- "post": {
- "summary": "Link a Device to a User",
- "parameters": [
- {
- "$ref": "#/parameters/DevicePermission"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/DevicePermission"
+ "$ref": "#/definitions/Permission"
}
},
"400": {
@@ -325,134 +263,10 @@
}
},
"delete": {
- "summary": "Remove a Device from a User",
- "parameters": [
- {
- "$ref": "#/parameters/DevicePermission"
- }
- ],
- "responses": {
- "204": {
- "description": "No Content"
- }
- }
- }
- },
- "/permissions/groups": {
- "post": {
- "summary": "Link a Group to a User",
- "parameters": [
- {
- "$ref": "#/parameters/GroupPermission"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/GroupPermission"
- }
- }
- }
- },
- "delete": {
- "summary": "Remove a Group from a User",
- "parameters": [
- {
- "$ref": "#/parameters/GroupPermission"
- }
- ],
- "responses": {
- "204": {
- "description": "No Content"
- }
- }
- }
- },
- "/permissions/geofences": {
- "post": {
- "summary": "Link a Geofence to a User",
- "parameters": [
- {
- "$ref": "#/parameters/GeofencePermission"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/GeofencePermission"
- }
- }
- }
- },
- "delete": {
- "summary": "Remove a Geofence from a User",
- "parameters": [
- {
- "$ref": "#/parameters/GeofencePermission"
- }
- ],
- "responses": {
- "204": {
- "description": "No Content"
- }
- }
- }
- },
- "/permissions/calendars": {
- "post": {
- "summary": "Link a Calendar to a User",
- "parameters": [
- {
- "$ref": "#/parameters/CalendarPermission"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/CalendarPermission"
- }
- }
- }
- },
- "delete": {
- "summary": "Remove a Calendar from a User",
+ "summary": "Unlink an Object from another Object",
"parameters": [
{
- "$ref": "#/parameters/CalendarPermission"
- }
- ],
- "responses": {
- "204": {
- "description": "No Content"
- }
- }
- }
- },
- "/permissions/users": {
- "post": {
- "summary": "Link a User to a manager User",
- "parameters": [
- {
- "$ref": "#/parameters/UserPermission"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/UserPermission"
- }
- }
- }
- },
- "delete": {
- "summary": "Remove a User from a manager User",
- "parameters": [
- {
- "$ref": "#/parameters/UserPermission"
+ "$ref": "#/parameters/Permission"
}
],
"responses": {
@@ -793,18 +607,13 @@
"$ref": "#/parameters/userId"
},
{
- "name": "groupId",
- "in": "query",
- "type": "integer"
+ "$ref": "#/parameters/deviceId"
},
{
- "$ref": "#/parameters/deviceId"
+ "$ref": "#/parameters/groupId"
},
{
- "name": "refresh",
- "in": "query",
- "required": false,
- "type": "boolean"
+ "$ref": "#/parameters/refresh"
}
],
"responses": {
@@ -1222,6 +1031,174 @@
}
}
}
+ },
+ "/attributes/computed": {
+ "get": {
+ "summary": "Fetch a list of Attributes",
+ "description": "Without params, it returns a list of Attributes the user has access to",
+ "parameters": [
+ {
+ "$ref": "#/parameters/all"
+ },
+ {
+ "$ref": "#/parameters/userId"
+ },
+ {
+ "$ref": "#/parameters/deviceId"
+ },
+ {
+ "$ref": "#/parameters/groupId"
+ },
+ {
+ "$ref": "#/parameters/refresh"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Attribute"
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "summary": "Create an Attribute",
+ "parameters": [
+ {
+ "$ref": "#/parameters/Attribute"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/Attribute"
+ }
+ }
+ }
+ }
+ },
+ "/attributes/computed/{id}": {
+ "put": {
+ "summary": "Update an Attribute",
+ "parameters": [
+ {
+ "$ref": "#/parameters/entityId"
+ },
+ {
+ "$ref": "#/parameters/Attribute"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/Attribute"
+ }
+ }
+ }
+ },
+ "delete": {
+ "summary": "Delete an Attribute",
+ "parameters": [
+ {
+ "$ref": "#/parameters/entityId"
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "No Content"
+ }
+ }
+ }
+ },
+ "/drivers": {
+ "get": {
+ "summary": "Fetch a list of Drivers",
+ "description": "Without params, it returns a list of Drivers the user has access to",
+ "parameters": [
+ {
+ "$ref": "#/parameters/all"
+ },
+ {
+ "$ref": "#/parameters/userId"
+ },
+ {
+ "$ref": "#/parameters/deviceId"
+ },
+ {
+ "$ref": "#/parameters/groupId"
+ },
+ {
+ "$ref": "#/parameters/refresh"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Driver"
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "summary": "Create a Driver",
+ "parameters": [
+ {
+ "$ref": "#/parameters/Driver"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/Driver"
+ }
+ }
+ }
+ }
+ },
+ "/drivers/{id}": {
+ "put": {
+ "summary": "Update a Driver",
+ "parameters": [
+ {
+ "$ref": "#/parameters/entityId"
+ },
+ {
+ "$ref": "#/parameters/Driver"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/Driver"
+ }
+ }
+ }
+ },
+ "delete": {
+ "summary": "Delete a Driver",
+ "parameters": [
+ {
+ "$ref": "#/parameters/entityId"
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "No Content"
+ }
+ }
+ }
}
},
"definitions": {
@@ -1473,72 +1450,39 @@
"attributes": {}
}
},
- "DevicePermission": {
+ "Permission": {
+ "description": "This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }",
"properties": {
"userId": {
+ "description": "User Id, can be only first parameter",
"type": "integer"
},
"deviceId": {
- "type": "integer"
- }
- }
- },
- "GroupPermission": {
- "properties": {
- "userId": {
+ "description": "Device Id, can be first parameter or second only in combination with userId",
"type": "integer"
},
"groupId": {
- "type": "integer"
- }
- }
- },
- "GeofencePermission": {
- "properties": {
- "userId": {
+ "description": "Group Id, can be first parameter or second only in combination with userId",
"type": "integer"
},
"geofenceId": {
- "type": "integer"
- }
- }
- },
- "CalendarPermission": {
- "properties": {
- "userId": {
+ "description": "Geofence Id, can be second parameter only",
"type": "integer"
},
"calendarId": {
- "type": "integer"
- }
- }
- },
- "UserPermission": {
- "properties": {
- "userId": {
+ "description": "Geofence Id, can be second parameter only and only in combination with userId",
"type": "integer"
},
- "managedUserId": {
- "type": "integer"
- }
- }
- },
- "GroupGeofence": {
- "properties": {
- "groupId": {
+ "attributeId": {
+ "description": "Computed Attribute Id, can be second parameter only",
"type": "integer"
},
- "geofenceId": {
- "type": "integer"
- }
- }
- },
- "DeviceGeofence": {
- "properties": {
- "deviceId": {
+ "driverId": {
+ "description": "Driver Id, can be second parameter only",
"type": "integer"
},
- "geofenceId": {
+ "managedUserId": {
+ "description": "User Id, can be second parameter only and only in combination with userId",
"type": "integer"
}
}
@@ -1635,6 +1579,10 @@
"type": "number",
"description": "in meters"
},
+ "spentFuel": {
+ "type": "number",
+ "description": "in liters"
+ },
"engineHours": {
"type": "integer"
}
@@ -1660,6 +1608,10 @@
"type": "number",
"description": "in meters"
},
+ "spentFuel": {
+ "type": "number",
+ "description": "in liters"
+ },
"duration": {
"type": "integer"
},
@@ -1690,6 +1642,51 @@
},
"endLon": {
"type": "number"
+ },
+ "driverUniqueId": {
+ "type": "integer"
+ },
+ "driverName": {
+ "type": "string"
+ }
+ }
+ },
+ "ReportStops": {
+ "properties": {
+ "deviceId": {
+ "type": "integer"
+ },
+ "deviceName": {
+ "type": "string"
+ },
+ "duration": {
+ "type": "integer"
+ },
+ "startTime": {
+ "type": "string",
+ "format": "date-time",
+ "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`"
+ },
+ "address": {
+ "type": "string"
+ },
+ "lat": {
+ "type": "number"
+ },
+ "lon": {
+ "type": "number"
+ },
+ "endTime": {
+ "type": "string",
+ "format": "date-time",
+ "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`"
+ },
+ "spentFuel": {
+ "type": "number",
+ "description": "in liters"
+ },
+ "engineHours": {
+ "type": "integer"
}
}
},
@@ -1758,6 +1755,40 @@
},
"atributes": {}
}
+ },
+ "Attribute": {
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "description": {
+ "type": "string"
+ },
+ "attribute": {
+ "type": "string"
+ },
+ "expression": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "description": "String|Number|Boolean"
+ }
+ }
+ },
+ "Driver": {
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "uniqueId": {
+ "type": "string"
+ },
+ "atributes": {}
+ }
}
},
"parameters": {
@@ -1773,6 +1804,12 @@
"description": "Can only be used by admins or managers to fetch all entities",
"type": "boolean"
},
+ "refresh": {
+ "name": "refresh",
+ "in": "query",
+ "required": false,
+ "type": "boolean"
+ },
"userId": {
"name": "userId",
"in": "query",
@@ -1785,6 +1822,12 @@
"description": "Standard users can use this only with _deviceId_s, they have access to",
"type": "integer"
},
+ "groupId": {
+ "name": "groupId",
+ "in": "query",
+ "description": "Standard users can use this only with _groupId_s, they have access to",
+ "type": "integer"
+ },
"Device": {
"name": "body",
"in": "body",
@@ -1793,12 +1836,12 @@
"$ref": "#/definitions/Device"
}
},
- "DeviceGeofence": {
+ "Permission": {
"name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/DeviceGeofence"
+ "$ref": "#/definitions/Permission"
}
},
"Group": {
@@ -1809,84 +1852,52 @@
"$ref": "#/definitions/Group"
}
},
- "GroupGeofence": {
- "name": "body",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/GroupGeofence"
- }
- },
- "DevicePermission": {
- "name": "body",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/DevicePermission"
- }
- },
- "GroupPermission": {
- "name": "body",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/GroupPermission"
- }
- },
- "GeofencePermission": {
- "name": "body",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/GeofencePermission"
- }
- },
- "CalendarPermission": {
+ "User": {
"name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/CalendarPermission"
+ "$ref": "#/definitions/User"
}
},
- "UserPermission": {
+ "Geofence": {
"name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/UserPermission"
+ "$ref": "#/definitions/Geofence"
}
},
- "User": {
+ "AttributeAlias": {
"name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/User"
+ "$ref": "#/definitions/AttributeAlias"
}
},
- "Geofence": {
+ "Calendar": {
"name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/Geofence"
+ "$ref": "#/definitions/Calendar"
}
},
- "AttributeAlias": {
+ "Attribute": {
"name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/AttributeAlias"
+ "$ref": "#/definitions/Attribute"
}
},
- "Calendar": {
+ "Driver": {
"name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/Calendar"
+ "$ref": "#/definitions/Driver"
}
},
"deviceIdArray": {