Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

Define Reseller Resource Limits — setresellerlimits

This function allows you to specify the amount of bandwidth and disk space a reseller is able to use.

Calling Functions

Using the XML API

To use the XML API to perform the setresellerlimits function from within your custom script:

  • Append the /xml-api/setresellerlimits function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/setresellerlimits

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the setresellerlimits function from within your custom script:

  • Append the /json-api/setresellerlimits function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/setresellerlimits

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

Input

The setresellerlimits function takes the following variables as input.

The following variable is required:

  • user (string) — The reseller's username.

The following variables are optional:

  • enable_account_limit (boolean) — Enables or disables a limit on the number of accounts to which the reseller has access.
    • 1 — enabled.
    • 0 — disabled.
  • account_limit (integer) — The number of accounts to which the reseller has access.
    • note Note: This argument is only relevant when enable_account_limit is set to 1.
  • enable_resource_limits (boolean) — Enables or disables limits on resources available to the reseller.
    • 1 — enabled.
    • 0 — disabled.
  • bandwidth_limit (integer) — Sets the amount of bandwidth allocated to the reseller.
  • diskspace_limit (integer) — Sets the amount of disk space allocated to the reseller.
  • enable_overselling (boolean) — Allows the reseller to oversell accounts.
    • 1 — enabled.
    • 0 — disabled.
  • enable_overselling_bandwidth (boolean) — Allows a reseller to oversell bandwidth.
    • 1 — enabled.
    • 0 — disabled.
  • enable_overselling_diskspace (boolean) — Allows a reseller to oversell disk space.
    • 1 — enabled.
    • 0 — disabled.
  • enable_package_limits (boolean) — Enables or disables the application of package limits to the reseller.
    • 1 — enabled.
    • 0 — disabled.
  • enable_package_limit_numbers (boolean) — Enables or disables the application of package limit numbers to the reseller.
    • 1 — enabled.
    • 0 — disabled.

Output

Show Hide

  • setresellerlimits — Root-level XML tag for the output of the setresellerlimits function.
    • result — Container for the results of the function.
      • status (boolean) — Status of the request.
        • 1 — success.
        • 0 — failure.
      • statusmsg — Information about the status of the request.

Examples

XML API

Show Hide

Calling https://example.com:2087/xml-api//setresellerlimits?user=user123 &enable_account_limit=1&account_limit=100&enable_resource_limits=1 &bandwidth_limit=100000&diskspace_limit=100000&enable_overselling=0 &enable_package_limits=0&enable_package_limit_number=0 in WebHost Manager will produce output similar to:

<setresellerlimits>
     <result>
            <status>1</status>
            <statusmsg>Successfully set reseller account creation limits.</statusmsg>
      </result>
</setresellerlimits>

note Note: Submit the entire request as a single string. For display purposes, the example above may be wrapped.

JSON API

Show Hide

Calling https://example.com:2087/json-api//setresellerlimits?user=user123 &enable_account_limit=1&account_limit=100&enable_resource_limits=1 &bandwidth_limit=100000&diskspace_limit=100000&enable_overselling=0 &enable_package_limits=0&enable_package_limit_number=0 in WebHost Manager will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Successfully set reseller account creation limits."
      }
   ]
}
note Note: Submit the entire request as a single string. For display purposes, the example above may be wrapped.

Topic revision: r4 - 26 Jul 2010 - 22:17:11 - Main.JustinSchaefer