Scalr\Service\Aws\Rds\V20130110\RdsApi::describeEvents PHP Метод

describeEvents() публичный Метод

Returns events related to DB instances, DB security groups, DB Snapshots, and DB parameter groups for the past 14 days. Events specific to a particular DB Iinstance, DB security group, DB Snapshot, or DB parameter group can be obtained by providing the source identifier as a parameter. By default, the past hour of events are returned.
public describeEvents ( DescribeEventRequestData $request = null ) : Scalr\Service\Aws\Rds\DataType\EventList
$request Scalr\Service\Aws\Rds\DataType\DescribeEventRequestData optional Request object.
Результат Scalr\Service\Aws\Rds\DataType\EventList Returns EventList on success or throws an exception.
    public function describeEvents(DescribeEventRequestData $request = null)
    {
        $result = null;
        if ($request !== null) {
            $options = $request->getQueryArray();
            if ($this->rds->getApiClientType() == Aws::CLIENT_SOAP) {
                if (isset($options['EventCategories.member.1'])) {
                    foreach ($options as $k => $v) {
                        if (strpos($k, 'EventCategories.member.') === 0) {
                            $options['EventCategories']['EventCategory'][] = $v;
                            unset($options[$k]);
                        }
                    }
                }
            }
        } else {
            $options = array();
        }
        $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 = new EventList();
            $result->setRds($this->rds);
            $result->marker = $this->exist($ptr->Marker) ? (string) $ptr->Marker : null;
            if (isset($ptr->Events->Event)) {
                foreach ($ptr->Events->Event as $v) {
                    $item = $this->_loadEventData($v);
                    $result->append($item);
                    unset($item);
                }
            }
        }
        return $result;
    }