API documentationGeneralHealth checkGet Unimus health status. Method: GET CURL Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v1/health" |
Success 200Field | Type | Description |
---|
status | String | OK - Unimus is ready to handle all requests. LICENSING_UNREACHABLE - License server is unreachable. All request will proceed except add, remove and update device. ERROR - Unimus require user interaction to solve the problem. All requests will be refused. |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Success response |
---|
| HTTP/1.1 200 OK { } |
SchedulesSchedules - get scheduleGet an individual schedule. Method: GET CURL Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v1/schedules/<scheduleId>" |
ParameterField | Type | Description |
---|
scheduleId | Number | The ID of the schedule |
Success 200Field | Type | Description |
---|
id | Number | The ID of the schedule | createTime | Number | Schedule creation time in seconds | periodicity | String | Schedule periodicity. Possible values: MONTHLY, WEEKLY, DAILY, HOURLY | dom | Number | Day of month | dow | Number | Day of week | hour | Number | Hour of day | min | Number | Minute of hour | name | String | Schedule pretty name |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Success response |
---|
| HTTP/1.1 200 OK { "data": {"id": 7, "createTime": 1511863250, "periodicity": "MONTHLY", "dom": 1, "dow": 1, "hour": 0, "min": 6, "name": "Every month, on day 1, at 00:06." } } |
Error 4xxName | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Error response |
---|
| HTTP/1.1 404 NOT FOUND { "timestamp": 1511862182524, "code": 404, "error": "Not Found", "message": "Schedule with id 11 not found" }
|
Schedules - get schedulesGet a list of all schedules in Unimus. Method: GET CURL Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v1/schedules?page=0&size=20" |
ParameterName | Type | Description |
---|
pageIndex | Number | Page index (OPTIONAL) | pageSize | Number | Page size (OPTIONAL) |
Success 200Name | Type | Description |
---|
id | Number | The ID of the schedule | createTime | Number | Schedule creation time in seconds | periodicity | String | Schedule periodicity. Possible values: MONTHLY, WEEKLY, DAILY, HOURLY | dom | Number | Day of month | dow | Number | Day of week | hour | Number | Hour of day | min | Number | Minute of hour | name | String | Schedule pretty name |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Success response |
---|
| HTTP/1.1 200 OK { "data": [ {"id": 5, "createTime": 1511863239, "periodicity": "MONTHLY", "dom": 5, "dow": 1, "hour": 0, "min": 0, "name": "Every month, on day 5, at 00:00." }, {"id": 7, "createTime": 1511863250, "periodicity": "MONTHLY", "dom": 1, "dow": 1, "hour": 0, "min": 6, "name": "Every month, on day 1, at 00:06." } ], "paginator": {"totalCount": 7, "totalPages": 4, "page": 1, "size": 2 } }
|
DevicesDevices - get deviceGet an individual device. Method: GET CURL Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimuis>/api/v1/devices/<deviceId>?attr=s,c" |
ParameterName | Type | Description |
---|
deviceId | Number | The ID of the device | attributes | String | Comma separated graph attribute nodes. (OPTIONAL) Possible values for device schedule: schedule, sch, s for device credential: credential, cred, c |
Success 200Name | Type | Description |
---|
id | Number | The ID of the device | createTime | Number | Device creation time in seconds | address | String | Hostname, IPv4 or IPv6 | description | String | Device description | port | Number | Device port | connector | String | Connector type, possible values: SSH, TELNET | vendor | String | Vendor | type | String | Type | model | String | Model | schedule | Object | Device schedule | credential | Object | Credential used to login to the device |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Success response |
---|
| HTTP/1.1 200 OK { "data": {"id": 1, "createTime": 1511339013, "address": "198.18.0.29", "description": "Back bone device", "port": 22, "connector": "SSH", "vendor": "MikroTik", "type": "RouterOS", "model": "Simulated-RouterOS", "schedule": null, "credential": { "id": 1, "username": "test", "password": "test", "sshKey": null } } } |
Error 4xxName | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 400 | error | String | HTTP code message | message | String | Error message |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Error response |
---|
| HTTP/1.1 400 BAD REQUEST { "timestamp": 1511869830038, "code": 400, "error": "Bad Request", "message": "Argument deviceId type mismatch" }
|
Devices - get devicesGet a list of devices. Method: GET CURL Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v1/devices?page=0&size=20&attr=s,c" |
ParameterName | Type | Description |
---|
pageIndex | Number | Page index (OPTIONAL) | pageSize | Number | Page size (OPTIONAL) | attributes | String | Comma separated graph attribute nodes.(OPTIONAL) Possible values for device schedule: schedule, sch, s for device credential: credential, cred, c |
Success 200Name | Type | Description |
---|
id | Number | The ID of the device | createTime | Number | Device creation time in seconds | address | String | Hostname, IPv4 or IPv6 | description | String | Device description | port | Number | Device port | connector | String | Connector type, possible values: SSH, TELNET | vendor | String | Vendor | type | String | Type | model | String | Model | schedule | Object | Device schedule | credential | Object | Credential used to login to the device |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Success response |
---|
| HTTP/1.1 200 OK { "data": [ {"id": 2, "createTime": 1511339013, "address": "198.18.0.2777", "description": null, "port": 22, "connector": null, "credential": null, "vendor": "MikroTik", "type": "RouterOS", "model": "Simulated-RouterOS", "schedule": {"id": 1, "createTime": 1511339012, "periodicity": "DAILY", "dom": 1, "dow": 1, "hour": 3, "min": 0, "name": "Every day at 03:00." } } ], "paginator": {"totalCount": 29, "totalPages": 29, "page": 1, "size": 1 } }
|
Devices - create new deviceCreate a new device. Method: POST CURL Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
| curl -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer <token>" -d '{"address":"<address>","description":"<description>"}' "http://<example.unimus>/api/v1/devices" |
ParameterName | Type | Description |
---|
address | String | Device address | description | String | Description of the new device | scheduleId | Number | Schedule id If null then device will be backed up according to system default schedule |
Success 201Name | Type | Description |
---|
id | Number | The ID of the device | createTime | Number | Device creation time in seconds | address | String | Hostname, IPv4 or IPv6 | description | String | Device description | schedule | Object | Device schedule | port | Number | null | connector | String | null | vendor | String | null | type | String | null | model | String | null | credential | Object | null |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Success response |
---|
| HTTP/1.1 201 CREATED { "id": 94, "createTime": 1511876477, "address": "10.10.10.10", "description": null, "port": null, "connector": null, "credential": null, "vendor": null, "type": null, "model": null, "schedule": {"id": 1, "createTime": 1511339012, "periodicity": "DAILY", "dom": 1, "dow": 1, "hour": 3, "min": 0, "name": "Every day at 03:00." }
} |
Error 4xxName | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 422 | error | String | HTTP code message | message | String | Error message |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Error response |
---|
| HTTP/1.1 422 UNPROCESSABLE ENTITY { "timestamp": 1511876680885, "code": 422, "error": "Unprocessable Entity", "message": "Device already exist" }
|
Devices - update deviceUpdate device address, description or schedule time. Method: PATCH CURL Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
| curl -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer <token>" -X PATCH -d '{"address":"<address>","description":"<description>","scheduleId":"<scheduleId>"}' "http://<example.unimus>/api/v1/devices/<deviceId>" |
ParameterName | Type | Description |
---|
deviceId | Number | The ID of the device | address | String | Device address | description | String | Device description | scheduleId | Number | Schedule id. If null then no schedule update occurs If -1 then device will be backed up according to system default schedule |
Success 200Name | Type | Description |
---|
id | Number | The ID of the device | createTime | Number | Device creation time in seconds | address | String | Hostname, IPv4 or IPv6 | description | String | Device description | port | Number | Device port | connector | String | Connector type, possible values: SSH, TELNET | vendor | String | Vendor | type | String | Type | model | String | Model | schedule | Object | Device schedule | credential | Object | Credential used to login to the device |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Success response |
---|
| HTTP/1.1 200 OK { "id": 96, "createTime": 1511879360, "address": "198.18.0.18", "description": "aaaa", "port": 22, "connector": "SSH", "type": "RouterOS", "model": "Simulated-RouterOS", "schedule": {"id": 1, "createTime": 1511339012, "periodicity": "DAILY", "dom": 1, "dow": 1, "hour": 3, "min": 0, "name": "Every day at 03:00." }, "credential": {"id": 1, "username": "test", "password": "test", "sshKey": null }
} |
Error 4xxName | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Error response |
---|
| HTTP/1.1 404 NOT FOUND { "timestamp": 1511880124270, "code": 404, "error": "Not Found", "message": "Device not found" }
|
Devices - delete deviceDelete a single device from Unimus. Method: DELETE CURL Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" -X DELETE "http://<example.unimus>/api/v1/devices/<deviceId>" |
ParameterName | Type | Description |
---|
deviceId | Number | The ID of the device to delete |
Success 200Name | Type | Description |
---|
success | String | A message stating that the deletion was successful |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
title | Success response |
---|
| HTTP/1.1 200 OK { "data": {"success": "true" } } |
Error 4xxName | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Panel |
---|
borderColor | grey |
---|
borderStyle | solid |
---|
| HTTP/1.1 404 NOT FOUND { "timestamp": 1511884051726, "code": 404, "error": "Not Found", "message": "Device with id 102 not found" }
|
|