Class: Exa::Resources::Websets::Monitors

Inherits:
Base
  • Object
show all
Defined in:
lib/exa/resources/websets/monitors.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Exa::Resources::Base

Instance Method Details

#create(params) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/exa/resources/websets/monitors.rb', line 7

def create(params)
  client.request(
    method: :post,
    path: monitor_path,
    body: params,
    response_model: Exa::Responses::Monitor
  )
end

#delete(id) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/exa/resources/websets/monitors.rb', line 42

def delete(id)
  client.request(
    method: :delete,
    path: monitor_path(id),
    response_model: Exa::Responses::Monitor
  )
end

#list(params = nil) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/exa/resources/websets/monitors.rb', line 16

def list(params = nil)
  client.request(
    method: :get,
    path: monitor_path,
    query: params,
    response_model: Exa::Responses::MonitorListResponse
  )
end

#retrieve(id) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/exa/resources/websets/monitors.rb', line 25

def retrieve(id)
  client.request(
    method: :get,
    path: monitor_path(id),
    response_model: Exa::Responses::Monitor
  )
end

#runs_get(monitor_id, run_id) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/exa/resources/websets/monitors.rb', line 59

def runs_get(monitor_id, run_id)
  client.request(
    method: :get,
    path: monitor_path(monitor_id, "runs", run_id),
    response_model: Exa::Responses::MonitorRun
  )
end

#runs_list(monitor_id, params = nil) ⇒ Object



50
51
52
53
54
55
56
57
# File 'lib/exa/resources/websets/monitors.rb', line 50

def runs_list(monitor_id, params = nil)
  client.request(
    method: :get,
    path: monitor_path(monitor_id, "runs"),
    query: params,
    response_model: Exa::Responses::MonitorRunListResponse
  )
end

#update(id, params) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/exa/resources/websets/monitors.rb', line 33

def update(id, params)
  client.request(
    method: :patch,
    path: monitor_path(id),
    body: params,
    response_model: Exa::Responses::Monitor
  )
end