cPanel API 2 Functions - Ftp::setquota
The cPanel API 2 system is deprecated. We strongly recommend that you use UAPI instead of cPanel API 2.
Description
This function changes an FTP account's quota.
The cPanel API 2 system is deprecated. We strongly recommend that you use UAPI instead of cPanel API 2.
This function changes an FTP account's quota.
We strongly recommend that you use the following UAPI function instead of this function:
Ftp::set_quota
— This function changes an FTP account's quota.
When you disable the FTP role, the system disables this function.
WHM API (JSON)
https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Ftp&cpanel_jsonapi_func=setquota&user=user"a=12345
For more information, read our Calls from the WHM API documentation.
LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
// Sets the FTP quota of "user" to "12345"
$change_quota = $cpanel->api2(
'Ftp', 'setquota',
array(
'user' => 'user',
'setquota' => '12345',
)
);
For more information, read our Guide to the LiveAPI System.
LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
# Sets the FTP quota of "user" to "12345"
my $change_quota = $cpliveapi->api2(
'Ftp', 'setquota',
{
'user' => 'user',
'quota' => '12345',
}
);
For more information, read our Guide to the LiveAPI System.
cPanel Tag System (deprecated)
Command Line
cpapi2 --user=username Ftp setquota user=user quota=12345
username
represents your account-level username.
--user=username
option.
cpapi2 --help
command.
cpapi2
command:
/usr/local/cpanel/bin/cpapi2
Output (JSON)
{
"cpanelresult": {
"apiversion": 2,
"func": "setquota",
"data": [
{
"reason": "OK",
"result": 1
}
],
"event": {
"result": 1
},
"module": "Ftp"
}
}
Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters | Type | Description | Possible values | Example |
---|---|---|---|---|
user |
string | Required The FTP account's username. |
Any valid username. | user |
quota |
integer | Required The new FTP account's quota. |
|
12345 |
Return | Type | Description | Possible values | Example |
---|---|---|---|---|
reason |
string |
A reason for failure. This function only returns a |
A string that describes the error. |
This is an error message. |
result |
Boolean | Whether the function succeeded. |
|
1 |