Class: Watchforge::API::Client

Inherits:
Object
  • Object
show all
Includes:
Dashboard, Issues, Monitors, Traces
Defined in:
lib/watchforge/api/client.rb

Instance Method Summary collapse

Methods included from Dashboard

#dashboard_analytics, #dashboard_reports, #dashboard_summary, #list_custom_dashboards, #project_dashboard, #query_dashboard_widget

Methods included from Monitors

#create_monitor, #delete_monitor, #get_monitor, #list_monitor_check_ins, #list_monitors, #update_monitor

Methods included from Traces

#get_trace, #list_trace_spans, #list_traces, #trace_performance

Methods included from Issues

#get_issue, #ignore_issue, #issue_stats, #list_issues, #resolve_issue, #update_issue

Constructor Details

#initialize(base_url, token) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
# File 'lib/watchforge/api/client.rb', line 10

def initialize(base_url, token)
  @base_url = base_url.to_s.chomp("/")
  @base_url += "/api" unless @base_url.end_with?("/api")
  @token = token
end

Instance Method Details

#delete(path) ⇒ Object



28
29
30
# File 'lib/watchforge/api/client.rb', line 28

def delete(path)
  request(:delete, path)
end

#get(path, params = {}) ⇒ Object



16
17
18
# File 'lib/watchforge/api/client.rb', line 16

def get(path, params = {})
  request(:get, path, params: params)
end

#patch(path, body = {}) ⇒ Object



24
25
26
# File 'lib/watchforge/api/client.rb', line 24

def patch(path, body = {})
  request(:patch, path, body: body)
end

#post(path, body = {}) ⇒ Object



20
21
22
# File 'lib/watchforge/api/client.rb', line 20

def post(path, body = {})
  request(:post, path, body: body)
end