Scalr\Service\Aws\Rds\V20130110\RdsApi::createDBSnapshot PHP Method

createDBSnapshot() public method

Creates a DBSnapshot. The source DBInstance must be in "available" state.
public createDBSnapshot ( string $dBInstanceIdentifier, string $dBSnapshotIdentifier ) : DBSnapshotData
$dBInstanceIdentifier string The DB Instance Identifier
$dBSnapshotIdentifier string The identifier for the DB Snapshot.
return Scalr\Service\Aws\Rds\DataType\DBSnapshotData Returns DBSnapshotData on success or throws an exception.
    public function createDBSnapshot($dBInstanceIdentifier, $dBSnapshotIdentifier)
    {
        $result = null;
        $options = array('DBInstanceIdentifier' => (string) $dBInstanceIdentifier, 'DBSnapshotIdentifier' => (string) $dBSnapshotIdentifier);
        $action = ucfirst(__FUNCTION__);
        $response = $this->client->call($action, $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if (!$this->exist($sxml->{$action . 'Result'})) {
                throw new RdsException(sprintf(self::UNEXPECTED, $action));
            }
            $ptr = $sxml->{$action . 'Result'};
            $result = $this->_loadDBSnapshotData($ptr->DBSnapshot);
        }
        return $result;
    }