Method: Elasticsearch::API::MachineLearning::Actions#estimate_model_memory

Defined in:
lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb

#estimate_model_memory(arguments = {}) ⇒ Object

Estimates the model memory

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The analysis config, plus cardinality estimates for fields it references (Required)

Raises:

  • (ArgumentError)

See Also:


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb', line 32

def estimate_model_memory(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'ml.estimate_model_memory' }

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

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

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_ml/anomaly_detectors/_estimate_model_memory'
  params = {}

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