• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Upload to HP Cloud CDN Using OpenStack Swift Client

By Abhishek Ghosh January 18, 2015 3:36 am Updated on January 18, 2015

Upload to HP Cloud CDN Using OpenStack Swift Client

Advertisement

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.

Advertisement

---

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 :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
 
# 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*
export OS_AUTH_URL=https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
 
# With the addition of Keystone we have standardized on the term **tenant**
# as the entity that owns the resources.
export OS_TENANT_ID=xxxxxxxxxxxxxxxxx
export OS_TENANT_NAME="xxxxxxxxxxxx-Project"
 
# In addition to the owning entity (tenant), openstack stores the entity
# performing the action as the **user**.
export OS_USERNAME="yourusername"
 
# With Keystone you pass the keystone password.
echo "Please enter your OpenStack Password: "
read -sr OS_PASSWORD_INPUT
export OS_PASSWORD=$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.
export OS_REGION_NAME="region-a.geo-1"
# 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 :

Vim
1
2
3
4
5
6
export OS_AUTH_URL=https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
export OS_TENANT_ID=xxxxxxxxxxxxxx
export OS_TENANT_NAME="xxxxxxxxxxx-Project"
export OS_USERNAME="yourusername"
export OS_PASSWORD="yourpassword"
export OS_REGION_NAME="region-a.geo-1"

As we are using Oh-My-ZSH / ZSH shell, we will simply open the file at $HOME :

Vim
1
nano .zshrc

and add the thing on the bottom of the file. Then load the environment :

Vim
1
source .zshrc

You have to install the clients like written in the older Getting Started guide.

Upload to HP Cloud CDN Using OpenStack Swift Client
 

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 :

Vim
1
http://docs.openstack.org/cli-reference/content/swiftclient_commands.html

To test your settings you can run :

Vim
1
swift stat

It will give you an output like this :

Vim
1
2
3
4
5
6
7
8
9
Account: xxxxxxxxxxxx
   Containers: 7
      Objects: 345
        Bytes: 116969
Accept-Ranges: bytes
   Connection: keep-alive
  X-Timestamp: 1416220171.44924
   X-Trans-Id: ttttttttttttttttttttttttt
Content-Type: text/plain; charset=utf-8

If you run this command :

Vim
1
swift list

You will get the list of the containers. If you have a container named test, if you run :

Vim
1
swift list test

You will get the list of the stuffs inside the container. Suppose, you downloaded that pdf guide on OpenStack docs :

Vim
1
wget http://docs.openstack.org/api/openstack-object-storage/1.0/os-objectstorage-devguide-1.0.pdf

If you run this kind of command :

Vim
1
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.

Tagged With paperuri:(0788ef4e94fdc08227dec5770ff19381)
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Upload to HP Cloud CDN Using OpenStack Swift Client

  • Python Script to Upload Files to OpenStack Swift (HP Cloud CDN)

    Here is a Simple Python Script to Upload Files to OpenStack Swift, for Our Case HP Cloud CDN. Very easy to use from Mac or Linux Server.

  • Upload to IBM Cloud CDN Using OpenStack Swift Client

    Here is How Upload to IBM Cloud CDN Using OpenStack Swift Client. We have a helper Python script for the process. IBM Cloud CDN needs Pay-as-you-go account.

  • Upload WordPress Objects to OpenStack Swift (HP Cloud CDN)

    Here is How to Upload WordPress Objects to OpenStack Swift, Working Example is With HP Cloud CDN and W3TC Plugin. Necessity is the Mother.

  • OpenStack Swift & HPCloud CDN PHP Bindings : Basics

    Here is the basics of OpenStack Swift & HPCloud CDN PHP Bindings for the WordPress Plugin developers and those who works with PHP based CMS.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy