API documentation
General
Health checkGet Unimus health status. Method: GET Code Block |
---|
| http://example.unimus/api/v2/health |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/health" |
Success 200 Field | 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. |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":{
"status":"OK"
}
} |
Schedules
Schedules - get scheduleGet an individual schedule. Method: GET Code Block |
---|
| http://example.unimus/api/v2/schedules/:scheduleId |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/schedules/<scheduleId>" |
Parameter Field | Type | Description |
---|
scheduleId | Number | The ID of the schedule |
Success 200 Field | 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 |
Code Block |
---|
language | text |
---|
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 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Schedules - get schedulesGet a list of all schedules in Unimus. Method: GET Code Block |
---|
| http://example.unimus/api/v2/schedules?page=:pageIndex&size=:pageSize |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/schedules?page=0&size=20" |
Parameter Name | Type | Description |
---|
pageIndex | Number | Page index (OPTIONAL) | pageSize | Number | Page size (OPTIONAL) |
Success 200
Name | 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 |
Code Block |
---|
language | text |
---|
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
}
} |
Devices
Devices - get device by IDGet an individual device by ID. Method: GET Code Block |
---|
| http://example.unimus/api/v2/devices/:deviceId?attr=:attributes |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/devices/<deviceId>?attr=s,c" |
Parameter Name | Type | Description |
---|
deviceId | Number | The ID of the device | attributes | String | Comma separated attribute nodes. (OPTIONAL) Possible values: device schedule: schedule, sch, s device connections: connections, conn, c |
Success 200 Name | Type | Description |
---|
id | Number | The ID of the device | uuid | String | The UUID of the device (used in APIv3) | createTime | Number | Device creation time in seconds | address | String | Hostname, IPv4 or IPv6 | description | String | Device description | managed | Boolean | Managed state | schedule | Object | Device schedule | vendor | String | Vendor | type | String | Type | model | String | Model | lastJobStatus | String | Status of the last job. Possible values: SUCCESSFUL, FAILED, UNKNOWN (no job ran yet or unmanaged) | connections | Array | Device connections | zoneId | String | The ID of the zone |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":{
"id":1,
"createTime":1525101029,
"address":"198.18.0.0",
"description":null,
"managed":true,
"schedule":{
"id":1,
"createTime":1524564606,
"periodicity":"DAILY",
"dom":-1,
"dow":-1,
"hour":3,
"min":0,
"name":"Every day at 03:00."
},
"vendor":"MikroTik",
"type":"RouterOS",
"model":"Simulated-RouterOS",
"lastJobStatus":"SUCCESSFUL"
"connections":[
{
"type":"SSH",
"port":22,
"credentials":[
{
"id":1,
"username":"test",
"password":"test",
"sshKey":null
}
],
"enablePassword":null
}
],
"zoneId": "1"
}
} |
Error 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 400 | error | String | HTTP code message | message | String | Error message |
Code Block |
---|
language | text |
---|
title | Error response |
---|
| HTTP/1.1 400 BAD REQUEST
{
"timestamp":1511869830038,
"code":400,
"error":"Bad Request",
"message":"Argument deviceId type mismatch"
} |
Devices - get device by addressGet an individual device by address. Method: GET Code Block |
---|
| http://example.unimus/api/v2/devices/findByAddress/:address?attr=:attributes&zoneId=:zone_ID |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/devices/findByAddress/<address>?attr=s,c?zoneId=<zone ID>" |
Parameter Name | Type | Description |
---|
address | String | Device address | attributes | String | Comma separated attribute nodes. (OPTIONAL) Possible values: device schedule: schedule, sch, s device connections: connections, conn, c | zone_ID | String | Zone ID (as seen in UI) (OPTIONAL) Default Zone used if not specified |
Success 200 Name | Type | Description |
---|
id | Number | The ID of the device | uuid | String | The UUID of the device (used in APIv3) | createTime | Number | Device creation time in seconds | address | String | Hostname, IPv4 or IPv6 | description | String | Device description | managed | Boolean | Managed state | schedule | Object | Device schedule | vendor | String | Vendor | type | String | Type | model | String | Model | lastJobStatus | String | Status of the last job. Possible values: SUCCESSFUL, FAILED, UNKNOWN (no job ran yet or unmanaged) | connections | Array | Device connections | zoneId | String | The ID of the zone |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":{
"id":1,
"uuid":D-aaaacccc-bbee-4321-b42b-abc1234d101b"
"createTime":1525101029,
"address":"198.18.0.0",
"description":null,
"managed":true,
"schedule":null,
"vendor":"MikroTik",
"type":"RouterOS",
"model":"Simulated-RouterOS",
"lastJobStatus":"SUCCESSFUL"
"connections":[
],
"zoneId": "1"
}
} |
Error 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Code Block |
---|
language | text |
---|
title | Error response |
---|
| HTTP/1.1 404 BAD REQUEST
{
"timestamp":1511862182524,
"code":404,
"error":"Not Found",
"message":"Device with address some_address not found"
} |
Devices - get devices by descriptionGet a list of devices which description contains given term. Method: GET Code Block |
---|
| http://example.unimus/api/v2/devices/findByDescription/:description?attr=:attributes |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/devices/findByDescription/<description>?attr=s,c" |
Parameter Name | Type | Description |
---|
description | String | Device description | attributes | String | Comma separated attribute nodes. (OPTIONAL) Possible values: device schedule: schedule, sch, s device connections: connections, conn, c |
Success 200 Name | Type | Description |
---|
id | Number | The ID of the device | uuid | String | The UUID of the device (used in APIv3) | createTime | Number | Device creation time in seconds | address | String | Hostname, IPv4 or IPv6 | description | String | Device description | managed | Boolean | Managed state | schedule | Object | Device schedule | vendor | String | Vendor | type | String | Type | model | String | Model | lastJobStatus | String | Status of the last job. Possible values: SUCCESSFUL, FAILED, UNKNOWN (no job ran yet or unmanaged) | connections | Array | Device connections | zoneId | String | The ID of the zone |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":[
{
"id":1,
"uuid":D-aaaacccc-bbee-4321-b42b-abc1234d101b"
"createTime":1525101574,
"address":"198.1.0.1",
"description":"Main back-bone",
"managed":true,
"schedule":null,
"vendor":"MikroTik",
"type":"RouterOS",
"model":"Simulated-RouterOS",
"lastJobStatus": "SUCCESSFUL"
"connections":[
],
"zoneId": "1"
}
],
"paginator":{
"totalCount":1,
"totalPages":1,
"page":0,
"size":20
}
} |
Devices - get devicesGet a list of devices. Method: GET Code Block |
---|
| http://example.unimus/api/v2/devices?page=:pageIndex&size=:pageSize&attr=:attributes |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/devices?page=0&size=20&attr=s,c" |
Parameter Name | 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 200 Name | Type | Description |
---|
id | Number | The ID of the device | uuid | String | The UUID of the device (used in APIv3) | createTime | Number | Device creation time in seconds | address | String | Hostname, IPv4 or IPv6 | description | String | Device description | managed | Boolean | Managed state | schedule | Object | Device schedule | vendor | String | Vendor | type | String | Type | model | String | Model | lastJobStatus | String | Status of the last job. Possible values: SUCCESSFUL, FAILED, UNKNOWN (no job ran yet or unmanaged) | connections | Array | Device connections | zoneId | String | The ID of the zone |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":[
{
"id":1,
"uuid":D-aaaacccc-bbee-4321-b42b-abc1234d101b"
"createTime":1525101029,
"address":"198.18.0.0",
"description":null,
"managed":true,
"schedule":null,
"vendor":"MikroTik",
"type":"RouterOS",
"model":"Simulated-RouterOS",
"lastJobStatus":"SUCCESSFUL"
"connections":[
],
"zoneId": "1"
}
],
"paginator":{
"totalCount":1,
"totalPages":1,
"page":0,
"size":20
}
} |
Devices - create new deviceCreate a new device. Method: POST Code Block |
---|
| http://example.unimus/api/v2/devices |
Code Block |
---|
| curl -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer <token>"
-d '{"address":"<address>","description":"<description>","zoneId":"<zone_ID>"}' "http://<example.unimus>/api/v2/devices" |
Parameter Name | Type | Description |
---|
address | String | Device address | description | String | Description of the new device | scheduleId | Number | Schedule id (OPTIONAL) If omitted then device will be backed up according to system default schedule | zoneId | String | Zone ID (as seen in UI) (OPTIONAL) if omitted then device will be created in the default Zone |
Success 201 Name | Type | Description |
---|
id | Number | The ID of the device | uuid | String | The UUID of the device (used in APIv3) | createTime | Number | Device creation time in seconds | address | String | Hostname, IPv4 or IPv6 | description | String | Device description | managed | Boolean | Managed state | schedule | Object | Device schedule | vendor | String | Vendor | type | String | Type | model | String | Model | lastJobStatus | String | Status of the last job. Possible values: SUCCESSFUL, FAILED, UNKNOWN (no job ran yet or unmanaged) | connections | Array | Device connections | zoneId | String | The ID of the zone |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 201 CREATED
{
"data":{
"id":1,
"uuid":D-aaaacccc-bbee-4321-b42b-abc1234d101b"
"createTime":1525101029,
"address":"198.18.0.0",
"description":null,
"managed": true,
"schedule":{
"id":1,
"createTime":1524564606,
"periodicity":"DAILY",
"dom":-1,
"dow":-1,
"hour":3,
"min":0,
"name":"Every day at 03:00."
},
"vendor":null,
"type":null,
"model":null,
"lastJobStatus":"UNKNOWN"
"connections":[],
"zoneId": "1"
}
} |
Error 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 422 | error | String | HTTP code message | message | String | Error message |
Code Block |
---|
language | text |
---|
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 Code Block |
---|
| http://example.unimus/api/v2/devices/:deviceId |
Code Block |
---|
| 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/v2/devices/<deviceId>" |
Parameter Name | Type | Description |
---|
deviceId | Number | The ID of the device. | address | String | Device address. If null then no address update occurs | description | String | Device description. Description is always updated - should be provided if it should not be changed. If null, then description is removed | 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 200 Name | Type | Description |
---|
id | Number | The ID of the device | uuid | String | The UUID of the device (used in APIv3) | createTime | Number | Device creation time in seconds | address | String | Hostname, IPv4 or IPv6 | description | String | Device description | managed | Boolean | Managed state | schedule | Object | Device schedule | vendor | String | Vendor | type | String | Type | model | String | Model | lastJobStatus | String | Status of the last job. Possible values: SUCCESSFUL, FAILED, UNKNOWN (no job ran yet or unmanaged) | connections | Array | Device connections | zoneId | String | The ID of the zone |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":{
"id":1,
"uuid":D-aaaacccc-bbee-4321-b42b-abc1234d101b"
"createTime":1525101029,
"address":"198.18.0.0",
"description":null,
"managed": true,
"schedule":{
"id":1,
"createTime":1524564606,
"periodicity":"DAILY",
"dom":-1,
"dow":-1,
"hour":3,
"min":0,
"name":"Every day at 03:00."
},
"vendor":"MikroTik",
"type":"RouterOS",
"model":"Simulated-RouterOS",
"lastJobStatus":"SUCCESSFUL"
"connections":[
],
"zoneId": "1"
}
} |
Error 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Code Block |
---|
language | text |
---|
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 Code Block |
---|
| http://example.unimus/api/v2/devices/:deviceId |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" -X DELETE "http://<example.unimus>/api/v2/devices/<deviceId>" |
Parameter Name | Type | Description |
---|
deviceId | Number | The ID of the device to delete |
Success 200 Name | Type | Description |
---|
success | String | A message stating that the deletion was successful |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":{
"success":"true"
}
} |
Error 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Code Block |
---|
language | text |
---|
title | Error response |
---|
| HTTP/1.1 404 NOT FOUND
{
"timestamp":1511884051726,
"code":404,
"error":"Not Found",
"message":"Device with id 102 not found"
} |
Backups
Backups - get device backupsGet a list of all device backups. Backups are ordered descending by create time so the latest backup will always be at index 0 in the list. The list can be empty if the device has no backup yet. Method: GET Code Block |
---|
| http://example.unimus/api/v2/devices/:deviceId/backups?page=:pageIndex&size=:pageSize |
Parameter Name | Type | Description |
---|
deviceId | Number | The ID of the device | pageIndex | Number | Page index (OPTIONAL) | pageSize | Number | Page size (OPTIONAL) |
Success 200 Name | Type | Description |
---|
id | Number | The ID of the backup | validSince | Number | First time this configuration retrieved from the device | validUntil | Number | Last time this configuration retrieved from the device. Will be null if the configuration was retrieved only once (only validSince will be set) | type | String | Backup type. Could be TEXT or BINARY | bytes | Array | Backup as byte array |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":[
{
"id":1,
"validSince":1525117527,
"validUntil":null,
"type":"TEXT",
"bytes":"IyBTaW11bGF0ZWQgTWlrcm9UaWsgUm91dGVyT1Mgc3lzdGVtCiMgc29mdHdhcmUgaWQgPS"
}
],
"paginator":{
"totalCount":1,
"totalPages":1,
"page":0,
"size":20
}
} |
Error 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Code Block |
---|
language | text |
---|
title | Error response |
---|
| HTTP/1.1 404 NOT FOUND
{
"timestamp":1511886913012,
"code":404,
"error":"Not Found",
"message":"Device with id 964 not found"
} |
Backups - get device latest backupGet device latest backup. Backup can be null if the device has no backups yet. Method: GET Code Block |
---|
| http://example.unimus/api/v2/devices/:deviceId/backups/latest |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/devices/<deviceId>/backups/latest" |
Parameter Name | Type | Description |
---|
deviceId | Number | The ID of the device |
Success 200 Name | Type | Description |
---|
id | Number | The ID of the backup | validSince | Number | First time this configuration retrieved from the device | validUntil | Number | Last time this configuration retrieved from the device. Will be null if the configuration was retrieved only once (only validSince will be set) | type | String | Backup type. Could be TEXT or BINARY | bytes | Array | Backup as byte array |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":{
"id":1,
"validSince":1525117527,
"validUntil":null,
"type":"TEXT",
"bytes":"IyBTaW11bGF0ZWQgTWlrcm9UaWsgUm91dGVyT1Mgc3lzdGVtCiMgc29mdHdhcmUgaWQgPSBub25"
}
} |
Error 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Code Block |
---|
language | text |
---|
title | Error response |
---|
| HTTP/1.1 404 NOT FOUND
{
"timestamp":1511889424942,
"code":404,
"error":"Not Found",
"message":"Device with id 12 not found"
} |
Backups - get latest backupsGet a list of latest backup of devices with no particular order. Each backup is wrapped with device id and address. Method: GET Code Block |
---|
| http://example.unimus/api/v2/devices/backups/latest?page=:pageIndex&size=:pageSize&id=:deviceIds |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/devices/backups/latest?page=0&size=20&id=<deviceIds>" |
Parameter Name | Type | Description |
---|
pageIndex | Number | Page index (OPTIONAL) | pageSize | Number | Page size (OPTIONAL) | deviceIds | String | Comma separated device ids. If this parameter is not specified then backups of all devices will be returned according to pagination. |
Success 200 Name | Type | Description |
---|
deviceId | Number | The ID of the device | address | String | Hostname, IPv4 or IPv6 | backup | Object | Backup object |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":[
{
"deviceId":1,
"address":"198.18.0.0",
"backup":{
"id":1,
"validSince":1525117527,
"validUntil":null,
"type":"TEXT",
"bytes":"IyBTaW11bGF0ZWQgTWlrcm9UaWsgUm91dGVyT1Mgc3lzdGVtCiMgc29mdHdhcmUgaWQgPSBub25l"
}
}
],
"paginator":{
"totalCount":1,
"totalPages":1,
"page":0,
"size":20
}
} |
Backups - create new backupCreate a new backup. Method: POST Code Block |
---|
| http://example.unimus/api/v2/devices/:deviceId/backups |
Code Block |
---|
| curl -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer <token>"
-d '{"backup":"<backup>","type":"<TEXT>"}' "http://example.unimus/api/v2/devices/<deviceId>/backups" |
Parameter Name | Type | Description |
---|
backup | String | Backup content (Base64 encoded) | type | String | Possible values: BINARY - for binary content TEXT - for text content |
Success 200 Name | Type | Description |
---|
success | String | A message stating that the creation was successful |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 200 OK
{
"data":{
"success":"true"
}
} |
Error 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Code Block |
---|
language | text |
---|
title | Error response |
---|
| HTTP/1.1 404 NOT FOUND
{
"timestamp":1514894056726,
"code":404,
"error":"Not Found",
"message":"Device with id 102 not found"
} |
Diff
Diff - get devices with different backupsGet a list of devices that has different backups in specified time range. If no backups has been changed for any device then empty array is returned with HTTP code 200. NOTE: In the following example since is 100 and until is 200 for easier understand how this endpoint works. Method: GET Code Block |
---|
| http://example.unimus/api/v2/devices/findByChangedBackup?page=:pageIndex&size=:pageSize&since=:since&until=:until |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/devices/findByChangedBackup?page=0&size=20&since=100&until=200" |
Parameter Name | Type | Description |
---|
pageIndex | Number | Page index (OPTIONAL) | pageSize | Number | Page size (OPTIONAL) | since | Number | Start of time range in seconds (OPTIONAL) (DEFAULT = 0) | until | Number | End of time range in seconds (OPTIONAL) (DEFAULT = time of the request) |
Success 200 Name | 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 | vendor | String | Vendor | type | String | Type | model | String | Model | lastJobStatus | String | Status of the last job. Possible values: SUCCESSFUL, FAILED, UNKNOWN (no job ran yet) | backups | Array | List of different device backups | zoneId | String | The ID of the zone |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| {
"data":[
{
"id":1,
"uuid":D-aaaacccc-bbee-4321-b42b-abc1234d101b"
"createTime":1525101029,
"address":"198.18.0.0",
"description":null,
"managed": true,
"vendor":"MikroTik",
"type":"RouterOS",
"model":"model",
"lastJobStatus":"SUCCESSFUL"
"backups":[
{
"id":1,
"validSince":80,
"validUntil":101
},
{
"id":2,
"validSince":120,
"validUntil":145
},
{
"id":3,
"validSince":150,
"validUntil":180
},
{
"id":4,
"validSince":181,
"validUntil":260
}
],
"zoneId": "1"
}
],
"paginator":{
"totalCount":1,
"totalPages":1,
"page":0,
"size":20
}
} |
Diff - get diffGet a difference between original and revised backup. Endpoint support making difference between backups from different devices. Method: GET Code Block |
---|
| http://example.unimus/api/v2/backups/diff?origId=:origId&revId=:revId |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v2/backups/diff?origId=1&revId=2" |
Parameter Name | Type | Description |
---|
origId | Number | ID of the backup that will be considered as original | revId | Number | ID of the backup that will be considered as revised |
Success 200 Name | Type | Description |
---|
origDeviceInfo | Object | Contains information about device with original backup | revDeviceInfo | Object | Contains information about device with revised backup | lineGroups | Array | Contains array of group of lines. Every group has one of the following types: COMMON, CHANGED, INSERTED, DELETED |
Code Block |
---|
language | text |
---|
title | Success response - complete JSON |
---|
| {
"data":{
"origDeviceInfo":{
"id":1,
"createTime":123456789,
"address":"10.0.0.1",
"description":"some dscr",
"vendor":"MikroTik",
"type":"RouterOS",
"model":"mkt-model",
"lastJobStatus":"SUCCESSFUL"
"zoneId": "1"
},
"revDeviceInfo":{
"id":2,
"createTime":123456789,
"address":"10.1.1.1",
"description":"another dscr",
"vendor":"Cisco",
"type":"IOS switch",
"model":"cisco-model",
"lastJobStatus":"FAILED"
"zoneId": "1"
},
"lineGroups":[
{
"type":"COMMON",
"originalLines":[
{
"number":1,
"text":"common line 1"
},
{
"number":2,
"text":"common line 2"
}
],
"revisedLines":[
{
"number":1,
"text":"common line 1"
},
{
"number":2,
"text":"common line 2"
}
]
},
{
"type":"CHANGED",
"originalLines":[
{
"number":3,
"text":"changed line - asd"
},
{
"number":4,
"text":"changed line - asd"
},
{
"number":5,
"text":"changed line - asd"
}
],
"revisedLines":[
{
"number":3,
"text":"changed line - xyz"
},
{
"number":4,
"text":"changed line - xyz"
},
{
"number":-1,
"text":null
}
]
},
{
"type":"COMMON",
"originalLines":[
{
"number":6,
"text":"common line"
}
],
"revisedLines":[
{
"number":5,
"text":"common line"
}
]
},
{
"type":"INSERTED",
"originalLines":[
],
"revisedLines":[
{
"number":6,
"text":"inserted line"
}
]
},
{
"type":"COMMON",
"originalLines":[
{
"number":7,
"text":"common line"
}
],
"revisedLines":[
{
"number":7,
"text":"common line"
}
]
},
{
"type":"DELETED",
"originalLines":[
{
"number":8,
"text":"deleted line"
}
],
"revisedLines":[
]
}
]
}
} |
Running tasks
Run job - discover deviceTrigger discovery job with all devices in the system. If u want to narrow down devices included in job then specify their IDs in request parameter. Method: PATCH Code Block |
---|
| http://example.unimus/api/v2/jobs/discovery?id=:deviceIds |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" -X PATCH "http://<example.unimus>/api/v2/jobs/discovery?id=<deviceIds>" |
Parameter Name | Type | Description |
---|
deviceIds | String | Comma separated device ids to run discovery on |
Success 202 Name | Type | Description |
---|
accepted | Number | Number of started discoveries | refused | Number | Number of refused discoveries. Discovery or backup currently running | unManaged | Number | Number of un-managed devices |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 202 ACCEPTED
{
"data":{
"accepted":12,
"refused":0,
"unManaged":0
}
} |
Error 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Code Block |
---|
language | text |
---|
title | Error response |
---|
| HTTP/1.1 403 NOT FOUND
{
"timestamp":1511897481896,
"code":404,
"error":"Not Found",
"message":"Devices not found [3]"
} |
Run job - discover un-discovered devicesTrigger discovery job for all undiscovered devices. Method: PATCH Code Block |
---|
| http://example.unimus/api/v2/jobs/discovery/undiscovered |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" -X PATCH "http://<example.unimus>/api/v2/jobs/discovery/undiscovered" |
Success 202 Name | Type | Description |
---|
accepted | Number | Number of started discoveries | refused | Number | Number of refused discoveries. Discovery or backup currently running | unManaged | Number | Number of un-managed devices |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 202 ACCEPTED
{
"data":{
"accepted":12,
"refused":0,
"unManaged":0
}
} |
Run job - backup deviceTrigger backup job with all devices in the system. If u want to narrow down devices included in job then specify their IDs in request parameter. Method: PATCH Code Block |
---|
| http://example.unimus/api/v2/jobs/backup?id=:deviceIds |
Code Block |
---|
| curl -H "Accept: application/json" -H "Authorization: Bearer <token>" -X PATCH "http://<example.unimus>/api/v2/jobs/backup?id=<deviceIds>" |
Parameter Name | Type | Description |
---|
deviceIds | String | Comma separated device ids to run backup on |
Success 202 Name | Type | Description |
---|
accepted | Number | Number of started backups | refused | Number | Number of refused backups | sentForDiscovery | Number | Un-discovered devices sent for discovery | unManaged | Number | Number of un-managed devices |
Code Block |
---|
language | text |
---|
title | Success response |
---|
| HTTP/1.1 202 ACCEPTED
{
"data":{
"accepted":0,
"refused":2,
"sentForDiscovery":0,
"unManaged":0
}
} |
Error 4xx Name | Type | Description |
---|
timestamp | Number | Current timestamp | code | Number | 404 | error | String | HTTP code message | message | String | Error message |
Code Block |
---|
language | text |
---|
title | Error response |
---|
| HTTP/1.1 403 NOT FOUND
{
"timestamp":1511899365179,
"code":404,
"error":"Not Found",
"message":"Devices not found [16, 23, 15]"
} |
|