Connecting to softlayer object storage using openstack API library php-opencloud

╄→гoц情女王★ 提交于 2019-12-11 11:09:55

问题


Is there someone tried to connect to softlayer object storage using the php-opencloud library?

I got 400 bad response when the library trying to make authentication.

From what I see inside the php-opencloud library, It use authentication method described here, it uses v2/token and softlayer object storage using v1.

Does softlayer object storage that based on the same openstack doesn't support the authentication v2?

I can connect to the object storage using sdk(softlayer-object-storage-php) they provided, it seems use the authentication v1, the problem is that I'm using laravel 5.1 which has the built in filesystem using flysystem(thephpleague/flysystem) that have openstack adapter using php-ocencloud.

It will be very nice and will saving my time to just use the driver rather than I have to build custom driver using softlayer sdk and make me reinvent the wheel.

My Config in the config/filesystems.php

'rackspace' => [
        'driver'    => 'rackspace',
        'username'  => '***username from softlayer***',
        'key'       => '***api key from softlayer**',
        'container' => '***my test container***',
        'endpoint'  => 'https://sng01.objectstorage.softlayer.net/auth/v1',
        'region'    => 'sng01',
        'url_type'  => 'publicURL',
    ],

And I try connect like this :

Storage::disk('rackspace')->exists('test');

And the error is :

ClientErrorResponseException in BadResponseException.php line 43:
    Client error response
    [status code] 400
    [reason phrase] Bad Request
    [url] https://sng01.objectstorage.softlayer.net/auth/v1/tokens

回答1:


Currenlty softlayer only has endpoints for authentication v1, you can see the valid endpoints in the portal (click view credentials http://knowledgelayer.softlayer.com/procedure/how-do-i-access-object-storage-command-line).

Regards



来源:https://stackoverflow.com/questions/34113190/connecting-to-softlayer-object-storage-using-openstack-api-library-php-opencloud

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!