• 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 » Change CDN Object Metadata in HP Cloud CDN With cURL

By Abhishek Ghosh June 12, 2015 2:40 pm Updated on June 12, 2015

Change CDN Object Metadata in HP Cloud CDN With cURL

Advertisement

Possibly Most Important Parameter to Change is TTL or Expires. We Have Pointed How To Change CDN Object Metadata in HP Cloud CDN With cURL. We observed to get the data written as metadata but unfortunately we could not change the Expires or TTL. HP Cloud CDN means we are communicating with Akamai CDN Service via HP Cloud OpenStack Swift as HP Cloud’s Customer, it is not exactly easy to predict except being HP’s employee what values can be changes or has bug. There is zero visible effort from HP so far for setting setting the expire far ahead, so this might bring some help to the next person who might be able to write or change the expire or TTL. We are talking about object TTL or Expires. Container expire, TTL etc. should be set to higher.

 

Guide to Read Before Attempting To Change CDN Object Metadata in HP Cloud CDN

 

You should read this guide to authenticate in HP Cloud CDN. This is first step. Second step is learning about unix & epoch time stamp. Some of these values will need it instead of normal time in seconds. Searching the web with Epoch & Unix Timestamp Conversion Tools will give some easy to use tools.

 

Change CDN Object Metadata in HP Cloud CDN With cURL

 

If you hit the button cum dropdown named “View Details” on the Container name on HP Horizon Web GUI Admin panel, after some modification from the web GUI, you will get some data like these :

Advertisement

---

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Container Name
security-garden
Container URL
https://region-a.geo-1.objects.hpcloudsvc.com/v1/xxxxxxxxxx/security-garden
Container Access
Public (access via Container URL)
CDN URLs
http://h3eaa823f452f54f42b7273b36a68e456.cdn.hpcloudsvc.com
https://a248.e.akamai.net/cdn.hpcloudsvc.com/h3eaa823f452f54f42b7273b36a68e456/prodaw2/
CDN Time to Live
1577836800 seconds
Object Count
15
Size
72.8 KB

Note that https://region-a.geo-1.objects.hpcloudsvc.com/v1/xxxxxxxxxx/security-garden. We will need this URL. Use a test container and upload one object via GUI and publish via CDN.

xxxxxxxxxx is basically the project ID or rather OS_TENANT_ID, we are getting ready to use format as URL from Web GUI. security-garden is the container name.

If we do cURL of a file on CDN before the attempt to change any metadata :

Vim
1
http://h3eaa823f452f54f42b7273b36a68e456.cdn.hpcloudsvc.com/center_cloud.gif

We will get these data publicly :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
~  curl -I http://h3eaa823f452f54f42b7273b36a68e456.cdn.hpcloudsvc.com/center_cloud.gif
HTTP/1.1 200 OK
Last-Modified: Tue, 14 Apr 2015 22:33:26 GMT
ETag: "8f5f7aa1cb94c3953664414b35e461d0"
Content-Length: 2231
Accept-Ranges: bytes
Content-Type: image/gif
X-Trans-Id: tx81a9a8fbfc91457e85c0b-00557ad0aa
Cache-Control: public, max-age=0
Expires: Fri, 12 Jun 2015 12:29:30 GMT
Date: Fri, 12 Jun 2015 12:29:30 GMT
Connection: keep-alive

Note these two values :

Vim
1
Cache-Control: public, max-age=0

Vim
1
Expires: Fri, 12 Jun 2015 12:29:30 GMT

If any of the values – Cache-Control: public, max-age= or TTL or Expires is increased on HP Cloud OpenStack Object, it would reflect on the CDN. We can read the previous guide now and fetch the metadata internal URL. Suppose your Auth is HPAuth10_2255, then the command will be :

Vim
1
curl -i -k -X HEAD -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'X-Auth-Token: HPAuth10_2255' https://region-a.geo-1.objects.hpcloudsvc.com/v1/xxxxxxxxxx/security-garden/center_cloud.gif

Try to understand where from the xxxxxxxxxx and /security-garden came from above discussed topic. You will get this response :

Vim
1
2
3
4
5
6
7
8
9
10
HTTP/1.1 200 OK
Content-Length: 13503
Accept-Ranges: bytes
X-Object-Meta-Expires: 2380880912
Last-Modified: Fri, 12 Jun 2015 12:18:21 GMT
Etag: 3805e6d500919bd42889acde9c975363
X-Timestamp: 1434111501.57582
Content-Type: application/json
X-Trans-Id: tx8f3e106cde8e42d6b22e4-00557ad2ac
Date: Fri, 12 Jun 2015 12:38:04 GMT

We should make sure that with our username, we have the full read and write access to the container :

Vim
1
2
3
curl -X POST -H 'X-Auth-Token: HPAuth10_2255' -H 'X-Container-Read: username' https://region-a.geo-1.objects.hpcloudsvc.com/v1/10577961648287/security-garden/
#
curl -X POST -H 'X-Auth-Token: HPAuth10_2255' -H 'X-Container-Write: username' https://region-a.geo-1.objects.hpcloudsvc.com/v1/10577961648287/security-garden/

We can compose a POST request to change the metadata :

Vim
1
curl -i -k -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'X-Auth-Token: HPAuth10_225' -H 'X-CDN-Enabled: True' -H 'X-Object-Meta-Expires: 2380880912' https://region-a.geo-1.objects.hpcloudsvc.com/v1/xxxxxxxxxx/security-garden/center_cloud.gif

Change CDN Object Metadata in HP Cloud CDN With cURL

There are 03 types of Meta – X-Account-Meta, X-Container-Meta and X-Object-Meta. We can see that X-Object-Meta- in that above example and change that X-Object-Meta-Expires: 2380880912 part to :

Vim
1
2
3
4
5
X-Object-Meta-Expires
X-Object-Meta-TTL
X-TTL
X-Delete-After
X-Delete-At

X-Delete-At and X-Delete-After actually not exactly what it sounds to be.

‘X-CDN-Enabled: True’ can be omitted from the command. Only the X-Delete-At needs the unix Epoch timestamp among the variables above. Others are in seconds.

After running a command successfully, we will receive a HTTP 202 response as well as a HTML output declaring the success :

Vim
1
2
3
4
5
6
7
HTTP/1.1 202 Accepted
Content-Length: 76
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txd6ff2bfcd06a4a19a15a5-00557ac7ed
Date: Fri, 12 Jun 2015 11:52:13 GMT
 
<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>%

You will get documentation on official websites OpenStack and HP Cloud.

Tagged With does a cdn have ability to keep metadata

This Article Has Been Shared 499 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 Change CDN Object Metadata in HP Cloud CDN With cURL

  • Cloud Computing India : How Much Safe to Opt for Indian Datacenter

    Cloud Computing India is on the rise despite high bandwidth charges due to less incurred cost for skilled management. But, is your data is secured ?

  • How to Build a Private Cloud

    Building a Private Cloud infrastructure is not very easy for building a Company’s IT Infrastructure. Many brand and Open Source Projects.has various resources.

  • Installing WordPress on Heroku with Rackspace Cloud Database

    Installing WordPress on Heroku with Rackspace Cloud Database is not very tough if you want to host WordPress on Heroku Cloud and use Rackspace Cloud Database.

  • Repairing WordPress Database : Using Cloud Database Server

    Repairing WordPress Database is easy by using Cloud Database Server like from The Rackspace Cloud which provides MySQL database server with PHPmyAdmin software.

  • SSL Certificate for WordPress on Rackspace Cloud Sites

    SSL Certificate for WordPress on Rackspace Cloud Sites needs a bit tweaking to be working flawlessly without duplicate content issue or 404, 500 server errors.

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

  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023
  • 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

About This Article

Cite this article as: Abhishek Ghosh, "Change CDN Object Metadata in HP Cloud CDN With cURL," in The Customize Windows, June 12, 2015, February 1, 2023, https://thecustomizewindows.com/2015/06/change-cdn-object-metadata-in-hp-cloud-cdn-with-curl/.

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