Scalr\Service\Aws\Ec2\V20150415\Ec2Api::createPlacementGroup PHP 메소드

createPlacementGroup() 공개 메소드

Creates a placement group that you launch cluster instances into.You must give the group a name unique within the scope of your account.
public createPlacementGroup ( string $groupName, string $strategy = 'cluster' ) : boolean
$groupName string The name of the placement group.
$strategy string optional The placement group strategy.
리턴 boolean Returns True on success
    public function createPlacementGroup($groupName, $strategy = 'cluster')
    {
        $result = false;
        $options = ['GroupName' => (string) $groupName, 'Strategy' => (string) $strategy];
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if ((string) $sxml->return != 'true') {
                throw new Ec2Exception(sprintf('Amazon Ec2 could not create placement group "%s". It returned "%s"', $options['GroupName'], $sxml->return));
            }
            $result = true;
        }
        return $result;
    }
Ec2Api