600 lines
14 KiB
JSON
600 lines
14 KiB
JSON
{
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"schemes": [
|
|
"https"
|
|
],
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"title": "JNX Robot Control Manager API Documentation.",
|
|
"version": "1.0.0"
|
|
},
|
|
"host": "jannex",
|
|
"basePath": "/v1",
|
|
"paths": {
|
|
"/api/v1/robots": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"robots"
|
|
],
|
|
"summary": "Get all robots",
|
|
"operationId": "getRobots",
|
|
"parameters": [
|
|
{
|
|
"description": "Page number",
|
|
"name": "page",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/RobotsResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/urobots": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"robots"
|
|
],
|
|
"summary": "Get all unauthorized robots",
|
|
"operationId": "getUnauthorizedRobots",
|
|
"parameters": [
|
|
{
|
|
"description": "Page number",
|
|
"name": "page",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/UnauthorizedRobotsResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/control/1": {
|
|
"post": {
|
|
"description": "This is used to control Rex.\n",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"control"
|
|
],
|
|
"summary": "Control Rex.",
|
|
"operationId": "controlRex",
|
|
"parameters": [
|
|
{
|
|
"description": "Control Rex body.",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/ControlBody"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Control Rex"
|
|
},
|
|
"400": {
|
|
"description": "Invalid request body"
|
|
},
|
|
"422": {
|
|
"description": "Robot not found"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/control/1/finish": {
|
|
"post": {
|
|
"description": "This is used to finish control Rex.\n",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"control"
|
|
],
|
|
"summary": "Finish control Rex.",
|
|
"operationId": "finishControlRex",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Finish control Rex"
|
|
},
|
|
"400": {
|
|
"description": "Invalid robot name"
|
|
},
|
|
"422": {
|
|
"description": "Robot not found"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/permitjoin": {
|
|
"get": {
|
|
"description": "This is used to get the current permit join status.\n",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"permitjoin"
|
|
],
|
|
"summary": "Get permit join.",
|
|
"operationId": "getPermitJoin",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Permit join status",
|
|
"schema": {
|
|
"$ref": "#/definitions/PermitJoinResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/permitjoin/{enabled}": {
|
|
"post": {
|
|
"description": "This is used to enable or disable permit join.\n",
|
|
"tags": [
|
|
"permitjoin"
|
|
],
|
|
"summary": "Set permit join.",
|
|
"operationId": "setPermitJoin",
|
|
"parameters": [
|
|
{
|
|
"description": "Enable or disable permit join. 0 = disable, 1 = enable.",
|
|
"name": "enabled",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"enum": [
|
|
0,
|
|
1
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Permit join set"
|
|
},
|
|
"400": {
|
|
"description": "Invalid request body"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/robot": {
|
|
"post": {
|
|
"description": "This is the first request from the robot. It will be used to identify the robot.\n",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"robot"
|
|
],
|
|
"summary": "First request from robot.",
|
|
"operationId": "robotFirstRequest",
|
|
"parameters": [
|
|
{
|
|
"description": "First request body.",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/FirstRequestBody"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Robot identified",
|
|
"schema": {
|
|
"$ref": "#/definitions/StatusResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request body"
|
|
},
|
|
"403": {
|
|
"description": "Permit join is enabled"
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"robot"
|
|
],
|
|
"summary": "Update robot.",
|
|
"operationId": "robotUpdate",
|
|
"parameters": [
|
|
{
|
|
"description": "Update robot body.",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/Robot"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Robot updated"
|
|
},
|
|
"400": {
|
|
"description": "Invalid request body"
|
|
},
|
|
"422": {
|
|
"description": "Robot not found"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/robot/authorize/{robotId}": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"robot"
|
|
],
|
|
"summary": "Authorize robot.",
|
|
"operationId": "robotAuthorize",
|
|
"parameters": [
|
|
{
|
|
"description": "Robot id.",
|
|
"name": "robotId",
|
|
"in": "params",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Robot authorized"
|
|
},
|
|
"400": {
|
|
"description": "Invalid robot id"
|
|
},
|
|
"422": {
|
|
"description": "Robot not found"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/robot/deny/{robotId}": {
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"robot"
|
|
],
|
|
"summary": "Deny unauthorized robot.",
|
|
"operationId": "robotDenyUnauthorizedRobot",
|
|
"parameters": [
|
|
{
|
|
"description": "Robot id.",
|
|
"name": "robotId",
|
|
"in": "params",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Robot denied"
|
|
},
|
|
"400": {
|
|
"description": "Invalid robot id"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/robot/fuj/{robotId}": {
|
|
"patch": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"robot"
|
|
],
|
|
"summary": "Free up job from robot.",
|
|
"operationId": "robotFreeUpJob",
|
|
"parameters": [
|
|
{
|
|
"description": "Robot id.",
|
|
"name": "robotId",
|
|
"in": "params",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Job freed up"
|
|
},
|
|
"400": {
|
|
"description": "Invalid robot id"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/robot/{robotId}": {
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"robot"
|
|
],
|
|
"summary": "Delete robot.",
|
|
"operationId": "robotDelete",
|
|
"parameters": [
|
|
{
|
|
"description": "Robot id.",
|
|
"name": "robotId",
|
|
"in": "params",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Robot deleted"
|
|
},
|
|
"400": {
|
|
"description": "Invalid robot id"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"APIRobot": {
|
|
"type": "object",
|
|
"properties": {
|
|
"Address": {
|
|
"type": "string"
|
|
},
|
|
"ConnectedAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"CreatedAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"CurrentJobName": {
|
|
"type": "string"
|
|
},
|
|
"FirmwareVersion": {
|
|
"type": "string"
|
|
},
|
|
"Id": {
|
|
"type": "string"
|
|
},
|
|
"JobsWaitingCount": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"JobsWaitingNameList": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"Name": {
|
|
"type": "string"
|
|
},
|
|
"Status": {
|
|
"type": "integer",
|
|
"format": "uint8"
|
|
},
|
|
"Type": {
|
|
"type": "integer",
|
|
"format": "uint8"
|
|
}
|
|
},
|
|
"x-go-package": "jannex/robot-control-manager/modules/structs"
|
|
},
|
|
"ControlBody": {
|
|
"type": "object",
|
|
"properties": {
|
|
"JobId": {
|
|
"type": "string"
|
|
},
|
|
"JobName": {
|
|
"type": "string"
|
|
},
|
|
"RobotName": {
|
|
"type": "string"
|
|
},
|
|
"Task": {
|
|
"$ref": "#/definitions/ControlTask"
|
|
}
|
|
},
|
|
"x-go-package": "jannex/robot-control-manager/modules/structs"
|
|
},
|
|
"ControlTask": {
|
|
"type": "object",
|
|
"properties": {
|
|
"ConnectedModule": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"X": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"Y": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"Z": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
},
|
|
"x-go-package": "jannex/robot-control-manager/modules/structs"
|
|
},
|
|
"FirstRequestBody": {
|
|
"type": "object",
|
|
"properties": {
|
|
"FirmwareVersion": {
|
|
"description": "used firmware version of the robot",
|
|
"type": "string"
|
|
},
|
|
"Id": {
|
|
"description": "robot id",
|
|
"type": "string"
|
|
},
|
|
"Type": {
|
|
"description": "robot type",
|
|
"type": "integer",
|
|
"format": "uint8"
|
|
}
|
|
},
|
|
"x-go-package": "jannex/robot-control-manager/modules/structs"
|
|
},
|
|
"PermitJoinResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"Enabled": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"x-go-package": "jannex/robot-control-manager/modules/structs"
|
|
},
|
|
"RobotsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"Robots": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/APIRobot"
|
|
}
|
|
},
|
|
"TotalPages": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
},
|
|
"x-go-package": "jannex/robot-control-manager/modules/structs"
|
|
},
|
|
"StatusResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"Status": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
},
|
|
"x-go-package": "jannex/robot-control-manager/modules/structs"
|
|
},
|
|
"UnauthorizedRobot": {
|
|
"type": "object",
|
|
"properties": {
|
|
"Address": {
|
|
"type": "string"
|
|
},
|
|
"ConnectedAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"CreatedAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"FirmwareVersion": {
|
|
"type": "string"
|
|
},
|
|
"Id": {
|
|
"type": "string"
|
|
},
|
|
"Type": {
|
|
"type": "integer",
|
|
"format": "uint8"
|
|
}
|
|
},
|
|
"x-go-package": "jannex/robot-control-manager/modules/structs"
|
|
},
|
|
"UnauthorizedRobotsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"TotalPages": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"UnauthorizedRobots": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/UnauthorizedRobot"
|
|
}
|
|
}
|
|
},
|
|
"x-go-package": "jannex/robot-control-manager/modules/structs"
|
|
}
|
|
}
|
|
} |