Created
January 18, 2017 03:28
-
-
Save mudone/3c6428a6bfb3728ba047f5f59bfd145c to your computer and use it in GitHub Desktop.
OVH Cloud Storage Api Error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is my PHP Code: | |
================================================================= | |
<?php | |
require 'vendor/autoload.php'; | |
use OpenCloud\OpenStack; | |
//https://storage.bhs1.cloud.ovh.net/v1/AUTH_ad412206eda94f58a291ba2706b8c3cf/gifpik | |
//ad412206eda94f58a291ba2706b8c3cf | |
$client = new OpenStack('https://auth.cloud.ovh.net/v2.0', array( | |
'username' => '[email protected]', // this is replaced with my login username in real code | |
'password' => 'xxx', // this is replaced with password in real code | |
'tenantId' => 'ad412206eda94f58a291ba2706b8c3cf', | |
)); | |
$service = $client->objectStoreService('swift', 'BHS1'); | |
$container = $service->getContainer('gifpik'); | |
================================================================== | |
This is Error stack: | |
PHP Fatal error: Uncaught Guzzle\Http\Exception\ClientErrorResponseException: Client error response | |
[status code] 401 | |
[reason phrase] Unauthorized | |
[url] https://auth.cloud.ovh.net/v2.0/tokens in /srv/http/sites/tools/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:43 | |
Stack trace: | |
#0 /srv/http/sites/tools/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(145): Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Message\Response)) | |
#1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher)) | |
#2 /srv/http/sites/tools/vendor/symfony/event-dispatcher/EventDispatcher.php(184): call_user_func(Array, Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher)) | |
#3 /srv/http/sites/tools/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDi in /srv/http/sites/tools/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php on line 43 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment