Class: GraylogAPI::System::Inputs

Inherits:
Object
  • Object
show all
Defined in:
lib/graylogapi/system/inputs.rb,
lib/graylogapi/system/inputs/types.rb

Overview

class for manage inputs

Defined Under Namespace

Classes: Types

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Inputs

Returns a new instance of Inputs.



7
8
9
# File 'lib/graylogapi/system/inputs.rb', line 7

def initialize(client)
  @client = client
end

Instance Method Details

#allGraylogAPI::Client::Response

get all inputs



14
15
16
# File 'lib/graylogapi/system/inputs.rb', line 14

def all
  @client.request(:get, '/system/inputs')
end

#by_id(id) ⇒ GraylogAPI::Client::Response

get input by input id



21
22
23
# File 'lib/graylogapi/system/inputs.rb', line 21

def by_id(id)
  @client.request(:get, "/system/inputs/#{id}")
end

#create(params = {}) ⇒ GraylogAPI::Client::Response

create input

Parameters:

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

Returns:



29
30
31
# File 'lib/graylogapi/system/inputs.rb', line 29

def create(params = {})
  @client.request(:post, '/system/inputs', parse(params))
end

#delete(id) ⇒ GraylogAPI::Client::Response

delete input

Parameters:

  • params (Hash)

Returns:



45
46
47
# File 'lib/graylogapi/system/inputs.rb', line 45

def delete(id)
  @client.request(:delete, "/system/inputs/#{id}")
end

#typesGraylogAPI::System::Inputs::Types

object for get information about input types



52
53
54
# File 'lib/graylogapi/system/inputs.rb', line 52

def types
  @types ||= Types.new(@client)
end

#update(id, params = {}) ⇒ GraylogAPI::Client::Response

update input

Parameters:

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

Returns:



37
38
39
# File 'lib/graylogapi/system/inputs.rb', line 37

def update(id, params = {})
  @client.request(:put, "/system/inputs/#{id}", parse(params))
end