Sha256: 7a2a1455f5f95e90837d33749fabfb3d5ab218d49c4ee8045bac8221b05b9b60

Contents?: true

Size: 1.93 KB

Versions: 38

Compression:

Stored size: 1.93 KB

Contents

module Fog
  module AWS
    class RDS
      class Real
        require 'fog/aws/parsers/rds/modify_db_parameter_group'

        # modifies a database parameter group
        # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_ModifyDBParameterGroup.html
        # ==== Parameters
        # * DBParameterGroupName <~String> - name of the parameter group
        # * Parameters<~Array> - Array of up to 20 Hashes describing parameters to set
        #   * 'ParameterName'<~String> - parameter name.
        #   * 'ParameterValue'<~String> - new paremeter value
        #   * 'ApplyMethod'<~String> - immediate | pending-reboot whether to set the parameter immediately or not (may require an instance restart)
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        def modify_db_parameter_group(group_name, parameters)
          parameter_names = []
          parameter_values = []
          parameter_apply_methods = []

          parameters.each do |parameter|
            parameter_names.push(parameter['ParameterName'])
            parameter_values.push(parameter['ParameterValue'])
            parameter_apply_methods.push(parameter['ApplyMethod'])
          end
          params = {}
          params.merge!(Fog::AWS.indexed_param('Parameters.member.%d.ParameterName', parameter_names))
          params.merge!(Fog::AWS.indexed_param('Parameters.member.%d.ParameterValue', parameter_values))
          params.merge!(Fog::AWS.indexed_param('Parameters.member.%d.ApplyMethod', parameter_apply_methods))

          request({
            'Action'  => 'ModifyDBParameterGroup',
            'DBParameterGroupName' => group_name,

            :parser   => Fog::Parsers::AWS::RDS::ModifyDbParameterGroup.new
          }.merge(params))
        end
      end

      class Mock
        def modify_db_parameter_group(group_name, parameters)
          Fog::Mock.not_implemented
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 5 rubygems

Version Path
fog-aws-0.8.1 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.8.0 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-aws-0.7.5/lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.7.6 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.7.5 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.7.4 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.7.3 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.7.2 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.6.0 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.5.0 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.4.1 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.4.0 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.3.0 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.2.2 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.2.0 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.1.2 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.1.1 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.1.0 lib/fog/aws/requests/rds/modify_db_parameter_group.rb
fog-aws-0.0.8 lib/fog/aws/requests/rds/modify_db_parameter_group.rb