Module: OpenSearch::API::Ingest::Actions

Included in:
IngestClient
Defined in:
lib/opensearch/api/namespace/ingest.rb,
lib/opensearch/api/actions/ingest/simulate.rb,
lib/opensearch/api/actions/ingest/geo_ip_stats.rb,
lib/opensearch/api/actions/ingest/get_pipeline.rb,
lib/opensearch/api/actions/ingest/put_pipeline.rb,
lib/opensearch/api/actions/ingest/processor_grok.rb,
lib/opensearch/api/actions/ingest/delete_pipeline.rb,
lib/opensearch/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) — default: DEPRECATED: use cluster_manager_timeout instead

    Explicit operation timeout for connection to master node

  • :cluster_manager_timeout (Time)

    Explicit operation timeout for connection to cluster_manager node

  • :timeout (Time)

    Explicit operation timeout

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)


40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/opensearch/api/actions/ingest/delete_pipeline.rb', line 40

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 = OpenSearch::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



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/opensearch/api/actions/ingest/geo_ip_stats.rb', line 36

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

  arguments = arguments.clone

  method = OpenSearch::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) — default: DEPRECATED: use cluster_manager_timeout instead

    Explicit operation timeout for connection to master node

  • :cluster_manager_timeout (Time)

    Explicit operation timeout for connection to cluster_manager node

  • :headers (Hash)

    Custom HTTP headers



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/opensearch/api/actions/ingest/get_pipeline.rb', line 40

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = OpenSearch::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



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/opensearch/api/actions/ingest/processor_grok.rb', line 36

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

  arguments = arguments.clone

  method = OpenSearch::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) — default: DEPRECATED: use cluster_manager_timeout instead

    Explicit operation timeout for connection to master node

  • :cluster_manager_timeout (Time)

    Explicit operation timeout for connection to cluster_manager node

  • :timeout (Time)

    Explicit operation timeout

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The ingest definition (Required)

Raises:

  • (ArgumentError)


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/opensearch/api/actions/ingest/put_pipeline.rb', line 41

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 = OpenSearch::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)


39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/opensearch/api/actions/ingest/simulate.rb', line 39

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

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

  arguments = arguments.clone

  _id = arguments.delete(:id)

  method = OpenSearch::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