It looks like Softlayer auth 1.0 endpoint returns a response in a format which is not supported by Libcloud.
Does Softlayer support auth v2.0 or v3.0? If so, please try using that, but keep in mind that support for auth v3.0 is only available in trunk at the moment. On Wed, Oct 8, 2014 at 5:51 PM, Jesus arteche <chechu.li...@gmail.com> wrote: > Hey guys, > I'm trying to connect to object store in SoftLayer, which is based in > OpenStack Swift. I have this code: > > from pprint import pprint > from prettytable import PrettyTable > from libcloud.storage.types import Provider > from libcloud.storage.providers import get_driver > > > cls = get_driver(Provider.OPENSTACK_SWIFT) > > driver = cls('IBMOSxxxxx:xxxxx', 'xxxxxxxxxxxxxxxxxxxxxx', > region='ams01', > ex_force_auth_url=' > https://ams01.objectstorage.softlayer.net/auth/v1.0', > ex_force_service_type='object-store', > ex_force_auth_version='1.0', > ex_force_service_name='cloudFiles') > > > print(driver.list_containers()) > > And I got the following error: > > > # -------- begin 140243148470736 request ---------- > curl -i -X GET -H 'Host: ams01.objectstorage.softlayer.net' -H > 'X-Auth-Key: > XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' -H 'X-Auth-User: IBMOSXXXXX-x:xxxxx' -H > 'Accept-Encoding: gzip,deflate' -H 'X-LC-Request-ID: 14024314847xxxxx' -H > 'Content-Type: application/json; charset=UTF-8' -H 'Accept: > application/json' -H 'User-Agent: libcloud/0.15.1 (OpenStack Swift) ' > --compress https://ams01.objectstorage.softlayer.net:443/auth/v1.0 > # -------- begin 140243148470736:XXXXXXXXXXX response ---------- > HTTP/1.1 200 OK > Content-Length: 780 > X-Trans-Id: tx924c4311413b4646a5997-xxxxxxxxxx > X-Auth-Token-Expires: 28743 > X-Auth-Token: AUTH_tk508b2XXXXXXXXXXXXXXXX > X-Storage-Token: AUTH_tk508bXXXXXXXXXXXXXXXX > Date: Wed, 08 Oct 2014 09:27:13 GMT > X-Storage-Url: > > https://ams01.objectstorage.softlayer.net/v1/AUTH_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > Content-Type: text/html; charset=UTF-8 > > {"clusters": {"lon02": " > https://lon02.objectstorage.softlayer.net/auth/v1.0/", > "dal05": "https://dal05.objectstorage.softlayer.net/auth/v1.0/", "ams01": > " > https://ams01.objectstorage.softlayer.net/auth/v1.0/", "tor01": " > https://tor01.objectstorage.softlayer.net/auth/v1.0/", "hkg02": " > https://hkg02.objectstorage.softlayer.net/auth/v1.0/", "sjc01": " > https://sjc01.objectstorage.softlayer.net/auth/v1.0/", "sng01": " > https://sng01.objectstorage.softlayer.net/auth/v1.0/", "mel01": " > https://mel01.objectstorage.softlayer.net/auth/v1.0/"}, "storage": > {"default": "public", "public": " > https://ams01.objectstorage.softlayer.net/v1/AUTH_XXXXXXXXXXXXXXXXXXXXXX", > "private": " > > https://ams01.objectstorage.service.networklayer.com/v1/AUTH_XXXXXXXXXXXXXXXXXXXXXXxx > "}} > # -------- end XXXXXXXXXXXXXXXXXXXXXXx response ---------- > > Traceback (most recent call last): > File "../../LibCloud_examples/object_storage_connection.py", line 25, in > <module> > print(driver.list_containers()) > File > > "/usr/local/lib/python2.7/dist-packages/apache_libcloud-0.15.1-py2.7.egg/libcloud/storage/base.py", > line 216, in list_containers > return list(self.iterate_containers()) > File > > "/usr/local/lib/python2.7/dist-packages/apache_libcloud-0.15.1-py2.7.egg/libcloud/storage/drivers/cloudfiles.py", > line 269, in iterate_containers > response = self.connection.request('') > File > > "/usr/local/lib/python2.7/dist-packages/apache_libcloud-0.15.1-py2.7.egg/libcloud/storage/drivers/cloudfiles.py", > line 163, in request > raw=raw) > File > > "/usr/local/lib/python2.7/dist-packages/apache_libcloud-0.15.1-py2.7.egg/libcloud/common/openstack.py", > line 200, in request > raw=raw) > File > > "/usr/local/lib/python2.7/dist-packages/apache_libcloud-0.15.1-py2.7.egg/libcloud/common/base.py", > line 657, in request > action = self.morph_action_hook(action) > File > > "/usr/local/lib/python2.7/dist-packages/apache_libcloud-0.15.1-py2.7.egg/libcloud/common/openstack.py", > line 255, in morph_action_hook > self._populate_hosts_and_request_paths() > File > > "/usr/local/lib/python2.7/dist-packages/apache_libcloud-0.15.1-py2.7.egg/libcloud/common/openstack.py", > line 299, in _populate_hosts_and_request_paths > url = self._ex_force_base_url or self.get_endpoint() > File > > "/usr/local/lib/python2.7/dist-packages/apache_libcloud-0.15.1-py2.7.egg/libcloud/storage/drivers/cloudfiles.py", > line 139, in get_endpoint > name=self._service_name, region=self._service_region) > File > > "/usr/local/lib/python2.7/dist-packages/apache_libcloud-0.15.1-py2.7.egg/libcloud/common/openstack_identity.py", > line 278, in get_endpoint > raise LibcloudError('Could not find specified endpointttt') > libcloud.common.types.LibcloudError: <LibcloudError in None 'Could not find > specified endpoint'> > > > Any idea? >