С версии: 27.03.2013
Автор: Vitaliy Demidov (vitaliy@scalr.com)
Наследование: extends Scalr\Service\Aws\Rds\AbstractRdsDataType
Пример #1
0
 /**
  * DescribeEvents action
  *
  * 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.
  *
  * @param   DescribeEventRequestData $request optional Request object.
  * @return  EventList Returns EventList on success or throws an exception.
  * @throws  ClientException
  * @throws  RdsException
  */
 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;
 }