Class: GraylogAPI::Dashboards

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

Overview

class for manage dashboards

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Dashboards



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

def initialize(client)
  @client = client
end

Instance Method Details

#allGraylogAPI::Client::Response

get list of all dashboards



19
20
21
# File 'lib/graylogapi/dashboards.rb', line 19

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

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

get dashboard by id



27
28
29
# File 'lib/graylogapi/dashboards.rb', line 27

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

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

create a dashboard



12
13
14
# File 'lib/graylogapi/dashboards.rb', line 12

def create(params)
  @client.request(:post, '/dashboards', params)
end

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

delete dashboard



44
45
46
# File 'lib/graylogapi/dashboards.rb', line 44

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

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

update dashboard



36
37
38
# File 'lib/graylogapi/dashboards.rb', line 36

def update(id, params)
  @client.request(:put, "/dashboards/#{id}", params)
end