All categories >>> Overview

Quick Start

Test CDN

As soon as you create your zone under "Referenced" you will get a CNAME from which you will be able to access the cached files from the CDN.

You can test if files are properly served by directing your browser to a file from your origin using your zone's CNAME.

For example: Origin URL: your-origin.com/images/image.jpg CDN URL: 10001 - 1.s.cdn13.com/images.jpg

The above URLs should point to the same content.

NOTE:
You should wait for several minutes after you create the zone, so that the change can propagate and the CDN can start serving your files.

After you can confirm that your files are properly served, you can redirect the resources associated with this origin to the CDN.

Author: UCDN
Last update: 2017-10-13 14:41


Create zone

In order to create the new zone you need to use the next steps:

  • Login to your control panel
  • Click on  from the menu on the right
  • Click on  

For the correct zone configuration, follow the instructions at below:

1. Determine the location of the files - your own server or UCDN storage. For example, file locations on your own server:

By default is selected the option that the files will be transferred via your personal server.

You need to enter  the URL address of your origin (change "http://ucdntest.cf" from the example with your URL) and the port that should be used (The default is 80).  Also you can add  more than one origin using   button. 

2. You can use your own domain name for zone usage by adding additional CNAMEs. CNAME is domain name that will redirect to our UCDN server. You can add multiple sites to point to one zone by adding different CNAMEs. After adding CNAME you have to configure your DNS settings properly.
Example:cdn1.ucdntest.cf or cdn2.yourwebsite.com

Note: SSL is enabled by default when the zone is created. Additionally you can upload certificates for your custom domains or activate letsencrypt as shown here: LetsEncrypt

When you are ready, click on "Add Zone"

Once you added the new zone, a new screen with multiple tabs will be visualized in front of you (By default you will see the "Instructions" tab.)

If you want to make additional changes to your zone settings, you can go to "Main settings" tab where you can set username/password if your origin requires authentication in order the files to be accessed. 

Optionally, you can also define a different host header with which your files will be pulled from the CDN (if the server from where your files will be served is hosting more than one website)

Hit the "Save Changes" button when you are ready."

Author: UCDN
Last update: 2018-10-18 15:28


Control panel

Dashboard

After successfully logging into your UCDN account, you will see the control panel on the left. The first tab is Dashboard and it includes:

  • Day of the week and month - shows the statistic of the calculated parameters (bandwidth, traffic and file hits) for the selected day of the week and month

  • Bandwidth - shows the used bandwidth for certain time 

 

 

  • Traffic - shows the amount of generated traffic 

 

 

  • File Hits - shows the total number of file hits 

 

These graphs will be discussed in detail in the next section Stats 

Author: UCDN
Last update: 2018-01-18 10:24


Support or feedback

You can send a message to the support selecting the Support tab in the left menu:

Then you will see a message box, choose one of the suggested categories that is more suitable for your topic:

If you want to send us feedback, use the above message box or the box with the topic ** Fast Support **:

The details of your account - user name, email address, API key are available in the upper right corner of your account, just select * View Profile *:

Author: UCDN
Last update: 2018-10-17 13:49


Cache management

When you create a new zone, you can to activate the option of caching files in CDN network for a limited time only. To enable this option login to my.ucdn.com. Next click on "My Zones" from the menu on the left side 

Check the box in front of "Cache my files in CDN network for a limited time only" and specify the desired time for caching in fields "Cache expire time".

Also you can reuse the cache from a different zone that has the same files. This means that the files that are already cached on our servers will be used also for the new zone. To enable reusing cache, check the box next to "Reuse cache from one of my other zones".

To save the activated settings using the button "Save Changes". 

Author: UCDN
Last update: 2018-10-17 13:43


Limit access

  • Limit access by referer

To enable access limits based on the referrer, you should first login to my.ucdn.com. Next click on "My Zones" from the menu on the left side.

You will see a list of your configured zones. To edit the advanced settings for a zone, click on the "cogwheel"  icon, on the right. After opening the zone settings, select the second tab - Limit access. Тick the box in front of "Limit access by referrer":

The field uses Perl-compatible regular expressions (PCRE) syntax

Below are some basic examples for setting the referer limit:

  • my-domain.net - will match anything that contains my-domain.net in the referer header
  • .my-domain.net - will match .my-domain.net - www.my-domain.netsubdomain.my-domain.netsub.domain.my-domain.net, will NOT match my-domain.net
  • ^(https?:\/\/)?my-domain.net - will match http://my-domain.net and https://my-domain.net, will NOT match http://www.my-domain.net
  • ^(https?:\/\/)?www.my-domain.net - will match http://www.my-domain.nethttps://www.my-domain.netwww.my-domain.net

For most setups you'll need two values:

  • ^(https?:\/\/)?my-domain.net and ^(https?:\/\/)?www.my-domain.net. This will make your files work if they were refered to from http://my-domain.net https://my-domain.net http://www.my-domain.net https://www.my-domain.net
  • You should always use a backslash (\) to escape the special characters like . /

Enter the domain which is allowed to refer to your files in the field "My files are allowed from" and click "Add" to add the domain. If you have more than one domain, you can add multiple domain names. When you are ready, click the button "Save changes" on the bottom of the page.

  • Limit access by country

The second option of the limit is "Limit access by country". To enable access limits based on the country, click on the Limit access tab and check the box next to "Limit access by country": 

Choose if you want to allow or deny access from the drop-down list. Enter the country which should be allowed/denied to access your files and click "Add" to add to the list. You can add multiple country names.

When you are ready, click the button "Save changes" on the bottom of the page.

  • Limit access by secret key

To enable limit access by secret key, click on the Limit access tab and tick the box in front of "Limit access by using a secret key": 

 Choose the desired hash algorithm, the key you will be using, and the time each key will be valid.

When you are ready, click the button "Save changes" on the bottom of the page.

Then you should generate md5 hash for the URLs you want to protect using for example PHP script. The hash should be created the following way:

request.uri+key

for example:

/example/image.jpgVerySecureKey

where,

  • /example/image.jpg - request URI
  • VerySecureKey - the key configured at your control panel

After that you can access the URL using the URL:

http://yourdomain.com/example/image.jpg?cdn_hash=generated_hash

In addition you can generate hash with the following options:

  • cdn_creation_time – when the hash was generated (unix timestamp)
  • cdn_ttl – the time for which the hash should be valid
  • cdn_net – IP from which the access will be allowed
  • cdn_bw – limit rate of the downloading speed
  • cdn_bw_fs - set the amount of data which should be served on full speed(support k,m and g for KB,MB and GB respectively)
  • cdn_cv_CUSTOM - this is custom parameter which can be configured based on your needs.(You should replace CUSTOM with any name)

With the above values, the hash that will need to be generated is:

request.uri+key+cdn_creation_time+cdn_ttl+cdn_net+cdn_bw+cdn_bw_fs+cdn_cv_CUSTOM

for example:

/example/image.jpgVerySecureKeytimestamp600192.168.0.1101024010mCUSTOM_PARAMETER

where

  • /example/image.jpg – request.uri
  • VerySecureKey – your secret key
  • timestamp – creation time for the hash, you can use time() for php or website http://www.epochconverter.com/
  • 600 – time to live for generated hash
  • 192.168.0.1 – the IP from which the URL can be accessed
  • 10240 – bytes per second limit rate
  • 10m - megabytes served at max speed
  • CUSTOM_PARAMETER - the value for the custom parameter

The full URL of the request will be:

http://yourdomain.com/example/image.jpg?cdn_hash=generated_hash&cdn_creation_time=timestamp&cdn_ttl=600&cdn_net=192.168.0.1&cdn_bw=10240&cdn_bw_fs=10m&cdn_cv_CUSTOM=CUSTOM_PARAMETER

You can use the following website to generate md5 hash for testing purposes:

Below you can find sample php code, for generating the required hash:

<?php

$secret_key = 'password';
$request_uri = '/path/to/video/videoname.mp4';

// Unix timestamp
$cdn_creation_time = time();

// how long the generated url will be active
$cdn_ttl = 600;

// limit access only to specified ip address or network
$cdn_net = "192.168.1.20";

// or limit access only to specified /24 network
$cdn_net = "192.168.2.0.24";

//limit download speed to
$cdn_bw = "10240" // bytes per second (10KB)

//the amount of served at maximum speed
$cdn_bw_fs = "10m" // 10 MB

//your custom parameter
$cdn_cv_CUSTOM = "CUSTOM_PARAMETER"


$hash = md5($request_uri.$secret_key.$cdn_creation_time.$cdn_ttl.$cdn_net.$cdn_bw.$cdn_bw_fs.$cdn_cv_CUSTOM);

$access_url  = 'http://cname.clientdomain.com/'.$request_uri;
$access_url .= '?cdn_hash='.$hash.'&cdn_creation_time='.$cdn_creation_time;
$access_url .= '&cdn_ttl='.$cdn_ttl.'&cdn_net='.$cdn_net.'&cdn_bw='.$cdn_bw.'&cdn_bw_fs'.$cdn_bw_fs.'&cdn_cv_CUSTOM'.$cdn_cv_CUSTOM;

?>
  • Limit access by IP

The last option is that you can limit access to your resources served through Universal CDN zone via IP.

This feature allows you enter a list of IPs , for example 192.168.0.88 or entire subnets, for example 192.168.1.0/24 and to either Allow your resources to be available for only these IPs or to Block the access for these IPs.

Currently there is a limitation on the maximum records you can have for either Allow or Blocked IPs - it is 64.

Author: UCDN
Last update: 2019-07-05 09:38


Available parameters which you can use with security token

If you have enabled protection using security token, you can define additional parameters to secure your content. The hash could be generated with the following options:

  • cdn_creation_time – when the hash was generated (unix timestamp)
  • cdn_ttl – the time for which the hash should be valid
  • cdn_net – IP from which the access will be allowed
  • cdn_bw – limit rate of the downloading speed
  • cdn_bw_fs - set the amount of data which should be served on full speed(support k,m and g for KB,MB and GB respectively)
  • cdn_cv_CUSTOM - this is custom parameter which can be configured based on your needs.(You should replace CUSTOM with any name)

With the above values, the hash that will need to be generated is:

request.uri+key+cdn_creation_time+cdn_ttl+cdn_net+cdn_bw+cdn_bw_fs+cdn_cv_CUSTOM

for example:

/example/image.jpgVerySecureKeytimestamp600192.168.0.1101024010mCUSTOM_PARAMETER

where

  • /example/image.jpg – request.uri
  • VerySecureKey – your secret key
  • timestamp – creation time for the hash, you can use time() for php or website\ http://www.epochconverter.com/
  • 600 – time to live for generated hash
  • 192.168.0.1 – the IP from which the URL can be accessed
  • 10240 – bytes per second limit rate
  • 10m - megabytes served at max speed
  • CUSTOM_PARAMETER - the value for the custom parameter

The full URL of the request will be:

http://yourdomain.com/example/image.jpg?cdn_hash=generated_hash&cdn_creation_time=timestamp&cdn_ttl=600&cdn_net=192.168.0.1&cdn_bw=10240&cdn_bw_fs=10m&cdn_cv_CUSTOM=CUSTOM_PARAMETER

You can use the following website to generate md5 hash for testing purposes:

Below you can find sample php code, for generating the required hash:

<?php

$secret_key = 'password';
$request_uri = '/path/to/video/videoname.mp4';

// Unix timestamp
$cdn_creation_time = time();

// how long the generated url will be active
$cdn_ttl = 600;

// limit access only to specified ip address or network
$cdn_net = "192.168.1.20";

// or limit access only to specified /24 network
$cdn_net = "192.168.2.0.24";

//limit download speed to
$cdn_bw = "10240" // bytes per second (10KB)

//the amount of served at maximum speed
$cdn_bw_fs = "10m" // 10 MB

//your custom parameter
$cdn_cv_CUSTOM = "CUSTOM_PARAMETER"


$hash = md5($request_uri.$secret_key.$cdn_creation_time.$cdn_ttl.$cdn_net.$cdn_bw.$cdn_bw_fs.$cdn_cv_CUSTOM);

$access_url  = 'http://cname.clientdomain.com/'.$request_uri;
$access_url .= '?cdn_hash='.$hash.'&cdn_creation_time='.$cdn_creation_time;
$access_url .= '&cdn_ttl='.$cdn_ttl.'&cdn_net='.$cdn_net.'&cdn_bw='.$cdn_bw.'&cdn_bw_fs'.$cdn_bw_fs.'&cdn_cv_CUSTOM'.$cdn_cv_CUSTOM;

?>

Author: UCDN
Last update: 2017-11-28 16:34


Download speed

To enable limiting the bandwidth for serving your files, use the tab "Download Speed":

To enable the option, tick the box in front of "Limit files download speed"

 

Then enter the maximum speed in the field "limit with constant rate:" and choose between Kb/s (kilobits per second) and Mb/s (megabits per second). You can also choose to use security token with parameter "cdn_bw".

When you are ready, click "Save Changes". 

Author: UCDN
Last update: 2018-10-17 11:48


Error pages

To set custom error pages for different http error codes, you need first login to my.ucdn.com. Next click on "My zones" from the menu on the left side.

You will see a list of your configured zones. To edit the advanced settings for a zone, click on the "gear"  on the right.

To customize the error page, click "Error pages handling":

To enable a custom page for specific error code, tick the box in front of the HTTP code and enter the full url in the text field below. 

When you are ready, click "Save Changes"

You can find more information on the error codes, and their meaning on http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Author: UCDN
Last update: 2018-10-17 11:37


Purge

Purge

Purging a file is required when you have changed (or deleted) a file on your origin, but it is still cached and served from our servers.

To purge files from our cache servers, you need first login to my.ucdn.com. Next click on "Purge files" from the menu on the left side.

You can select specific zone from the drop-down menu or leave the default value "guess from hostnames".

If you have not chosen a zone, you should enter the full URL to the file:

http://subdomain.domain.com/path/to/filename.ext

If you have already specified a zone from the list, you should omit the domain name:

/path/to/filename.ext

You can also import a text file, with a list of the files that should be purged, which can be uploaded from the button "Choose file" When you are ready, click "Purge Files". You will now see the status of the purge job, and review the history of the purge jobs you have created. 

You can also purge your files using our API.

You can find your API key in your profile page.  

Author: UCDN
Last update: 2018-10-17 13:56


Storage

Create storage

UCDN allows clients to upload their files to the UCDN cloud instead of their own storage.

By default this option is disabled because it is paid, but you can turn it on by contacting our support.

Once it is enabled, you can create new storage container by:

  • Login to your control panel
  • Click on  button from the left side menu, after that you need to select button  from the right 

From there you should enter the desired name of your container and choose a region. Currently, we offer automated storage creation in Europe and North America.

If you are interested in storage from a different part of the world, please contact support.

Author: UCDN
Last update: 2018-10-19 10:47


FTP Upload

Author: UCDN
Last update: 2017-10-20 10:44


Rclone

In order to upload/sync large amount of files(maximum filesize of a singe file can be up to 5GB) to your Swift storage, you can also use third-party tool called "rclone".

You can download the tool from this page: http://rclone.org/downloads/

You can generate your own config file using the following command: rclone config

Here is an example of config file:

