Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add create_multiple_clusters.php
  • Loading branch information
ekasitk committed Feb 15, 2018
commit 77c025ca46729c7fa6470d6c22ea485fad88b0cc
41 changes: 41 additions & 0 deletions samples/data_processing/cluster/create_multiple_clusters.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

require 'vendor/autoload.php';

use OpenStack\OpenStack;

$openstack = new OpenStack([
'authUrl' => '{authUrl}',
'user' => [
'name' => '{userName}',
'password' => '{password}',
'domain' => ['name' => '{userDomain}'],
],
'scope' => [
'project' => [
'name' => '{projectName}',
'domain' => ['name' => '{projectDomain}'],
],
],
]);

$sahara = $openstack->dataProcessingV1(['region' => '{region}']);

$options = [
'pluginName' => '{pluginName}',
'hadoopVersion' => '{hadoopVersion}',
'clusterTemplateId' => '{clusterTemplateId}',
'defaultImageId' => '{defaultImageId}',
//user keypair id is optional
'userKeypairId' => '{userKeypairId}',
'name' => '{name}',
'neutronManagementNetwork' => '{neutronManagementNetworkId}',
'count' => '{count}',
//optional
'clusterConfigs' => ['foo' => 'bar'],
];

$clusters = $sahara->createCluster($options);
foreach ($clusters as $cluster) {
print_r($cluster);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add type hint

}