API: Get Current Stats

Browse by products and services

Request Info

The following URL and HTTP method should be used.

GET https://api.mediatemple.net/api/v1/stats/{serviceId}

The following parameters must be provided in the URL.

Parameter Type Description
serviceId int The service id

Response Info

The response will return an HTTP status code to indicate the general category of success or failure to the client. More specific error codes and messages will be contained in the response data itself, if provided. For more information on response codes and parsing response data, see Parsing API responses.

Sample Request

To get the stats for service 1000 in JSON format, do the following.

curl -D log.txt -s -X "GET" "https://api.mediatemple.net/api/v1/stats/1000.json?apikey=a5h34sf62..."

Sample Response

Here is an example of the returned result.

"stats" : {
"timeStamp" : 1284170031,
"cpu" : 69.76,
"memory" : 59.8,
"load1Min" : 19.93,
"load5Min" : 29.9,
"load15Min" : 39.86,
"processes" : 50,
"diskSpace" : 49.83,
"kbytesIn" : 79.73,
"kbytesOut" : 89.69,
"packetsIn" : 99.66,
"packetsOut" : 109.62,
"state" : 1

Next line of text

Response Fields

The fields in the result represent the following.

Field Description
timeStamp The time these stats were recorded
cpu The percentage of CPU being consumed
memory The percentage of memory currently allocated
load1Min The system load average for the past minute
load5Min The system load average for the past 5 minutes
load15Min The system load average for the past 15 minutes
processes The number of processes currently running
diskSpace The percentage of disk space currently used
kbytesIn The kilobytes in per second
kbytesOut The kilobytes out per second
packetsIn The packets in per second
packetsOut The packets out per second
state The server state (0=off, 1=running)