Scalr\Service\Aws\Rds\V20141031\RdsApi::deleteDBCluster PHP Method

deleteDBCluster() public method

The DeleteDBCluster action deletes a previously provisioned DB cluster. A successful response from the web service indicates the request was received correctly. When you delete a DB cluster, all automated backups for that DB cluster are deleted and cannot be recovered. Manual DB cluster snapshots of the DB cluster to be deleted are not deleted.
public deleteDBCluster ( string $dBClusterIdentifier, boolean $skipFinalSnapshot = true, string $finalDBSnapshotIdentifier = null ) : DBClusterData
$dBClusterIdentifier string The DB Cluster identifier for the DB Instance to be deleted.
$skipFinalSnapshot boolean optional Determines whether a final DB Snapshot is created before the DB Cluster is deleted
$finalDBSnapshotIdentifier string optional The DBSnapshotIdentifier of the new DBSnapshot created when SkipFinalSnapshot is set to false
return Scalr\Service\Aws\Rds\DataType\DBClusterData Returns deleted DBCluster
    public function deleteDBCluster($dBClusterIdentifier, $skipFinalSnapshot = true, $finalDBSnapshotIdentifier = null)
    {
        $result = null;
        $options = ['DBClusterIdentifier' => (string) $dBClusterIdentifier];
        $options['SkipFinalSnapshot'] = $skipFinalSnapshot ? 'true' : 'false';
        if ($finalDBSnapshotIdentifier !== null) {
            $options['FinalDBSnapshotIdentifier'] = (string) $finalDBSnapshotIdentifier;
            if (isset($options['SkipFinalSnapshot']) && $options['SkipFinalSnapshot'] === 'true') {
                throw new \InvalidArgumentException(sprintf('Specifiying FinalDBSnapshotIdentifier and also setting the ' . 'SkipFinalSnapshot parameter to true is forbidden.'));
            }
        }
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if (!$this->exist($sxml->DeleteDBClusterResult)) {
                throw new RdsException(sprintf(self::UNEXPECTED, 'delete DBCluster'));
            }
            $result = $this->_loadDBClusterData($sxml->DeleteDBClusterResult->DBCluster);
        }
        return $result;
    }
RdsApi