Connecting to softlayer object storage using opens

2019-08-13 01:11发布

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条回答
叛逆
2楼-- · 2019-08-13 01:45

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

查看更多
登录 后发表回答