[swift] - remote name, must contain only letters and numbers
user = first part of FTP username(for example, 100001)
key = FTP_password
auth = https://auth.files.nl01.cloud.servers.com:5000/v2.0/ (if your storage is in EU) and https://auth.files.us01.cloud.servers.com:5000/v2.0/(if your storage is in North America)
tenant = same as user
region = leave it blank

In order to sync folder to your new storage, you can use the following command:
rclone sync foldertobesynced remotename:storage_name/path

For example:
rclone sync /home/example/videos swift: 10001 - 1.b.cdn13.com/videos

where,
/home/example/videos - the folder on the origin you want to be synced
swift - remote name configured in your rclone config file
10001-1.b.cdn13.com - the name of your storage(container)

Please find more information how you can use rclone here:
http://rclone.org/swift/
http://rclone.org/docs/

Author: UCDN
Last update: 2018-06-27 15:41


Swiftclient

Another method for managing your UCDN storage is by using a command-line tool called "swiftclient" based on python. You can download it from here: https://github.com/openstack/python-swiftclient

After you configure it on your server or local computer, you can start using it with the following details:

  • username - first part of your username associated with the container at your control panel. If your username is 100001.100001 , then username will be 100001
  • tenant - the same as username, e.g. 100001
  • password - the password, which you can check from your control panel
  • url - here you should use Swift authorization URL: https://auth.files.nl01.cloud.servers.com:5000/v2.0/ - if you want to connect to your Europe container https://auth.files.us01.cloud.servers.com:5000/v2.0/ - if you want to connecto to your North America container

In order to list files for your container you can use the following command:

swift --os-username YOUR_USERNAME --os-tenant-name YOUR_TENANT --os-password YOUR_PASSWORD --os-auth-url https://auth.files.nl01.cloud.servers.com:5000/v2.0/ list YOUR_CONTAINER

In order to upload files to your container you can use the following command:

swift --os-username YOUR_USERNAME --os-tenant-name YOUR_TENANT --os-password YOUR_PASSWORD --os-auth-url https://auth.files.nl01.cloud.servers.com:5000/v2.0/ upload YOUR_CONTAINER PATH_TO_YOUR_FILE

In order to delete files to your container you can use the following command:

swift --os-username YOUR_USERNAME --os-tenant-name YOUR_TENANT --os-password YOUR_PASSWORD --os-auth-url https://auth.files.nl01.cloud.servers.com:5000/v2.0/ delete YOUR_CONTAINER PATH_TO_YOUR_FILE

You can check all available commands using: swift -h or swift --help

Author: UCDN
Last update: 2019-09-18 13:41


Storage Synchronization

UCDN allows storages to be synchronized between two locations. This means that anything you upload/delete on one of the locations will be replicated to the other. We currently offer synchronization of two regions as a free feature:

  • Europe
  • North America

Please be advised that if you decide to use the feature and synchronize the content, you will be charged for the entire amount of storage you use (including the duplicated content)

If you enable synchronization, you will be able to upload the files to the location which is more close to your network and thus increase the speed. In addition if you use the storage as origin for your CDN zone then we will fetch the files to the location which is faster.

In order to enable synchronization you should:

  • Go to the  page in your control panel
  • Click on the icon   opposite of storage name for which you want to enable synchronization.
  • Check the box beside location "North America" or "Europe", depending on where you created the container initially and then select Apply.

Author: UCDN
Last update: 2018-10-18 15:29


Storage Upload

UCDN uses OpenStack Swift technology for storage purposes. You can check for more information here: Openstack's Swift

You can acquire your login details for the specific container by:

  • Go to the  page in your control panel
  • By clicking on the button  that is located in front of the storage you need
  • There you can check your FTP details. 

 

When selecting a button, you can check the storage synchronization between two regions - Europe and North America. If is synchronization enabled, you will see a checkmark in front of two or one region, as shown below: 

There are several ways which can be used as upload methods:

Author: UCDN
Last update: 2018-10-17 14:47


Remove Storage

In order to delete storage from your account, two prerequisites should be met:

  • The storage should be completely empty, which means that you should delete all files and folders.
  • This storage should be not be configured as origin for given zone.

After these requirements are completed, you can delete the storage by:

  • Go to the  page in your control panel
  • Click on  button, opposite the storage name, which you want to remove.
  • The second option of removal - click on the storage, which you want to delete, after that click on the button 
  • Confirm the removal:

Author: UCDN
Last update: 2018-10-17 14:58


How to use UCDN storage with WordPress

Wordpress plugin 'W3 Total Cache' allows to use UCDN Storage to host your wordpress data either as a backup or to serve your files from there. This will significantly improve the speed of serving your content since our storage service is located in the same DCs as our CDN nodes.

If you want to use only our CDN service, please check this tutorial:  How to integrate UCDN with Wordpress using W3 Total Cache?

 1. First you need to install W3 Total Cache. You can download it and install it using the following URL:
https://wordpress.org/plugins/w3-total-cache/

2. Once your plugin is activated, you will get new link in your WordPress menu 'Performance'

'

 3. You need to go to plugin's General Settings and CDN section

4. You need to enable it CDN feature and choose 'Self-hosted/ File Transfer Protocol Upload'. Save All Settings

5. Go to CDN from the plugin's configuration.

6. You will see a dialog where you will need to fill your FTP details for created storage at UCDN panel.
Check this tutorial how to create a storage: Create storage .
You can find your FTP details here Storage upload.

It is important to note, that for "FTP Path" you need to enter the name of your container, since the FTP account is common for all containers under your UCDN account

7. After that you need to set the hostname from which your content will be served from Universal CDN. You need to enter either our default  CNAME or your custom alias which you have configured. You can also choose whether the content should be loaded using HTTPS

If you want to use the storage as backup only, you can skip this step.

8. Now you need to sync your data to the cloud. You can do that using the following options:

You only need to migrate Attachments, wp-includes/files and theme files. In order to upload CSS and JS, you need to enable minify.

For more information how to use the plugin and all its options, please refer to its FAQ section.

Author: UCDN
Last update: 2018-06-25 09:25


Large files and resumable upload

Our storage service is based on OpenStack Swift and there is a limitation on the size of a singe file, which can be uploaded.  By default it is 5GB. This, however, does NOT limit the size of the file which can be downloaded.

In other words, in order to upload files larger than 5GB, you can use the so-called "segmentation". It will allow you to split the larger file in smaller chunks, for example to 1GB, and in this way you can upload file which is larger than the limitation.

What storage backend is doing afterwards, is to:

  • split the file in the designated segment size
  • upload all segments in parallel
  • create manifest file which allows the file to be downloaded/accessed as one, without the client noticing it is segmented

The quickest way to try out this feature is to use the swift tool(for more information on the parameters, please check Swiftclient):

swift --os-username YOUR_USERNAME --os-tenant-name YOUR_TENANT --os-password YOUR_PASSWORD --os-auth-url https://auth.files.nl01.cloud.servers.com:5000/v2.0/ upload YOUR_CONTAINER -S 1073741824 --segment-container YOUR_CONTAINER large_file

The above command will upload the "large_file" in segments of 1GB. Of course, you can specify any size of the segments(not bigger than 5GB)

Our FTP/SFTP service automatically performs segmentation for larger files.

Resumable upload

Unfortunately OpenStack's Swift does not support resumable upload at the moment.

If you are experiencing upload problems due to poor network connectivity or any other issues you can use the segmenation mentioned above to split your files in smaller chunks which will be uploaded in parallel and should significantly improve the process.

For more information on the middleware and different methods how you can use it, please check the following article:
https://docs.openstack.org/swift/latest/overview_large_objects.html

Author: Support
Last update: 2019-08-27 10:47


SSL

How to install SSL certificate?

In order to install your SSL, you should login to my.ucdn.com click "SSL" 

Next select the tab "Add SSL Certificate" 

First you need to enter the hostname, that will use the certificate. This is the CNAME that you have created in your domain, and using to access the CDN.

 

 

Note that the certificate must be valid for the hostname you access, or your browser will issue a "Certificate Mismatch" warning.

For example, if your SSL is valid for "www.yourdomain.net", but you set it for "cdn.yourdomain.net" the certificate will not be valid. You should obtain a 'wildcard' certificate if you want to use single certificate for multiple hosts.

You have 3 options for uploading your certificate to our servers:

1.As ZIP file 2.As seperate files 3.As plain text

Your ZIP file should contain a certificate (*.crt), a private key (*.key) and optionally a CA bundle certifiacate (*_bundle.crt) file.

Choosing the second option, will provide you with an option to upload 3 seperate files:

  • Certificate - The SSL certificate. It normally has the file extension *.crt
  • Key - The private key for the certificate. It normally has the file extension *.key
  • CA Bundle - (optional) This is a bundle of certificates, provided by your SSL issuer. Normally it will be called something like *_bundle.crt

The third option lets you copy and paste the contents of your key and certificates in the text areas.

After you have provided the files, click "Add SSL certificate" on the bottom of the page.

 

Author: UCDN
Last update: 2018-10-17 15:19


LetsEncrypt

Universal CDN supports automatic installation of LetsEncrypt certificates for all custom aliases added for given zone. In order to install and enable them you need to navigate to your UCDN control panel and go to the list of your zones. For the zone for which you want to enable LetsEncrypt there should be added at least one custom CNAME and it should point to our default zone address. After that you need to click on button  on the right side.

The process of installation and activation may take up to 1-2 minutes and the zone will be marked with

If you add new CNAME to a zone which has LetsEncrypt enabled, certificate will be automatically installed for the new alias.

All LetsEncrypt certificates are automatically renewed and no further actions are required from your side.

The installed certificates are also visible through the SSL section of the control panel

At the moment, if you want to remove or disable LetsEncrypt certificate, please contact us at support@ucdn.com.

Author: UCDN
Last update: 2018-06-25 10:56


Stats

Analytics

To view statistics for a given zone, you need first log in to my.ucdn.com. Then click on "Stats" from the menu on the left.

You will see a page containing various graphics for a certain zone, you can choose from the menu on the right. Next to the zone, you can select the interval for which we want to check the statistics:

These are graphs that provide different information:

  • SSl traffic - shows used SSL traffic for a certain time

  • SSL hits - shows the total number of SSL hits

  • HTTP2 traffic - shows used HTTP2 traffic

  • HTTP2 hits - shows the total number of HTTP2 hits

  • Bandwidth - shows the used bandwidth at a specific time

  • Traffic - shows the amount of generated traffic

  • File Hits - shows the total number of file hits

  • Countries - amount of hits and percentage based on the users' country

  • Status Codes - amount and percentage of different HTTP status codes

  • Storage (only if using UCDN storage) -  shows the amount of occupied space on our storage servers

Author: UCDN
Last update: 2019-01-31 11:16


VOD

HLS

INTRODUCTION

The usage of VOD service is available for CDN zones for big objects.

In order to use HLS you need to create a zone for big objects and generate m3u8 link for the mp4 file to be played. This is done by prefixing '/hls' to the path and appending /index.m3u8 at the end. Please note that you need to only upload your full mp4 files and segmentation is done by the CDN. 

Example:

mp4_file: /video/012345.mp4
m3u8_path: /hls/video/012345.mp4/index.m3u8

The returned m3u8 file will have the corresponding segments for the mp4 file. The default values for  first segment and the other segmens are 5 seconds and 10 seconds respectively.

You can change them by using parameters bsd (first few segments) and sd(other segments) in the URL.

Example:

mp4_file: /video/012345.mp4
m3u8_path: /hls/bsd/10000-10000-15000/sd/20000/video/012345.mp4/index.m3u8

In the provided example we set the initial segment to be 10 seconds, the second again 10 seconds, the third is 15 seconds  and the rest to be 20 seconds. Please note that the values should be in milliseconds.

 Another important thing to notice is that the segment are with relative paths as per the specification: 
https://tools.ietf.org/html/draft-pantos-http-live-streaming-17.

Which means that the absolute path for segment 'seg-5-v1-a1.ts' is /hls/video/012345.mp4/seg-5-v1-a1.ts, not /seg-5-v1-a1.ts.

URLSET

Additionally there is functionality to build a playlist from multiple files. This can be used when for a given video source there are multiple resolutions, and we would like the user to be able to change between them without changing the page.

For the example let's say that we have the previous file /video/012345.mp4 in 3 resolutions 240p, 360p and 480p and we have named them /012345_240p.mp4 , /012345_360p.mp4 and /012345_480p.mp4 accordingly.

If we request: 
/hls/video/012345_,24,36,48,0p.mp4/urlset/master.m3u8,
where you can see that the common parts are "012345_" and "0p.mp4" and we divide by commas the three different bitrates - 24,36,48

we will get a playlist which looks like:

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=368981,RESOLUTION=426x240,FRAME-RATE=24.000,CODECS="avc1.4d4015,mp4a.40.2"
/hls/012345_240p.mp4/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=460061,RESOLUTION=640x360,FRAME-RATE=24.000,CODECS="avc1.4d401e,mp4a.40.2"
/hls/012345_360p.mp4/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=789049,RESOLUTION=854x480,FRAME-RATE=24.000,CODECS="avc1.4d401e,mp4a.40.2"
/hls/012345_480p.mp4/index.m3u8

This is the master playlist which has a playlist for each of the files provided with additional info for the streams in each of the playlist.

It's important  that the end is master.m3u8 not index.m3u8 as with playlist for only one file.

It should be also noted that the playlist inside the master playlist, have the same url as the one that can be used for the individual urls. 

VTT Subtitles

UCDN supports multi-language subtitles in VTT format for HLS streaming. In order to demonstrate the feature we will use the same example /video/012345.mp4. In addition we will assume that the subtitles are in the same folder /video or in subfolder /video/subs/.

Example:

/hls/video/,lang/eng/012345_eng.vtt,lang/ger/012345_ger.vtt,012345.mp4,/urlset/master.m3u8
/hls/video/,subs/lang/eng/012345_eng.vtt,subs/lang/ger/012345_ger.vtt,012345.mp4,/urlset/master.m3u8

There should be noted several things for the above request path:

  • we use urlset and master.m3u8 to load the subtitles in the playlist, not standard playlist index.m3u8
  • we specify the common path first, which in the example is /video
  • required part for the URL is lang/ISO 639-2  which is three-letter country code. You can find all codes on this page:
    https://www.loc.gov/standards/iso639-2/php/code_list.php
  • if the subtitles are in subfolder, the folder should be before the require part.
  • all commas are intentional

SECURITY TOKEN

Our HLS functionallity supports the use of security token in order to block any hotlinking attemps. You can check for more information here:
https://help.ucdn.com/content/44/9/en/limit-access.html#token

Combining all features in order to generate security token you should include the following part:

/video/bsd/10000-10000-15000/sd/20000/,lang/eng/012345_eng.vtt,lang/ger/012345_ger.vtt,012345_,24,36,48,0p.mp4,

Note that the prefix /hls and suffixes urlset/master.m3u8 and /index.m3u8 are excluded

All the segments have security tokens attached to them when returned inside the m3u8 file. So there is no need to recalculate it for each of them before requesting them. 

Because the security token is the same one (including all parameters) for the m3u8 file it's important to note that for longer videos it's possible that the security token can expire before a request for the given segment is made.

Author: UCDN
Last update: 2018-03-02 17:34


MPEG/DASH

INTRODUCTION

The usage of VOD service is available for CDN zones for big objects.

In order to use MPEG/DASH you need to create a zone for big objects and generate mpd link for the mp4 file to be played. This is done by prefixing '/dash' to the path and appending /manifest.mpd at the end. Please note that you need to only upload your full mp4 files and segmentation is done by the CDN. 

Example:

mp4_file: /video/012345.mp4
manifest_path: /dash/video/012345.mp4/manifest.mpd

The returned manifest uses SegmentTemplate elements from the mpeg-dash specification. The mpd manifest list gives a template and how many fragments there are and the player can combine this info to build the absolute url for a given fragment. This makes the mpd significantly shorter for long videos.

You can change them by using parameters bsd (first segment) and sd(other segments) in the URL.

Example:

mp4_file: /video/012345.mp4
manifest_path: /dash/bsd/10000-10000-15000/sd/20000/video/012345.mp4/manifest.mpd

In the provided example we set the initial segment to be 10 seconds, the second again 10 seconds, the third is 15 seconds  and the rest to be 20 seconds. Please note that the values should be in milliseconds.

URLSET

Additionally there is functionality to build a manifest  from multiple files. This can be used when for a given video source there are multiple resolutions, and we would like the user to be able to change between them without changing the page.

For the example let's say that we have the previous file /video/012345.mp4 in 3 resolutions 240p, 360p and 480p and we have named them /012345_240p.mp4 , /012345_360p.mp4 and /012345_480p.mp4 accordingly.

The request will look like: 
/dash/video/012345_,24,36,48,0p.mp4/urlset/manifest.mpd
where you can see that the common parts are "012345_" and "0p.mp4" and we divide by commas the three different bitrates - 24,36,48

This will return a manifest once again using SegmentedTemplates, with all video streams from all the files present with additional info for the bitrates and codecs.

SECURITY TOKEN

Our MPEG/DASH functionallity supports the use of security token in order to block any hotlinking attemps. You can check for more information here:
https://help.ucdn.com/content/44/9/en/limit-access.html#token

Combining all features in order to generate security token you should include the following part:

/video/bsd/10000-10000-15000/sd/20000/012345_,24,36,48,0p.mp4

Note that the prefix /dash and suffixes urlset/manifest.mpd and /manifest.mpd are excluded

The fragment urls in the mpd are relative to the mpd url and also have the security token attached to them. 

There is no need to recalculate it for each of them before requesting them.

Because the security token is the same one (including all parameters) for the mpd file it's important to note that for longer videos it's possible that the security token can expire before a request for the given segment is made.

Author: UCDN
Last update: 2018-03-02 17:35


Billing

How to check your billing details?

In order to check your billing information you need to do the following:

  • Login to your control panel
  • Click on  from the left side menu

There you can check generated traffic for your account and used storage(if any) based on region and divided by month.

Author: UCDN
Last update: 2018-01-18 13:38


Troubleshooting

cURL

curl is powerful command-line tool which can be used to test download speed, check headers, connection and everything else related to http operations.

You can use it to verify your headers or test the download speed.

With the following command you can get only the response headers and thus verifying if everything is configured properly:
curl -I ucdn.com

You can check download speed with the command below:
curl -o /dev/null ucdn.com

For more details check:
curl -h or curl --help
http://curl.haxx.se/docs/manual.html

Author: UCDN
Last update: 2017-10-13 16:38


wget

wget is a tool which we can use to download files or check the HTTP headers.

With the following command we can check the average speed with which we download a file:
wget -O /dev/null ucdn.com

With the following command we can check the request/response headers of file without downloading it:
wget --server-response --spider ucdn.com

Author: UCDN
Last update: 2017-10-13 16:39


Traceroute

traceroute is a tool which is useful to recognize network problems and determine if there is any latency. It can be used to determine whether the problem with the connection is due to the final destination or somewhere along the line.

The example below shows traceroute to ucdn.com.

traceroute ucdn.com

traceroute to ucdn.com (78.140.166.8), 30 hops max, 60 byte packets
1  204.155.144.161 (204.155.144.161)  5.154 ms  0.164 ms  4.953 ms
2  204.26.60.108 (204.26.60.108)  0.472 ms  5.118 ms  5.175 ms
3  xe-0-3-1.r1.ny.iptransit.com (204.26.60.69)  47.169 ms xe-1-1-0.r1.ny.iptransit.com (204.26.60.61)  43.176 ms  43.308 ms
4  xe-0-3-0.r2.ams.tc2.nl.iptransit.com (199.59.206.137)  115.391 ms  115.449 ms xe-0-2-3.r2.ams.tc2.nl.iptransit.com (199.59.206.177)  119.586 ms
5  ae5.10.j-evo-d4.wz.iptransit.com (199.59.206.154)  124.039 ms  119.649 ms  118.246 ms
6  ucdn.com (78.140.166.8)  128.443 ms  126.796 ms  121.464 ms

You can check for more information here: How-To Geek|How to Use Traceroute to Identify Network Problems

Author: UCDN
Last update: 2017-10-16 08:30


Browsers' Tools

Author: UCDN
Last update: 2018-01-18 15:14


Troubleshooting with Swiftclient

Swiftclient can be used to debug your swift's objects and to determine whether there are any issues with them. You can check this page how to download swiftclient and basic usage:
Swiftclient

Check your container stats

swift --os-username YOUR_USERNAME --os-tenant-name YOUR_TENANT --os-password YOUR_PASSWORD --os-auth-url https://auth.files.nl01.cloud.servers.com:5000/v2.0/ stat YOUR_CONTAINER

Account:
Container: test2
Objects: 0
Bytes: 0
Read ACL: .r:*,.rlistings               
Write ACL:
Sync To:
Sync Key:
Accept-Ranges: bytes
X-Timestamp: 1436262476.77998
Content-Type: text/plain; charset=utf-8

With this command you can check your container objects' number and size, ACL, synchronization URL etc.

Check your object's headers

swift --os-username YOUR_USERNAME --os-tenant-name YOUR_TENANT --os-password YOUR_PASSWORD --os-auth-url https://auth.files.nl01.cloud.servers.com:5000/v2.0/ stat YOUR_CONTAINER FILE

Account:
Container:
Object: test.mp4
Content Type: video/mp4
Content Length: 32037854
Last Modified:
ETag:
Meta Mtime: 1434002653
Accept-Ranges: bytes
X-Timestamp: 1436194451.06674

Here you can check object's content type headers which is important for streaming videos, length, last modified etc

Author: UCDN
Last update: 2018-06-27 15:07


DNS propagation and how to reduce its time?

When you update the nameservers for a domain, it may take up to 24-72 hours for the change to take effect. This period is called DNS propagation. In other words, it is a period of time ISP (Internet service provider) nodes across the world take to update their caches with the new DNS information of your domain. 
Due to DNS caches of different levels, after the nameservers change, some of your visitors might still be directed to your old server for some time, whereas others can see the website from the new server shortly after the change. 

Why DNS propagation can take up to 72 hours?

Let’s imagine - you change the nameserver for your domain hosted in a country that is different from the one in which you live . When you open your domain in a web browser, your request is not going to the hosting server directly, it has to pass through several ISP nodes first. So your computer starts by checking local DNS cache, then the request is sent to your local living country ISP. Each of the ISP nodes checks its own cache to see if it contains the DNS information of the domain. If it is not there, it looks it up and saves it in order to speed up the loading next time and to reduce the traffic. 

Basic methods for the reducing time of DNS propagation.

There are three basic methods that will allow you to pass the DNS propagation. If you have not changed the nameservers and do not wish them to propagate for so long, there is a way to reduce the propagation time. You need to do two simple things: 

1. Point your domain to the destination IP address by means of A record on the side of the current DNS provider, setting the minimal TTL ('Time to live' – propagation time) for this record, for instance, to 300 seconds (5 minutes).

2. Once A record has been updated, wait up to 30 minutes and change the nameservers for your domain. 

As a result, your domain will be resolved to your previous host from the places where the propagation has not been completed yet and to a new one – from the places where it has already passed. In such a way, you may avoid a downtime as both hosts will show you the same result – your new website. 

If you have already changed the nameservers, Google public DNS tools may help you to see your website online. Here are the steps to be followed: 

1. Set Google Public DNS servers.
2. Once done, clear your browser's cache and flush your local DNS cache.
3. In addition, you can use Google Flush Cache tool and flush NS and A record for your domain name.

Author: UCDN
Last update: 2017-10-16 09:10


Integration

How to integrate UCDN with KVS?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

www.kernel-video-sharing.com

Here are the steps needed to setup your KVS:

       1. Backup your current KVS setup (in case something goes wrong)

       2. Edit the contents of ucdn.php and set the included constants (api key, username, etc)

       3. Put the attached file (ucdn.php) in your /kvs_install_dir/admin/cdn/

       4. In KVS control panel section covering multi servers, setup the server (you'd need to enter the API there too)

Author: UCDN
Last update: 2019-07-05 09:00


How to integrate UCDN with AVS?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

www.adultvideoscript.com

Description of the integration of UCDN with the version of AVS 4.0.

In order to use AdultVideoScript with CDN, you need to install the plugin Multi-Server System

After you have installed the plugin, you need to log in to AVS admin, select Servers  → Add Server and add storage server(s):

  • URL is the CNAME you have entered in the zone's settings, or the zone name itself http://cdn.your-domain.net/ or http:/10001-1.b.cdn13.com/
  • Video URL is the path to your video content. Default directory should be /media/videos: http://cdn.your-domain.net/media/videos/ or http://10001-1.b.cdn13.com/media/videos/
  • FTP IP / hostname the address of the FTP server
  • FTP Username the username used to login (can be viewed from my.ucdn.com → Storage→ Storage Name)
  • FTP Password the FTP password used to login (can be viewed from my.ucdn.com → Storage→Storage Name)
  • FTP path to videos the directory where videos should be uploaded

 Please note that FTP IP / hostname and another data will be different from the above in the screenshot, so check your UCDN control panel.

Author: UCDN
Last update: 2018-12-04 17:11


How to integrate UCDN with B2Evolution?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

b2evolution.net

You only need to edit a single file in order to set the path variables to point to the CDN location:

Open blogs/conf/_advanced.php Add the following code on top of the page:

$cdnurl = ‘http://ucdn.your-domain.net/’;

So that first line of code looks like this:

<?php  $cdnurl = ‘http://ucdn.your-domain.net/’;

Find the following line:

$rsc_url = $baseurl.$rsc_subdir;

Replace it with:

$rsc_url = $cdnurl.$rsc_subdir;

Find the following line:

$skins_url = $baseurl.$skins_subdir;

Replace it with:

$skins_url = $cdnurl.$skins_subdir;

Find the following line:

$media_url = $baseurl.$media_subdir;

Replace it with:

$media_url = $cdnurl.$media_subdir;

Note:
"ucdn.your-domain.net" needs to be replaced with the proper CDN temp URL or, if you have a custom URL, the proper custom URL. You can check if your application is using the CDN by reloading it in your browser and viewing the source code of the page.

Author: UCDN
Last update: 2018-10-18 15:54


How to integrate UCDN with Drupal?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

www.drupal.org

The CDN module add-on for Drupal will alter URLs, so your static
content will load from the CDN servers, as opposed to your origin
server. The module provide only "Origin Pull", which is basically used as a domain name rewriting mode.

  • Login to your Drupal admin panel, click Manage ⇨ Extend ⇨ Install New Module".
  • In the "Install from a URL" box, enter the CDN Module URL: http://ftp.drupal.org/files/projects/cdn-8.x-3.0.tar.gz(check the official Drupal CDN Project Page for the newest stable version) and click "Install".
  • Now click on Manage ⇨ Configuration ⇨ Web Services ⇨ CDN integration. In CDN settings tab tick the "Serve files from CDN" status box, then click "Save Configuration."
  • Click on "Details",  then select "Origin Pull". For the "CDN Mapping" box, enter the CDN URL, for example:http://10001-5.b.cdn13.com
  • Click "Save Configuration"     

Your website now should be using CDN services and you can confirm this by reloading your website and viewing the page source. If your Origin URL is rewritten to the CDN temporary URL you are all set.

For more information about the plugin, visit:
www.drupal.org/project/cdn

Author: UCDN
Last update: 2018-10-18 15:59


How to integrate UCDN with Prestashop?

   (*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

       1. Log into your PrestaShop Admin Panel

       2. Hover your mouse over “Advanced Parameters” and click on ”Performance”

       3. In section “CCC (Combine, Compress and Cache)”, enable CCC for
the following:

  • Smart cache for CSS
  • Smart cache for JavaScript

       4. ​​Scroll down to the "Media servers (use only with CCC)" section.

       5. ​​Find three fields called "Media server" and insert your CDN URL  as shown bellow :

        6. ​Hit the SAVE button on the top of page to save your current settings. ​

In order to make sure everything works as intended, reload your site and view the source code, you should be able to see the CDN URLs used to pull static content.

Important Note:
CDN integration has only been tested on the default Prestashop theme, so results may vary if you are running a custom theme.

Author: UCDN
Last update: 2018-10-18 16:00


How to integrate UCDN with Joomla?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

www.joomla.org

​For 3.9.10

  • Download the “CDN For Joomla!” plugin from download page.
  • Log into your Joomla Administrator Panel, hover over “Extensions” and
    click “Extension Manager.” Next to the “Upload Package File” box, click
    “Browse”, select the downloaded plugin file, and click “Upload and Install.”
  • After the installation is complete, go back to “Extensions”, click
    “Plugins” and “Manage”, then find and click on “System - Regular Labs - CDN for Joomla!”
    Click on it to setup the plugin.
  • Leave the “Site Root” value alone, type your CDN URL (e.g.
    http://10001-1.b.cdn13.com) into “CDN Domain”, then click “Save and Close.”

All done! You are now officially using our CDN service. You can check if your URLs are being rewritten to CDN URLs by loading the page and
viewing the source code of the page.

Important Note:
Different types of protocols are available (CDN Protocol, Relative Protocol  etc.) only in PRO version. 

For more information about the plugin, visit
https://extensions.joomla.org/extension/cdn-for-joomla/

Author: UCDN
Last update: 2019-08-13 10:43


How to integrate UCDN with Magento?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

magento.com

​Magento has the ability to utilize CDN Functionality without the need for a 3rd party plugin.

​Setting up a CDN using Magento’s native support (version 2.3.2):

       1. Log into the admin panel of your website.

       2. Go to Stores ⇒ Configuration.

       3. Under General select Web option.

       4. Go to URL's settings tab.

Follow these setup instructions:

  • Set the Base URL of your website so that your website domain is in the following format: http://ucdntest.cf/
  • Base link URL leave as default: http://ucdntest.cf/
  • Base URL for Static View Files: http://10001-1.b.cdn13.com/pub/static/
  • Base URL for Media Files: http://10001-1.b.cdn13.com/pub/media/

​Do not forget to replace the zone of UCDN 10001-1.b.cdn13.com with your actual CDN URL and http://ucdntest.cf/ with your domain!

Now that you are officially using a CDN on your website, you can check if your URLs are being rewritten by loading your website and viewing the source code of your page.

Author: UCDN
Last update: 2019-08-13 15:26


How to integrate UCDN with Social Engine?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

socialengine.com

       1. Log into your Social Engine admin panel.

       2. From the top navigation menu, hover on Settings, then click on Global Settings.

       3. Scroll down to Static File Base URL.

       4. Enter the CDN URL in a full format like at bellow:

The http:// part is mandatory.

        5. Scroll down and click Save Settings.

Author: UCDN
Last update: 2018-10-18 16:02


How to integrate UCDN with Typo3?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

typo3.org

​If you are using the open source TYPO3 for your enterprise’s content management system, you care about performance. Touted as a flexible and scalable CMS for websites and mobile apps, combining TYPO3 with UCDN helps you further enhance the performance TYPO3 affords.

​​This tutorial will show you how to use the TYPO3 CMS bootstrap package to integrate UCDN into your TYPO3 content management system.

       1. Go to your Typo3 Login page and login.

       2. In Admin Tools, select "Extension manager". Then from the top dropdown menu, select "Get Extensions".

       3. In the search field, enter “Replace Content”, then press Enter. Once the search for the extension is done, click on the Import and Install
icon next to the version 2.0.4

       4. In your sidebar, select Template. After that select option “Info/Modify” from the top dropdown menu. Add the following code in the Constants field:

    config.tx_replacecontent {
    host = 10442-5.b.cdn13.com
    schema = http://

       5. Add the following code in the Setup field:

    config.tx_replacecontent {
        search {
            1 = #(src|href|data-src|data-small|data-large|data-medium)=("|')(/?)([^/]*/)?(typo3temp|fileadmin|uploads|typo3conf)/#
        }
        replace {
            1 = $1=$2{$config.tx_replacecontent.schema}{$config.tx_replacecontent.host}/$4$5/
        }
    }

       6. Save the settings.

Please note the above code of extension Replace Content 2.0.4 successfully serve all static files through UCDN with CMS TYPO3 8.7.1.

Author: UCDN
Last update: 2018-10-18 16:03


How to integrate UCDN with vBulletin?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

vbulletin.com ​

​Integration with VBulletin 5.3.2

       1. Login to your VBulletin administration and navigate to Admin CP.

       2. Go to "Styles & Templates" ⇒ "Replacement Variable Manager".

       3. Then choose "Add New Replacement Variable" next to the style you are using.

       4. Create a new replacement variable for each item.

In case you have more directories with your images, repeat the process for all of them. You migh create custom CDN resource for each of these directories or use single one with different paths. Here is a list of common variables you might need:

You just setup vBulletin to fully use our CDN. Please check the configuration by opening the page with the source code of your site and find the URL of the CDN that you are using.

Author: UCDN
Last update: 2018-10-18 16:03


How to integrate UCDN with Wordpress using WP CDN Rewrite?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

wordpress.org

There are different plugins available for WordPress which can be useful if you plan to use a CDN for your blog.

In this tutorial, we will be using WP CDN Rewrite plugin.

After you have installed the plugin, you will see a new item in the Settings menu - "CDN Rewrite". Hover your mouse over "Settings", and then click "CDN Rewrite": 

You will see the settings for the plugin:

Next you should choose what file types should be served via UCDN, to do so enter the files' extensions in the field "File Extensions"

The next fields - CDN root URL for CSS and CDN root URL for JS are optional. If you have set different zones for .CSS and .JS you can set the urls.

Since you can enter file extensions in the fields, these options could be used if you have zones with big files (like multimedia):

After you are ready with the settings, click "Save Changes"

Now the files with the specified extensions will be served from UCDN.

For more information about the plugin, visit wordpress.org and wordpress.org/plugins/wp-cdn-rewrite

Enter the CNAME you have created in the field "CDN Root URL". You can also enter the url for the zone like a14-10001.clients.ucdn.com   

Author: UCDN
Last update: 2018-10-18 16:04


How to integrate UCDN with Wordpress using WP Super Cache?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

wordpress.org

There are different plugins available for WordPress which can be useful if you plan to use a CDN for your blog. In this tutorial, we will be using WP Super Cache

After you have installed the plugin, you will see a new submenu in Settings - "WP Super Cache". Hover your mouse over "Settings", and then click "WP Super Cache"

 

On the WP Super Cache Settings page, select "Caching On" and click "Update Status".

Next click the tab "CDN". Enter your CNAME or zone address in the field "Off-site URL". You can also select the directories that will be served from UCDN, and exclude files based on regular expression.


Note: You should click "Skip https URLs to avoid mixed content errors" if you have not provided your own SSL certificate. 

When you are ready with the settings, click "Save Changes"

For more information about the plugin, visit wordpress.org and wordpress.org/plugins/wp-super-cache    

Author: UCDN
Last update: 2018-10-18 16:05


How to integrate UCDN with Wordpress using W3 Total Cache?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

wordpress.org

There are different plugins available for WordPress which can be useful if you plan to use a CDN for your blog. In this tutorial, we will be using W3 Total Cache

After you have installed the plugin, you will see a new item in the Admin menu - "Performance". Hover your mouse over the text, and then click "General settings"

On the General Settings page, click the link "CDN" or scroll down to the settings. Tick the box next to "CDN:" to enable the functionality, then select "Generic Mirror" from the drop down-list, and click "Save all settings" to save the configuration.

After that scroll down to "Configuration" and enter the CNAME record you have configured for your zone in the field "Replace site's hostname with". You can also set to always use SSL or only HTTP from "SSL support".

Note: You should use the default zone address like "10001-14.b.cdn13.com", if you have selected "Enabled" in "SSL support", and want to use UCDN's shared certificate. 

For more information about the plugin, visit wordpress.org and wordpress.org/plugins/w3-total-cache

Now the static files in your blog will be served from UCDN.

Author: UCDN
Last update: 2018-10-18 16:05


How to integrate UCDN with XenForo?

(*Disclaimer: Please be advised that the following instructions may have undergone some changes due to the third-party software and plugins updates.)

xenforo.com

The tutorial is relevant for webversion XenForo 1.5.10

​Login to your XenForo admin area.

​​Navigate to Appearance → Styles → [Default] → Style Properties → General.

​Under field Path to Images replace existing content
/styles/default, using your the zone name, for example:
**http://10000-21.s.cdn13.com/styles/default**

​Click on Update Style Properties to apply your settings.

Note. If you are going to use installed XenForo to the root directory
follow these steps:

  • First you need to edit the file config.php which is in directory
    library
  • You should add the following lines to the file:
$config ['externalDataUrl'] = 'http://10000-21.s.cdn13.com/data';
$config ['javaScriptUrl'] = 'http://10000-21.s.cdn13.com/js';

Author: UCDN
Last update: 2018-10-18 16:06


How to integrate UCDN with OpenCart?

This entry is in revision and can not be displayed.

Author: UCDN
Last update: 2017-10-12 16:38


How to integrate UCDN with X-Cart?

This entry is in revision and can not be displayed.

Author: UCDN
Last update: 2017-10-12 16:38


API

UCDN API Documentation

About

You can use this API with any RESTful compliant client.
In the tables below you will find useful information about request methods, URIs, parameters, how to validate different data and a short description for each. Some of the requests have default values or helper functions. The latter can be used to quickly perform a simple task.
The main purpose of this API is to allow you to configure or fetch information about your zones, or create a purge cache job.

Authentication

You can find your Authentication Token (also known as API key) in your control panel under "View Profile". You will need this token for authenticating with UCDN API. Every request to our API should be authenticated. At the moment we support the following methods of authentication. You can select whichever one you find most suitable for you.

  • Query Token - for every request to our API supply the query parameter token. So the request to GET your account info will become GET https://api.ucdn.com/v2/account/?token=your-api-token.
  • HTTP Header Token - every request to our API must include the HTTP header X-UCDN-Token with value your Authentication Token.

Request Prameters and Responses

Request prameters for the GET method must be in the query string. For every other method (POST, PUT, PATCH) parameters should be supplied in the request body using application/json or application/x-www-form-urlencoded. Content-Type header in the request is required.
Our API always responds with json

Swagger Specification

You can see the swagger specification of our API here. Using the swagger tools you can create your own API clients in many programming languages. We've setup this web client for our API using the swagger tools. You can use it as a learning resource or a debugging tool.

Fetch account info

Returns information for your current account.
GET https://api.ucdn.com/v2/account
This item returns the following information
Name Flags Description
id int Your unique user ID
username string Your username
name string Your name
email string This account contact email
timezone string Timezone for the Control Panel reports
trial int Whether this account is part of the UCDN Free trial program
This request returns one of the following messages
Status Flags Description
200 object Account Information

Example

curl --include --request GET "https://api.ucdn.com/v2/account/?token=acf0230d03f5b71d7252e336106f7338"

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:03:08 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.16
X-Cache: miss
Vary: Accept-Encoding
Content-Length: 127
Content-Type: application/json; charset=utf-8

{
    "id": "121",
    "username": "kusanagi",
    "email": "major@section9.co.jp",
    "name": "Motoko Kusanagi",
    "timezone": "Asia\/Tokyo",
    "trial": "0"
}

Zone

Fetch all zones

Returns a list with all of your zones. Every zone in the list is a object with the same informations as the Fetch a zone call.
GET https://api.ucdn.com/v2/zones
This item returns the following information
Name Flags Description
* array A list of your zones
This request returns one of the following messages
Status Flags Description
200 array A list of zones
This request supports the following helpers
Name Description
count Returns the count of your zones

Example

curl --include --request GET "https://api.ucdn.com/v2/zones/?token=acf0230d03f5b71d7252e336106f7338"

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:03:10 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.16
X-Cache: miss
Vary: Accept-Encoding
Content-Length: 1594
Content-Type: application/json; charset=utf-8

[
    {
        "id": "1",
        "cdn_domain": "121-1.s.cdn13.com",
        "object_size": "small",
        "is_active": "1",
        "create_ts": "1423139335",
        "update_ts": "1435564990",
        "storage_id": null,
        "error_pages": [],
        "referers": [],
        "geo_filter": [],
        "limit_rate": [],
        "origins": [
            "example.com"
        ],
        "ssl": "no",
        "custom_domains": [
            "cdn.section9.com"
        ],
        "cache_reuse_from": null,
        "expiration": 3600,
        "ssl_type": "shared",
        "origins_host_header": "example.com",
        "origins_auth_username": null,
        "origins_auth_password": null,
        "hash_secret": null,
        "hash_algorithm": null,
        "hash_ttl": null,
        "reconfig_status": "reconfiguring"
    },
    {
        "id": "3",
        "cdn_domain": "121-3.s.cdn13.com",
        "object_size": "small",
        "is_active": "1",
        "create_ts": "1429620438",
        "update_ts": "1429620438",
        "storage_id": null,
        "error_pages": [],
        "referers": [],
        "geo_filter": [],
        "limit_rate": [],
        "origins": [
            "so00-nl0.cdn-project.info"
        ],
        "ssl": "no",
        "custom_domains": [],
        "cache_reuse_from": null,
        "expiration": null,
        "ssl_type": "shared",
        "origins_host_header": "client_1.ucdn.com",
        "origins_auth_username": null,
        "origins_auth_password": null,
        "hash_secret": null,
        "hash_algorithm": null,
        "hash_ttl": null,
        "reconfig_status": "ready"
    },
    {
        "id": "4",
        "cdn_domain": "121-4.s.cdn13.com",
        "object_size": "small",
        "is_active": "1",
        "create_ts": "1435316148",
        "update_ts": "1435316148",
        "storage_id": null,
        "error_pages": [],
        "referers": [],
        "geo_filter": [],
        "limit_rate": [],
        "origins": [
            "inv.bg"
        ],
        "ssl": "no",
        "custom_domains": [],
        "cache_reuse_from": null,
        "expiration": null,
        "ssl_type": "shared",
        "origins_host_header": "inv.bg",
        "origins_auth_username": null,
        "origins_auth_password": null,
        "hash_secret": null,
        "hash_algorithm": null,
        "hash_ttl": null,
        "reconfig_status": "ready"
    }
]

Fetch a zone

Returns information for a particular cache zone as an object. Few of the fields can be ´null´. This indicates that the feature they signify is off. For example ´origins_host_header´ set to ´null´ means that no special Host header is sent to your origins but the one from the request is used.
GET https://api.ucdn.com/v2/zone/{zone_id}
This item returns the following information
Name Flags Description
id int This zone ID
cdn_domain string Unique domain name with which you can access your files
object_size string File size for this zone. Small (= 20MB)
is_active int Whether this zone is enabled (1) or disabled (0)
error_pages object Custom error pages activated for this zone
referers array Allowed referers for files in this zone
geo_filter object Geo filtering configuration
limit_rate object Limit rates configuration
origins array Origin server(s). A special value "ucdn_storage" is returned when this zone uses the UCDN storage
origins_host_header string The heade UCDN uses while accessing your origin server
origins_auth_username string Origin authentication username
origins_auth_password string Origin authentication password
ssl string Whether or not shared ssl is enabled
ssl_type string What kind of ssl certificate is used - "own" or "shared"
custom_domains array Array with custom domains for this zone. They must be CNAMEs this zone's cdn_domain
cache_reuse_from int zone_id of the zone this account reuses cache from
expiration int Forced expiration time of files in this zone
hash_secret string Security token's secret key
hash_algorithm string They hashing algorithm with which the security token is hashed
hash_ttl int Number of seconds for which URLs generated with security token work
create_ts int Unix time of the moment this zone was created
update_ts int Unix time. Last time this zone was edited in any way
storage_id int If this zone uses UCDN Storage as its origin, this is the ID of this storage
This request returns one of the following messages
Status Flags Description
200 object Information for thsi zone

Example

curl --include --request GET "https://api.ucdn.com/v2/zone/1/?token=acf0230d03f5b71d7252e336106f7338"

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:03:09 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.16
X-Cache: miss
Vary: Accept-Encoding
Content-Length: 538
Content-Type: application/json; charset=utf-8

{
    "id": "1",
    "cdn_domain": "121-1.s.cdn13.com",
    "object_size": "small",
    "is_active": "1",
    "create_ts": "1423139335",
    "update_ts": "1435564989",
    "storage_id": null,
    "error_pages": {},
    "referers": [],
    "geo_filter": [],
    "limit_rate": [],
    "origins": [
        "example.com"
    ],
    "ssl": "yes",
    "custom_domains": [
        "cdn.section9.com"
    ],
    "cache_reuse_from": null,
    "expiration": 3600,
    "ssl_type": "own",
    "origins_host_header": "example.com",
    "origins_auth_username": null,
    "origins_auth_password": null,
    "hash_secret": null,
    "hash_algorithm": null,
    "hash_ttl": null,
    "reconfig_status": "reconfiguring"
}

Create a new zone

With this API call you can create a new cache zone. The only required parameters are ´origins´ and ´object_size´. With the first one you can control the origin of the files for this cache zone and with the second you tell us if they are big files or small. Picking good ´object_size´ may be the difference between fast cache and almost no cache at all. For every other parameter check their description.
POST https://api.ucdn.com/v2/zone
This item returns the following information
Name Flags Description
zone_id int The ID of the newly created zone
This request returns one of the following messages
Status Flags Description
200 json The new zone's id
532 json An error message
This request expects the following parameters
Name Flags Validation Default Description
object_size required
string 
big
small
  File size for this zone. Small objects are those less than 20MB
origins required
array 
string 
host[:port],host[:port]...
ucdn_storage
  Origins (or upstream) servers or the special value "ucdn_storage" in case you want to use your UCDN Storage
ssl string  yes
no
no Whether to use shared SSL or not.
ssl_type string  own
shared
shared What kind of SSL certificate to be used. Your own or UCDN shared.
ucdn_storage_region string  Name of a storage region returned in /storage/regions europe Only meaningful if origins is "ucdn_storage". Geographical region in which the UCDN storage will be created.
storage_id integer  Existing storage id   Only meaningful if origins is "ucdn_storage". Zone will use this storage instead of creating new one.
origins_auth_username string  valid HTTP username   HTTP-based authentication username. Ignored when ucdn_storage is used in the origins parameter
origins_auth_password string  valid HTTP password   HTTP-based authentication password. Ignored when ucdn_storage is used in the origins parameter
origins_host_header string  valid header string Origin's domain name Host header UCDN will use while accessing your origin. Ignored when ucdn_storage is used in the origins parameter
custom_domains string 
array 
domain,domain,domain...   Custom domains for your zone. They must be CNAMEs to this zone's cdn_domain. This field does not have any effect when using shared SSL.
error_pages string 
array 
status:url   Custom URLs to besed for redirecting from various HTTP error statuses (e.g. 404)
referers string 
array 
valid domains   Allow access only from certain referers
geo_filter_allow string 
array 
ISO 3166-1 country code   Allow access only from certain countries
geo_filter_deny string 
array 
ISO 3166-1 country code   Deny access to certain countries
limit_rate_global string  NNk, e.g. 20k   Limit rate for every connection in this zone. It is mutually exclusive with limit_rate_security
limit_rate_security string  on
off
  Use security token's limit rate. It is mutually exclusive with limit_rate_global
hash_secret string  valid url query string   Access security token, used in conjuction with hash_algorithm and hash_ttl
hash_algorithm string  md5
sha1
  Hashing algorithm of the security token
hash_ttl integer  in seconds   Time to live of the security token hash
cache_reuse_from integer  valid zone id   Zone id of another zone. You cane use it to force this zone into using the other's cache.
expiration integer  in seconds   Forced cache expiration in seconds. When this is set expire and cache-control headers from the origin are ignored

Example

curl --include --request POST "https://api.ucdn.com/v2/zone/?token=acf0230d03f5b71d7252e336106f7338" --header "Content-Type: application/json" -d '{"object_size":"small", "origins": "example.com"}'

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:10:37 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.16
X-Cache: miss
Vary: Accept-Encoding
Content-Length: 13
Content-Type: application/json; charset=utf-8

{
    "zone_id": 5
}

Replace a zone configuration

Using this API call you can completely replace a zone configuration. It work just like creating new zone but instead of creating the zone it replaces the configuration for an already existing one. No cache is lost after this call. The only limitation when using this call is that you cannot change the zone object size type.
PUT https://api.ucdn.com/v2/zone/{zone_id}
This request returns one of the following messages
Status Flags Description
200 json Success message
532 json Fail message
This request expects the following parameters
Name Flags Validation Default Description
origins required
array 
string 
host[:port],host[:port]...
ucdn_storage
  Origins (or upstream) servers or the special value "ucdn_storage" in case you want to use your UCDN Storage
ssl string  yes
no
no Whether to use shared SSL or not.
ssl_type string  own
shared
shared What kind of SSL certificate to be used. Your own or UCDN shared.
ucdn_storage_region string  Name of a storage region returned in /storage/regions europe Only meaningful if origins is "ucdn_storage". Geographical region in which the UCDN storage will be created.
storage_id integer  Existing storage id   Only meaningful if origins is "ucdn_storage". Zone will use this storage instead of creating new one.
origins_auth_username string  valid HTTP username   HTTP-based authentication username. Ignored when ucdn_storage is used in the origins parameter
origins_auth_password string  valid HTTP password   HTTP-based authentication password. Ignored when ucdn_storage is used in the origins parameter
origins_host_header string  valid header string Origin's domain name Host header UCDN will use while accessing your origin. Ignored when ucdn_storage is used in the origins parameter
custom_domains string 
array 
domain,domain,domain...   Custom domains for your zone. They must be CNAMEs to this zone's cdn_domain. This field does not have any effect when using shared SSL.
error_pages string 
array 
status:url   Custom URLs to besed for redirecting from various HTTP error statuses (e.g. 404)
referers string 
array 
valid domains   Allow access only from certain referers
geo_filter_allow string 
array 
ISO 3166-1 country code   Allow access only from certain countries
geo_filter_deny string 
array 
ISO 3166-1 country code   Deny access to certain countries
limit_rate_global string  NNk, e.g. 20k   Limit rate for every connection in this zone. It is mutually exclusive with limit_rate_security
limit_rate_security string  on
off
  Use security token's limit rate. It is mutually exclusive with limit_rate_global
hash_secret string  valid url query string   Access security token, used in conjuction with hash_algorithm and hash_ttl
hash_algorithm string  md5
sha1
  Hashing algorithm of the security token
hash_ttl integer  in seconds   Time to live of the security token hash
cache_reuse_from integer  valid zone id   Zone id of another zone. You cane use it to force this zone into using the other's cache.
expiration integer  in seconds   Forced cache expiration in seconds. When this is set expire and cache-control headers from the origin are ignored

Example

curl --include --request PUT "https://api.ucdn.com/v2/zone/1/?token=acf0230d03f5b71d7252e336106f7338" --header "Content-Type: application/json" -d '{"object_size": "small", "origins": "example.com", "expiration": 3600, "custom_domains": ["cdn.section9.com"]}'

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:03:09 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.16
X-Cache: miss
Vary: Accept-Encoding
Content-Length: 27
Content-Type: application/json; charset=utf-8

{
    "message": "Zone replaced"
}

Replace a single zone parameter

You can edit the configuration for a particular zone with this API call. You may pass one or many of the parameters from the following.
PATCH https://api.ucdn.com/v2/zone/{zone_id}
This request returns one of the following messages
Status Flags Description
200 json Success message
532 json Fail message
This request supports the following helpers
Name Description
enable Enable the zone
disable Disable the zone
clear_security_token Unset the security token
clear_geo_filters Unset the geo filters
clear_limit_rates Unset the limit rates
clear_origins_auth Unset origin authentication
clear_referers Unset referers filter
clear_custom_domains Unset all additional domains
clear_origins_header Unset the origin "Host:" header
clear_reuse_cache Stop reusing another zone's cache
This request expects the following parameters
Name Flags Validation Default Description
origins array 
string 
host[:port],host[:port]...
ucdn_storage
  Origins (or upstream) servers or the special value "ucdn_storage" in case you want to use your UCDN Storage
ssl string  yes
no
no Whether to use shared SSL or not.
ssl_type string  own
shared
shared What kind of SSL certificate to be used. Your own or UCDN shared.
ucdn_storage_region string  Name of a storage region returned in /storage/regions europe Only meaningful if origins is "ucdn_storage". Geographical region in which the UCDN storage will be created.
storage_id integer Existing storage id   Only meaningful if origins is "ucdn_storage". Zone will use this storage instead of creating new one.
origins_auth_username string  valid HTTP username   HTTP-based authentication username. Ignored when ucdn_storage is used in the origins parameter
origins_auth_password string  valid HTTP password   HTTP-based authentication password. Ignored when ucdn_storage is used in the origins parameter
origins_host_header string  valid header string Origin's domain name Host header UCDN will use while accessing your origin. Ignored when ucdn_storage is used in the origins parameter
custom_domains string 
array 
domain,domain,domain...   Custom domains for your zone. They must be CNAMEs to this zone's cdn_domain. This field does not have any effect when using shared SSL.
error_pages string 
array 
status:url   Custom URLs to besed for redirecting from various HTTP error statuses (e.g. 404)
referers string 
array 
valid domains   Allow access only from certain referers
geo_filter_allow string 
array 
ISO 3166-1 country code   Allow access only from certain countries
geo_filter_deny string 
array 
ISO 3166-1 country code   Deny access to certain countries
limit_rate_global string  NNk, e.g. 20k   Limit rate for every connection in this zone. It is mutually exclusive with limit_rate_security
limit_rate_security string  on
off
  Use security token's limit rate. It is mutually exclusive with limit_rate_global
hash_secret string  valid url query string   Access security token, used in conjuction with hash_algorithm and hash_ttl
hash_algorithm string  md5
sha1
  Hashing algorithm of the security token
hash_ttl integer in seconds   Time to live of the security token hash
cache_reuse_from integer valid zone id   Zone id of another zone. You cane use it to force this zone into using the other's cache.
expiration integer in seconds   Forced cache expiration in seconds. When this is set expire and cache-control headers from the origin are ignored

Example

curl --include --request PATCH "https://api.ucdn.com/v2/zone/1/?token=acf0230d03f5b71d7252e336106f7338" --header "Content-Type: application/json" -d '{"ssl": "on", "ssl_type": "own"}'

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:03:08 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.16
X-Cache: miss
Vary: Accept-Encoding
Content-Length: 26
Content-Type: application/json; charset=utf-8

{
    "message": "Zone patched"
}

Delete a zone

Removes a cache zone. Once removed a cache zone cannot be restored and all of its cache is lost.
DELETE https://api.ucdn.com/v2/zone/{zone_id}
This request returns one of the following messages
Status Flags Description
200 json Success message
406 json Fail message
532 json Fail message

Example

curl --include --request DELETE "https://api.ucdn.com/v2/zone/4/?token=acf0230d03f5b71d7252e336106f7338"

Response

HTTP/1.1 200 OK Date: Mon, 29 Jun 2015 08:10:38 GMT Server: Apache X-Powered-By: PHP/5.3.10-1ubuntu3.16 X-Cache: miss Vary: Accept-Encoding Content-Length: 26 Content-Type: application/json; charset=utf-8 { "message": "Zone deleted" }

Certificates

Single certificate information

Information for a particular certificate. For security reasons it includes the certificate's fingerprint only.
GET https://api.ucdn.com/v2/certificate/{crt_id}
This item returns the following information
Name Flags Description
id int The id of this certificate
fingerprint string sha1 of the certificate you've uploaded.
hostname string The hostname this certificate is used with.
used_in_zones array List of all zones which make use of this certificate.
This request returns one of the following messages
Status Flags Description
200 object success message
404 string certificate did not exists

Example

curl --include --request GET "https://api.ucdn.com/v2/certificate/18/?token=acf0230d03f5b71d7252e336106f7338"

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:10:38 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.16
X-Cache: miss
Vary: Accept-Encoding
Content-Length: 26
Content-Type: application/json; charset=utf-8

{
    "message": "Zone deleted"
}

List all certificates

This API call lists all certificates for your account. It retuns an array with objects. Every object is information for one certificate. See the call for single certificate where all keys and values for single object are explained.
GET https://api.ucdn.com/v2/certificates
This item returns the following information
Name Flags Description
*** array All certificates for this account.
This request returns one of the following messages
Status Flags Description
200 array success message

Example

curl --include --request GET "https://api.ucdn.com/v2/certificates/?token=acf0230d03f5b71d7252e336106f7338"

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:03:15 GMT
Server: Apache
X-Powered-By: PHP/5.6.8-pl0-gentoo
X-Cache: hit
Vary: Accept-Encoding
Content-Length: 320
Content-Type: application/json; charset=utf-8

[
    {
        "id": 18,
        "hostname": "cdn.section9.com",
        "fingerprint": "3d284b5326388d22f9bfb15600917ebc1dfa96cd",
        "used_in_zones": [
            {
                "zone_id": 1,
                "domain": "cdn.section9.com",
                "cdn_domain": "121-1.s.cdn13.com"
            }
        ]
    },
    {
        "id": 35,
        "hostname": "cdn3.section9.co.jp",
        "fingerprint": "0f382f59b8ee80950c9663042190008927a6012f",
        "used_in_zones": []
    }
]

Upload certificate

Will add this certificate in UCDN. UCDN ssl servers will start to use this certificate for this hostname.
POST https://api.ucdn.com/v2/certificate/
This request returns one of the following messages
Status Flags Description
200 string success message
409 string Error message
This request expects the following parameters
Name Flags Validation Default Description
hostname string 
required
It should be valid host name. Such as domain or IP. Examples: example.com, 234.234.234.234, *.example.com   Show even if the zone has been deleted.
certificate string 
required
It must be in .pem format. Base64 encoded certificate with BEGIN and END.   Your certificate in pem format
key string 
required
It must be in .pem format. We support only base64 encoded RSA keys.   Your key in pem format
ca_bundle string  It must be in .pem format. Base64 encoded with BEGIN and END.   CA bundle

Example

curl --include --request POST "https://api.ucdn.com/v2/certificate/?token=acf0230d03f5b71d7252e336106f7338" --header "Content-Type: application/json" -d '{"hostname": "cdn2.section9.com", "key": "-----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgQDc95uOOiAJNKaoZBvTqIaMjCRVWhGjiZcHkmM+rENyW4xOuai1\nY2WUyj59jYsHzusu31NmaWgNTSzeYhI0oSBPCmitIEDmp7mGzfqadwFlbtQuAsaK\nR2QkvdpTHkPJaiT0N58Isq2J3M2jjwHnX2npYQILxgndWwt+syeXFoDauwIDAQAB\nAoGAEijfRd8NBvSmxawEhW6SMDbMPZ97V59VJDApq9roaBuR+l5TuSSEEqhUXmkl\nhezBc0azSfVbscwn5dbVfDHJv84Y5BcPyvzBqtrUhzO64HPefFICQh6HpE4t/rke\npSl9KeznWpiQqMq5AQwQo1IHeINnXdp7ZLDp9mCGOJV4Y3ECQQDwIL7kM7Q0nhZ/\nOO4yYzL+AMAYvs1hvhR2Ij7bWYuqJ+Pb/8aV8IrjDQMujFcfS2GwKDEPed42oQZl\n79hQjvavAkEA65Kjzck51prvMNdwv1abcq66COXLf8EdyY74QqjrtKknEweQclQs\nihCt0x47O+YiB1zJ/VLpW845EBCfUpbftQJAI7s7rIllD09W2aeHCkholhNWglgi\nB6FZOhrub4Vrmu5Eob/1tOoOQKr3Bj4r2KRG7QeOBVeFEWv0n8aI0bP0UQJBAKY9\n+LzbmaZ59fxIvTc5/j9DUOPAjwicFtJLw6T/Ij9+86U5PFWCU2AnfxOyjOirci4x\n7BWKckYoVRqiMF0PPdUCQEeq3IancNy8/5s7N6PKxEtnJ6G/Odty03pZ5xwSReM9\njBYtqogXMe6BSm9HlVSPYfA8gs4vynFtJlt0Cdc1A/c=\n-----END RSA PRIVATE KEY-----", "certificate": "-----BEGIN CERTIFICATE-----\nMIICLTCCAZYCCQCl/56DTdFTUDANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQGEwJB\nVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0\ncyBQdHkgTHRkMRQwEgYDVQQDDAtleGFtcGxlLmNvbTAeFw0xNTAxMjYxNjIzMTla\nFw0xNjAxMjYxNjIzMTlaMFsxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0\nYXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxFDASBgNVBAMM\nC2V4YW1wbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDc95uOOiAJ\nNKaoZBvTqIaMjCRVWhGjiZcHkmM+rENyW4xOuai1Y2WUyj59jYsHzusu31NmaWgN\nTSzeYhI0oSBPCmitIEDmp7mGzfqadwFlbtQuAsaKR2QkvdpTHkPJaiT0N58Isq2J\n3M2jjwHnX2npYQILxgndWwt+syeXFoDauwIDAQABMA0GCSqGSIb3DQEBBQUAA4GB\nAAEQreWBJw7zReaELu2Pn+IUnXd8N6hJBjp3SX1jCO6LjodjKd33sqyvFvRhZOSg\nevp0wiADmAoVE9jToxPEO5ZxJ1j6dtycog60IRbMGskWeh10m/cUzaKGWYnatYqE\nZsNWvi3ahdovfzM7ukkecn9SDrUD+74+qNIhL6QDqhOD\n-----END CERTIFICATE-----"}'

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:10:29 GMT
Server: Apache
X-Powered-By: PHP/5.6.8-pl0-gentoo
Vary: Accept-Encoding
Content-Length: 39
Content-Type: application/json; charset=utf-8

{
    "message": "Certificate saved",
    "id": 41
}

Delete certificate

Removes certificate from the CDN. Any further HTTPS hits on the domain for this certificate will use the shared UCDN ssl certificate. This may cause verification errors.
DELETE https://api.ucdn.com/v2/certificate/{crt_id}
This request returns one of the following messages
Status Flags Description
200 string success message
404 string certificate did not exists

Example

curl --include --request DELETE "https://api.ucdn.com/v2/certificate/20/?token=acf0230d03f5b71d7252e336106f7338"

Purge files

Removes files from a cache zone. This call will create a purge job which will be executed atomically.
POST https://api.ucdn.com/v2/purge/zone/{zone_id}/
This item returns the following information
Name Flags Description
job_id string The ID of the newly created purge job
This request returns one of the following messages
Status Flags Description
204 json Success message
532 json Fail message
This request expects the following parameters
Name Flags Validation Default Description
files string  You can use either http://example.com/dir/file.txt or /dir/file.txt   A list of files separated by a new line
This item has the following deprecated URIs:
POST https://api.ucdn.com/v2/purge/{zone_id}/

They will be supported as long as it is technically possible. Regardless, consider them deprecated and make sure you are using the new URI.

Example

curl --include --request POST "https://api.ucdn.com/v2/purge/1/?token=a1cceef964910f10947c09257e87ca40" --header "Content-Type: application/json" -d '{"files":"/example/logo.png\n/second/file"}'

Response

HTTP/1.1 200 OK
Date: Wed, 12 Aug 2015 13:21:34 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 80
Content-Type: application/json; charset=utf-8

{
    "message": "Purge request received",
    "job_id": "3cfb478531097f1830056a828752cbdd"
}

View purge job

Returns information for particular purge job.
GET https://api.ucdn.com/v2/purge/job/{job_id}/
This item returns the following information
Name Flags Description
job_id string The ID of this purge job
files array List of file which make up this purge job
status string The status of this purge job. It can be "waiting", "running", "finished" or "failed"
created_at int The time this job was created in Unix timestamp
This request returns one of the following messages
Status Flags Description
200 string Success message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
job_id string  -   A purge job id as returned by the job creation call
This item has the following deprecated URIs:
GET https://api.ucdn.com/v2/purge/{job_id}/

They will be supported as long as it is technically possible. Regardless, consider them deprecated and make sure you are using the new URI.

Example

curl --include "https://api.ucdn.com/v2/purge/2170dd23decc45691adf28987282d0bc/?token=a1cceef964910f10947c09257e87ca40"

Response

HTTP/1.1 200 OK
Date: Wed, 12 Aug 2015 13:21:33 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 210
Content-Type: application/json; charset=utf-8

{
    "job_id": "2170dd23decc45691adf28987282d0bc",
    "files": [
        "http:\/\/121-1.s.cdn13.com\/example\/logo.png",
        "http:\/\/121-1.s.cdn13.com\/second\/file"
    ],
    "status": "finished",
    "created_at": 1435318980
}

List purge jobs

Returns an array with the latest purge jobs.
GET https://api.ucdn.com/v2/purge/[?status=...][&amp;count=...]
This request returns one of the following messages
Status Flags Description
200 array Array with purge jobs
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
status string  Supporeted values are "waiting", "running", "finished" and "failed" Will show "waiting", "running" and "failed" purge jobs only Return only purge jobs which are in this status.
count integer  Positive integer less or equal to 500 20 How many purge jobs to return

Example

curl --include "https://api.ucdn.com/v2/purge/?token=a1cceef964910f10947c09257e87ca40&status=finished"

Example

HTTP/1.1 200 OK
Date: Wed, 12 Aug 2015 13:21:33 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 1900
Content-Type: application/json; charset=utf-8

[
    {
        "job_id": "ed74f89ab1469b4942fa6fee32832c31",
        "files": [
            "http:\/\/121-1.s.cdn13.com\/example\/logo.png",
            "http:\/\/121-1.s.cdn13.com\/second\/file"
        ],
        "status": "finished",
        "created_at": 1439377493
    },
    {
        "job_id": "58432bcd7c38551ab1c3552315962a39",
        "files": [
            "http:\/\/121-1.s.cdn13.com\/example\/logo.png",
            "http:\/\/121-1.s.cdn13.com\/second\/file"
        ],
        "status": "finished",
        "created_at": 1435565013
    },
    {
        "job_id": "ae2f114aa4ee1940fe960a2dca2d2d4d",
        "files": [
            "http:\/\/121-1.s.cdn13.com\/example\/logo.png",
            "http:\/\/121-1.s.cdn13.com\/second\/file"
        ],
        "status": "finished",
        "created_at": 1435564159
    },
    {
        "job_id": "e2a311eaaf6408621c6ba10d37b0a17f",
        "files": [
            "http:\/\/121-1.s.cdn13.com\/example\/logo.png",
            "http:\/\/121-1.s.cdn13.com\/second\/file"
        ],
        "status": "finished",
        "created_at": 1435564105
    },
    {
        "job_id": "2170dd23decc45691adf28987282d0bc",
        "files": [
            "http:\/\/121-1.s.cdn13.com\/example\/logo.png",
            "http:\/\/121-1.s.cdn13.com\/second\/file"
        ],
        "status": "finished",
        "created_at": 1435318980
    },
    {
        "job_id": "cd704ed605964e55a2a3c64162f94b05",
        "files": [
            "http:\/\/121-1.s.cdn13.com\/example\/logo.png",
            "http:\/\/121-1.s.cdn13.com\/second\/file"
        ],
        "status": "finished",
        "created_at": 1435317428
    },
    {
        "job_id": "a301e0571b0402a5fca1b6271612612b",
        "files": [
            "http:\/\/121-1.s.cdn13.com\/example\/logo.png",
            "http:\/\/121-1.s.cdn13.com\/second\/file"
        ],
        "status": "finished",
        "created_at": 1435317395
    },
    {
        "job_id": "9dfb57172bbbdc33abeb66862bb995d4",
        "files": [
            "http:\/\/121-1.s.cdn13.com\/example\/logo.png",
            "http:\/\/121-1.s.cdn13.com\/second\/file"
        ],
        "status": "finished",
        "created_at": 1435317350
    },
    {
        "job_id": "72709f187f5b5759d1db5055ac3c1340",
        "files": [
            "http:\/\/121-1.s.cdn13.com\/example\/logo.png",
            "http:\/\/121-1.s.cdn13.com\/second\/file"
        ],
        "status": "finished",
        "created_at": 1435317296
    }
]

Delete a purge job

Removes a purge job. Note that only purge jobs which are waiting or finished can be deleted.
DELETE https://api.ucdn.com/v2/purge/job/{job_id}
This request returns one of the following messages
Status Flags Description
200 string Success message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
job_id string  -   A purge job id as returned by the job creation call
This item has the following deprecated URIs:
DELETE https://api.ucdn.com/v2/purge/{job_id}

They will be supported as long as it is technically possible. Regardless, consider them deprecated and make sure you are using the new URI.

Example

curl --include --request DELETE "https://api.ucdn.com/v2/purge/cd704ed605964e55a2a3c64162f94b05/?token=a1cceef964910f10947c09257e87ca40"

Usage report

Returns served bytes and requests satisfied for particular zone or this account as a whole when ´zone_id´ is omitted or 0.
GET https://api.ucdn.com/v2/reports/[{zone_id}]/[?date_from=...][&amp;date_to=...]
This item returns the following information
Name Flags Description
bytes_served int Bytes served for the requested period
hits int File hits for the requested period
This request returns one of the following messages
Status Flags Description
200 json data
400 json Fail message
404 json Fail message
532 json Fail message
This request expects the following parameters
Name Flags Validation Default Description
date_from required
string 
GMT date in format YYYY-MM-DD or a Unix timestamp 24 hours ago From which date to generate the reports. Inclusive.
date_to required
string 
GMT date in format YYYY-MM-DD or a Unix timestamp Now To which date to generate the reports. Exclusive.

Example

curl --include "https://api.ucdn.com/v2/reports/1/?date_from=2015-08-12&date_to=2015-08-13&token=a1cceef964910f10947c09257e87ca40"

Response

HTTP/1.1 200 OK
Date: Wed, 12 Aug 2015 13:21:34 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 49
Content-Type: application/json; charset=utf-8

{
    "hits": 72223298971,
    "bytes_served": 1031761416566
}

Status codes

Statistics for HTTP status codes.
GET https://api.ucdn.com/v2/reports/status/codes/[?from=...][&amp;to=...][&amp;zones=1,2,3][&amp;by=hour][&amp;code=301]
This item returns the following information
Name Flags Description
elements object A key-value pairs. The key in the pair is a HTTP status code. The value an array with the generated data. Every element in the array represents a time slot. See the ´element_description´ field for for information on what it is made of.
element_duration int Lenght of tht time interval for each element. In seconds.
element_description array Every element in ´elements´ is an array of values. This fields says what does each value in an element mean.
This request returns one of the following messages
Status Flags Description
200 object Reports data
400 string Fail message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
from string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 24 hours ago From which date to generate the reports
to string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 now To which date to generate the reports
zones string A zone id or a list of zone ids separated with comma. Example: 1,2,3,4 All zones for this account Filter output for user zones. This way a report for particular zone or a group of zones can be made.
by string One of to following: 5min, hour, day hour Group the reported elements in slots with particular time length.
code string Integer. Represents a HTTP status code between 100 and 599. All status codes. Show staistics for particular HTTP status code.

Example

curl --include "https://api.ucdn.com/v2/reports/status/codes/?from=2015-08-12&to=2015-08-13&token=a1cceef964910f10947c09257e87ca40&code=404"

Response

HTTP/1.1 200 OK
Date: Wed, 12 Aug 2015 13:21:34 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 643
Content-Type: application/json; charset=utf-8

{
    "element_description": [
        "unix timestamp of the time slot start",
        "hits",
        "percents of all"
    ],
    "element_duration": 3600,
    "elements": {
        "404": [
            [
                1439337600,
                0,
                0
            ],
            [
                1439341200,
                181058,
                0
            ],
            [
                1439344800,
                195398,
                0
            ],
            [
                1439348400,
                212096,
                0
            ],
            [
                1439352000,
                205871,
                0
            ],
            [
                1439355600,
                173808,
                0
            ],
            [
                1439359200,
                137148,
                0
            ],
            [
                1439362800,
                118913,
                0
            ],
            [
                1439366400,
                117169,
                0
            ],
            [
                1439370000,
                125157,
                0
            ],
            [
                1439373600,
                116099,
                0
            ],
            [
                1439377200,
                0,
                0
            ],
            [
                1439380800,
                0,
                0
            ],
            [
                1439384400,
                0,
                0
            ],
            [
                1439388000,
                0,
                0
            ],
            [
                1439391600,
                0,
                0
            ],
            [
                1439395200,
                0,
                0
            ],
            [
                1439398800,
                0,
                0
            ],
            [
                1439402400,
                0,
                0
            ],
            [
                1439406000,
                0,
                0
            ],
            [
                1439409600,
                0,
                0
            ],
            [
                1439413200,
                0,
                0
            ],
            [
                1439416800,
                0,
                0
            ],
            [
                1439420400,
                0,
                0
            ]
        ]
    }
}

Bytes served via SSL

Returns stats with bytes served. The data is for particular time period and grouped in time intervals.
GET https://api.ucdn.com/v2/reports/bytes/ssl[?from=...][&amp;to=...][&amp;zones=1,2,3][&amp;by=hour]
This item returns the following information
Name Flags Description
elements array An array with the generated data. Every element in the array represents a time slot. See the ´element_description´ field for for information on what it is made of.
element_duration int Lenght of tht time interval for each element. In seconds.
element_description array Every element in ´elements´ is an array of values. This fields says what does each value in an element mean.
This request returns one of the following messages
Status Flags Description
200 object Reports data
400 string Fail message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
from string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 24 hours ago From which date to generate the reports
to string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 now To which date to generate the reports
zones string A zone id or a list of zone ids separated with comma. Example: 1,2,3,4 All zones for this account Filter output for user zones. This way a report for particular zone or a group of zones can be made.
by string One of to following: 5min, hour, day hour Group the reported elements in slots with particular time length.

Cache hits

Returns information for cache hits and misses
GET https://api.ucdn.com/v2/reports/cache/hits/[?from=...][&amp;to=...][&amp;zones=1,2,3][&amp;by=hour]
This item returns the following information
Name Flags Description
elements array An array with the generated data. Every element in the array represents a time slot. See the ´element_description´ field for for information on what it is made of.
element_duration int Lenght of tht time interval for each element. In seconds.
element_description array Every element in ´elements´ is an array of values. This fields says what does each value in an element mean.
This request returns one of the following messages
Status Flags Description
200 object Reports data
400 string Fail message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
from string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 24 hours ago From which date to generate the reports
to string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 now To which date to generate the reports
zones string A zone id or a list of zone ids separated with comma. Example: 1,2,3,4 All zones for this account Filter output for user zones. This way a report for particular zone or a group of zones can be made.
by string One of to following: 5min, hour, day hour Group the reported elements in slots with particular time length.

Example

curl --include "https://api.ucdn.com/v2/reports/cache/hits/?token=a1cceef964910f10947c09257e87ca40"

Response

HTTP/1.1 200 OK
Date: Wed, 12 Aug 2015 11:04:50 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 960
Content-Type: application/json; charset=utf-8

{
    "element_description": [
        "unix timestamp of the time slot start",
        "cache hits",
        "cache misses"
    ],
    "element_duration": 3600,
    "elements": [
        [
            1439290800,
            0,
            0
        ],
        [
            1439294400,
            5396496593,
            899416094
        ],
        [
            1439298000,
            5247521743,
            874586953
        ],
        [
            1439301600,
            5162247017,
            860374498
        ],
        [
            1439305200,
            5152343919,
            858723984
        ],
        [
            1439308800,
            5249369554,
            874894920
        ],
        [
            1439312400,
            5552153129,
            925358850
        ],
        [
            1439316000,
            6019501815,
            1003250298
        ],
        [
            1439319600,
            6515737416,
            1085956233
        ],
        [
            1439323200,
            6707771973,
            1117961992
        ],
        [
            1439326800,
            7180243032,
            1196707169
        ],
        [
            1439330400,
            7016808093,
            1169468011
        ],
        [
            1439334000,
            6704402747,
            1117400453
        ],
        [
            1439337600,
            6369665676,
            1061610943
        ],
        [
            1439341200,
            6353130634,
            1058855104
        ],
        [
            1439344800,
            6856277563,
            1142712923
        ],
        [
            1439348400,
            7442160406,
            1240360064
        ],
        [
            1439352000,
            7223771374,
            1203961891
        ],
        [
            1439355600,
            6098735079,
            1016455844
        ],
        [
            1439359200,
            4812403956,
            802067323
        ],
        [
            1439362800,
            4172597099,
            695432846
        ],
        [
            1439366400,
            4111374288,
            685229044
        ],
        [
            1439370000,
            4391737590,
            731956260
        ],
        [
            1439373600,
            4073831201,
            678971863
        ],
        [
            1439377200,
            0,
            0
        ]
    ]
}

Storages

Returns the used UCDN storage in bytes.
GET https://api.ucdn.com/v2/reports/storages/[?from=...][&amp;to=...][&amp;by=hour]
This item returns the following information
Name Flags Description
elements array An array with the generated data. Every element in the array represents a time slot. See the ´element_description´ field for for information on what it is made of.
element_duration int Lenght of tht time interval for each element. In seconds.
element_description array Every element in ´elements´ is an array of values. This fields says what does each value in an element mean.
This request returns one of the following messages
Status Flags Description
200 object Reports data
400 string Fail message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
from string  Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 24 hours ago From which date to generate the reports
to string  Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 now To which date to generate the reports
by string  Only one possible value is supported for now: hour hour Group the reported elements in slots with particular time length.

Example

curl --include "https://api.ucdn.com/v2/reports/storages/?token=a1cceef964910f10947c09257e87ca40"

Response

HTTP/1.1 200 OK
Date: Wed, 12 Aug 2015 11:04:52 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 698
Content-Type: application/json; charset=utf-8

{
    "element_description": [
        "unix timestamp of the time slot start",
        "used size in bytes"
    ],
    "element_duration": 3600,
    "elements": [
        [
            1439290800,
            0
        ],
        [
            1439294400,
            2887995255
        ],
        [
            1439298000,
            2887995255
        ],
        [
            1439301600,
            2887995255
        ],
        [
            1439305200,
            2887995255
        ],
        [
            1439308800,
            2887995255
        ],
        [
            1439312400,
            2887995255
        ],
        [
            1439316000,
            2887995255
        ],
        [
            1439319600,
            2887995255
        ],
        [
            1439323200,
            2887995255
        ],
        [
            1439326800,
            2887995255
        ],
        [
            1439330400,
            2887995255
        ],
        [
            1439334000,
            2887995255
        ],
        [
            1439337600,
            2887995255
        ],
        [
            1439341200,
            2887995255
        ],
        [
            1439344800,
            2887995255
        ],
        [
            1439348400,
            2887995255
        ],
        [
            1439352000,
            2887995255
        ],
        [
            1439355600,
            2887995255
        ],
        [
            1439359200,
            2887995255
        ],
        [
            1439362800,
            2887995255
        ],
        [
            1439366400,
            2887995255
        ],
        [
            1439370000,
            2887995255
        ],
        [
            1439373600,
            0
        ],
        [
            1439377200,
            0
        ]
    ]
}

Hits SSL

Returns total number of hits. The data is for particular time period and grouped in time intervals.
GET https://api.ucdn.com/v2/reports/hits/ssl[?from=...][&amp;to=...][&amp;zones=1,2,3][&amp;by=hour]
This item returns the following information
Name Flags Description
elements array An array with the generated data. Every element in the array represents a time slot. See the ´element_description´ field for for information on what it is made of.
element_duration int Lenght of tht time interval for each element. In seconds.
element_description array Every element in ´elements´ is an array of values. This fields says what does each value in an element mean.
This request returns one of the following messages
Status Flags Description
200 object Reports data
400 string Fail message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
from string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 24 hours ago From which date to generate the reports
to string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 now To which date to generate the reports
zones string A zone id or a list of zone ids separated with comma. Example: 1,2,3,4 All zones for this account Filter output for user zones. This way a report for particular zone or a group of zones can be made.
by string One of to following: 5min, hour, day hour Group the reported elements in slots with particular time length.

Countries

Statistics for the traffic destination by country. It shows hits and bytes served to this country.
GET https://api.ucdn.com/v2/reports/countries/[?from=...][&amp;to=...][&amp;zones=1,2,3][&amp;by=hour][&amp;countries=de,ru,jp]
This item returns the following information
Name Flags Description
elements object A key-value pairs. The key in the pair is a ISO 3166-1 country code. The value an array with the generated data. Every element in the array represents a time slot. See the ´element_description´ field for for information on what it is made of.
element_duration int Lenght of tht time interval for each element. In seconds.
element_description array Every element in ´elements´ is an array of values. This fields says what does each value in an element mean.
This request returns one of the following messages
Status Flags Description
200 object Reports data
400 string Fail message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
from string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 24 hours ago From which date to generate the reports
to string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 now To which date to generate the reports
zones string A zone id or a list of zone ids separated with comma. Example: 1,2,3,4 All zones for this account Filter output for user zones. This way a report for particular zone or a group of zones can be made.
by string One of to following: 5min, hour, day hour Group the reported elements in slots with particular time length.
countries string Comma separated list of countries. Every country must be represented by a ISO 3166-1 country code. Examples: 'bg,vn,ru' All countries. List of countries for which to show statistics.

Example

curl --include "https://api.ucdn.com/v2/reports/countries/?token=a1cceef964910f10947c09257e87ca40"

Response

HTTP/1.1 200 OK
Date: Wed, 12 Aug 2015 11:04:50 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 4406
Content-Type: application/json; charset=utf-8

{
    "element_description": [
        "unix timestamp of the time slot start",
        "hits from this country",
        "bytes served to this country"
    ],
    "element_duration": 3600,
    "elements": {
        "CH": [
            [
                1439290800,
                0,
                0
            ],
            [
                1439294400,
                384465,
                19224985
            ],
            [
                1439298000,
                373860,
                18694275
            ],
            [
                1439301600,
                367775,
                18390470
            ],
            [
                1439305200,
                367080,
                18355200
            ],
            [
                1439308800,
                373990,
                18700850
            ],
            [
                1439312400,
                395555,
                19779515
            ],
            [
                1439316000,
                428855,
                21444440
            ],
            [
                1439319600,
                464220,
                23212285
            ],
            [
                1439323200,
                477890,
                23896410
            ],
            [
                1439326800,
                511555,
                25579590
            ],
            [
                1439330400,
                499925,
                24997345
            ],
            [
                1439334000,
                477660,
                23884405
            ],
            [
                1439337600,
                453815,
                22691905
            ],
            [
                1439341200,
                452635,
                22632990
            ],
            [
                1439344800,
                488485,
                24425460
            ],
            [
                1439348400,
                530235,
                26512670
            ],
            [
                1439352000,
                514665,
                25734655
            ],
            [
                1439355600,
                434510,
                21726715
            ],
            [
                1439359200,
                342845,
                17144165
            ],
            [
                1439362800,
                297270,
                14864850
            ],
            [
                1439366400,
                292910,
                14646740
            ],
            [
                1439370000,
                312875,
                15645535
            ],
            [
                1439373600,
                290240,
                14513000
            ],
            [
                1439377200,
                0,
                0
            ]
        ],
        "GB": [
            [
                1439290800,
                0,
                0
            ],
            [
                1439294400,
                427190,
                21361100
            ],
            [
                1439298000,
                415390,
                20771405
            ],
            [
                1439301600,
                408645,
                20433865
            ],
            [
                1439305200,
                407865,
                20394660
            ],
            [
                1439308800,
                415540,
                20778725
            ],
            [
                1439312400,
                439510,
                21977240
            ],
            [
                1439316000,
                476520,
                23827165
            ],
            [
                1439319600,
                515800,
                25791430
            ],
            [
                1439323200,
                531010,
                26551560
            ],
            [
                1439326800,
                568410,
                28421770
            ],
            [
                1439330400,
                555470,
                27774840
            ],
            [
                1439334000,
                530735,
                26538230
            ],
            [
                1439337600,
                504230,
                25213225
            ],
            [
                1439341200,
                502930,
                25147775
            ],
            [
                1439344800,
                542765,
                27139400
            ],
            [
                1439348400,
                589135,
                29458515
            ],
            [
                1439352000,
                571850,
                28594060
            ],
            [
                1439355600,
                482785,
                24140800
            ],
            [
                1439359200,
                380950,
                19049070
            ],
            [
                1439362800,
                330290,
                16516505
            ],
            [
                1439366400,
                325450,
                16274160
            ],
            [
                1439370000,
                347645,
                17383935
            ],
            [
                1439373600,
                322490,
                16125560
            ],
            [
                1439377200,
                0,
                0
            ]
        ],
        "MX": [
            [
                1439290800,
                0,
                0
            ],
            [
                1439294400,
                261435,
                13072990
            ],
            [
                1439298000,
                254210,
                12712090
            ],
            [
                1439301600,
                250090,
                12505515
            ],
            [
                1439305200,
                249605,
                12481520
            ],
            [
                1439308800,
                254305,
                12716565
            ],
            [
                1439312400,
                268970,
                13450060
            ],
            [
                1439316000,
                291615,
                14582210
            ],
            [
                1439319600,
                315660,
                15784340
            ],
            [
                1439323200,
                324955,
                16249550
            ],
            [
                1439326800,
                347845,
                17394115
            ],
            [
                1439330400,
                339935,
                16998190
            ],
            [
                1439334000,
                324800,
                16241380
            ],
            [
                1439337600,
                308580,
                15430480
            ],
            [
                1439341200,
                307775,
                15390430
            ],
            [
                1439344800,
                332155,
                16609305
            ],
            [
                1439348400,
                360550,
                18028610
            ],
            [
                1439352000,
                349965,
                17499560
            ],
            [
                1439355600,
                295450,
                14774155
            ],
            [
                1439359200,
                233140,
                11658020
            ],
            [
                1439362800,
                202135,
                10108085
            ],
            [
                1439366400,
                199170,
                9959775
            ],
            [
                1439370000,
                212745,
                10638965
            ],
            [
                1439373600,
                197355,
                9868830
            ],
            [
                1439377200,
                0,
                0
            ]
        ],
        "RU": [
            [
                1439290800,
                0,
                0
            ],
            [
                1439294400,
                326800,
                16341240
            ],
            [
                1439298000,
                317775,
                15890115
            ],
            [
                1439301600,
                312615,
                15631895
            ],
            [
                1439305200,
                312020,
                15601915
            ],
            [
                1439308800,
                317880,
                15895725
            ],
            [
                1439312400,
                336225,
                16812575
            ],
            [
                1439316000,
                364530,
                18227770
            ],
            [
                1439319600,
                394585,
                19730440
            ],
            [
                1439323200,
                406205,
                20311945
            ],
            [
                1439326800,
                434830,
                21742650
            ],
            [
                1439330400,
                424925,
                21247740
            ],
            [
                1439334000,
                406010,
                20301735
            ],
            [
                1439337600,
                385735,
                19288100
            ],
            [
                1439341200,
                384725,
                19238045
            ],
            [
                1439344800,
                415190,
                20761630
            ],
            [
                1439348400,
                450685,
                22535765
            ],
            [
                1439352000,
                437460,
                21874445
            ],
            [
                1439355600,
                369335,
                18467715
            ],
            [
                1439359200,
                291435,
                14572525
            ],
            [
                1439362800,
                252685,
                12635120
            ],
            [
                1439366400,
                248960,
                12449735
            ],
            [
                1439370000,
                265945,
                13298700
            ],
            [
                1439373600,
                246695,
                12336040
            ],
            [
                1439377200,
                0,
                0
            ]
        ],
        "US": [
            [
                1439290800,
                0,
                0
            ],
            [
                1439294400,
                449685,
                22485365
            ],
            [
                1439298000,
                437260,
                21864645
            ],
            [
                1439301600,
                430150,
                21509335
            ],
            [
                1439305200,
                429335,
                21468070
            ],
            [
                1439308800,
                437415,
                21872345
            ],
            [
                1439312400,
                462655,
                23133930
            ],
            [
                1439316000,
                501595,
                25081230
            ],
            [
                1439319600,
                542950,
                27148880
            ],
            [
                1439323200,
                558955,
                27949025
            ],
            [
                1439326800,
                598325,
                29917650
            ],
            [
                1439330400,
                584710,
                29236665
            ],
            [
                1439334000,
                558665,
                27934990
            ],
            [
                1439337600,
                530770,
                26540240
            ],
            [
                1439341200,
                529400,
                26471355
            ],
            [
                1439344800,
                571320,
                28567790
            ],
            [
                1439348400,
                620150,
                31008980
            ],
            [
                1439352000,
                601955,
                30099015
            ],
            [
                1439355600,
                508200,
                25411365
            ],
            [
                1439359200,
                400995,
                20051655
            ],
            [
                1439362800,
                347695,
                17385790
            ],
            [
                1439366400,
                342585,
                17130695
            ],
            [
                1439370000,
                365945,
                18298885
            ],
            [
                1439373600,
                339460,
                16974280
            ],
            [
                1439377200,
                0,
                0
            ]
        ],
        "VN": [
            [
                1439290800,
                0,
                0
            ],
            [
                1439294400,
                196060,
                9804735
            ],
            [
                1439298000,
                190655,
                9534070
            ],
            [
                1439301600,
                187550,
                9379120
            ],
            [
                1439305200,
                187185,
                9361135
            ],
            [
                1439308800,
                190730,
                9537415
            ],
            [
                1439312400,
                201715,
                10087535
            ],
            [
                1439316000,
                218700,
                10936660
            ],
            [
                1439319600,
                236740,
                11838255
            ],
            [
                1439323200,
                243710,
                12187150
            ],
            [
                1439326800,
                260885,
                13045570
            ],
            [
                1439330400,
                254950,
                12748630
            ],
            [
                1439334000,
                243590,
                12181035
            ],
            [
                1439337600,
                231425,
                11572860
            ],
            [
                1439341200,
                230825,
                11542820
            ],
            [
                1439344800,
                249110,
                12456965
            ],
            [
                1439348400,
                270395,
                13521445
            ],
            [
                1439352000,
                262465,
                13124655
            ],
            [
                1439355600,
                221585,
                11080610
            ],
            [
                1439359200,
                174850,
                8743510
            ],
            [
                1439362800,
                151590,
                7581045
            ],
            [
                1439366400,
                149365,
                7469825
            ],
            [
                1439370000,
                159550,
                7979210
            ],
            [
                1439373600,
                148010,
                7401615
            ],
            [
                1439377200,
                0,
                0
            ]
        ]
    }
}

Hits via HTTP2

Returns total number of hits. The data is for particular time period and grouped in time intervals.
GET https://api.ucdn.com/v2/reports/hits/http2[?from=...][&amp;to=...][&amp;zones=1,2,3][&amp;by=hour]
This item returns the following information
Name Flags Description
elements array An array with the generated data. Every element in the array represents a time slot. See the ´element_description´ field for for information on what it is made of.
element_duration int Lenght of tht time interval for each element. In seconds.
element_description array Every element in ´elements´ is an array of values. This fields says what does each value in an element mean.
This request returns one of the following messages
Status Flags Description
200 object Reports data
400 string Fail message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
from string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 24 hours ago From which date to generate the reports
to string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 now To which date to generate the reports
zones string A zone id or a list of zone ids separated with comma. Example: 1,2,3,4 All zones for this account Filter output for user zones. This way a report for particular zone or a group of zones can be made.
by string One of to following: 5min, hour, day hour Group the reported elements in slots with particular time length.

Hits

Returns statistics with the number of HTTP hits
GET https://api.ucdn.com/v2/reports/hits/[?from=...][&amp;to=...][&amp;zones=1,2,3][&amp;by=hour]
This item returns the following information
Name Flags Description
elements array An array with the generated data. Every element in the array represents a time slot. See the ´element_description´ field for for information on what it is made of.
element_duration int Lenght of tht time interval for each element. In seconds.
element_description array Every element in ´elements´ is an array of values. This fields says what does each value in an element mean.
This request returns one of the following messages
Status Flags Description
200 object Reports data
400 string Fail message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
from string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 24 hours ago From which date to generate the reports
to string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 now To which date to generate the reports
zones string A zone id or a list of zone ids separated with comma. Example: 1,2,3,4 All zones for this account Filter output for user zones. This way a report for particular zone or a group of zones can be made.
by string One of to following: 5min, hour, day hour Group the reported elements in slots with particular time length.

Example

curl --include "https://api.ucdn.com/v2/reports/hits/?token=a1cceef964910f10947c09257e87ca40"

Example

HTTP/1.1 200 OK
Date: Wed, 12 Aug 2015 11:04:50 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 602
Content-Type: application/json; charset=utf-8

{
    "element_description": [
        "unix timestamp of the time slot start",
        "hits"
    ],
    "element_duration": 3600,
    "elements": [
        [
            1439290800,
            0
        ],
        [
            1439294400,
            739857
        ],
        [
            1439298000,
            719431
        ],
        [
            1439301600,
            707736
        ],
        [
            1439305200,
            706384
        ],
        [
            1439308800,
            719685
        ],
        [
            1439312400,
            761199
        ],
        [
            1439316000,
            825275
        ],
        [
            1439319600,
            893314
        ],
        [
            1439323200,
            919642
        ],
        [
            1439326800,
            984416
        ],
        [
            1439330400,
            962014
        ],
        [
            1439334000,
            919178
        ],
        [
            1439337600,
            873281
        ],
        [
            1439341200,
            871015
        ],
        [
            1439344800,
            939998
        ],
        [
            1439348400,
            1020329
        ],
        [
            1439352000,
            990386
        ],
        [
            1439355600,
            836136
        ],
        [
            1439359200,
            659778
        ],
        [
            1439362800,
            572053
        ],
        [
            1439366400,
            563661
        ],
        [
            1439370000,
            602095
        ],
        [
            1439373600,
            558520
        ],
        [
            1439377200,
            0
        ]
    ]
}

Bytes served

Returns stats with bytes served. The data is for particular time period and grouped in time intervals.
GET https://api.ucdn.com/v2/reports/bytes/[?from=...][&amp;to=...][&amp;zones=1,2,3][&amp;by=hour]
This item returns the following information
Name Flags Description
elements array An array with the generated data. Every element in the array represents a time slot. See the ´element_description´ field for for information on what it is made of.
element_duration int Lenght of tht time interval for each element. In seconds.
element_description array Every element in ´elements´ is an array of values. This fields says what does each value in an element mean.
This request returns one of the following messages
Status Flags Description
200 object Reports data
400 string Fail message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
from string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 24 hours ago From which date to generate the reports
to string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 now To which date to generate the reports
zones string A zone id or a list of zone ids separated with comma. Example: 1,2,3,4 All zones for this account Filter output for user zones. This way a report for particular zone or a group of zones can be made.
by string One of to following: 5min, hour, day hour Group the reported elements in slots with particular time length.

Example

curl --include "https://api.ucdn.com/v2/reports/bytes/?from=2015-08-12&to=2015-08-13&token=a1cceef964910f10947c09257e87ca40&zones=1,3"

Response

HTTP/1.1 200 OK
Date: Wed, 12 Aug 2015 13:21:35 GMT
Server: Apache
Vary: Accept-Encoding
Content-Length: 602
Content-Type: application/json; charset=utf-8

{
    "element_description": [
        "unix timestamp of the time slot start",
        "bytes served in this time slot"
    ],
    "element_duration": 3600,
    "elements": [
        [
            1439337600,
            0
        ],
        [
            1439341200,
            105885510745
        ],
        [
            1439344800,
            114271292947
        ],
        [
            1439348400,
            124036006918
        ],
        [
            1439352000,
            120396189741
        ],
        [
            1439355600,
            101645584874
        ],
        [
            1439359200,
            80206732783
        ],
        [
            1439362800,
            69543285192
        ],
        [
            1439366400,
            68522904965
        ],
        [
            1439370000,
            73195626735
        ],
        [
            1439373600,
            67897186868
        ],
        [
            1439377200,
            0
        ],
        [
            1439380800,
            0
        ],
        [
            1439384400,
            0
        ],
        [
            1439388000,
            0
        ],
        [
            1439391600,
            0
        ],
        [
            1439395200,
            0
        ],
        [
            1439398800,
            0
        ],
        [
            1439402400,
            0
        ],
        [
            1439406000,
            0
        ],
        [
            1439409600,
            0
        ],
        [
            1439413200,
            0
        ],
        [
            1439416800,
            0
        ],
        [
            1439420400,
            0
        ]
    ]
}

Bytes served via HTTP2

Returns stats with bytes served. The data is for particular time period and grouped in time intervals.
GET https://api.ucdn.com/v2/reports/bytes/http2[?from=...][&amp;to=...][&amp;zones=1,2,3][&amp;by=hour]
This item returns the following information
Name Flags Description
elements array An array with the generated data. Every element in the array represents a time slot. See the ´element_description´ field for for information on what it is made of.
element_duration int Lenght of tht time interval for each element. In seconds.
element_description array Every element in ´elements´ is an array of values. This fields says what does each value in an element mean.
This request returns one of the following messages
Status Flags Description
200 object Reports data
400 string Fail message
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
from string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 24 hours ago From which date to generate the reports
to string Valid formats are: YYYY-MM-DD HH:mm with optional timezone parameter or a Unix timestamp. Examples: 2014-03-12 15:32 GMT+3, 1394571600 now To which date to generate the reports
zones string A zone id or a list of zone ids separated with comma. Example: 1,2,3,4 All zones for this account Filter output for user zones. This way a report for particular zone or a group of zones can be made.
by string One of to following: 5min, hour, day hour Group the reported elements in slots with particular time length.

Check user credentials

Checks if a email and password pair belong to a valid user and returns its ID if they do. By saying "email" we actually mean "username or email". Both will work for logging in.
POST https://api.ucdn.com/v2/check/login/
This item returns the following information
Name Flags Description
authenticated bool True if the credentials are valid or false otherwise
user_id int The user ID of the user for which the credentials matched. Only present in successful logins.
reason string Huaman readable sentence explaining the result from this call
token string The token for this user needed for authenticating against the Public API. Only present in successful logins.
This request returns one of the following messages
Status Flags Description
200 string Message
401 string Invalid login credentials
532 string An error message
This request expects the following parameters
Name Flags Validation Default Description
email string 
required
The email with which this user has been registered   Email supplied by the user
password string 
required
The password for this user   Password supplied by the user

Example

curl --include --request POST "https://api.ucdn.com/v2/check/login/" --header "Content-Type: application/json" -d '{"email":"major@section9.co.jp", "password": "password"}'

List storages

Returns a list with all of your UCDN storages. For every storage in the list there is a object with information for it.
GET https://api.ucdn.com/v2/storages
This item returns the following information
Name Flags Description
id int The identificator of this storage instance
container string The name of this storage
ftp_host string FTP host for this storage
ftp_user string FTP user for this storage
ftp_password string FTP password for this storage
region string The geo region this storage is in
synchronized_with_storage string Id of a storage which is synchronized with this one if there is one.
This request returns one of the following messages
Status Flags Description
200 array Array with information for all storages
532 json Error message

Example

curl --include --request GET "https://api.ucdn.com/v2/storages/?token=acf0230d03f5b71d7252e336106f7338"

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:10:29 GMT
Server: Apache
X-Powered-By: PHP/5.6.8-pl0-gentoo
Vary: Accept-Encoding
Content-Length: 36
Content-Type: application/json; charset=utf-8

{
    "message": "Storage Created",
    "id": 3
}

Create storage

Creates a new UCDN storage and returns its ID on success. The storage will be ready for uploading files and general use but still not attached to any cache zone. See zone creation and reconfiguration API calls for details on how to use particular UCDN storage.
POST https://api.ucdn.com/v2/storage
This item returns the following information
Name Flags Description
id int The id of the created storage
status string Operation success message
This request returns one of the following messages
Status Flags Description
200 json Message for successful creation
532 json Error message
504 json Storage backend failed
This request expects the following parameters
Name Flags Validation Default Description
name string 
required
At least 3 characters long identifier.   Name wihch will be used for the swift container.
region string 
required
"europe" or "north-america".   The geographical region of this container.

Example

curl --include --request POST "https://api.ucdn.com/v2/storage/?token=acf0230d03f5b71d7252e336106f7338" --header "Content-Type: application/json" -d '{"region":"north-america", "name": "level-4-logs"}'

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:10:29 GMT
Server: Apache
X-Powered-By: PHP/5.6.8-pl0-gentoo
Vary: Accept-Encoding
Content-Length: 36
Content-Type: application/json; charset=utf-8

{
    "message": "Storage Created",
    "id": 3
}

Reconfigure storages

This API call makes possible changing the settings for all storages in particular region. Different values of the ´action´ parameter mean different operations to be performed.
PATCH https://api.ucdn.com/v2/storages
This item returns the following information
Name Flags Description
new_ftp_password string The new FTP password which must be used with storages in the patched region. Will be returned only if the ´action´ request parameter is "change_ftp_password".
message string Success message
This request returns one of the following messages
Status Flags Description
200 object Relevant information for the successful ´action´
400 string Something wrong with the request
409 string Insufficient parameters
504 string Storage backend errors
532 string Fail message
This request expects the following parameters
Name Flags Validation Default Description
region string 
required
"europe" or "north-america".   The region in which will storages be patched.
action string 
required
Only "change_ftp_password" is supported for now. With it, all storages in the region will have their FTP passwords changed.   Tells what will this reconfiguration do.

Example

curl --include --request PATCH "https://api.ucdn.com/v2/storages/?token=jasdhjshad234234jh" --header "Content-Type: application/json" -d '{"action":"change_ftp_password", "region": "north-america"}'

Example

HTTP/1.1 200 OK
Date: Tue, 24 Nov 2015 11:03:39 GMT
Server: Apache/2.4.7 (Ubuntu)
X-Powered-By: PHP/5.5.9-1ubuntu4.14
Content-Length: 41
Content-Type: application/json; charset=utf-8

{
    "new_ftp_password": "dd9028f5f3ed79408e"
}

Storage FTP

Returns information for a particular UCDN storage.
GET https://api.ucdn.com/v2/storage/{id}
This item returns the following information
Name Flags Description
id int The identificator of this storage instance
container string The name of this storage
ftp_host string FTP host for this storage
ftp_user string FTP user for this storage
ftp_password string FTP password for this storage
region string The geo region this storage is in
synchronized_with_storage string Id of a storage which is synchronized with this one if there is one.
This request returns one of the following messages
Status Flags Description
200 json Information for this storage
404 json No active storage found message
532 json Error message

Example

curl --include --request GET "https://api.ucdn.com/v2/storage/1/?token=acf0230d03f5b71d7252e336106f7338"

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:03:12 GMT
Server: Apache
X-Powered-By: PHP/5.6.8-pl0-gentoo
X-Cache: hit
Vary: Accept-Encoding
Content-Length: 200
Content-Type: application/json; charset=utf-8

{
    "id": 1,
    "container": "level-3-logs",
    "ftp_host": "north-america.upload.cdn13.com",
    "ftp_user": "1000121.1000121",
    "ftp_password": "ftppassword",
    "region": "north-america",
    "synchronized_with_storage": null
}

Storage consumed size

Returns utilisation information for this storage. How big it is and how many objects there are.
GET https://api.ucdn.com/v2/storage/{id}/size
This item returns the following information
Name Flags Description
bytes int Number of bytes consumed on this storage
objects int Number files and folders on this storage
This request returns one of the following messages
Status Flags Description
200 json Consumed size
404 json No active storage found message
532 json Error message

Example

curl --include --request GET "https://api.ucdn.com/v2/storage/1/size/?token=acf0230d03f5b71d7252e336106f7338"

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:03:11 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.16
X-Cache: miss
Vary: Accept-Encoding
Content-Length: 23
Content-Type: application/json; charset=utf-8

{
    "bytes": 0,
    "objects": 0
}

Remove storage

Removes an UCDN storage. To remove a storage there are few preconditions: it must be empty and there must be no cache zone using it as its origin.
DELETE https://api.ucdn.com/v2/storage/{id}
This request returns one of the following messages
Status Flags Description
200 json Message for successful deletion
404 json No active storage found message
532 json Error message
504 json Storage backend failed

Example

curl --include --request DELETE "https://api.ucdn.com/v2/storage/2/?token=acf0230d03f5b71d7252e336106f7338"

 

Response

HTTP/1.1 200 OK
Date: Mon, 29 Jun 2015 08:10:35 GMT
Server: Apache
X-Powered-By: PHP/5.6.8-pl0-gentoo
Vary: Accept-Encoding
Content-Length: 33
Content-Type: application/json; charset=utf-8

{
    "message": "Storage was deleted"
}

Sync storages

You can sychronize two storages with this API call. Once synced the two storages will be identical. Adding or deleting files from one of them will result in the same files being added or deleted in the syched storage. This is true the both directions. In addition cache zones which use either of them as an origin will start to use the closest one automatically. Note that adding or deleting files will have a minimum delay before being replicated on the synched origin.
PATCH https://api.ucdn.com/v2/storage/{id}/sync
This request returns one of the following messages
Status Flags Description
200 json Message for successful synchronization
532 json Error message
504 json Storage backend failed
This request expects the following parameters
Name Flags Validation Default Description
synchronize_with integer 
required
Valid id of an other storage container.   Identifies the container with which this one will be synchronized.

Example

curl --include --request PATCH "https://api.ucdn.com/v2/storage/1/sync/?token=acf0230d03f5b71d7252e336106f7338" --header "Content-Type: application/json" -d '{"synchronize_with": 2}'

Remove synchronization

Remove synchronization between storages while leaving the both of the them the same in any other way. This means you will have two separate storages after this API call. You need to call this method only once for just one of the two synchronized storages.
DELETE https://api.ucdn.com/v2/storage/{id}/sync
This request returns one of the following messages
Status Flags Description
200 json Message for success
404 json No such storage found message
532 json Error message
504 json Storage backend failed

Example

curl --include --request DELETE --header "X-UCDN-Token: jasdhjshad234234jh" "https://api.ucdn.com/v2/storage/2/sync/"

Author: UCDN
Last update: 2018-03-01 12:10