aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-24 11:17:18 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-24 11:44:42 +0500
commitf57b2094210de3de6f7333fd5169b8218478f8f9 (patch)
tree213585a47ace74d2c695667ae87aab83c6626404
parentf4058d92243ecd7c5e6b4d1669f38a81041eaa40 (diff)
downloadtrackermap-server-f57b2094210de3de6f7333fd5169b8218478f8f9.tar.gz
trackermap-server-f57b2094210de3de6f7333fd5169b8218478f8f9.tar.bz2
trackermap-server-f57b2094210de3de6f7333fd5169b8218478f8f9.zip
Add Computed Attributes to swagger
-rw-r--r--swagger.json121
1 files changed, 117 insertions, 4 deletions
diff --git a/swagger.json b/swagger.json
index a8d4f5641..970052e79 100644
--- a/swagger.json
+++ b/swagger.json
@@ -607,12 +607,10 @@
"$ref": "#/parameters/userId"
},
{
- "name": "groupId",
- "in": "query",
- "type": "integer"
+ "$ref": "#/parameters/deviceId"
},
{
- "$ref": "#/parameters/deviceId"
+ "$ref": "#/parameters/groupId"
},
{
"name": "refresh",
@@ -1036,6 +1034,87 @@
}
}
}
+ },
+ "/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"
+ },
+ ],
+ "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"
+ }
+ }
+ }
}
},
"definitions": {
@@ -1539,6 +1618,26 @@
},
"atributes": {}
}
+ },
+ "Attribute": {
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "description": {
+ "type": "string"
+ },
+ "attribute": {
+ "type": "string"
+ },
+ "expression": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "description": "String|Number|Boolean"
+ }
+ }
}
},
"parameters": {
@@ -1566,6 +1665,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",
@@ -1622,6 +1727,14 @@
"$ref": "#/definitions/Calendar"
}
},
+ "Attribute": {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/Attribute"
+ }
+ },
"deviceIdArray": {
"name": "deviceId",
"in": "query",