Skip to content

Commit 77c025c

Browse files
committed
Add create_multiple_clusters.php
1 parent bd2a9a5 commit 77c025c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
require 'vendor/autoload.php';
4+
5+
use OpenStack\OpenStack;
6+
7+
$openstack = new OpenStack([
8+
'authUrl' => '{authUrl}',
9+
'user' => [
10+
'name' => '{userName}',
11+
'password' => '{password}',
12+
'domain' => ['name' => '{userDomain}'],
13+
],
14+
'scope' => [
15+
'project' => [
16+
'name' => '{projectName}',
17+
'domain' => ['name' => '{projectDomain}'],
18+
],
19+
],
20+
]);
21+
22+
$sahara = $openstack->dataProcessingV1(['region' => '{region}']);
23+
24+
$options = [
25+
'pluginName' => '{pluginName}',
26+
'hadoopVersion' => '{hadoopVersion}',
27+
'clusterTemplateId' => '{clusterTemplateId}',
28+
'defaultImageId' => '{defaultImageId}',
29+
//user keypair id is optional
30+
'userKeypairId' => '{userKeypairId}',
31+
'name' => '{name}',
32+
'neutronManagementNetwork' => '{neutronManagementNetworkId}',
33+
'count' => '{count}',
34+
//optional
35+
'clusterConfigs' => ['foo' => 'bar'],
36+
];
37+
38+
$clusters = $sahara->createCluster($options);
39+
foreach ($clusters as $cluster) {
40+
print_r($cluster);
41+
}

0 commit comments

Comments
 (0)