Toggle CDN

Toggles CDN for a specific site and returns the site.

POST
https://portal.onyx.io/api/v2/sites/{site}/toggle_cdn

If successful, this endpoint will return a 200 OK status.

Arguments

The following arguments are supported for this endpoint.

Name Type Default Value

site Required

Site Lookup None

Potential Errors

The following errors may occur during this request.

Details HTTP status

cdn_not_allowed

Your current plan does not allow CDN usage, upgrade to use CDN functionality.

403 Forbidden

cdn_not_allowed

Error changing CDN state. There's already a task running.

409 Conflict

cdn_over_limit

Unable to enable CDN, bandwidth limit exceeded.

403 Forbidden

site_not_found

No site was found matching any of the criteria provided in the arguments

404 Not Found

Returned Object

When the request is successful, you can expect an object matching the specification below to be returned.

{
    site: Site {
        id: Integer
        name: String
        subdomain: String
        parent_id: Integer?
        created_at: Unix Timestamp
        ssh_enabled: Boolean
        cdn_enabled: Boolean
        cdn_active_domain: String?
        onyx_domain: String
        version: String?
        php_version: SitePHPVersionEnum
        debug_mode: Boolean
        provision_status: SiteProvisioningStatusEnum
    }
}