module Elasticsearch::API::Autoscaling::Actions

Public Instance Methods

delete_autoscaling_policy(arguments = {}) click to toggle source

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

@option arguments [String] :name the name of the autoscaling policy @option arguments [Time] :master_timeout Timeout for processing on master node @option arguments [Time] :timeout Timeout for acknowledgement of update from all nodes in cluster @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-delete-autoscaling-policy.html

# File lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb, line 34
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 = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_autoscaling_capacity(arguments = {}) click to toggle source

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.

@option arguments [Time] :master_timeout Timeout for processing on master node @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-get-autoscaling-capacity.html

# File lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb, line 32
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 = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_autoscaling_policy(arguments = {}) click to toggle source

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

@option arguments [String] :name the name of the autoscaling policy @option arguments [Time] :master_timeout Timeout for processing on master node @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-get-autoscaling-policy.html

# File lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb, line 33
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 = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_autoscaling_policy(arguments = {}) click to toggle source

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

@option arguments [String] :name the name of the autoscaling policy @option arguments [Time] :master_timeout Timeout for processing on master node @option arguments [Time] :timeout Timeout for acknowledgement of update from all nodes in cluster @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body the specification of the autoscaling policy (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-put-autoscaling-policy.html

# File lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb, line 35
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 = Utils.process_params(arguments)

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