• 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 IBM Cloud CDN Using OpenStack Swift Client

By Abhishek Ghosh December 9, 2018 7:20 am Updated on December 9, 2018

Upload to IBM Cloud CDN Using OpenStack Swift Client

Advertisement

IBM Cloud CDN needs Pay-as-you-go account. We have not tested the lite version of IBM Cloud Object Storage (free trial version) for the presence of features of OpenStack Swift. In this guide, we will show how to upload objects to IBM Cloud CDN or Object Storage using OpenStack Swift client and our a helper Python script. OpenStack Swift already have long known Python clients. We have a lot of articles on this website on OpenStack Swift. The keystone API is essentially a create, read, update, delete (CRUD) interface. The keystone API is essentially a create, read, update, delete (CRUD) interface. IBM Cloud Object Storage is a low-cost storage solution that can be used for various purposes. The command line is a powerful and flexible method to access object storage.

You should either a GNU/Linux computer or server or MacOS X with iTerm2 properly configured or Microsoft Windows 10 with Ubuntu Bash application with Python pip installed.

 

Required Configuration Files to Upload to IBM Cloud CDN Using OpenStack Swift Client

 

As alternative way, you can install python-swiftclient from apt repository too :

Advertisement

---

Vim
1
apt install python-swiftclient -y

But, age old method is to install using Python pip :

Vim
1
2
3
4
5
# keystone client
pip install python-keystoneclient
 
# swift client
pip install python-swiftclient

What in this website we do : to simplify authentication, we create an openrc file with the credentials to environment variables and load it from .zshrc, bashrc etc files to make it easy. IBM system needs three lines :

Vim
1
2
3
export ST_AUTH=     (https://tor01.objectstorage.softlayer.net/auth/v1.0/ )
export ST_USER=     (IBMOS278685-10:######)
export ST_KEY=      (#############)

You can keep the above script where your .zshrc, bashrc etc files are location.

IBM’s system is configured to work with API, like Rackspace. For username-password system of OpenStack Swift access, we can use this kind of openrc file :

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

We can use wift commands such as :

Vim
1
2
swift stat
swift list

Download and upload objects :

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

You must have that openrc.sh file imported in your .zshrc or .bashrc file. In other words, swift command must be working.

Create this script :

upload.sh
Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
#
# Author : Dr. Abhishek Ghosh
# GNU GPL 3.0
# https://thecustomizewindows.com
#
echo "Script to copy source files/directories to OpenStack Swift Storage"
echo "Supply the source file/directory below:"
read target
echo "Supply the container name below:"
read container
echo " "
swift upload $container $target
finish=`date "+%Y-%m-%d-%H-%M-%S"`
echo "Upload completed at ${finish}"

Make it executable :

Vim
1
2
3
chmod +x upload.sh
 
sh upload.sh

Upon run, it will ask “Supply the source file/directory below:”. You will paste/type the full UNIX path like :

Vim
1
/Users/abhishekghosh/Desktop/cdn

and hit the Return/Enter Key. Then it will ask “Supply the container name below:”. You’ll type only the container name on IBM Cloud and hit the Return/Enter Key.

Upload to IBM Cloud CDN Using OpenStack Swift Client

It will return the message the upload completed with a time stamp. As usually, the required scripts for this guide kept on GitHub.

Required official documentation can be found on IBM’s these web pages :

Vim
1
2
3
4
5
6
7
###
https://console.bluemix.net/docs/infrastructure/content-deliver-network/attach-edgecast-cdn-account-sl-object-storage.html
###
 
###
https://console.bluemix.net/docs/infrastructure/objectstorage-swift/connect-object-storage-using-command-line.html#connecting-to-object-storage-with-the-command-line
###

Tagged With LDVG , didbx9 , monkeyaev , orbitpj9 , partlyc1c , PUL3
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 IBM 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.

  • Deploy OctoPress on OpenStack Swift (HP Cloud)

    Here is How To Deploy OctoPress on OpenStack Swift, Example Given With HP Helion Cloud With Only Python Swift Client & a Custom Shebang Script.

  • Upload to HP Cloud CDN Using OpenStack Swift Client

    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.

  • 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.

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