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

describeDBSnapshots() public method

Returns the detailed parameter list for a particular DBParameterGroup.
public describeDBSnapshots ( $dBInstanceIdentifier = null, $dBSnapshotIdentifier = null, $snapshotType = null, string $marker = null, integer $maxRecords = null ) : Scalr\Service\Aws\Rds\DataType\DBSnapshotList
$marker string optional An optional pagination token provided by a previous DescribeDBParameterGroups request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
$maxRecords integer optional The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a pagination token called a marker is included in the response so that the remaining results may be retrieved.
return Scalr\Service\Aws\Rds\DataType\DBSnapshotList Returns DBSnapshotList on success or throws an exception.
    public function describeDBSnapshots($dBInstanceIdentifier = null, $dBSnapshotIdentifier = null, $snapshotType = null, $marker = null, $maxRecords = null)
    {
        $result = null;
        $options = array();
        $action = ucfirst(__FUNCTION__);
        if ($dBInstanceIdentifier !== null) {
            $options['DBInstanceIdentifier'] = (string) $dBInstanceIdentifier;
        }
        if ($dBSnapshotIdentifier !== null) {
            $options['DBSnapshotIdentifier'] = (string) $dBSnapshotIdentifier;
        }
        if ($snapshotType !== null) {
            $options['SnapshotType'] = (string) $snapshotType;
        }
        if ($marker !== null) {
            $options['Marker'] = (string) $marker;
        }
        if ($maxRecords !== null) {
            $options['MaxRecords'] = (int) $maxRecords;
        }
        $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 = new DBSnapshotList();
            $result->setRds($this->rds);
            $result->marker = $this->exist($ptr->Marker) ? (string) $ptr->Marker : null;
            if (isset($ptr->DBSnapshots->DBSnapshot)) {
                foreach ($ptr->DBSnapshots->DBSnapshot as $v) {
                    $item = $this->_loadDBSnapshotData($v);
                    $result->append($item);
                    unset($item);
                }
            }
        }
        return $result;
    }