Class: Synthetics::API::Monitor
- Defined in:
- lib/synthetics/api/monitor.rb
Overview
This class makes requests to the monitors section of the Synthetics API.
Instance Attribute Summary collapse
-
#monitor_uuid ⇒ Object
readonly
Returns the value of attribute monitor_uuid.
Attributes inherited from Base
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(client, monitor_uuid) ⇒ Monitor
constructor
A new instance of Monitor.
- #show ⇒ Object
- #update(options) ⇒ Object
- #update_script(str) ⇒ Object
Constructor Details
#initialize(client, monitor_uuid) ⇒ Monitor
Returns a new instance of Monitor.
7 8 9 10 |
# File 'lib/synthetics/api/monitor.rb', line 7 def initialize(client, monitor_uuid) super(client) @monitor_uuid = monitor_uuid end |
Instance Attribute Details
#monitor_uuid ⇒ Object (readonly)
Returns the value of attribute monitor_uuid.
5 6 7 |
# File 'lib/synthetics/api/monitor.rb', line 5 def monitor_uuid @monitor_uuid end |
Instance Method Details
#destroy ⇒ Object
28 29 30 |
# File 'lib/synthetics/api/monitor.rb', line 28 def destroy request(path: "/monitors/#{monitor_uuid}", method: 'DELETE') end |
#show ⇒ Object
12 13 14 |
# File 'lib/synthetics/api/monitor.rb', line 12 def show request(path: "/monitors/#{monitor_uuid}", method: 'GET') end |
#update(options) ⇒ Object
16 17 18 |
# File 'lib/synthetics/api/monitor.rb', line 16 def update() request(path: "/monitors/#{monitor_uuid}", method: 'PUT', body: ) end |
#update_script(str) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/synthetics/api/monitor.rb', line 20 def update_script(str) request( path: "/monitors/#{monitor_uuid}/script", method: 'PUT', body: { script_text: Base64.strict_encode64(str) } ) end |