Module: Mackerel::REST::Downtime
- Included in:
- Client
- Defined in:
- lib/mackerel/downtime.rb
Instance Method Summary collapse
- #delete_downtime(downtime_id) ⇒ Object
- #get_downtimes ⇒ Object
- #post_downtime(downtime) ⇒ Object
- #update_downtime(downtime_id, downtime) ⇒ Object
Instance Method Details
#delete_downtime(downtime_id) ⇒ Object
21 22 23 24 |
# File 'lib/mackerel/downtime.rb', line 21 def delete_downtime(downtime_id) command = ApiCommand.new(:delete, "/api/v0/downtimes/#{downtime_id}", @api_key) command.execute(client) end |
#get_downtimes ⇒ Object
10 11 12 13 |
# File 'lib/mackerel/downtime.rb', line 10 def get_downtimes() command = ApiCommand.new(:get, "/api/v0/downtimes", @api_key) command.execute(client) end |
#post_downtime(downtime) ⇒ Object
4 5 6 7 8 |
# File 'lib/mackerel/downtime.rb', line 4 def post_downtime(downtime) command = ApiCommand.new(:post, "/api/v0/downtimes", @api_key) command.body = downtime.to_json command.execute(client) end |
#update_downtime(downtime_id, downtime) ⇒ Object
15 16 17 18 19 |
# File 'lib/mackerel/downtime.rb', line 15 def update_downtime(downtime_id, downtime) command = ApiCommand.new(:put, "/api/v0/downtimes/#{downtime_id}", @api_key) command.body = downtime.to_json command.execute(client) end |