public resetDBParameterGroup ( string $dBParameterGroupName, Scalr\Service\Aws\Rds\DataType\ParameterList $parameters = null, boolean $resetAllParameters = null ) : string | ||
$dBParameterGroupName | string | The name of DB Parameter Group to modify. |
$parameters | Scalr\Service\Aws\Rds\DataType\ParameterList | optional An list of parameter names, values, and the apply method for the parameter update. At least one parameter name, value, and apply method must be supplied; subsequent arguments are optional. A maximum of 20 parameters may be modified in a single request. Valid Values (for the application method): immediate | pending-reboot |
$resetAllParameters | boolean | optional Specifies whether (true) or not (false) to reset all parameters in the DB Parameter Group to default values. |
return | string | Returns DBParameterGroupName on success or throws an exception. |
public function resetDBParameterGroup($dBParameterGroupName, ParameterList $parameters = null, $resetAllParameters = null)
{
$result = false;
$options = array('DBParameterGroupName' => (string) $dBParameterGroupName);
if ($parameters !== null) {
if ($this->rds->getApiClientType() == Aws::CLIENT_SOAP) {
$parameter = array();
foreach ($parameters as $v) {
$parameter[] = $v->getQueryArray();
}
$options['Parameters']['Parameter'] = $parameter;
} else {
$options = array_merge($options, array_filter($parameters->getQueryArray('Parameters'), function ($v) {
return $v !== null;
}));
}
} elseif ($resetAllParameters !== null) {
$options['ResetAllParameters'] = $resetAllParameters ? 'true' : 'false';
}
$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 = (string) $ptr->DBParameterGroupName;
}
return $result;
}