ModifyInstanceGroups modifies the number of nodes and configuration settings of an instance group. The input parameters include the new target instance count for the group and the instance group ID. The call will either succeed or fail atomically.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Modify the size of an existing instance group in a Hadoop cluster.
Unfortunately, there’s no easy way to get the InstanceGroupId. We’ll need to do some queries to to get the data we need.
$emr = new AmazonEMR(); // Look up the data for our job flow $description = $emr->describe_job_flows(array( 'JobFlowIds' => 'j-2PL8AAY8YJ06P' )); // Query the response with an XPath expression to get the InstanceGroupId $instance_group_id = $description->body ->query('descendant-or-self::InstanceGroups/member[Name = "my-hadoop-task-cluster"]/InstanceGroupId') ->first() ->to_string(); $response = $emr->modify_instance_groups(array( 'InstanceGroups' => array( array( 'InstanceGroupId' => $instance_group_id, 'InstanceCount' => 2 ) ) )); // Success? var_dump($response->isOK());
Related Methods
Source
Method defined in services/emr.class.php | Toggle source view (15 lines) | View on GitHub