public describeEvents ( |
||
$request | 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;
}