public modifyDBParameterGroup ( string $dBParameterGroupName, Scalr\Service\Aws\Rds\DataType\ParameterList $parameters ) : string | ||
$dBParameterGroupName | string | The name of DB Parameter Group to modify. |
$parameters | Scalr\Service\Aws\Rds\DataType\ParameterList | 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 |
return | string | Returns DBParameterGroupName on success or throws an exception. |
public function modifyDBParameterGroup($dBParameterGroupName, ParameterList $parameters)
{
$result = false;
$options = array('DBParameterGroupName' => (string) $dBParameterGroupName);
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;
}));
}
$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;
}