Here is How to Upload Images, Java-scripts, CSS Files to HP Cloud CDN Using OpenStack Swift Python Client From OS X or GNU Linux Terminal. You basically can use this primitive method to upload static contents of WordPress to HP Cloud CDN. The PHP Binding for HP Cloud CDN is unusable with WordPress due to unknown reason. Not everyone can easily use OpenStack Swift Client – neither good guide is available for free anywhere, nor so detailed steps are written for the common users. We hope that, with this guide, users can feel better, as at least it can upload faster than HP Cloud web GUI.
OpenStack Python command-line client is very powerful tool. With this basic idea, you can actually create a script to sync the files. Python is better than PHP plus it is native OpenStack tool, making the basic thing to a WordPress plugin is not very difficult. The practical fact is that – the way the Vendor (read Rackspace, HP Cloud) install OpenStack, the way to authenticate changes with that, which makes the Plugins kind of vendor-locked. Otherwise there are lot of WordPress Plugins for Rackspace Cloud Files, modifying them will not make them working as WordPress HP Cloud CDN Plugin. Learn How to Upload to HP Cloud CDN Using OpenStack Swift Client From This Basic Guide. Your Server is also a computer. You have to filter out the PHP, HTML etc. files on Server’s Public Directory and Upload them to HP Cloud CDN. If you want to develop yourself, do slowly, else wait when we will develop a plugin. There are lot of tools like we wrote in the OpenStack Cloud Tools Python Packages guide.
Upload to HP Cloud CDN Using OpenStack Swift Client : Installing the Python Clients
We published a detailed guide on how to install this tools in HP Helion Public Cloud Getting Started guide. The title of the article possibly was a misnomer. Read that guide if you have not installed the Python Client.
We are using iTerm2-HomeBrew-ZSH on OSX, you have to change the method a bit for GNU Linux – only difference is the profile dot file. We are editing the
.zshrc file here.
Upload to HP Cloud CDN Using OpenStack Swift Client : How To Get the Ready Made Configuration File to Authenticate?
OpenStack RC File is actually present – you can find it in your in OpenStack Horizon control panel on HP Cloud. Then go into Access & Security panel, then into API Access tab. Finally, click on Download OpenStack RC File. You will see, under the Access and Security option, there API Access tab. You will get a button like link to Download OpenStack RC File. It will look like this :
# To use an Openstack cloud you need to authenticate against keystone, which
# returns a **Token** and **Service Catalog**. The catalog contains the
# endpoint for all services the user/tenant has access to - including nova,
# glance, keystone, swift.
# *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We
# will use the 1.1 *compute api*
# With the addition of Keystone we have standardized on the term **tenant**
# as the entity that owns the resources.
# In addition to the owning entity (tenant), openstack stores the entity
# performing the action as the **user**.
# With Keystone you pass the keystone password.
echo "Please enter your OpenStack Password: "
read -sr OS_PASSWORD_INPUT
# If your configuration has multiple regions, we set that information here.
# OS_REGION_NAME is optional and only valid in certain environments.
# Don't leave a blank variable, unset it if it was empty
if [ -z "$OS_REGION_NAME" ]; then unset OS_REGION_NAME; fi
Clean it a bit and add the password thing too :
As we are using
ZSH shell, we will simply open the file at
and add the thing on the bottom of the file. Then load the environment :
You have to install the clients like written in the older Getting Started guide.
Upload to HP Cloud CDN Using OpenStack Swift Client
It is very easy to use. If you run
swift command, you will get a kind of user guide. That is what is written here :
To test your settings you can run :
It will give you an output like this :
Content-Type: text/plain; charset=utf-8
If you run this command :
You will get the list of the containers. If you have a container named test, if you run :
swift list test
You will get the list of the stuffs inside the container. Suppose, you downloaded that pdf guide on OpenStack docs :
If you run this kind of command :
swift upload test os-objectstorage-devguide-1.0.pdf
It will upload the file in the test named container. In this way, you can change the metadata, add headers etc. We will get hacked if we show the real names, so we have shown you another example in the screenshot.
Follow the Author of this article :