Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. root@sandbox:/home/user# cat test.php
  2. <?php
  3. // Define the path to the library
  4. $libPath = '/home/user/php-opencloud-1.6.0/lib';
  5.  
  6. // Include the autoloader
  7. require_once $libPath . '/php-opencloud.php';
  8.  
  9. $endpoint = 'http://192.168.10.4:5000/v2.0/tokens';
  10. $credentials = array(
  11. 'username' => 'admin',
  12. 'password' => '12345678',
  13. 'tenantId' => '8e943197eff6488saf7c8fd287caf36d',
  14. );
  15.  
  16. $conn = new \OpenCloud\OpenStack($endpoint, $credentials);
  17. $compute = $conn->Compute('compute', 'RegionOne');
  18. ?>
  19.  
  20. root@sandbox:/home/user# php test.php
  21. PHP Fatal error: Uncaught exception 'OpenCloud\Common\Exceptions\AuthenticationError' with message 'Authentication failure, status [404], response [{"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}]' in /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/OpenStack.php:721
  22. Stack trace:
  23. #0 /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/OpenStack.php(591): OpenCloud\OpenStack->authenticate()
  24. #1 /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/OpenStack.php(652): OpenCloud\OpenStack->checkExpiration()
  25. #2 /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/Common/Service.php(337): OpenCloud\OpenStack->serviceCatalog()
  26. #3 /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/Common/Service.php(68): OpenCloud\Common\Service->getEndpoint('compute', 'compute', 'RegionOne', 'publicURL')
  27. #4 /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/Common/Nova.php(62): OpenCloud\Common\Service->__construct(Object(OpenCloud\OpenStack), 'compute', 'compute', 'RegionOne', 'publicURL')
  28. #5 /home/jasons/php-opencloud-1.6.0/lib/Op in /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/OpenStack.php on line 721
  29. root@sandbox:/home/jasons#
  30.  
  31. root@controller:~# keystone endpoint-list
  32. WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
  33. +----------------------------------+-----------+-------------------------------------------+-------------------------------------------+-------------------------------------------+----------------------------------+
  34. | id | region | publicurl | internalurl | adminurl | service_id |
  35. +----------------------------------+-----------+-------------------------------------------+-------------------------------------------+-------------------------------------------+----------------------------------+
  36. | 18f09fca47324f08967f3baef0a287a3 | RegionOne | http://192.168.10.4:8776/v1/%(tenant_id)s | http://192.168.10.4:8776/v1/%(tenant_id)s | http://192.168.10.4:8776/v1/%(tenant_id)s | b204bc605db245a3879290d07b701c01 |
  37. | 6366559f5df241bc88a38ddedb81e8bb | RegionOne | http://192.168.10.4:8773/services/Cloud | http://192.168.10.4:8773/services/Cloud | http://192.168.10.4:8773/services/Admin | 75b817342a604c2da0141893d35db473 |
  38. | 76e5d78f4d1a474986627e59dd7c809d | RegionOne | http://192.168.10.4:9292 | http://192.168.10.4:9292 | http://192.168.10.4:9292 | 046f9fdfa80e4e1faa75cd61dff186bb |
  39. | d256d9e54c5b48e4beed4de8a1b238fb | RegionOne | http://192.168.10.4:8774/v2/%(tenant_id)s | http://192.168.10.4:8774/v2/%(tenant_id)s | http://192.168.10.4:8774/v2/%(tenant_id)s | 4446e22296d1495cb2989731b2c6aa21 |
  40. | dbb381d57ed148f08a8606cb22201bd2 | RegionOne | http://192.168.10.4:5000/v2.0 | http://192.168.10.4:5000/v2.0 | http://192.168.10.4:35357/v2.0 | 15c3478a3ddd4c4b995c4ec0282ac1ca |
  41. +----------------------------------+-----------+-------------------------------------------+-------------------------------------------+-------------------------------------------+----------------------------------+
  42. root@controller:~#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement