All API calls are prefixed with /api/v1/admin
- Authentication
- Set the API token
- Change the API token
- Upload a license
- View the license details
- Update the system
- View the status of a software update
- View the software update log
- Update the network and application settings
- View the network and application settings
- Retrieve compressed log files
- Retrieve the version of the system
- Retrieve the changelog of the system
- Reboot the system
Each API request requires a valid API token. The API token must be sent on every request as a query parameter: ?token=yourtoken
, except for the initial setup API call.
You MUST Set the API token prior to making any other API calls.
This is the initial setup API call where you set the API token.
Endpoint
POST /api/v1/admin/setup
Parameters
- newtoken: (required) New API token sent as
multipart/form-data
Example
curl -X POST https://enterprise.vm:8443/api/v1/admin/setup -F newtoken=yourtoken
HTTP/1.1 200 OK
Content-Type: application/json
{"Status":"200 OK"}
Endpoint
POST /api/v1/admin/setup?token=yourtoken
Parameters
- newtoken: (required) New API token sent as
multipart/form-data
Example
curl -X POST https://enterprise.vm:8443/api/v1/admin/setup?token=yourtoken -F newtoken=mynewtoken
HTTP/1.1 200 OK
Content-Type: application/json
{"Status":"200 OK"}
Endpoint
POST /api/v1/admin/license
Parameters
- license: (required) Encrypted license file sent as
multipart/form-data
Example
curl -X POST https://enterprise.vm:8443/api/v1/admin/license?token=yourtoken -F [email protected]
HTTP/1.1 200 OK
Content-Type: application/json
{
"app": "enterprise",
"users": 20,
"expires": "19 January 2038",
"name": "Enterprise Company",
"contact": "cto@enterprise"
}
Endpoint
GET /api/v1/admin/license
Example
curl -X GET https://enterprise.vm:8443/api/v1/admin/license?token=yourtoken
HTTP/1.1 200 OK
Content-Type: application/json
{
"app": "enterprise",
"users": 20,
"expires": "19 January 2038",
"name": "Enterprise Company",
"contact": "cto@enterprise"
}
Endpoint
POST /api/v1/admin/update
Parameters
- update: (required) Encrypted software update package sent as
multipart/form-data
Example
curl -X POST https://enterprise.vm:8443/api/v1/admin/update?token=yourtoken -F update=@software_update-v1.2.0.enc
HTTP/1.1 202 Accepted
Location: /api/v1/admin/update
{"Status":"202 Accepted","Location":"/api/v1/admin/update"}
Endpoint
GET /api/v1/admin/update
Example
curl -X GET https://enterprise.vm:8443/api/v1/admin/update?token=yourtoken
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "success",
"log": "[1432140922][SYSTEM] Updating system successful"
}
Endpoint
GET /api/v1/admin/update/log
Example
curl -X GET https://enterprise.vm:8443/api/v1/admin/update/log?token=yourtoken
HTTP/1.1 200 OK
Content-Type: text/plain
[1433080791][SYSTEM] Updating system. Please wait..
[1433080791][SYSTEM] Updating system successful
...
Endpoint
POST /api/v1/admin/settings
Parameters
- settings: (required) JSON settings file sent as
multipart/form-data
Example
curl -X POST https://enterprise.vm:8443/api/v1/admin/settings?token=yourtoken -F [email protected]
HTTP/1.1 202 Accepted
Location: /api/v1/admin/settings
{"Status":"202 Accepted","Location":"/api/v1/admin/settings"}
Example static settings.json
{
"network": {
"interface": "eth0",
"hostname": "test.host",
"ip_address": "192.168.1.100",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"dns1": "192.168.1.2",
"dns2": "192.168.1.3"
},
"app": {
"name": "testapp"
}
}
Simply omit the ip_address, netmask, gateway
fields and the network will be reconfigured using DHCP.
Example dhcp settings.json
{
"network": {
"interface": "eth0",
"hostname": "test.host"
},
"app": {
"name": "testapp"
}
}
Endpoint
GET /api/v1/admin/settings
Example
curl -X GET https://enterprise.vm:8443/api/v1/admin/settings?token=yourtoken
HTTP/1.1 200 OK
Content-Type: application/json
{
"network": {
"interface": "eth0",
"hostname": "test.host",
"ip_address": "192.168.1.100",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"dns1": "192.168.1.2",
"dns2": "192.168.1.3"
},
"app": {
"name": "testapp"
}
}
Endpoint
GET /api/v1/admin/logs
Example
curl -X GET https://enterprise.vm:8443/api/v1/admin/logs?token=yourtoken
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Filename: logs.tar.gz
Endpoint
GET /api/v1/admin/version
Example
curl -X GET https://enterprise.vm:8443/api/v1/admin/version?token=yourtoken
HTTP/1.1 200 OK
Content-Type: application/json
{
"version": "1.0.0"
}
Endpoint
GET /api/v1/admin/changelog
Example
curl -X GET https://enterprise.vm:8443/api/v1/admin/changelog?token=yourtoken
HTTP/1.1 200 OK
Content-Type: text/plain
# Changelog
## 1.0.9 (2015-08-21)
* Update app to version 2.1.2
* Update nodejs modules
* Update system packages
* Update API to version 1.1.6
Endpoint
GET /api/v1/admin/reboot
Example
curl -X GET https://enterprise.vm:8443/api/v1/admin/reboot?token=yourtoken
HTTP/1.1 202 Accepted
Content-Type: application/json
{"Status": "202 Accepted"}
Powered by Jidoteki - Copyright notices