Loading...

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 * Submit your ApiKey through the request header. (Required)
{
    'machine_id': 12345,
    'machine_updatekey': 'tz3948vtz349gnh4308t34058zt34z5h'
}
Response Status Codes
201 Created The machine got successfully created
400 Bad Request No Apikey or wrong Apikey provided
404 Not Found The ApiKey was not found
500 Internal Server Error There was an internal error. Please contact the admin.
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 * Use the machine_id from the Creation above. (Required)
x-lico-machine-updatekey Header * Use the machine_updatekey from the Creation above. (Required)
--data Body * All keys are optional, but at least one "key=value" entry is required (Required)
--data key Parameters
hostname String The hostname of your machine
cores Integer The number of CPU cores
flags String The flags of the CPU(s)
accounts Integer The number of accounts on your machine
diskspace Integer The diskspace in megabytes
diskspaceFree Integer The free diskspace in kilobytes
memory Integer The memory (RAM) in megabytes
memoryFree Integer The free memory (RAM) in kilobytes
swap Integer The swap space in megabytes
swapFree Integer The free swap space in kilobytes
distversion String The versionstring of the distribution
mailer String What program is used to send emails
network String How is it connected to the internet
online Integer is the machine online (1) or offline (0)
uptime String The uptime of the machine in seconds(!)
loadavg String The Load average string (e.g. "0,23 0,54 0,45")
distribution String The name of the distribution (without version!)
kernel String The kernel version string (e.g. "3.13.44-2")
cpu String The name (model) of the CPU (from e.g. /proc/cpuinfo)
country String The ISO country code (e.g. "DE" or "US")
architecture String The arch of your machine (e.g. "armv7" or "x86_64")
class String The class of the machine (e.g. "server", "laptop" or "workstation")
purpose String For what is this machine used for (e.g. "work", "home", "school", ...)
There will be an empty response with status code "204 No Content"
Response Status Codes
204 No Content The machine got successfully updated
400 Bad Request The was something wrong with the request (maybe wrong --data parameter?)
404 Not Found The machine_id or the machine_updatekey were not found
500 Internal Server Error There was an internal error. Please contact the admin.
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 * Submit your ApiKey through the request header. (Required)
{
    '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 The list of your machines get returned
404 Not Found The ApiKey was not found
500 Internal Server Error There was an internal error. Please contact the admin.
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 * Use the machine_id from the Creation above. (Required)
x-lico-apikey Header * Submit your ApiKey through the request header. (Required)
{
    "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 The details of your machine get returned
404 Not Found The ApiKey was not found
500 Internal Server Error There was an internal error. Please contact the admin.
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 * Use the machine_id from the Creation above. (Required)
x-lico-apikey Header * Submit your ApiKey through the request header. (Required)
There will be an empty response with status code "204 No Content"
Response Status Codes
204 No Content The machine got successfully deleted
404 Not Found The machine_id or the machine_updatekey were not found
500 Internal Server Error There was an internal error. Please contact the admin.

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 * Submit your ApiKey through the request header. (Required)
page Query * The results are limited to pages (Required)
{
    [ not thought of this yet ]
}
                                            
Response Status Codes
200 Ok The statistics get returned
404 Not Found The ApiKey was not found
500 Internal Server Error There was an internal error. Please contact the admin.
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 * Submit your ApiKey through the request header. (Required)
{
    [ not thought of this yet ]
}
                                            
Response Status Codes
200 Ok The statistics get returned
404 Not Found The ApiKey was not found
500 Internal Server Error There was an internal error. Please contact the admin.
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 * Submit your ApiKey through the request header. (Required)
{
    [ not thought of this yet ]
}
                                            
Response Status Codes
200 Ok The statistics get returned
404 Not Found The ApiKey was not found
500 Internal Server Error There was an internal error. Please contact the admin.
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 * Submit your ApiKey through the request header. (Required)
{
    [ not thought of this yet ]
}
                                            
Response Status Codes
200 Ok The statistics get returned
404 Not Found The ApiKey was not found
500 Internal Server Error There was an internal error. Please contact the admin.
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 * Submit your ApiKey through the request header. (Required)
{
    [ not thought of this yet ]
}
                                            
Response Status Codes
200 Ok The statistics get returned
404 Not Found The ApiKey was not found
500 Internal Server Error There was an internal error. Please contact the admin.
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 * Submit your ApiKey through the request header. (Required)
{
    [ not thought of this yet ]
}
                                            
Response Status Codes
200 Ok The statistics get returned
404 Not Found The ApiKey was not found
500 Internal Server Error There was an internal error. Please contact the admin.