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

promoteReadReplica() public method

Promotes a Read Replica DB instance to a standalone DB instance.
public promoteReadReplica ( string $dBInstanceIdentifier, integer $backupRetentionPeriod = null, string $preferredBackupWindow = null ) : DBInstanceData
$dBInstanceIdentifier string
$backupRetentionPeriod integer
$preferredBackupWindow string
return Scalr\Service\Aws\Rds\DataType\DBInstanceData
    public function promoteReadReplica($dBInstanceIdentifier, $backupRetentionPeriod = null, $preferredBackupWindow = null)
    {
        $result = null;
        if ($dBInstanceIdentifier !== null) {
            $options['DBInstanceIdentifier'] = (string) $dBInstanceIdentifier;
        }
        if ($backupRetentionPeriod !== null) {
            $options['BackupRetentionPeriod'] = (int) $backupRetentionPeriod;
        }
        if ($preferredBackupWindow !== null) {
            $options['PreferredBackupWindow'] = (string) $preferredBackupWindow;
        }
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if (!$this->exist($sxml->PromoteReadReplicaResult)) {
                throw new RdsException(sprintf(self::UNEXPECTED, 'promote DBInstance Read Replica'));
            }
            $result = $this->_loadDBInstanceData($sxml->PromoteReadReplicaResult->DBInstance);
        }
        return $result;
    }
RdsApi