Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@sandbox:/home/user# cat test.php
- <?php
- // Define the path to the library
- $libPath = '/home/user/php-opencloud-1.6.0/lib';
- // Include the autoloader
- require_once $libPath . '/php-opencloud.php';
- $endpoint = 'http://192.168.10.4:5000/v2.0/tokens';
- $credentials = array(
- 'username' => 'admin',
- 'password' => '12345678',
- 'tenantId' => '8e943197eff6488saf7c8fd287caf36d',
- );
- $conn = new \OpenCloud\OpenStack($endpoint, $credentials);
- $compute = $conn->Compute('compute', 'RegionOne');
- ?>
- root@sandbox:/home/user# php test.php
- 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
- Stack trace:
- #0 /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/OpenStack.php(591): OpenCloud\OpenStack->authenticate()
- #1 /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/OpenStack.php(652): OpenCloud\OpenStack->checkExpiration()
- #2 /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/Common/Service.php(337): OpenCloud\OpenStack->serviceCatalog()
- #3 /home/jasons/php-opencloud-1.6.0/lib/OpenCloud/Common/Service.php(68): OpenCloud\Common\Service->getEndpoint('compute', 'compute', 'RegionOne', 'publicURL')
- #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')
- #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
- root@sandbox:/home/jasons#
- root@controller:~# keystone endpoint-list
- WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
- +----------------------------------+-----------+-------------------------------------------+-------------------------------------------+-------------------------------------------+----------------------------------+
- | id | region | publicurl | internalurl | adminurl | service_id |
- +----------------------------------+-----------+-------------------------------------------+-------------------------------------------+-------------------------------------------+----------------------------------+
- | 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 |
- | 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 |
- | 76e5d78f4d1a474986627e59dd7c809d | RegionOne | http://192.168.10.4:9292 | http://192.168.10.4:9292 | http://192.168.10.4:9292 | 046f9fdfa80e4e1faa75cd61dff186bb |
- | 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 |
- | 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 |
- +----------------------------------+-----------+-------------------------------------------+-------------------------------------------+-------------------------------------------+----------------------------------+
- root@controller:~#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement