Skip to content

Commit 7de4609

Browse files
author
Jamie Hannaford
authored
Update generate_token.php
1 parent 92f8acb commit 7de4609

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed
Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
<?php
22

3-
require __DIR__ . '/../../../vendor/autoload.php';
3+
require 'vendor/autoload.php';
44

5+
use GuzzleHttp\Client;
6+
use GuzzleHttp\HandlerStack;
7+
use OpenStack\Identity\v2\Service;
8+
use OpenStack\Common\Transport\Utils as TransportUtils;
59
use OpenStack\OpenStack;
610

7-
$client = new OpenStack;
8-
9-
$objectStore = $client->objectStoreV2([
10-
'region' => 'RegionOne',
11-
//'debug' => true,
11+
$httpClient = new Client([
12+
'base_uri' => TransportUtils::normalizeUrl(getenv('OS_AUTH_URL')),
13+
'handler' => HandlerStack::create(),
1214
]);
15+
16+
$options = [
17+
'authUrl' => 'https://example.com:5000/v2.0',
18+
'region' => 'RegionOne',
19+
'username' => 'foo',
20+
'password' => 'bar',
21+
'tenantName' => 'baz',
22+
'identityService' => Service::factory($httpClient),
23+
];
24+
25+
$openstack = new OpenStack($options);

0 commit comments

Comments
 (0)