Search code examples
cdnibm-cloud-infrastructure

(Softlayer API) How to set Time to Live in cloud storage in softlayer


I refered this document, http://sldn.softlayer.com/reference/Object-Storage-CDN/Set-Time-Live-TTL

my request headers are like below but I get 400 error with this message "NetworkError: 400 Bad Request - http://localhost:8080/cloud/objectstorage"

'X-Context' : 'cdn',
'X-Cdn-Ttl' : 3600,
'Accept' : 'application/json',
'X-Auth-Token' : token

enter image description here


Solution

  • Try this curl:

    curl -i -XPOST -H "X-Cdn-Ttl: 3600" -H "X-Context: cdn"  -H "X-Auth-Token: AUTH_XXXX" https://dal05.objectstorage.softlayer.net/v1/AUTH_6d6s56a-1665-4135-b145-8584d3427299/407608/mycontainer
    
    Replace your token, URL
            The value 407608 is the ID of your account
            mycontainer is the name of the container you wish to edit the Time
    

    Regards