Child pages
  • Edit CDN Resource
Skip to end of metadata
Go to start of metadata

To edit details of the CDN resource, use the following API call:

PUT /cdn_resources/:id.xml
PUT /cdn_resources/:id.json

XML Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url 'http://onapp.test/cdn_resources/:id.xml' -d '<cdn_resource><edge_group_ids type="array"><edge_group_id type="integer">1</edge_group_id></edge_group_ids><origin></origin><cdn_hostname>az.test.api</cdn_hostname><cdn_ssl_certificate_id>8</cdn_ssl_certificate_id></cdn_resource>'

JSON Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url 'http://onapp.test/cdn_resources/:id.json' -d '{"cdn_resource":{"edge_group_ids":["12"],"origin":"","cdn_hostname":"", "cdn_ssl_certificate_id":"8"}}' 

Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CDN resource with a requested ID, or URL is incorrect.

Where you can edit all strings:

origin* - the path from which the CDN requests the content  (for HTTP Pull СDN resources only). You can specify up to 3 origins.

When you are specifying only one origin, it can be either a CDN hostname or an IP address. In case you are specifying more than one origin, they can only be IP addresses.

To send two or more origins in the API request, use array. For example:

<origins type="array">

cdn_hostname - indicate the hostname which will serve static content

edge_group_ids - indicate the ID(s) of required CDN edge groups

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels