Пример #1
0
 /**
  * DescribeDBParameters action
  *
  * Returns the detailed parameter list for a particular DBParameterGroup.
  *
  * @param   string     $dBParameterGroupName The name of the DB Parameter Group.
  * @param   string     $source               optional The parameter types to return.
  * @param   string     $marker               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.
  * @param   int        $maxRecords           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  ParameterList Returns ParameterList on success or throws an exception.
  * @throws  ClientException
  * @throws  RdsException
  */
 public function describeDBParameters($dBParameterGroupName, $source = null, $marker = null, $maxRecords = null)
 {
     $result = null;
     $options = array('DBParameterGroupName' => (string) $dBParameterGroupName);
     $action = ucfirst(__FUNCTION__);
     if ($source !== null) {
         $options['Source'] = (string) $source;
     }
     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 ParameterList();
         $result->setRds($this->rds);
         $result->marker = $this->exist($ptr->Marker) ? (string) $ptr->Marker : null;
         if (isset($ptr->Parameters->Parameter)) {
             foreach ($ptr->Parameters->Parameter as $v) {
                 $item = $this->_loadParameterData($v);
                 $result->append($item);
                 unset($item);
             }
         }
     }
     return $result;
 }
Пример #2
0
 /**
  * Reset parameters in the given group
  *
  * @param string $cloudLocation Cloud location
  * @param string $name          Group name
  */
 public function xResetAction($cloudLocation, $name)
 {
     $this->request->restrictAccess(Acl::RESOURCE_AWS_RDS, Acl::PERM_AWS_RDS_MANAGE);
     $aws = $this->getAwsClient($cloudLocation);
     $params = $aws->rds->dbParameterGroup->describeParameters($name);
     $modifiedParameters = new DataType\ParameterList();
     foreach ($params as $param) {
         if ($param->parameterValue && !empty($param->parameterValue)) {
             if ($param->applyType == 'static') {
                 $modifiedParameters->append(new DataType\ParameterData($param->parameterName, DataType\ParameterData::APPLY_METHOD_PENDING_REBOOT, $param->parameterValue));
             } else {
                 $modifiedParameters->append(new DataType\ParameterData($param->parameterName, DataType\ParameterData::APPLY_METHOD_IMMEDIATE, $param->parameterValue));
             }
         }
     }
     if (count($modifiedParameters)) {
         $aws->rds->dbParameterGroup->reset($name, $modifiedParameters);
     }
     $this->response->success("DB parameter group successfully reset to default");
 }