Digits Local Interface API

From Wiki

(Difference between revisions)
Jump to: navigation, search
(Additional details to Digits)
 
(9 intermediate revisions not shown)
Line 1: Line 1:
-
[[Category:APIs]]
+
[[Category:APIs]] [[Category:Digits]]
= API URL =
= API URL =
Line 48: Line 48:
== Response ==
== Response ==
-
 
-
<span style="color: red;">Comments needed</span>
 
  { "count":[299,299],"users":[
  { "count":[299,299],"users":[
Line 59: Line 57:
   ]
   ]
  }
  }
 +
 +
The count array consists of two values:
 +
# slot count (currently not for use by 1H clients)
 +
# user count
 +
 +
The users array consists of:
 +
# username
 +
# active (not suspended)
 +
# exists in /etc/passwd
 +
# has a home folder
 +
# cPanel plan
= Disk Usage Info=
= Disk Usage Info=
Line 72: Line 81:
You are receiving a JSON encoded array of arrays. It returns data for a
You are receiving a JSON encoded array of arrays. It returns data for a
each mount point.
each mount point.
-
 
-
<span style="color: red;">Comments needed</span>
 
  [
  [
Line 79: Line 86:
   ["/backup","22850.39",79,"2010-10-10 07:00:01"]
   ["/backup","22850.39",79,"2010-10-10 07:00:01"]
  ]
  ]
 +
 +
# mountpoint
 +
# used space
 +
#
 +
# last time the data was collected
= Show all usernames =
= Show all usernames =
Line 91: Line 103:
  [
  [
-
+
  ["estherca","gyntec","ikandacr","holytri8","lsspl1","fldeaf85","bluesimi"],
-
["estherca","gyntec","ikandacr","holytri8","lsspl1","fldeaf85","bluesimi"],
+
   [
   [
   ["/","430633.26","49","2012-10-15 07:00:01"],
   ["/","430633.26","49","2012-10-15 07:00:01"],
Line 179: Line 190:
You are receiving a JSON encoded array of arrays.
You are receiving a JSON encoded array of arrays.
-
 
-
<span style="color: red;">Comments needed</span>
 
  [
  [
Line 188: Line 197:
   ["notwhart","0.00","55.02","0.00","55.02"]
   ["notwhart","0.00","55.02","0.00","55.02"]
  ]
  ]
 +
 +
# username
 +
# Incoming http
 +
# Outgoing http
 +
# Incoming all
 +
# Outgoing all
= Server Traffic =
= Server Traffic =
Line 207: Line 222:
   ["2011-08-02","719","751","148.50","432.77"]
   ["2011-08-02","719","751","148.50","432.77"]
  ]
  ]
 +
 +
# Date
 +
# Incoming packets
 +
# Outgoing packets
 +
# Incoming bytes
 +
# Outgoing bytes
= Traffic Graphs =
= Traffic Graphs =
Line 227: Line 248:
   ["2011-08-02","719","751","148.50","432.77"]
   ["2011-08-02","719","751","148.50","432.77"]
  ]
  ]
 +
 +
# Date
 +
# Incoming packets
 +
# Outgoing packets
 +
# Incoming bytes
 +
# Outgoing bytes
= Get traffic for specified date =
= Get traffic for specified date =
Line 246: Line 273:
   ["2012-10-15 04:00:00","755","1063","118.81","1099.66"]
   ["2012-10-15 04:00:00","755","1063","118.81","1099.66"]
  ]
  ]
 +
 +
# Date
 +
# Incoming packets
 +
# Outgoing packets
 +
# Incoming bytes
 +
# Outgoing bytes
= Get slots, suspended user count and du info =
= Get slots, suspended user count and du info =
Line 409: Line 442:
Default parameters:
Default parameters:
  '''txt      4'''
  '''txt      4'''
 +
 +
As of version 0.3.0 we also have an optional parameter, that allows the list of all accounts from the server.
 +
"all"
== Response ==
== Response ==
-
<span style="color: red;">Comments needed</span>
+
You are receiving a list of the Top 50 users of this machine, sorted by Disk Usage in GB.
 +
 
 +
If you wish to list all users, you should add the "all" option in the request.
  1epoppys 27.21 15311
  1epoppys 27.21 15311
Line 419: Line 457:
  abbeacon 12.96 20242
  abbeacon 12.96 20242
  gnifitca 11.03 29970
  gnifitca 11.03 29970
-
  goradiol 10.40 61178                                                                                                                              
+
  goradiol 10.40 61178
  dotowerc 6.03 65547
  dotowerc 6.03 65547
 +
 +
The response is space separated list with the following structure:
 +
# username
 +
