class GraylogAPI::System::Inputs::Types

class for getting info about input types

Public Class Methods

new(client) click to toggle source
# File lib/graylogapi/system/inputs/types.rb, line 6
def initialize(client)
  @client = client
end

Public Instance Methods

all() click to toggle source

get all input types

@return [GraylogAPI::Client::Response]

# File lib/graylogapi/system/inputs/types.rb, line 20
def all
  @client.request(:get, '/system/inputs/types/all')
end
by_type(type) click to toggle source

get info about input type

@return [GraylogAPI::Client::Response]

# File lib/graylogapi/system/inputs/types.rb, line 27
def by_type(type)
  @client.request(:get, "/system/inputs/types/#{type}")
end
name_to_type(name) click to toggle source

convert type name to type

@return [String]

# File lib/graylogapi/system/inputs/types.rb, line 34
def name_to_type(name)
  all.body.find { |_, type| type['name'].casecmp(name).zero? }.first
end
node() click to toggle source

get input types of current node

@return [GraylogAPI::Client::Response]

# File lib/graylogapi/system/inputs/types.rb, line 13
def node
  @client.request(:get, '/system/inputs/types')
end
type_to_name(type_id) click to toggle source

converg type_id to type name

@return [String]

# File lib/graylogapi/system/inputs/types.rb, line 41
def type_to_name(type_id)
  all.body.find { |_, type| type['type'].casecmp(type_id).zero? }.last['name']
end