• 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 » Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

By Abhishek Ghosh February 16, 2015 6:33 pm Updated on February 19, 2015

Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

Advertisement

Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad, They Are Written By Rackspace’s Employees. Rackspace uses API Key based access while normally we use Key Stone based Access – HP Cloud uses Key Stone based access too. That is why Racksace’s stuffs will not work with HP Cloud Products including HP Cloud CDN. Skip the first sub header in this article, if you do not want to read criticism and other things. Rackspace Cloud is an OpenStack deployment that uses a custom authentication back end not the Native OpenStack installation. Otherwise, people would port them easily.

 

Changing Data With cURL for OpenStack Swift (HP Cloud CDN) : Why It Feels Hell Like Tough?

 

Releasing Softwares with non cross-vendor usability renders it vendor locked. That is Richard M. Stallman said “Cloud Computing is a Hype.” Basically, his contribution is huge only in Linux! He will know what a Software has inside it. You are reading this article means, you are either advanced user or going to be advanced user. You have understood the fact – HP Cloud’s whole team can not easily make their services very user friendly to a new, novice computer user. We described how to upload the static contents from WordPress to OpenStack Swift (HP Cloud CDN) for the first time on this Planet. We have not discovered anything new. They were written but not in usable form to a new user. Python Swift Client is the best development for OpenStack Swift. Code contribution for OpenStack is highest by HP. HP is hardware company. Their Software License is like Free Software. That is why you’ll see that, HP sponsors Free Software Foundation. Articles like this are useless :

Advertisement

---

Vim
1
http://arstechnica.com/information–technology/2008/09/why–stallman–is–wrong–when–he–calls–cloud–computing–stupid/

The person wrote has not much contribution to Free Software :

Vim
1
https://github.com/segphault?tab=repositories

Now you know very well about PRISM, NSA Spyware activities etc. There is another Ryan Paul, who has no beard – it is a US Political Person. But this Ryan Paul’s Google Plus account is verified :

Vim
1
https://plus.google.com/+RyanPaul/about

All are arranged. Back to the topic – we will demonstrate you using cURL for OpenStack Swift which you can test with HP Cloud CDN. The examples are badly written, one reason is written above and another reason is that – they are employees, not Bloggers or Technical Blog Writers. If Darren Rowse wrote it, he would write more readable way.

Why I do not write Health Blogs? Because I know; I can not make easy to understand. Our brain processes stuffs of different domains in different ways. If you pay me $8000 per month and force to write “How to replace elbow joint”, it will be quite unreadable. Technically sound but practically useless. Also, cURL is not installed on MS Windows – you can install cURL on Windows by reading this guide.

 

Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

 

Take native OpenStack Swift installation and HP Cloud CDN as Equivalent. We do not need to create a container, publish it as CDN etc, via CLI, we have the features on Graphical User Interface. We need to change the Metadata like things – like Expires Header of some objects.

We have four secrets :

  1. All data in the OpenStack RC file (written in Python Swift Client tuts)
  2. Account username and password
  3. The API URLs from where you downloaded the OpenStack RC file
  4. URL of the Container or Object

 

Run this command after modification :

 

Vim
1
curl –v –X GET –H “X-Auth-User: username” –H “X-Auth-Key: password” “https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/”

 

The username and password both are in that OpenStack RC file and is the thing which you use to login to HP Cloud except – the username is in LOWER CASE. This command will definitely work and you’ll get this response :

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
âžœ  ~  curl –v –X GET –H “X-Auth-User: myusername” –H “X-Auth-Key: myPasSword” “https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/”
* Hostname was NOT found in DNS cache
*   Trying 206.164.176.15…
* Connected to region–b.geo–1.identity.hpcloudsvc.com (206.164.176.15) port 35357 (#0)
* TLS 1.2 connection using TLS_RSA_WITH_RC4_128_MD5
* Server certificate: region–b.geo–1.identity.hpcloudsvc.com
* Server certificate: VeriSign Class 3 Secure Server CA – G3
* Server certificate: VeriSign Class 3 Public Primary Certification Authority – G5
> GET /v2.0/ HTTP/1.1
> User–Agent: curl/7.37.1
> Host: region–b.geo–1.identity.hpcloudsvc.com:35357
> Accept: */*
> X–Auth–User: myusername
> X–Auth–Key: myPasSword
>
< HTTP/1.1 200 OK
< Date: Sun, 08 Feb 2015 11:06:51 GMT
* Server Apache is not blacklisted
< Server: Apache
< Vary: X–Auth–Token
< Content–Length: 277
< Content–Type: application/json
< Connection: keep–alive
<
* Connection #0 to host region–b.geo–1.identity.hpcloudsvc.com left intact
{“version”: {“status”: “stable”, “updated”: “2012-06-20T16:55:53.340Z”, “id”: “v2.0”, “links”: [{“href”: “https://docs.hpcloud.com/api/identity”, “type”: “text/html”, “rel”: “describedby”}, {...}

Have you received the X-Auth-Key? See the output above ! The official guides are described in this way :

Vim
1
2
3
4
curl –i –X POST –H “Origin: example.com” –H “X-Auth-Token:
48e17715dfce47bb90dc2a336f63493a“
https://storage.example.com/v1/MossoCloudFS_c31366f1–9f1c–40dc–a
b92–6b3f0b5a8c45/ephotos

Rackspace wrote the guides – MossoCloud is Rackspace Cloud Sites. Now, you have a CDN API URL which looks like this :

Vim
1
https://region–a.geo–1.objects.hpcloudsvc.com/v1/1234567890123

If your container’s name is tcw-all-january and inside its root, there is a file named apple-touch-icon-144x144-precomposed.png, then the relative URI becomes :

Vim
1
./tcw–all–january/apple–touch–icon–144×144–precomposed.png

That dot is what we said above :

Vim
1
https://region–a.geo–1.objects.hpcloudsvc.com/v1/1234567890123

Join these two :

Vim
1
https://region–a.geo–1.objects.hpcloudsvc.com/v1/1234567890123/tcw–all–january/apple–touch–icon–144×144–precomposed.png

We normally use the CDN URLs which has read only function. First test that URI return header which has read and write permission for you :

Vim
1
curl –i https://region–a.geo–1.objects.hpcloudsvc.com/v1/1234567890123/tcw–all–january/apple–touch–icon–144×144–precomposed.png

You’ll get :

Vim
1
2
3
4
5
6
7
8
9
10
HTTP/1.1 200 OK
Content–Length: 19752
Content–Type: image/png
Accept–Ranges: bytes
Last–Modified: Fri, 23 Jan 2015 18:44:58 GMT
Etag: 003372f86df8eb31286cdb7036635139
X–Timestamp: 1422038698.69038
X–Object–Meta–Mtime: 1371802422.000000
X–Trans–Id: txcbfafd0a53604a8aa8f57–0054d74b70
Date: Sun, 08 Feb 2015 11:41:36 GMT
Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

Morons write the documentations in this way :

Vim
1
2
3
4
5
6
7
8
9
10
11
curl –i https://region–a.geo–1.objects.hpcloudsvc.com/v1/1234567890123/tcw–all–january/apple–touch–icon–144×144–precomposed.png
HTTP/1.1 200 OK
Content–Length: 19752
Content–Type: image/png
Accept–Ranges: bytes
Last–Modified: Fri, 23 Jan 2015 18:44:58 GMT
Etag: 003372f86df8eb31286cdb7036635139
X–Timestamp: 1422038698.69038
X–Object–Meta–Mtime: 1371802422.000000
X–Trans–Id: txcbfafd0a53604a8aa8f57–0054d74b70
Date: Sun, 08 Feb 2015 11:41:36 GMT

It is really difficult to understand. Sajal Kayan also suffered, he is quite known person; he initially could not change the meta data (expire headers). Time to time, with complex commands; which is command and which is response becomes difficult to understand.

Text Books has not written to write in that way. It is like, some doctors do not talk properly with the patients! That is a wrong in accordance to the Text books. Patient Should be Explained and Counseled. In the same way, in the Engineering Text books (related to these topics) exactly the same is written – User Might Be Explained.

Human frankly does not talk properly after taking money when a human is dying, how you can expect that his brother will explain which is command and which is output or why -k flag is used? That is why software engineers, doctors all faces a bit “control” by the owner groups. Otherwise, both will not work properly. Basic thing is that, they assume, degree or traditional education will do the things. Owners usually do not have MBA but has better engine to control the MBA. Practical thing.

If you run this for HP Cloud :

Vim
1
curl –X –i –k https://region–a.geo–1.objects.hpcloudsvc.com/v1/1234567890123/tcw–all–january/apple–touch–icon–144×144–precomposed.png

You will get a response :

Vim
1
This method may not be used.%

This means – everything is right, you need to put that Authentication stuff. Firewall is blocking. For a given provider, HP Cloud, if you run :

Vim
1
curl –k https://region–b.geo–1.identity.hpcloudsvc.com:35357

You’ll Get :

Vim
1
“versions”: {“values”: [{“status”: “stable”, “updated”: “2012-06-20T16:55:53.340Z”, “id”: “v1.0”}, {“status”: “stable”, “updated”: “2012-06-20T16:55:53.340Z”, “id”: “v1.1”, “links”: [{“href”: “https://docs.hpcloud.com/api/identity”, “type”: “text/html”, “rel”: “described by”}]}, {“status”: “stable”, “updated”: “2012-06-20T16:55:53.340Z”, “id”: “v2.0”, “links”: [{“href”: “https://docs.hpcloud.com/api/identity”, “type”: “text/html”, “rel”: “described by”}, {“href”: “https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0”, “rel”: “self”}]}, {“status”: “stable”, “updated”: “2013-04-25T16:55:53.340Z”, “id”: “v3.0”, “links”: [{“href”: “https://docs.hpcloud.com/api/v13/identity”, “type”: “text/html”, “rel”: “describedby”}, {“href”: “https://region-b.geo-1.identity.hpcloudsvc.com:35357/v3”, “rel”: “self”}]}]}}%

Collapsed JSON response. Officially, according to HP Cloud CDN docs, you should use this format to update the metadata TTL :

Vim
1
curl –i –k –X POST “X-Auth-Token: PassWord” https://region–a.geo–1.objects.hpcloudsvc.com/v1/1234567890123/tcw–all–january/apple–touch–icon–144×144–precomposed.png “x_ttl: 1024”

You can use :

"X-Auth-User: username" -H "X-Auth-Key: Password"

in place of

"X-Auth-Token: PassWord"

If you are getting :

Vim
1
2
3
4
5
6
7
HTTP/1.1 401 Unauthorized
Content–Length: 131
Content–Type: text/html; charset=UTF–8
X–Trans–Id: txbf160d2639c244afa20ef–0054d7599d
Date: Sun, 08 Feb 2015 12:42:05 GMT
 
<html><h1>Unauthorized</h1><p>This server could not verify that you are authorized to access the document you requested.</p></html>%

Then ask HP Cloud’s Support. It is Firewall which is blocking. You have done 90% right.

Python Middleware is a better way, that is fully different topic. We at least passed you to a point which possibly you were fighting too much.

This Article Has Been Shared 494 Times!

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 Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

  • Cloud and SaaS : Is Cloud Based SaaS Becoming the Mainstream ?

    Cloud Computing is becoming the dominant global trend not only in enterprise IT but also in Private Small Sectors. Better,faster,cheaper is pushing Cloud ahead.

  • Juju on Rackspace Cloud Server : Test Drive with Ubuntu 12.04

    Juju on Rackspace Cloud Server is a test drive in real time. It is some what like driving a F1 car on a busy avenue for the first time in life. Start the Cloud. And the ride is too without wearing helmet – on an Operating System without any smartness – Windows 7 with PuTTY. […]

  • SaaS : Everything You Wanted To Know

    SaaS or Software as a Service is designed by the architecture to be used by the consumer. SaaS is the model oCloud which the general users mostly know to exist.

  • Rackspace Deployment Services Early Access Video Guide

    Rackspace Deployment Services Early Access Video Guide Shows How to Setup Rackspace Cloud Server, Load Balancers, Cloud Database in easy clicks from GUI.

  • Points to Check Before Switching to Cloud Computing

    If you work as a IT service provider you need either to explain the benefits of cloud computing or decide to switch own business, some points to check before switching to Cloud.

Additionally, 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

  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Changing Data With cURL for OpenStack Swift (HP Cloud CDN)," in The Customize Windows, February 16, 2015, January 29, 2023, https://thecustomizewindows.com/2015/02/changing-data-curl-openstack-swift-hp-cloud-cdn/.

Source:The Customize Windows, JiMA.in

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT