Scalr\Service\Aws\Rds\V20130110\RdsApi::deleteDBInstance PHP Метод

deleteDBInstance() публичный Метод

The DeleteDBInstance API deletes a previously provisioned RDS instance. A successful response from the web service indicates the request was received correctly. If a final DBSnapshot is requested the status of the RDS instance will be "deleting" until the DBSnapshot is created. DescribeDBInstance is used to monitor the status of this operation. This cannot be canceled or reverted once submitted
public deleteDBInstance ( string $dBInstanceIdentifier, boolean $skipFinalSnapshot = null, string $finalDBSnapshotIdentifier = null ) : DBInstanceData
$dBInstanceIdentifier string The DB Instance identifier for the DB Instance to be deleted.
$skipFinalSnapshot boolean optional Determines whether a final DB Snapshot is created before the DB Instance is deleted
$finalDBSnapshotIdentifier string optional The DBSnapshotIdentifier of the new DBSnapshot created when SkipFinalSnapshot is set to false
Результат Scalr\Service\Aws\Rds\DataType\DBInstanceData Returns created DBInstance
    public function deleteDBInstance($dBInstanceIdentifier, $skipFinalSnapshot = null, $finalDBSnapshotIdentifier = null)
    {
        $result = null;
        $options = array('DBInstanceIdentifier' => (string) $dBInstanceIdentifier);
        if ($skipFinalSnapshot !== null) {
            $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->DeleteDBInstanceResult)) {
                throw new RdsException(sprintf(self::UNEXPECTED, 'delete DBIntance'));
            }
            $result = $this->_loadDBInstanceData($sxml->DeleteDBInstanceResult->DBInstance);
        }
        return $result;
    }