class Morpheus::MonitoringGroupsInterface
Public Instance Methods
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 20 def create(payload) url = "#{@base_url}/api/monitoring/groups" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :post, url: url, headers: headers, payload: payload.to_json} execute(opts) end
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 34 def destroy(id, payload={}) url = "#{@base_url}/api/monitoring/groups/#{id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :delete, url: url, headers: headers, payload: payload.to_json} execute(opts) end
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 5 def get(id, params={}) raise "#{self.class}.get() passed a blank id!" if id.to_s == '' url = "#{@base_url}/api/monitoring/groups/#{id}" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 63 def history(id, params={}) url = "#{@base_url}/api/monitoring/groups/#{id}/history" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 13 def list(params={}) url = "#{@base_url}/api/monitoring/groups" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 41 def mute(id, payload={}) url = "#{@base_url}/api/monitoring/groups/#{id}/mute" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :put, url: url, headers: headers, payload: payload.to_json} execute(opts) end
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 48 def mute_all(payload={}) url = "#{@base_url}/api/monitoring/groups/mute-all" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :put, url: url, headers: headers, payload: payload.to_json} execute(opts) end
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 55 def quarantine(id, payload={}) mute(id, payload) end
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 59 def quarantine_all(payload={}) mute_all(payload) end
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 70 def statistics(id) url = "#{@base_url}/api/monitoring/groups/#{id}/statistics" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :get, url: url, headers: headers} execute(opts) end
Source
# File lib/morpheus/api/monitoring_groups_interface.rb, line 27 def update(id, payload) url = "#{@base_url}/api/monitoring/groups/#{id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :put, url: url, headers: headers, payload: payload.to_json} execute(opts) end