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/geo_ip_stats.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

Deletes a pipeline.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    Pipeline ID

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :timeout (Time)

    Explicit operation timeout

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/elasticsearch/api/actions/ingest/delete_pipeline.rb', line 31

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

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

  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, headers).body
end

#geo_ip_stats(arguments = {}) ⇒ Object

Returns statistical information about geoip databases

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

See Also:


28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/elasticsearch/api/actions/ingest/geo_ip_stats.rb', line 28

def geo_ip_stats(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_GET
  path   = "_ingest/geoip/stats"
  params = {}

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

#get_pipeline(arguments = {}) ⇒ Object

Returns a pipeline.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    Comma separated list of pipeline ids. Wildcards supported

  • :summary (Boolean)

    Return pipelines without their definitions (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :headers (Hash)

    Custom HTTP headers

See Also:


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

def get_pipeline(arguments = {})
  headers = arguments.delete(:headers) || {}

  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, headers).body
end

#processor_grok(arguments = {}) ⇒ Object

Returns a list of the built-in patterns.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

See Also:


28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/elasticsearch/api/actions/ingest/processor_grok.rb', line 28

def processor_grok(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

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

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

#put_pipeline(arguments = {}) ⇒ Object

Creates or updates a pipeline.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    Pipeline ID

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :timeout (Time)

    Explicit operation timeout

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The ingest definition (Required)

Raises:

  • (ArgumentError)

See Also:


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

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

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

  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, headers).body
end

#simulate(arguments = {}) ⇒ Object

Allows to simulate a pipeline with example documents.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    Pipeline ID

  • :verbose (Boolean)

    Verbose mode. Display data output for each processor in executed pipeline

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The simulate definition (Required)

Raises:

  • (ArgumentError)

See Also:


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

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

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_POST
  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, headers).body
end