softlayer / softlayer-object-storage-python

SoftLayer Object Storage Python Client
Other
19 stars 30 forks source link

How to get cdn_url - Not getting cdn_url None #42

Open ashokrkm opened 9 years ago

ashokrkm commented 9 years ago

what is the right way to get cdn_url from object_storage? after doing prime_cd and get_info, cdn_url is None

  >>> sl_storage = object_storage.get_client('###', '###',datacenter='sjc01')
  >>> f=c['YUk1-27-Apr-15-10-33-04.xml']
  >>> f.prime_cdn()
  f<object_storage.transport.Response object at 0x7f65480ac5d0>
  >>> f.get_info()
  {'cdn_url': None, 'hash': '74be24b6ddb41357275dd3ad2a2f4cc9', 'name': 'YUk1-27-Apr-15-10-33-04.xml', 'url': u'https://sjc01.objectstorage.softlayer.net/v1/AUTH_e3f9614e-c713-4151-a633-45d4a4d1381b/foo/YUk1-27-Apr-15-10-33-04.xml', 'cdn_ssl_url': None, 'manifest': None, 'last_modified': 'Wed, 10 Jun 2015 17:47:26 GMT', 'meta': {}, 'content_encoding': None, 'content_type': 'text/xml', 'path': 'foo/YUk1-27-Apr-15-10-33-04.xml', 'container': 'foo', 'cache_control': None, 'size': 2536}
  >>> f=c['YUk1-27-Apr-15-10-33-04.xml']
  >>> f.get_info()
  {'cdn_url': None, 'hash': '74be24b6ddb41357275dd3ad2a2f4cc9', 'name': 'YUk1-27-Apr-15-10-33-04.xml', 'url': u'https://sjc01.objectstorage.softlayer.net/v1/AUTH_e3f9614e-c713-4151-a633-45d4a4d1381b/foo/YUk1-27-Apr-15-10-33-04.xml', 'cdn_ssl_url': None, 'manifest': None, 'last_modified': 'Wed, 10 Jun 2015 17:47:26 GMT', 'meta': {}, 'content_encoding': None, 'content_type': 'text/xml', 'path': 'foo/YUk1-27-Apr-15-10-33-04.xml', 'container': 'foo', 'cache_control': None, 'size': 2536}
  >>> 
gtnx commented 8 years ago

@KCastiglione Use StorageObject.load() instead of .get_info(). There's a cdn flag.

f.load(cdn=True)
f.get_info()