Scalr\Service\Aws\Rds\V20130110\RdsApi::modifyDBParameterGroup PHP Метод

modifyDBParameterGroup() публичный Метод

Modifies the parameters of a DBParameterGroup. To modify more than one parameter submit a list of the following: ParameterName, ParameterValue, and ApplyMethod. A maximum of 20 parameters can be modified in a single request. Note! The apply-immediate method can be used only for dynamic parameters; the pending-reboot method can be used with MySQL and Oracle DB Instances for either dynamic or static parameters. For Microsoft SQL Server DB Instances, the pending-reboot method can be used only for static parameters.
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
Результат 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;
    }