Module: Elasticsearch::API::Ingest::Actions

Included in:
IngestClient
Defined in:
lib/elasticsearch/api/namespace/ingest.rb,
lib/elasticsearch/api/actions/ingest/simulate.rb,
lib/elasticsearch/api/actions/ingest/get_pipeline.rb,
lib/elasticsearch/api/actions/ingest/put_pipeline.rb,
lib/elasticsearch/api/actions/ingest/processor_grok.rb,
lib/elasticsearch/api/actions/ingest/delete_pipeline.rb,
lib/elasticsearch/api/actions/ingest/params_registry.rb

Defined Under Namespace

Modules: ParamsRegistry

Instance Method Summary collapse

Instance Method Details

#delete_pipeline(arguments = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/elasticsearch/api/actions/ingest/delete_pipeline.rb', line 18

def delete_pipeline(arguments = {})
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_ingest/pipeline/#{Utils.__listify(_id)}"
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body).body
end

#get_pipeline(arguments = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/elasticsearch/api/actions/ingest/get_pipeline.rb', line 17

def get_pipeline(arguments = {})
  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _id
             "_ingest/pipeline/#{Utils.__listify(_id)}"
           else
             "_ingest/pipeline"
end
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body).body
end

#processor_grok(arguments = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/elasticsearch/api/actions/ingest/processor_grok.rb', line 15

def processor_grok(arguments = {})
  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_GET
  path   = "_ingest/processor/grok"
  params = {}

  body = nil
  perform_request(method, path, params, body).body
end

#put_pipeline(arguments = {}) ⇒ Object

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :body (Hash)

    The ingest definition (Required)

Raises:

  • (ArgumentError)

See Also:



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/elasticsearch/api/actions/ingest/put_pipeline.rb', line 19

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_ingest/pipeline/#{Utils.__listify(_id)}"
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = arguments[:body]
  perform_request(method, path, params, body).body
end

#simulate(arguments = {}) ⇒ Object

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :body (Hash)

    The simulate definition (Required)

Raises:

  • (ArgumentError)

See Also:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/elasticsearch/api/actions/ingest/simulate.rb', line 18

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _id
             "_ingest/pipeline/#{Utils.__listify(_id)}/_simulate"
           else
             "_ingest/pipeline/_simulate"
  end
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = arguments[:body]
  perform_request(method, path, params, body).body
end