WebsiteBackup

Validate website backup disk quota

Changed on

This function estimates whether a backup of the domain parameter fits in the account's remaining disk quota.

Note:

  • The function compares an estimate of the document root's size against the quota the account has left and returns both figures alongside a single verdict, so a caller can warn before starting a backup that would fail.
  • The estimate is advisory. The WebsiteBackup::create_backup function re-checks the quota itself and refuses if the backup no longer fits.
  • This function is not cheap. It runs du over the whole document root, bounded only by a one-hour timeout. Call it when the backup dialog opens, not on a timer.
  • This function requires the account's backup feature.
get/WebsiteBackup/disk_quota_check

Request

  • Base URL
    https://cpanel-server.tld:2083/execute
  • Auth
    HTTP basic

Query parameters

domainstring required
Example:example.com

The website whose backup size to estimate.

Note: The account must own this domain.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "disk_quota_check",
  "module": "WebsiteBackup",
  "result": {
    "data": {
      "availableBytes": 524288000,
      "estimatedBytes": 104857600,
      "ok": 1
    },
    "status": 1
  }
}

Changes