Class: GraylogAPI::StaticFields

Inherits:
Object
  • Object
show all
Defined in:
lib/graylogapi/static_fields.rb

Overview

class for manage StaticFields of an input

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ StaticFields

Returns a new instance of StaticFields.



4
5
6
# File 'lib/graylogapi/static_fields.rb', line 4

def initialize(client)
  @client = client
end

Instance Method Details

#create(input_id, params) ⇒ GraylogAPI::Client::Response

add key to an input

Parameters:

  • input_id (Integer)

    id of an input

  • params (Hash)

    hash with key and value of new static field

Returns:



13
14
15
# File 'lib/graylogapi/static_fields.rb', line 13

def create(input_id, params)
  @client.request(:post, "/system/inputs/#{input_id}/staticfields", params)
end

#delete(input_id, key) ⇒ GraylogAPI::Client::Response

delete key of an input

Parameters:

  • input_id (Integer)

    id of an input

  • key (String)

    key of static field

Returns:



22
23
24
# File 'lib/graylogapi/static_fields.rb', line 22

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