usagestatistics
Get Eenos Accounts usage metrics
To get all Eenos reseller hosting accounts usage metrics via api. This will return account information, bandwidth usage, and disk usage
Required Headers
| Field | Description | Example |
| X-RESELLER | The reseller account user name | alphareseller |
| X-API-USER | API user name | eenos_api |
| X-API-PASSWORD | API user password | eenos123 |
Status Codes
| Code | Description |
| 200 | OK, Success |
| 500 | Server Error |
| 403 | Forbidden |
| 400 | Bad request |
Request URL
Post url = /usagestatistics/
Default Full URL = https://your-host-name:4444/api/usagestatistics/
Version Full URL = https://your-host-name:4444/api/v1/usagestatistics/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/usagestatistics/"
BASE_URL="https://your-host-name:4444/api/v1"
# Default base URL
# BASE_URL="https://your-host-name:4444/api"
# Version specific base URL (recommended)
# BASE_URL="https://your-host-name:4444/api/v1"
API_URL="$BASE_URL$REQUEST_URL"
/usr/bin/curl -X POST "$API_URL" \
-H "X-RESELLER: alphareseller" \
-H "X-API-USER: eenos_api" \
-H "X-API-PASSWORD: eenos123"
Sample Output
{
"data" : {
"accounts" : {
"a111user" : {
"addondomains" : "unlimited",
"bandwidth" : "1048576",
"contactemail" : "sdsd@sdsds.com",
"dedicatedip" : {
"ipv4" : "x.x.x.x",
"ipv6" : "x:x:x:x:bbbb:0000:0000:x",
"status" : "off",
"status6" : "on"
},
"dkim" : "off",
"domain" : "0000testongfor.com",
"email" : "unlimited",
"feature" : "Xls",
"ftp" : "unlimited",
"homedir" : "/home/a111user",
"language" : "en",
"maillist" : "unlimited",
"mailquota" : "unlimited",
"mailserver" : "remote",
"nameservers" : [
"dns.a.com",
"ns2.b.com",
"ns3.c.com"
],
"owner" : "root",
"package" : "AoneHost",
"parkeddomains" : "unlimited",
"quota" : "unlimited",
"reseller" : {
"selfown" : "on",
"status" : "on"
},
"setuptime" : "2023-01-24 00:44",
"shell" : {
"shell" : "/bin/bash",
"status" : "on"
},
"spf" : "on",
"sql" : "unlimited",
"subdomains" : "unlimited",
"theme" : "default",
"user" : "a111user",
"is_reseller" : "yes",
"is_suspended" : "no",
"reseller_data": {
"accounts": [
"lilly123",
"mydreams",
"ntest",
"peace"
],
"contactemail": "sdsd@sdsds.com",
"ips": {
"ipv4": "188.xx.xx.xx",
"ipv6": "2a01:xxxx:xxxx:xxxx:0000:0000:0000:xxxx"
},
"name": "a111user",
"nameservers": [
"ns1.0000testongfor.com",
"ns2.0000testongfor.com",
"ns3.0000testongfor.com",
"ns4.0000testongfor.com"
],
"reseller_bandwidth": "unlimited",
"reseller_limt": "unlimited",
"reseller_quota": "unlimited"
},
"quota_usage_reseller": 1,
"bandwidth_usage_reseller": 0,
"quota_usage": 10234,
"bandwidth_usage": 5545
},
"sysvm" : {
"addondomains" : "0",
"bandwidth" : "1048576",
"contactemail" : "asa@sysvm.com",
"dedicatedip" : {
"ipv4" : "x.x.x.204",
"ipv6" : "x:x:x:2093:bbbb:0000:0000:002a",
"status" : "off",
"status6" : "on"
},
"dkim" : "on",
"domain" : "sysvm.net",
"email" : "0",
"feature" : "Default",
"ftp" : "0",
"homedir" : "/home/sysvm",
"language" : "en",
"maillist" : "0",
"mailquota" : "0",
"mailserver" : "local",
"nameservers" : [
"ns1.as.com",
"ns2.as.com"
],
"owner" : "sysvm",
"package" : "100Gb",
"parkeddomains" : "0",
"quota" : "102404",
"reseller" : {
"selfown" : "off",
"status" : "off"
},
"setuptime" : "2021-06-27 01:12",
"shell" : {
"shell" : "/bin/bash",
"status" : "on"
},
"spf" : "on",
"sql" : "0",
"subdomains" : "0",
"theme" : "default",
"user" : "sysvm",
"is_reseller" : "no",
"is_suspended" : "no",
"quota_usage": 10234,
"bandwidth_usage": 5545
}
}
},
"info" : "Return eenos hosting accounts",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# ---------------------------------------------------------------------
# API VERSION RULES
# ---------------------------------------------------------------------
# Default API (stable):
# https://your-host-name:4444/api/
#
# Versioned API (recommended for production / future compatibility):
# https://your-host-name:4444/api/v1/
#
# Endpoint example:
# usagestatistics/
# Full versioned URL:
# https://your-host-name:4444/api/v1/usagestatistics/
#
# This endpoint does NOT require a payload body.
# ---------------------------------------------------------------------
# API URL (versioned)
api_url = "https://your-host-name:4444/api/v1/usagestatistics/"
# If using default API, uncomment below:
# api_url = "https://your-host-name:4444/api/usagestatistics/"
# Authentication headers (new API format)
headers = {
"X-RESELLER": "alphareseller",
"X-API-USER": "eenos_api",
"X-API-PASSWORD": "eenos123",
}
try:
response = requests.post(api_url, headers=headers)
response.raise_for_status()
pprint(response.json())
except Exception as e:
pprint(str(e))
PHP Code
<?php
/*
|--------------------------------------------------------------------------
| API VERSION RULES
|--------------------------------------------------------------------------
| Default API (stable):
| https://your-host-name:4444/api/
|
| Versioned API (recommended for production / future compatibility):
| https://your-host-name:4444/api/v1/
|
| Endpoint example:
| usagestatistics/
| Full versioned URL:
| https://your-host-name:4444/api/v1/usagestatistics/
|--------------------------------------------------------------------------
*/
// API request URL (versioned)
$request_url = '/usagestatistics/';
/*
|--------------------------------------------------------------------------
| BASE URL SELECTION
|--------------------------------------------------------------------------
*/
// Versioned API base URL
$base_url = 'https://your-host-name:4444/api/v1';
// Default API base URL (uncomment if needed)
// $base_url = 'https://your-host-name:4444/api';
// Full API URL
$api_url = $base_url . $request_url;
// Initialize cURL
$ch = curl_init($api_url);
// No payload required
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Authentication headers (new API format)
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-RESELLER: alphareseller',
'X-API-USER: eenos_api',
'X-API-PASSWORD: eenos123'
]);
// Execute request
$result = curl_exec($ch);
// Error handling
if (curl_errno($ch)) {
echo 'cURL Error: ' . curl_error($ch);
} else {
echo json_encode(json_decode($result), JSON_PRETTY_PRINT);
}
// Close connection
curl_close($ch);
?>