Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section

API documentation

General

Health check

Get Unimus health status.

Method: GET

Panel
borderColorgrey
borderStylesolid

http://example.unimus/api/v1/heatlh

CURL

Panel
borderColorgrey
borderStylesolid

curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v1/health"

Success 200

FieldTypeDescription
statusString

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
borderColorgrey
borderStylesolid
titleSuccess response

 HTTP/1.1 200 OK

{

"data": {
"status": "OK"
}

}

 

 


 

Schedules

Schedules - get schedule

Get an individual schedule.

Method: GET

Panel
borderColorgrey
borderStylesolid

http://example.unimus/api/v1/schedules/:scheduleId

CURL

Panel
borderColorgrey
borderStylesolid

curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v1/schedules/<scheduleId>"

Parameter

FieldTypeDescription
scheduleIdNumberThe ID of the schedule

Success 200

FieldTypeDescription
 idNumber  The ID of the schedule
createTimeNumberSchedule creation time in seconds
periodicityStringSchedule periodicity. Possible values: MONTHLY, WEEKLY, DAILY, HOURLY
domNumberDay of month
dowNumberDay of week
hourNumberHour of day
minNumberMinute of hour
nameStringSchedule pretty name

 

 

Panel
borderColorgrey
borderStylesolid
titleSuccess 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

NameTypeDescription
timestamp Number Current timestamp
 code Number404
 error String HTTP code message
 messageString  Error message
Panel
borderColorgrey
borderStylesolid
titleError response

HTTP/1.1 404 NOT FOUND

{

"timestamp": 1511862182524,
"code": 404,
"error": "Not Found",
"message": "Schedule with id 11 not found"

}



Schedules - get schedules

Get a list of all schedules in Unimus.

Method: GET

Panel
borderColorgrey
borderStylesolid

http://example.unimus/api/v1/schedules?page=:pageIndex&size=:pageSize

CURL

Panel
borderColorgrey
borderStylesolid

curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v1/schedules?page=0&size=20"

Parameter

NameTypeDescription
pageIndexNumberPage index (OPTIONAL)
pageSizeNumberPage size (OPTIONAL)

Success 200

NameTypeDescription
 idNumber  The ID of the schedule
createTimeNumberSchedule creation time in seconds
periodicityStringSchedule periodicity. Possible values: MONTHLY, WEEKLY, DAILY, HOURLY
domNumberDay of month
dowNumberDay of week
hourNumberHour of day
minNumberMinute of hour
nameStringSchedule pretty name
Panel
borderColorgrey
borderStylesolid
titleSuccess 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

Get an individual device.

Method: GET

Panel
borderColorgrey
borderStylesolid
 http://example.unimus/api/v1/devices/:deviceId?attr=:attributes

CURL

Panel
borderColorgrey
borderStylesolid

curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimuis>/api/v1/devices/<deviceId>?attr=s,c"

Parameter

NameTypeDescription
deviceIdNumberThe ID of the device
attributesString

Comma separated graph attribute nodes. (OPTIONAL)

Possible values for device schedule: schedule, sch, s

for device credential: credential, cred, c

Success 200

NameTypeDescription
id NumberThe ID of the device 
createTime Number Device creation time in seconds
address StringHostname, IPv4 or IPv6
description StringDevice description
port NumberDevice port
connector StringConnector type, possible values: SSH, TELNET
vendor StringVendor
type StringType
model StringModel
schedule ObjectDevice schedule
credential ObjectCredential used to login to the device

 

 

Panel
borderColorgrey
borderStylesolid
titleSuccess 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 4xx

NameTypeDescription
timestamp Number Current timestamp
 code Number400
 error String HTTP code message
 messageString  Error message
Panel
borderColorgrey
borderStylesolid
titleError response

HTTP/1.1 400 BAD REQUEST

{

"timestamp": 1511869830038,
"code": 400,
"error": "Bad Request",
"message": "Argument deviceId type mismatch"

}



Devices - get devices

Get a list of devices.

Method: GET

Panel
borderColorgrey
borderStylesolid

http://example.unimus/api/v1/devices?page=:pageIndex&size=:pageSize&attr=:attributes

CURL

Panel
borderColorgrey
borderStylesolid

curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v1/devices?page=0&size=20&attr=s,c"

Parameter

NameTypeDescription
pageIndexNumberPage index (OPTIONAL)
pageSizeNumberPage size (OPTIONAL)
attributesString

Comma separated graph attribute nodes.(OPTIONAL)

Possible values for device schedule: schedule, sch, s

for device credential: credential, cred, c

Success 200

NameTypeDescription
id NumberThe ID of the device 
createTime Number Device creation time in seconds
address StringHostname, IPv4 or IPv6
description StringDevice description
port NumberDevice port
connector StringConnector type, possible values: SSH, TELNET
vendor StringVendor
type StringType
model StringModel
schedule ObjectDevice schedule
credential ObjectCredential used to login to the device
Panel
borderColorgrey
borderStylesolid
titleSuccess 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
}

}