Enable your container(s) for public CDN access
- If you primarily wish to use the Control portal:
- Log in to the Control portal, and navigate to Storage -> Object Storage.
- Select the account then the DC where your containers exist.
- Click once on a container you wish to make public.
- On the right-hand pane, click the “Enable CDN” checkbox.
- Repeat steps (c) and (d) for each container you wish to make accessible via your EdgeCast account.
- Using the steps (a) through (c) in Part 2, determine what the “AUTH_abcdef12-3456-7890-..." part of your account URL is and make a note of it.
- Alternatively, through the Object Storage API full API details available at OpenStack and SLDN:
- Authenticate against the Object Storage cluster where your containers exist. For the below examples we’ll assume your files are primarily stored in the DAL05 cluster, and we’ll use to curl get the information we need.
- An example authentication command with curl may look like this:
- In a successful auth response, you’ll receive an HTTP 200 and receive a header called “X-Storage-Url”. Make a note of this URL as it is the base URL to your object storage account. For example: https://dal05.objectstorage.softlayer.net/v1/AUTH_[your token here].
- Also take note of the X-Auth-Token specified in the header, since you will need it to identify yourself securely in the next API request. For illustration we’ll assume we were givenone of “AUTH_tk12345”.
- Note that the full URL to a specific container like “mycontainer” would simply be appended to this URL, for instance: https://dal05.objectstorage.softlayer.net/v1/AUTH_[your token here]/mycontainer
- Issue an HTTP POST against the container URL and include the “X-Container-Read:.r:*" header, to indicate it can be read publicly — in this case by EdgeCast. For instance:
curl -i -X POST https://dal05.objectstorage.softlayer.net/v1/AUTH_[your token here]/mycontainer -H "X-Auth-Token: AUTH_tk12345" -H "X-Container-Read:.r:*"
- Repeat step (f) for each container you wish to make accessible via your EdgeCast account. In each case you should receive an HTTP 204 response.
Note that if you only have one object storage account, you’ll only see a DC list rather than an account list.
curl -i https://dal05.objectstorage.softlayer.net/auth/v1.0 -H "X-Auth-User:youruser:yourusername" -H "X-Auth-Key:yourapikey"
Add a Customer Origin and Edge CNAME at EdgeCast
- Log in to the EdgeCast account portal.
- For the platform/media type (HTTP large, HTTP small, etc.) you wish to connect to Object Storage, navigate to that menu and click “Customer Origin”.
- Add a new Customer Origin with the following details:
- Directory name: (or whatever name you wish) sl-dal05
- Hostname or IP: http://dal05.objectstorage.softlayer.net:80
- HTTP Host Header (should be filled in automatically): dal05.objectstorage.softlayer.net
- Click the Add button to save the new origin.
- From the same platform/media type menu, click “Edge CNAMEs”.
- Add a new CNAME with the following details:
- New Edge Cname:(or whatever name you wish)slcdn01.example.com
- Points To: Customer Origin
- Origin Directory: (the Customer Origin directory you added in step 3)
- Directory Path: /v1/AUTH_[your token here]
- Click the Add button to save the new CNAME.
- Add the CNAME record to your domain’s DNS records to point to the “Points To” column on the resulting screen, omitting the “http://” portion.
Note that adding a CNAME for the origin is not required if you wish to simply use the “based URL".
Note: if you wish to tie this CNAME to a specific container on your account, also be sure to append “/mycontainer” to the end of this path.
Linking to content in Object Storage via the CDN
- Determine Base URL:
- If you added a CNAME for your Customer Origin, use that as the basis for your URL (for instance, http://slcdn01.example.com).
- If you did not add a CNAME for your Customer Origin use the long form corresponding to your base Edgecast URL plus the above “Directory Path” component of what would have otherwise been used in a CNAME; for instance: http://wpc.ZZZZ.edgecastcdn.net/80ZZZZ/sl-dal05/v1/AUTH_[your token here]
- Determine Container URL:
- If you did not link the CNAME to a specific container, append the container name to the base URL formed in step 1. For instance, a base link to the “mycontainer” container for a CNAME would be “http://slcdn01.example.com/mycontainer”.
- Determine Object URL:
- Append the path within your container of the content you wish to link to. For instance, if you have an object within “mycontainer” called “images/ghost.gif”, the CNAME based link would be “http://slcdn01.example.com/mycontainer/images/ghost.gif”.
- If you did link the CNAME to a specific container, the same steps apply above, but you only need to append the Object URL to the CNAME. For instance, if you set up a CNAME called and linked it to the “mycontainer” container, the object URL for the static.slcdn01.example.com “images/ghost.gif” object would then become “http://static.slcdn01.example.com/images/ghost.gif”.