Skip to content

Commit 3c233d8

Browse files
author
Jamie Hannaford
committed
Remove remaining env vars
1 parent ff3a4bd commit 3c233d8

File tree

5 files changed

+22
-57
lines changed

5 files changed

+22
-57
lines changed

samples/LoadBalancer/create-lb.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,16 @@
1515
* limitations under the License.
1616
*/
1717

18-
// Prior to running this script, you must setup the following environment variables:
19-
// * RS_AUTH_URL: your Rackspace authentication URL
20-
// * RS_USERNAME: your Rackspace username
21-
// * RS_API_KEY: your Rackspace API key
22-
// * RS_REGION: the Rackspace Cloud region you want to use
23-
2418
require dirname(__DIR__) . '/../vendor/autoload.php';
2519

2620
use OpenCloud\Rackspace;
2721

28-
$client = new Rackspace(getenv('RS_AUTH_URL'), array(
29-
'username' => getenv('RS_USERNAME'),
30-
'apiKey' => getenv('RS_API_KEY'),
22+
$client = new Rackspace('{authUrl}', array(
23+
'username' => '{username}',
24+
'apiKey' => '{apiKey}',
3125
));
3226

33-
$service = $client->loadBalancerService(null, getenv('RS_REGION'));
27+
$service = $client->loadBalancerService(null, '{region}');
3428

3529
// Create empty object
3630
$lb = $service->loadBalancer();

samples/LoadBalancer/delete-lb.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,16 @@
1515
* limitations under the License.
1616
*/
1717

18-
// Prior to running this script, you must setup the following environment variables:
19-
// * RS_AUTH_URL: your Rackspace authentication URL
20-
// * RS_USERNAME: your Rackspace username
21-
// * RS_API_KEY: your Rackspace API key
22-
// * RS_REGION: the Rackspace Cloud region you want to use
23-
2418
require dirname(__DIR__) . '/../vendor/autoload.php';
2519

2620
use OpenCloud\Rackspace;
2721

28-
$client = new Rackspace(getenv('RS_AUTH_URL'), array(
29-
'username' => getenv('RS_USERNAME'),
30-
'apiKey' => getenv('RS_API_KEY'),
22+
$client = new Rackspace('{authUrl}', array(
23+
'username' => '{username}',
24+
'apiKey' => '{apiKey}',
3125
));
3226

33-
$service = $client->loadBalancerService(null, getenv('RS_REGION'));
27+
$service = $client->loadBalancerService(null, '{region}');
3428

3529
// Retrieve existing LB
3630
$lb = $service->loadBalancer('{loadBalancerId}');

samples/LoadBalancer/list-load-balancers.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,19 @@
1515
* limitations under the License.
1616
*/
1717

18-
//
19-
// Pre-requisites:
20-
// * Prior to running this script, you must setup the following environment variables:
21-
// * OS_AUTH_URL: Your Rackspace Cloud Authentication URL,
22-
// * OS_USERNAME: Your Rackspace Cloud Account Username,
23-
// * RAX_API_KEY: Your Rackspace Cloud Account API KEY, and
24-
// * OS_REGION_NAME: The Rackspace Cloud region you want to use
25-
//
18+
require dirname(__DIR__) . '/../vendor/autoload.php';
2619

27-
require __DIR__ . '/../../vendor/autoload.php';
2820
use OpenCloud\Rackspace;
2921

30-
// 1. Instantiate an Rackspace client.
31-
$client = new Rackspace(getenv('OS_AUTH_URL'), array(
32-
'username' => getenv('OS_USERNAME'),
33-
'apiKey' => getenv('RAX_API_KEY')
22+
$client = new Rackspace('{authUrl}', array(
23+
'username' => '{username}',
24+
'apiKey' => '{apiKey}',
3425
));
3526

36-
// 2. Obtain an LoadBalancer service object from the client.
37-
$region = getenv('OS_REGION_NAME');
38-
$loadBalancerService = $client->loadBalancerService(null, $region);
27+
$service = $client->loadBalancerService(null, '{region}');
3928

40-
// 3. Get load balancers.
4129
$loadBalancers = $loadBalancerService->loadBalancerList();
30+
4231
foreach ($loadBalancers as $loadBalancer) {
4332
/** @var $loadBalancer OpenCloud\LoadBalancer\Resource\LoadBalancer **/
4433
var_dump($loadBalancer);

samples/LoadBalancer/ssl-termination.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,16 @@
1515
* limitations under the License.
1616
*/
1717

18-
// Prior to running this script, you must setup the following environment variables:
19-
// * RS_AUTH_URL: your Rackspace authentication URL
20-
// * RS_USERNAME: your Rackspace username
21-
// * RS_API_KEY: your Rackspace API key
22-
// * RS_REGION: the Rackspace Cloud region you want to use
23-
2418
require dirname(__DIR__) . '/../vendor/autoload.php';
2519

2620
use OpenCloud\Rackspace;
2721

28-
$client = new Rackspace(getenv('RS_AUTH_URL'), array(
29-
'username' => getenv('RS_USERNAME'),
30-
'apiKey' => getenv('RS_API_KEY'),
22+
$client = new Rackspace('{authUrl}', array(
23+
'username' => '{username}',
24+
'apiKey' => '{apiKey}',
3125
));
3226

33-
$service = $client->loadBalancerService(null, getenv('RS_REGION'));
27+
$service = $client->loadBalancerService(null, '{region}');
3428

3529
// Retrieve existing LB
3630
$lb = $service->loadBalancer('{loadBalancerId}');

samples/LoadBalancer/throttle-connections.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,16 @@
1515
* limitations under the License.
1616
*/
1717

18-
// Prior to running this script, you must setup the following environment variables:
19-
// * RS_AUTH_URL: your Rackspace authentication URL
20-
// * RS_USERNAME: your Rackspace username
21-
// * RS_API_KEY: your Rackspace API key
22-
// * RS_REGION: the Rackspace Cloud region you want to use
23-
2418
require dirname(__DIR__) . '/../vendor/autoload.php';
2519

2620
use OpenCloud\Rackspace;
2721

28-
$client = new Rackspace(getenv('RS_AUTH_URL'), array(
29-
'username' => getenv('RS_USERNAME'),
30-
'apiKey' => getenv('RS_API_KEY'),
22+
$client = new Rackspace('{authUrl}', array(
23+
'username' => '{username}',
24+
'apiKey' => '{apiKey}',
3125
));
3226

33-
$service = $client->loadBalancerService(null, getenv('RS_REGION'));
27+
$service = $client->loadBalancerService(null, '{region}');
3428

3529
// Retrieve existing LB
3630
$lb = $service->loadBalancer('{loadBalancerId}');

0 commit comments

Comments
 (0)