Module: Elasticsearch::API::Logstash::Actions

Included in:
LogstashClient
Defined in:
lib/elasticsearch/api/namespace/logstash.rb,
lib/elasticsearch/api/actions/logstash/get_pipeline.rb,
lib/elasticsearch/api/actions/logstash/put_pipeline.rb,
lib/elasticsearch/api/actions/logstash/delete_pipeline.rb
more...

Instance Method Summary collapse

Instance Method Details

#delete_pipeline(arguments = {}) ⇒ Object

Deletes Logstash Pipelines used by Central Management

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the Pipeline

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:

[View source]

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

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

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

  body = nil

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_logstash/pipeline/#{Utils.__listify(_id)}"
  params = {}

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

#get_pipeline(arguments = {}) ⇒ Object

Retrieves Logstash Pipelines used by Central Management

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    A comma-separated list of Pipeline IDs

  • :headers (Hash)

    Custom HTTP headers

See Also:

[View source]

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

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

  body = nil

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _id
             "_logstash/pipeline/#{Utils.__listify(_id)}"
           else
             "_logstash/pipeline"
           end
  params = {}

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

#put_pipeline(arguments = {}) ⇒ Object

Adds and updates Logstash Pipelines used for Central Management

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :id (String)

    The ID of the Pipeline

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The Pipeline to add or update (Required)

Raises:

  • (ArgumentError)

See Also:

[View source]

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

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
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_logstash/pipeline/#{Utils.__listify(_id)}"
  params = {}

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