File: create_cluster_parameter_group.rb

package info (click to toggle)
ruby-fog-aws 3.18.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,140 kB
  • sloc: ruby: 73,328; javascript: 14; makefile: 9; sh: 4
file content (53 lines) | stat: -rw-r--r-- 2,543 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
module Fog
  module AWS
    class Redshift
      class Real
        require 'fog/aws/parsers/redshift/create_cluster_parameter_group'

        # ==== Parameters
        #
        # @param [Hash] options
        # * :parameter_group_name - required - (String)
        #    The name of the cluster parameter group. Constraints: Must be 1 to 255 alphanumeric
        #    characters or hyphens First character must be a letter. Cannot end with a hyphen or
        #    contain two consecutive hyphens. Must be unique within your AWS account. This value
        #    is stored as a lower-case string.
        # * :parameter_group_family - required - (String)
        #    The Amazon Redshift engine version to which the cluster parameter group applies. The
        #    cluster engine version determines the set of parameters. To get a list of valid parameter
        #    group family names, you can call DescribeClusterParameterGroups. By default, Amazon
        #    Redshift returns a list of all the parameter groups that are owned by your AWS account,
        #    including the default parameter groups for each Amazon Redshift engine version. The
        #    parameter group family names associated with the default parameter groups provide you
        #    the valid values. For example, a valid family name is "redshift-1.0".
        # * :description - required - (String)
        #    A description of the parameter group.
        #
        # ==== See Also
        # http://docs.aws.amazon.com/redshift/latest/APIReference/API_CreateClusterParameterGroup.html
        def create_cluster_parameter_group(options = {})
          parameter_group_name   = options[:parameter_group_name]
          parameter_group_family = options[:parameter_group_family]
          description            = options[:description]

          path = "/"
          params = {
            :idempotent => true,
            :headers    => {},
            :path       => path,
            :method     => :put,
            :query      => {},
            :parser     => Fog::Parsers::Redshift::AWS::CreateClusterParameterGroup.new
          }

          params[:query]['Action']               = 'CreateClusterParameterGroup'
          params[:query]['ParameterGroupName']   = parameter_group_name if parameter_group_name
          params[:query]['ParameterGroupFamily'] = parameter_group_family if parameter_group_family
          params[:query]['Description']          = description if description

          request(params)
        end
      end
    end
  end
end