limitbw function from within your custom script:
/xml-api/limitbw function call name, plus the required variables (see below), to a URL which includes the address of your server.
example.com, you would include the following string in your script: https://example.com:2087/xml-api/limitbw
limitbw function from within your custom script:
/json-api/limitbw function call name, plus the required variables (see below), to a URL which includes the address of your server.
example.com, you would include the following string in your script: https://example.com:2087/json-api/limitbw
limitbw function takes the following variables as input. Both variables are required: limitbw function. 1 — yes.
0 — no.
1 — yes.
0 — no.
1 — yes.
0 — no.
https://example.com:2087/xml-api/limitbw?user=username&bwlimit=5
will produce output similar to:
<limitbw>
<result>
<bwlimit>
<bwlimit>5242880</bwlimit>
<bwlimitenable>1</bwlimitenable>
<domains>example.com</domains>
<domains>example2.com</domains>
<human_bwlimit>5 MB</human_bwlimit>
<human_bwused>1.81 KB</human_bwused>
<unlimited>0</unlimited>
</bwlimit>
<status>1</status>
<statusmsg>Bandwidth Limit for username set to 5</statusmsg>
</result>
</limitbw>
This will modify the user "username" to have a bandwidth usage limit of 5 MB.
https://example.com:2087/json-api/limitbw?user=joe&bwlimit=5
will produce output similar to:
{
"result":[
{
"status":1,
"statusmsg":"Bandwidth Limit for joe set to 5",
"bwlimit":{
"bwlimitenable":0,
"human_bwlimit":"5 MB",
"domains":[
"example.com"
],
"unlimited":0,
"bwlimit":5242880,
"human_bwused":"none"
}
}
]
}
This will modify the user "joe" to have a bandwidth usage limit of 5 MB.
Copyright © cPanel 2000-2009.