Class: Meerkat::Resources::Monitors
- Inherits:
-
Base
- Object
- Base
- Meerkat::Resources::Monitors
show all
- Defined in:
- lib/meerkat/resources/monitors.rb
Overview
Change Intelligence monitors — always recurring.
CRUD + runs/artifacts against /api/v1/monitors.
Direct Known Subclasses
Tasks
Instance Method Summary
collapse
-
#artifacts(id, run_id) ⇒ Object
-
#create(**attributes) ⇒ Object
-
#delete(id, permanent: false) ⇒ Object
-
#events(id, limit: nil) ⇒ Object
-
#list(status: nil, include_archived: nil, limit: nil, offset: nil) ⇒ Object
-
#pause(id) ⇒ Object
-
#replace(id, **attributes) ⇒ Object
-
#resume(id) ⇒ Object
-
#retrieve(id) ⇒ Object
-
#retrieve_run(id, run_id) ⇒ Object
-
#run(id, async: true) ⇒ Object
-
#runs(id, limit: nil) ⇒ Object
-
#update(id, **attributes) ⇒ Object
Methods inherited from Base
#initialize
Instance Method Details
#artifacts(id, run_id) ⇒ Object
57
58
59
|
# File 'lib/meerkat/resources/monitors.rb', line 57
def artifacts(id, run_id)
client.get("/monitors/#{id}/runs/#{run_id}/artifacts")
end
|
#create(**attributes) ⇒ Object
21
22
23
|
# File 'lib/meerkat/resources/monitors.rb', line 21
def create(**attributes)
client.post("/monitors", body: { monitor: public_attrs(attributes) })
end
|
#delete(id, permanent: false) ⇒ Object
33
34
35
|
# File 'lib/meerkat/resources/monitors.rb', line 33
def delete(id, permanent: false)
client.delete("/monitors/#{id}", params: { permanent: permanent })
end
|
#events(id, limit: nil) ⇒ Object
61
62
63
|
# File 'lib/meerkat/resources/monitors.rb', line 61
def events(id, limit: nil)
client.get("/monitors/#{id}/events", params: { limit: limit }.compact)
end
|
#list(status: nil, include_archived: nil, limit: nil, offset: nil) ⇒ Object
8
9
10
11
12
13
14
15
|
# File 'lib/meerkat/resources/monitors.rb', line 8
def list(status: nil, include_archived: nil, limit: nil, offset: nil)
client.get("/monitors", params: {
status: status,
include_archived: include_archived,
limit: limit,
offset: offset
}.compact)
end
|
#pause(id) ⇒ Object
41
42
43
|
# File 'lib/meerkat/resources/monitors.rb', line 41
def pause(id)
client.post("/monitors/#{id}/pause")
end
|
#replace(id, **attributes) ⇒ Object
29
30
31
|
# File 'lib/meerkat/resources/monitors.rb', line 29
def replace(id, **attributes)
client.put("/monitors/#{id}", body: { monitor: public_attrs(attributes) })
end
|
#resume(id) ⇒ Object
45
46
47
|
# File 'lib/meerkat/resources/monitors.rb', line 45
def resume(id)
client.post("/monitors/#{id}/resume")
end
|
#retrieve(id) ⇒ Object
17
18
19
|
# File 'lib/meerkat/resources/monitors.rb', line 17
def retrieve(id)
client.get("/monitors/#{id}")
end
|
#retrieve_run(id, run_id) ⇒ Object
53
54
55
|
# File 'lib/meerkat/resources/monitors.rb', line 53
def retrieve_run(id, run_id)
client.get("/monitors/#{id}/runs/#{run_id}")
end
|
#run(id, async: true) ⇒ Object
37
38
39
|
# File 'lib/meerkat/resources/monitors.rb', line 37
def run(id, async: true)
client.post("/monitors/#{id}/run", params: { async: async })
end
|
#runs(id, limit: nil) ⇒ Object
49
50
51
|
# File 'lib/meerkat/resources/monitors.rb', line 49
def runs(id, limit: nil)
client.get("/monitors/#{id}/runs", params: { limit: limit }.compact)
end
|
#update(id, **attributes) ⇒ Object
25
26
27
|
# File 'lib/meerkat/resources/monitors.rb', line 25
def update(id, **attributes)
client.patch("/monitors/#{id}", body: { monitor: public_attrs(attributes) })
end
|