# disk usage in GB
 +
# inodes usage (number of files and directories)
= Get the users with most content =
= Get the users with most content =
Line 429: Line 472:
== Response ==
== Response ==
-
 
-
<span style="color: red;">Comments needed</span>
 
  [
  [

Latest revision as of 13:31, 24 June 2013


Contents

API URL

http://server-name/digits/quotastats.pl

http://server-name/digits/stats.pl

Basic options

action you want to perform.

Bandwidth stats

count, suspended users and usage info

Quota stats

Summary user information

Output the Data for the Table

Request

Default parameters:

txt       1

Response

{ "count":[299,299],"users":[
  ["7swiscon","yes","yes","yes","1h-gold"],
  ...............
  ["encrafty","yes","yes","yes","1h-gold"],
  ["scedie","yes","yes","yes","1h-silver"],
  ["snvitami","yes","yes","yes","1h-silver"]
 ]
}

The count array consists of two values:

  1. slot count (currently not for use by 1H clients)
  2. user count

The users array consists of:

  1. username
  2. active (not suspended)
  3. exists in /etc/passwd
  4. has a home folder
  5. cPanel plan

Disk Usage Info

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 each mount point.

[
 ["/","60967.67",8,"2010-10-10 07:00:01"],
 ["/backup","22850.39",79,"2010-10-10 07:00:01"]
]
  1. mountpoint
  2. used space
  3. last time the data was collected

Show all usernames

Request

Default parameters:

txt       3

Response

Comments needed

[
 ["estherca","gyntec","ikandacr","holytri8","lsspl1","fldeaf85","bluesimi"],
 [
  ["/","430633.26","49","2012-10-15 07:00:01"],
  ["/sdb/mysql","16954.14","59","2012-10-15 07:00:01"],
  ["/sdb/backup","89479.10","11","2012-10-15 07:00:01"]
 ]
]

Slots count and disk usage info

Request

Default parameters:

txt       4

Response

Comments needed

[
 541,[
  ["/","430633.26","49","2012-10-15 07:00:01"],
  ["/sdb/mysql","16954.14","59","2012-10-15 07:00:01"],
  ["/sdb/backup","89479.10","11","2012-10-15 07:00:01"]
 ]
]

Slots count, suspended users and usage info

Request

Default parameters:

txt       5

Response

Comments needed

[
 541,"13",[
  ["/","430633.26","49","2012-10-15 07:00:01"],
  ["/sdb/mysql","16954.14","59","2012-10-15 07:00:01"],
  ["/sdb/backup","89479.10","11","2012-10-15 07:00:01"]
 ]
]

Summary traffic for the servers and all users

Request

Default parameters:

txt       6

Response

Comments needed

["20955444","31893921","3061054854","31439151849","0","6349265528"]

Summary traffic for the servers and all users plus slots count, suspended users and usage info

Request

Default parameters:

txt       7

Response

You are receiving a JSON encoded array of arrays.

Comments needed

[541,"13",[
 ["/","430633.26","49","2012-10-15 07:00:01"],
 ["/sdb/mysql","16954.14","59","2012-10-15 07:00:01"],
 ["/sdb/backup","89479.10","11","2012-10-15 07:00:01"]
],
 ["21114513","32109017","3086147198","31673854208","0","6349265528"]
]

Daily User Teraffic

Output the Data for the Table

Request

Default parameters:

txt       8

Response

You are receiving a JSON encoded array of arrays.

[
 ["arhurstb","0.00","5.30","0.00","5.30"],
 ...............
 ["peforosd","0.00","32.53","0.00","32.53"],
 ["notwhart","0.00","55.02","0.00","55.02"]
]
  1. username
  2. Incoming http
  3. Outgoing http
  4. Incoming all
  5. Outgoing all

Server Traffic

Output the Data for the Table

Request

Default parameters:

txt       9

Response

You are receiving a JSON encoded array of arrays.

[
 ["2010-09-05","27075","37225","4102.63","40111.04"],
 ...............
 ["2011-07-31","2300","1996","507.79","181.53"],
 ["2011-08-01","3353","4464","601.57","3702.62"],
 ["2011-08-02","719","751","148.50","432.77"]
]
  1. Date
  2. Incoming packets
  3. Outgoing packets
  4. Incoming bytes
  5. Outgoing bytes

Traffic Graphs

Output the Data for the Table

Request

Default parameters:

txt       9

Response

You are receiving a JSON encoded array of arrays.

[
 ["2010-09-05","27075","37225","4102.63","40111.04"],
 ...............
 ["2011-07-31","2300","1996","507.79","181.53"],
 ["2011-08-01","3353","4464","601.57","3702.62"],
 ["2011-08-02","719","751","148.50","432.77"]
]
  1. Date
  2. Incoming packets
  3. Outgoing packets
  4. Incoming bytes
  5. Outgoing bytes

Get traffic for specified date

Request

Default parameters:

txt       10
date      date

The date is in format YYYY-MM-DD. For example 2012-10-15.

Response

You are receiving a JSON encoded array of arrays.

[
 ["2012-10-15 00:00:00","550","757","79.77","716.80"],
 ...............
 ["2012-10-15 03:00:00","753","1025","132.32","943.98"],
 ["2012-10-15 04:00:00","755","1063","118.81","1099.66"]
]
  1. Date
  2. Incoming packets
  3. Outgoing packets
  4. Incoming bytes
  5. Outgoing bytes

Get slots, suspended user count and du info

Request

Default parameters:

txt       11

Response

You are receiving a JSON encoded array of arrays.

[
 541,541,"13",[
  ["/","430633.26","49","2012-10-15 07:00:01"],
  ["/sdb/mysql","16954.14","59","2012-10-15 07:00:01"],
  ["/sdb/backup","89479.10","11","2012-10-15 07:00:01"]
 ]
]

Get slots count, suspended users count, du info and bw info

Request

Default parameters:

txt       12

Response

You are receiving a JSON encoded array of arrays.

[541,541,"13",[
 ["/","430633.26","49","2012-10-15 07:00:01"],
 ["/sdb/mysql","16954.14","59","2012-10-15 07:00:01"],
 ["/sdb/backup","89479.10","11","2012-10-15 07:00:01"]
 ],
["20264344","30903936","2978709362","30500471155","0","6349265528"]
]

Get count slots

Request

Default parameters:

txt       13

Response

You are receiving a JSON encoded array of arrays.

[
 [541,541]
]

Get du info for the last 24 hours

Request

Default parameters:

txt       14

Response

You are receiving a JSON encoded array of arrays.

[
 ["1","420.54","49","2012-10-15 07:00:01"],
 ["2","16.56","59","2012-10-15 07:00:01"],
 ["3","87.38","11","2012-10-15 07:00:01"],
 ["1","420.53","49","2012-10-15 03:00:01"],
 ["3","87.11","11","2012-10-14 11:00:01"]
]

User Stats for specific user

Request

Default parameters:

txt       1
user      username

Response

Returns integer for the block usage for the specified client.

28528768

Daily User Quota stats

Output the Data for the Table

Request

Default parameters:

txt       2

Response

You are receiving a JSON encoded array of arrays.

[
 ["1epoppys","27.21","15311","2010-10-05 12:00:00"],
 ...............
 ["nadegelm","4.80","30697","2010-10-05 12:00:00"],
 ["nykorywa","4.69","7962","2010-10-05 12:00:00"]
]

Daily Quota Server Stats

Output the Data for the Table

Request

Default parameters:

txt       3
interval  1

With the help of the interval variable you can setup the interval for the data returned. For example if you want the weekly data interval should be 7.

Response

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

It looks like this:

[
 ["2010-10-05 02:00:00","475.65","6606649"],
 ...............
 ["2010-10-05 10:00:00","475.55","6606045"],
 ["2010-10-05 00:00:00","475.44","6605955"]
]

The columns are as follows:

Weekly Quota Server Stats

Output the Data for the Table

Request

Default parameters:

txt       3
interval  7

Response

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

[
 ["2010-10-05 02:00:00","475.65","6606649"],
 ...............
 ["2010-10-05 00:00:00","475.44","6605955"],
 ["2010-09-29 20:00:00","474.74","6600790"]
]

The columns are as follows:

Disk and inode usage per client

Request

Default parameters:

txt       4

As of version 0.3.0 we also have an optional parameter, that allows the list of all accounts from the server.

"all"

Response

You are receiving a list of the Top 50 users of this machine, sorted by Disk Usage in GB.

If you wish to list all users, you should add the "all" option in the request.

1epoppys 27.21 15311
...............
slpaulwa 15.50 50781
abbeacon 12.96 20242
gnifitca 11.03 29970
goradiol 10.40 61178
dotowerc 6.03 65547

The response is space separated list with the following structure:

  1. username
  2. disk usage in GB
  3. inodes usage (number of files and directories)

Get the users with most content

Request

Default parameters:

txt       5

Response

[
 {"user":"root","size":"26317872"},
 ...............
 {"user":"lanuevar","size":"13727964"},
 {"user":"vcsa","size":"8"},
 {"user":"cpanellogaholic","size":"8"},
 {"user":"dovecot","size":"4"}
]
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox