/** * * Resets some or all of the parameters of a DB Parameter Group to the default values. * * When resetting the entire group, dynamic parameters are updated immediately, * and static parameters are set to pending-reboot to take effect when the DB * Instance reboots. * * @link http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/ learn more * * @param string $DBParameterGroupName * @param ParametersList $parameters * @param bool $resetAllParameters * @return object $response * */ public function ResetDBParameterGroup($DBParameterGroupName, ParametersList $parameters, $resetAllParameters = true) { $request_args = array("Action" => "ResetDBParameterGroup", "DBParameterGroupName" => strtolower($DBParameterGroupName), "resetAllParameters" => $resetAllParameters); foreach ($parameters->GetParameters() as $i => $o) { $request_args['Parameters.member.' . ($i + 1) . ".ParameterName"] = $o->ParameterName; $request_args['Parameters.member.' . ($i + 1) . ".ApplyMethod"] = $o->ApplyMethod; } $response = $this->Request("GET", "/", $request_args); return $response; }
public function xResetAction() { $amazonRDSClient = Scalr_Service_Cloud_Aws::newRds($this->getEnvironment()->getPlatformConfigValue(Modules_Platforms_Ec2::ACCESS_KEY), $this->getEnvironment()->getPlatformConfigValue(Modules_Platforms_Ec2::SECRET_KEY), $this->getParam('cloudLocation')); $response = $amazonRDSClient->DescribeDBParameters($this->getParam('name')); $result = json_decode(json_encode($response->DescribeDBParametersResult->Parameters), true); $params = $result['Parameter']; $modifiedParameters = new ParametersList(); foreach ($params as $param) { if ($param['ParameterValue'] && !empty($param['ParameterValue'])) { if ($param['ApplyType'] == 'static') { $modifiedParameters->AddParameters($param['ParameterName'], $param['ParameterValue'], "pending-reboot"); } else { $modifiedParameters->AddParameters($param['ParameterName'], $param['ParameterValue'], "immediate"); } } } $amazonRDSClient->ResetDBParameterGroup($this->getParam('name'), $modifiedParameters); $this->response->success("DB parameter group successfully reset to default"); }