class Vmpooler::API::Dashboard
Public Instance Methods
backend()
click to toggle source
# File lib/vmpooler/api/dashboard.rb, line 15 def backend Vmpooler::API.settings.redis end
config()
click to toggle source
handle to the App's configuration information
# File lib/vmpooler/api/dashboard.rb, line 11 def config @config ||= Vmpooler::API.settings.config end
graph_link(target = '')
click to toggle source
return a full URL to a viewable graph for a given metrics target (graphite syntax)
# File lib/vmpooler/api/dashboard.rb, line 61 def graph_link(target = '') return '' unless graph_url graph_url + target end
graph_prefix()
click to toggle source
configuration setting for URL prefix for graphs to view
# File lib/vmpooler/api/dashboard.rb, line 37 def graph_prefix return @graph_prefix if @graph_prefix if config[:graphs] return 'vmpooler' unless config[:graphs]['prefix'] @graph_prefix = config[:graphs]['prefix'] elsif config[:graphite] return false unless config[:graphite]['prefix'] @graph_prefix = config[:graphite]['prefix'] else false end end
graph_server()
click to toggle source
configuration setting for server hosting graph URLs to view
# File lib/vmpooler/api/dashboard.rb, line 20 def graph_server return @graph_server if @graph_server if config[:graphs] return false unless config[:graphs]['server'] @graph_server = config[:graphs]['server'] elsif config[:graphite] return false unless config[:graphite]['server'] @graph_server = config[:graphite]['server'] else false end end
graph_url()
click to toggle source
what is the base URL for viewable graphs?
# File lib/vmpooler/api/dashboard.rb, line 54 def graph_url return false unless graph_server && graph_prefix @graph_url ||= "http://#{graph_server}/render?target=#{graph_prefix}" end