Digits Central Portal API

From Wiki

Jump to: navigation, search

Digits Central Portal API

Contents

API URL

http://portal-hostname-or-ip/~1h/portal/stats.pl

http://portal-hostname-or-ip/~1h/portal/quotastats.pl

If you have configured a separate hostname for the portal, you can skip the /~1h.

Basic options

Bandwidth stats

Quota stats

Daily Bandwidth Stats

Output the Data for the Table

Request

Default parameters:

txt       1
offset    1

With the help of the offset option you can get the data for a past day.

For example, if today is 15th day of the month and you want to see the data for 11th day, your offset will be 4, because you want to see the data from before 4 days.

Response

You are receiving a JSON encoded array of arrays. It returns data for a period of 24hours.

It looks like this:

[
	["192.168.0.199","27057","45872","3.18","56.40","0.00","19.40","1h-169.com"],
	["192.168.2.183","20163","28780","4.26","31.80","0.00","17.78","1h-215.com"],
	...............
	["192.168.2.100","17153","24142","3.90","26.91","0.00","17.83","1h-248.com"],
]

Each line represents one server.

The columns are as follows:

14 Days Bandwidth Stats

Output the Data for the table

Request

Default parameters:

txt       2

Response

You are receiving a JSON encoded array of arrays. It returns data for a period of 14 days.

It looks like this:

[
	["192.168.0.199","27057","45872","3.18","56.40","0.00","19.40","1h-169.com"],
	["192.168.2.183","20163","28780","4.26","31.80","0.00","17.78","1h-215.com"],
	...............
	["192.168.2.100","17153","24142","3.90","26.91","0.00","17.83","1h-248.com"],
]

Each line represents the summed data for one server.

The columns are as follows:

Daily Disk Usage

Output the Data for the table

Request

Default parameters:

txt       4

Response

You are receiving a JSON encoded array of arrays. It returns data for a period of 14 days.

It looks like this:

[
  [ "192.168.0.54", 80, "2010-11-21 23:00:00", "1h-154.com" ],
  [ "192.168.1.64", 80, "2010-11-21 23:00:00", "1h-118.com" ],
  ............................
  [ "192.168.1.206", 79, "2010-11-21 23:00:00", "1h-139.com" ]
]

Each line represents the information for /dev/sda from one server.

The columns are as follows:


Weekly Disk Usage

Output the Data for the graphs

Request

Default parameters:

txt        1
start      0
limit      4
min_perc   0
max_perc   100
min_usage  0
max_usage  1000

Response

You are receiving a JSON encoded array of hashes. It returns data for a period of one week.

It looks like this:

{
   "servers" : [
      { "dname" : "1h-154.com", "ip" : "192.168.0.54", "data" : [
            { "perc" : 80, "usage" : "676.32", "hour" : "2010-11-15 03:00" },
            { "perc" : 80, "usage" : "676.29", "hour" : "2010-11-15 07:00" },
            ...... usually it returns 41 lines of data to build the one graph ......
            { "perc" : 80, "usage" : "676.42", "hour" : "2010-11-15 11:00" }
         ]
      },
      { "dname" : "1h-131.com", "ip" : "192.168.1.241", "data" : [
            { "perc" : 79, "usage" : "672.13", "hour" : "2010-11-15 03:00" },
            { "perc" : 79, "usage" : "672.43", "hour" : "2010-11-15 07:00" },
            ...... usually it returns 41 lines of data to build the one graph ......
            { "perc" : 79, "usage" : "673.57", "hour" : "2010-11-15 03:00" },
         ]
      }
   ],
    "total" : "203"
}

Each line from the data array for each server represents the disk usage in percentage, GB and the date on which the information was collected.

At the end it reports the number of servers for which we have data.


Quota Recently user usage

Output the Data for the graphs

Request

Default parameters:

txt        2
start      0
limit      4
min_perc   0
max_perc   100
min_usage  0
max_usage  1000

Response

{
   "servers" : [
      { "dname" : "m16.siteground.biz", "ip" : "184.154.44.90", "data" : [
            { "usage" : "39.87", "username" : "gilbert1" },
            { "usage" : "33.52", "username" : "infopsc" },
            { "usage" : "29.85", "username" : "junnut" },
            ..........................
            { "usage" : "29.12", "username" : "btwwnet" }
          ]
      },
      { "dname" : "m16.siteground.biz", "ip" : "184.154.44.90", "data" : [
            { "usage" : "39.87", "username" : "gilbert1" },
            { "usage" : "33.52", "username" : "infopsc" },
            { "usage" : "29.85", "username" : "junnut" },
            ..........................
            { "usage" : "29.12", "username" : "btwwnet" }
          ]
      }
   ],
   "total" : null
}

Total is always null.

Quota Top 50 users

Output the Data for the graphs

Request

Default parameters:

txt        3
type	   0

Response

You are receiving a JSON encoded array of arrays. It returns data for a period of 24hours.

It looks like this:

[
   [ "1h-157.com", "dsmftp",   "98.93", "1h-157.com", "192.168.1.62"  ],
   [ "1h-132.com", "eweftp",   "35.93", "1h-132.com", "192.168.2.23"  ],
   ............................
   [ "1h-217.com", "virtua72", "58.17", "1h-217.com", "192.168.0.214" ]
]

The columns are as follows:

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox