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

copyDBClusterSnapshot() public method

Creates a new DB cluster snapshot.
public copyDBClusterSnapshot ( string $sourceDbClusterSnapshotIdentifier, string $targetDbClusterSnapshotIdentifier, Scalr\Service\Aws\Rds\DataType\TagsList $tags = null ) : Scalr\Service\Aws\Rds\DataType\DBClusterSnapshotData
$sourceDbClusterSnapshotIdentifier string The identifier of the DB cluster snapshot to copy. This parameter is not case-sensitive.
$targetDbClusterSnapshotIdentifier string The identifier of the new DB cluster snapshot to create from the source DB cluster snapshot. This parameter is not case-sensitive.
$tags Scalr\Service\Aws\Rds\DataType\TagsList optional A list of tags.
return Scalr\Service\Aws\Rds\DataType\DBClusterSnapshotData Returns created DB cluster snapshot
    public function copyDBClusterSnapshot($sourceDbClusterSnapshotIdentifier, $targetDbClusterSnapshotIdentifier, TagsList $tags = null)
    {
        $result = null;
        $options = [];
        if (count($tags) > 0) {
            $options = $tags->getQueryArray();
        }
        if ($sourceDbClusterSnapshotIdentifier !== null) {
            $options['SourceDBClusterSnapshotIdentifier'] = (string) $sourceDbClusterSnapshotIdentifier;
        }
        if ($targetDbClusterSnapshotIdentifier !== null) {
            $options['TargetDBClusterSnapshotIdentifier'] = (string) $targetDbClusterSnapshotIdentifier;
        }
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if (!$this->exist($sxml->CopyDBClusterSnapshotResult)) {
                throw new RdsException(sprintf(self::UNEXPECTED, 'copy DBClusterSnapshot'));
            }
            $result = $this->_loadDBClusterSnapshotData($sxml->CopyDBClusterSnapshotResult->DBClusterSnapshot);
        }
        return $result;
    }
RdsApi