Class: Morpheus::MonitoringChecksInterface
- Inherits:
-
APIClient
- Object
- APIClient
- Morpheus::MonitoringChecksInterface
- Defined in:
- lib/morpheus/api/monitoring_checks_interface.rb
Instance Method Summary collapse
- #create(payload) ⇒ Object
- #destroy(id) ⇒ Object
- #get(id) ⇒ Object
- #get_check_type(check_type_id) ⇒ Object
- #history(id, params = {}) ⇒ Object
- #list(params = {}) ⇒ Object
- #list_check_types(options = {}) ⇒ Object
- #mute(id, options = {}) ⇒ Object
- #mute_all(options = {}) ⇒ Object
- #quarantine(id, payload = {}) ⇒ Object
- #quarantine_all(payload = {}) ⇒ Object
- #statistics(id) ⇒ Object
- #update(id, options) ⇒ Object
Instance Method Details
#create(payload) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 20 def create(payload) url = "#{@base_url}/api/monitoring/checks" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :post, url: url, headers: headers, payload: payload.to_json} execute(opts) end |
#destroy(id) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 35 def destroy(id) url = "#{@base_url}/api/monitoring/checks/#{id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :delete, url: url, headers: headers} execute(opts) end |
#get(id) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 5 def get(id) raise "#{self.class}.get() passed a blank id!" if id.to_s == '' url = "#{@base_url}/api/monitoring/checks/#{id}" headers = { params: {}, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#get_check_type(check_type_id) ⇒ Object
87 88 89 90 91 92 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 87 def get_check_type(check_type_id) url = "#{@base_url}/api/monitoring/check-types/#{check_type_id}" headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#history(id, params = {}) ⇒ Object
66 67 68 69 70 71 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 66 def history(id, params={}) url = "#{@base_url}/api/monitoring/checks/#{id}/history" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#list(params = {}) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 13 def list(params={}) url = "#{@base_url}/api/monitoring/checks" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#list_check_types(options = {}) ⇒ Object
80 81 82 83 84 85 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 80 def list_check_types(={}) url = "#{@base_url}/api/monitoring/check-types" headers = { :params => , :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#mute(id, options = {}) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 42 def mute(id, ={}) url = "#{@base_url}/api/monitoring/checks/#{id}/mute" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } payload = opts = {method: :put, url: url, headers: headers, payload: payload.to_json} execute(opts) end |
#mute_all(options = {}) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 50 def mute_all(={}) url = "#{@base_url}/api/monitoring/checks/mute-all" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } payload = opts = {method: :put, url: url, headers: headers, payload: payload.to_json} execute(opts) end |
#quarantine(id, payload = {}) ⇒ Object
58 59 60 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 58 def quarantine(id, payload={}) mute(id, payload) end |
#quarantine_all(payload = {}) ⇒ Object
62 63 64 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 62 def quarantine_all(payload={}) mute_all(payload) end |
#statistics(id) ⇒ Object
73 74 75 76 77 78 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 73 def statistics(id) url = "#{@base_url}/api/monitoring/checks/#{id}/statistics" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#update(id, options) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/morpheus/api/monitoring_checks_interface.rb', line 27 def update(id, ) url = "#{@base_url}/api/monitoring/checks/#{id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } payload = opts = {method: :put, url: url, headers: headers, payload: payload.to_json} execute(opts) end |