Module: ElasticsearchServerless::API::Ingest::Actions
- Defined in:
- lib/elasticsearch-serverless/api/ingest/simulate.rb,
lib/elasticsearch-serverless/api/ingest/get_pipeline.rb,
lib/elasticsearch-serverless/api/ingest/put_pipeline.rb,
lib/elasticsearch-serverless/api/ingest/processor_grok.rb,
lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb
Instance Method Summary collapse
-
#delete_pipeline(arguments = {}) ⇒ Object
Deletes one or more existing ingest pipeline.
-
#get_pipeline(arguments = {}) ⇒ Object
Returns information about one or more ingest pipelines.
-
#processor_grok(arguments = {}) ⇒ Object
Extracts structured fields out of a single text field within a document.
-
#put_pipeline(arguments = {}) ⇒ Object
Creates or updates an ingest pipeline.
-
#simulate(arguments = {}) ⇒ Object
Executes an ingest pipeline against a set of provided documents.
Instance Method Details
#delete_pipeline(arguments = {}) ⇒ Object
Deletes one or more existing ingest pipeline.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb', line 37 def delete_pipeline(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "ingest.delete_pipeline" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = ElasticsearchServerless::API::HTTP_DELETE path = "_ingest/pipeline/#{Utils.listify(_id)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_pipeline(arguments = {}) ⇒ Object
Returns information about one or more ingest pipelines. This API returns a local reference of the pipeline.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/elasticsearch-serverless/api/ingest/get_pipeline.rb', line 38 def get_pipeline(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "ingest.get_pipeline" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = ElasticsearchServerless::API::HTTP_GET path = if _id "_ingest/pipeline/#{Utils.listify(_id)}" else "_ingest/pipeline" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#processor_grok(arguments = {}) ⇒ Object
Extracts structured fields out of a single text field within a document. You choose which field to extract matched fields from, as well as the grok pattern you expect will match. A grok pattern is like a regular expression that supports aliased expressions that can be reused.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch-serverless/api/ingest/processor_grok.rb', line 33 def processor_grok(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "ingest.processor_grok" } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = ElasticsearchServerless::API::HTTP_GET path = "_ingest/processor/grok" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_pipeline(arguments = {}) ⇒ Object
Creates or updates an ingest pipeline. Changes made using this API take effect immediately.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/elasticsearch-serverless/api/ingest/put_pipeline.rb', line 37 def put_pipeline(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "ingest.put_pipeline" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) method = ElasticsearchServerless::API::HTTP_PUT path = "_ingest/pipeline/#{Utils.listify(_id)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#simulate(arguments = {}) ⇒ Object
Executes an ingest pipeline against a set of provided documents.
35 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 61 62 63 64 |
# File 'lib/elasticsearch-serverless/api/ingest/simulate.rb', line 35 def simulate(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "ingest.simulate" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) method = ElasticsearchServerless::API::HTTP_POST path = if _id "_ingest/pipeline/#{Utils.listify(_id)}/_simulate" else "_ingest/pipeline/_simulate" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |