Machine management
POST
Create a new, empty machine in your linuxcounter account
POST http://api.linuxcounter.net/v1/machines
curl --request POST \
'http://api.linuxcounter.net/v1/machines' \
--header 'x-lico-apikey: YOUR-APIKEY-HERE'
| Request Parameters | ||
|---|---|---|
x-lico-apikey |
Header | |
{
'machine_id': 12345,
'machine_updatekey': 'tz3948vtz349gnh4308t34058zt34z5h'
}
| Response Status Codes | |
|---|---|
201 Created |
|
400 Bad Request |
|
404 Not Found |
|
500 Internal Server Error |
|
PATCH
Update a machine with some data
PATCH http://api.linuxcounter.net/v1/machines/{machine_id}
curl --request PATCH \
'http://api.linuxcounter.net/v1/machines/YOUR-MACHINE-ID-HERE' \
--header 'x-lico-machine-updatekey: YOUR-MACHINE-UPDATEKEY-HERE' \
--data 'hostname=some.example.com' \
--data 'distribution=Trisquel' \
--data 'distversion=7.0 LTS Belenos'
| Request Parameters | ||
|---|---|---|
machine_id |
Query URL | |
x-lico-machine-updatekey |
Header | |
--data |
Body | |
| --data key Parameters | ||
|---|---|---|
hostname |
String | |
cores |
Integer | |
flags |
String | |
accounts |
Integer | |
diskspace |
Integer | |
diskspaceFree |
Integer | |
memory |
Integer | |
memoryFree |
Integer | |
swap |
Integer | |
swapFree |
Integer | |
distversion |
String | |
mailer |
String | |
network |
String | |
online |
Integer | |
uptime |
String | |
loadavg |
String | |
distribution |
String | |
kernel |
String | |
cpu |
String | |
country |
String | |
architecture |
String | |
class |
String | |
purpose |
String | |
There will be an empty response with status code "204 No Content"
| Response Status Codes | |
|---|---|
204 No Content |
|
400 Bad Request |
|
404 Not Found |
|
500 Internal Server Error |
|
GET
Get the list of all of your machines of your account
GET http://api.linuxcounter.net/v1/machines
curl --request GET \
'http://api.linuxcounter.net/v1/machines' \
--header 'x-lico-apikey: YOUR-APIKEY-HERE'
| Request Parameters | ||
|---|---|---|
x-lico-apikey |
Header | |
{
'machine_id': 12345,
'machine_updatekey': 'tz3948vtz349gnh4308t34058zt34z5h',
'createdat': 2015-04-10 08:56:31,
'modifiedat': 2015-04-10 08:56:31
},
{
'machine_id': 234567,
'machine_updatekey': 'uiw4z5t87w3tzo3tzw3tzwp345t4w5us',
'createdat': 2015-04-11 08:56:31,
'modifiedat': 2015-04-11 16:56:31
},
{
'machine_id': 321432,
'machine_updatekey': 'bev897twz3ot834zt37nztnw3o874tds',
'createdat': 2015-04-12 08:56:31,
'modifiedat': 2015-04-12 18:56:31
}
| Response Status Codes | |
|---|---|
200 Ok |
|
404 Not Found |
|
500 Internal Server Error |
|
GET
Get the details of one machine of your account
GET http://api.linuxcounter.net/v1/machines/{machine_id}
curl --request GET \
'http://api.linuxcounter.net/v1/machines/{machine_id}' \
--header 'x-lico-apikey: YOUR-APIKEY-HERE'
| Request Parameters | ||
|---|---|---|
machine_id |
Query URL | |
x-lico-apikey |
Header | |
{
"machine_id": 2009882,
"machine_updatekey": "xxxxxxxxx",
"machine_user": 249600,
"machine_hostname": "linuxcounter.net",
"machine_cores": 12,
"machine_flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq d",
"machine_accounts": 31,
"machine_diskspace": "221322",
"machine_diskspaceFree": "145081",
"machine_memory": "48271",
"machine_memoryFree": "3383",
"machine_swap": "3812",
"machine_swapFree": "3068",
"machine_distversion": "14.04",
"machine_mailer": "Postfix",
"machine_network": "ethernet",
"machine_online": true,
"machine_uptime": 1555200,
"machine_loadavg": "2.45, 2.19, 2.17",
"machine_distribution": "Ubuntu",
"machine_kernel": "3.13.0-45-generic",
"machine_cpu": "Intel(R) Xeon(R) CPU E5-1650 v2",
"machine_country": "DE",
"machine_architecture": "x86_64",
"machine_class": "server",
"machine_purpose": null,
"machine_createdat": {
"date": "2014-12-17 17:22:53",
"timezone_type": 3,
"timezone": "Europe\/Berlin"
},
"machine_modifiedat": {
"date": "2015-03-09 05:00:02",
"timezone_type": 3,
"timezone": "Europe\/Berlin"
}
}
| Response Status Codes | |
|---|---|
200 Ok |
|
404 Not Found |
|
500 Internal Server Error |
|
DELETE
Delete one machine from your account
DELETE http://api.linuxcounter.net/v1/machines/{machine_id}
curl --request DELETE \
'http://api.linuxcounter.net/v1/machines/{machine_id}' \
--header 'x-lico-apikey: YOUR-APIKEY-HERE'
| Request Parameters | ||
|---|---|---|
machine_id |
Query URL | |
x-lico-apikey |
Header | |
There will be an empty response with status code "204 No Content"
| Response Status Codes | |
|---|---|
204 No Content |
|
404 Not Found |
|
500 Internal Server Error |
|
Get Statistics
GET
Get the user statistics
GET http://api.linuxcounter.net/v1/statistics/user/{page}
curl --request GET \
'http://api.linuxcounter.net/v1/statistics/user/2' \
--header 'x-lico-apikey: YOUR-APIKEY-HERE'
| Request Parameters | ||
|---|---|---|
x-lico-apikey |
Header | |
page |
Query | |
{
[ not thought of this yet ]
}
| Response Status Codes | |
|---|---|
200 Ok |
|
404 Not Found |
|
500 Internal Server Error |
|
GET
Get the machine statistics
GET http://api.linuxcounter.net/v1/statistics/machines
curl --request GET \
'http://api.linuxcounter.net/v1/statistics/machines
--header 'x-lico-apikey: YOUR-APIKEY-HERE'
| Request Parameters | ||
|---|---|---|
x-lico-apikey |
Header | |
{
[ not thought of this yet ]
}
| Response Status Codes | |
|---|---|
200 Ok |
|
404 Not Found |
|
500 Internal Server Error |
|
GET
Get the distribution statistics
GET http://api.linuxcounter.net/v1/statistics/distributions
curl --request GET \
'http://api.linuxcounter.net/v1/statistics/distributions'
--header 'x-lico-apikey: YOUR-APIKEY-HERE'
| Request Parameters | ||
|---|---|---|
x-lico-apikey |
Header | |
{
[ not thought of this yet ]
}
| Response Status Codes | |
|---|---|
200 Ok |
|
404 Not Found |
|
500 Internal Server Error |
|
GET
Get the kernel statistics
GET http://api.linuxcounter.net/v1/statistics/kernels
curl --request GET \
'http://api.linuxcounter.net/v1/statistics/kernels'
--header 'x-lico-apikey: YOUR-APIKEY-HERE'
| Request Parameters | ||
|---|---|---|
x-lico-apikey |
Header | |
{
[ not thought of this yet ]
}
| Response Status Codes | |
|---|---|
200 Ok |
|
404 Not Found |
|
500 Internal Server Error |
|
GET
Get the uptime statistics
GET http://api.linuxcounter.net/v1/statistics/uptimes
curl --request GET \
'http://api.linuxcounter.net/v1/statistics/uptimes'
--header 'x-lico-apikey: YOUR-APIKEY-HERE'
| Request Parameters | ||
|---|---|---|
x-lico-apikey |
Header | |
{
[ not thought of this yet ]
}
| Response Status Codes | |
|---|---|
200 Ok |
|
404 Not Found |
|
500 Internal Server Error |
|
GET
Get the counter statistics
GET http://api.linuxcounter.net/v1/statistics/counter
curl --request GET \
'http://api.linuxcounter.net/v1/statistics/counter'
--header 'x-lico-apikey: YOUR-APIKEY-HERE'
| Request Parameters | ||
|---|---|---|
x-lico-apikey |
Header | |
{
[ not thought of this yet ]
}
| Response Status Codes | |
|---|---|
200 Ok |
|
404 Not Found |
|
500 Internal Server Error |
|