# Validate website backup disk quota

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.

Endpoint: GET /WebsiteBackup/disk_quota_check
Version: 11.138.0.19
Security: BasicAuth

## Query parameters:

  - `domain` (string, required)
    The website whose backup size to estimate.

Note:
The account must own this domain.
    Example: "example.com"

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "disk_quota_check"

  - `module` (string)
    The name of the module called.
    Example: "WebsiteBackup"

  - `result` (object)

  - `result.data` (object)
    The quota verdict and the two figures it was derived from.

  - `result.data.availableBytes` (integer)
    Bytes of quota the account has left.

Note:
This is 0 when the unlimited return value is
1, which means “not applicable” rather than “no
space”.
    Example: 524288000

  - `result.data.estimatedBytes` (integer)
    Estimated size in bytes of the website files to be
archived.

Note:

* This covers website files only and does not size
  database dumps.
* The value is best-effort. It is 0 when the
  function cannot measure the document root,
  because it is missing, unreadable, or du
  failed, and that also makes the ok return
  value come back 1.
* Treat 0 on a non-empty site as “not measured”,
  not as “nothing to back up”.
    Example: 104857600

  - `result.data.ok` (integer)
    Whether the estimated backup fits.

* 1 - The backup is expected to fit, or the
  account is unlimited.
* 0 - The estimate exceeds the remaining quota.
    Enum: 1, 0

  - `result.data.unlimited` (integer)
    Whether the account is unconstrained by a disk
quota.

* 1 - No quota applies, or quotas are not
  enabled on the server. The availableBytes
  return value is then 0 and the ok return
  value is always 1.
* 0 - A quota applies. See the availableBytes
  return value.
    Enum: 1, 0

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.status` (integer)
    * 1 - Success.
* 0 - Failed. Check the errors field for more
  details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings
describe non-critical failures or other problematic
conditions noted while running an API.


