Method: Elasticsearch::API::Transform::Actions#put_transform

Defined in:
lib/elasticsearch/api/actions/transform/put_transform.rb

#put_transform(arguments = {}) ⇒ Object

Instantiates a transform.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String)

    The id of the new transform.

  • :defer_validation (Boolean)

    If validations should be deferred until transform starts, defaults to false.

  • :timeout (Time)

    Controls the time to wait for the transform to start

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The transform definition (Required)

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/elasticsearch/api/actions/transform/put_transform.rb', line 35

def put_transform(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]

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

  body = arguments.delete(:body)

  _transform_id = arguments.delete(:transform_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_transform/#{Utils.__listify(_transform_id)}"
  params = Utils.process_params(arguments)

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