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

describeDBInstances() public method

Returns information about provisioned RDS instances. This API supports pagination
public describeDBInstances ( string $dbInstanceIdentifier = null, string $marker = null, integer $maxRecords = null ) : Scalr\Service\Aws\Rds\DataType\DBInstanceList
$dbInstanceIdentifier string optional The user-specified instance identifier.
$marker string optional The response includes only records beyond the marker.
$maxRecords integer optional The maximum number of records to include in the response.
return Scalr\Service\Aws\Rds\DataType\DBInstanceList Returns the list of DB Instances
    public function describeDBInstances($dbInstanceIdentifier = null, $marker = null, $maxRecords = null)
    {
        $result = null;
        $options = array();
        if ($dbInstanceIdentifier !== null) {
            $options['DBInstanceIdentifier'] = (string) $dbInstanceIdentifier;
        }
        if ($marker !== null) {
            $options['Marker'] = (string) $marker;
        }
        if ($maxRecords !== null) {
            $options['MaxRecords'] = (int) $maxRecords;
        }
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            $result = new DBInstanceList();
            $result->setRds($this->rds);
            $result->marker = $this->exist($sxml->DescribeDBInstancesResult->Marker) ? (string) $sxml->DescribeDBInstancesResult->Marker : null;
            if (isset($sxml->DescribeDBInstancesResult->DBInstances->DBInstance)) {
                foreach ($sxml->DescribeDBInstancesResult->DBInstances->DBInstance as $v) {
                    $item = $this->_loadDBInstanceData($v);
                    $result->append($item);
                    unset($item);
                }
            }
        }
        return $result;
    }