Method: Elasticsearch::API::SearchApplication::Actions#put_behavioral_analytics

Defined in:
lib/elasticsearch/api/actions/search_application/put_behavioral_analytics.rb

#put_behavioral_analytics(arguments = {}) ⇒ Object

Creates a behavioral analytics collection. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the analytics collection to be created or updated

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:

[View source]

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/elasticsearch/api/actions/search_application/put_behavioral_analytics.rb', line 36

def put_behavioral_analytics(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'search_application.put_behavioral_analytics' }

  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_PUT
  path   = "_application/analytics/#{Utils.__listify(_name)}"
  params = {}

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