Scalr\Service\Aws\Ec2\V20140615\Ec2Api::deletePlacementGroup PHP Method

deletePlacementGroup() public method

Deletes a placement group from your account.You must terminate all instances in the placement group before deleting it.
public deletePlacementGroup ( string $groupName ) : boolean
$groupName string The name of the placement group.
return boolean Returns true on success
    public function deletePlacementGroup($groupName)
    {
        $result = false;
        $options = array('GroupName' => (string) $groupName);
        $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 delete placement group "%s". It returned "%s"', $options['GroupName'], $sxml->return));
            }
            $result = true;
            $entity = $this->ec2->getEntityManagerEnabled() ? $this->ec2->placementGroup->get($options['GroupName']) : null;
            if ($entity !== null) {
                $this->getEntityManager()->detach($entity);
            }
        }
        return $result;
    }
Ec2Api