Module: Elasticsearch::API::Autoscaling::Actions

Included in:
AutoscalingClient
Defined in:
lib/elasticsearch/api/namespace/autoscaling.rb,
lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb,
lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb,
lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb,
lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb

Instance Method Summary collapse

Instance Method Details

#delete_autoscaling_policy(arguments = {}) ⇒ Object

Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    the name of the autoscaling policy

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb', line 32

def delete_autoscaling_policy(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.delete_autoscaling_policy' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_autoscaling/policy/#{Utils.__listify(_name)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_autoscaling_capacity(arguments = {}) ⇒ Object

Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb', line 31

def get_autoscaling_capacity(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.get_autoscaling_capacity' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_autoscaling/capacity'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_autoscaling_policy(arguments = {}) ⇒ Object

Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    the name of the autoscaling policy

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb', line 32

def get_autoscaling_policy(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.get_autoscaling_policy' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = "_autoscaling/policy/#{Utils.__listify(_name)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put_autoscaling_policy(arguments = {}) ⇒ Object

Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    the name of the autoscaling policy

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    the specification of the autoscaling policy (Required)

Raises:

  • (ArgumentError)

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb', line 33

def put_autoscaling_policy(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.put_autoscaling_policy' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_autoscaling/policy/#{Utils.__listify(_name)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end