class Morpheus::MonitoringChecksInterface

Public Instance Methods

create(payload) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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={}) click to toggle source
# 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={}) click to toggle source
# 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={}) click to toggle source
# File lib/morpheus/api/monitoring_checks_interface.rb, line 80
def list_check_types(options={})
  url = "#{@base_url}/api/monitoring/check-types"
  headers = { :params => options, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  opts = {method: :get, url: url, headers: headers}
  execute(opts)
end
mute(id, options={}) click to toggle source
# File lib/morpheus/api/monitoring_checks_interface.rb, line 42
def mute(id, options={})
  url = "#{@base_url}/api/monitoring/checks/#{id}/mute"
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  payload = options
  opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
  execute(opts)
end
mute_all(options={}) click to toggle source
# File lib/morpheus/api/monitoring_checks_interface.rb, line 50
def mute_all(options={})
  url = "#{@base_url}/api/monitoring/checks/mute-all"
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  payload = options
  opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
  execute(opts)
end
quarantine(id, payload={}) click to toggle source
# File lib/morpheus/api/monitoring_checks_interface.rb, line 58
def quarantine(id, payload={})
  mute(id, payload)
end
quarantine_all(payload={}) click to toggle source
# File lib/morpheus/api/monitoring_checks_interface.rb, line 62
def quarantine_all(payload={})
  mute_all(payload)
end
statistics(id) click to toggle source
# 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) click to toggle source
# File lib/morpheus/api/monitoring_checks_interface.rb, line 27
def update(id, options)
  url = "#{@base_url}/api/monitoring/checks/#{id}"
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  payload = options
  opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
  execute(opts)
end