Class: Cloudscale::Monitor::InitMenus
- Inherits:
-
Object
- Object
- Cloudscale::Monitor::InitMenus
- Defined in:
- lib/cloudscale/monitor/agent/init_menus.rb
Instance Attribute Summary collapse
-
#agentInstanceId ⇒ Object
Returns the value of attribute agentInstanceId.
-
#client ⇒ Object
Returns the value of attribute client.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#log ⇒ Object
Returns the value of attribute log.
-
#server ⇒ Object
Returns the value of attribute server.
Instance Method Summary collapse
- #init_menu(menuItem, agentInstanceId) ⇒ Object
-
#initialize(agentInstanceId, path) ⇒ InitMenus
constructor
A new instance of InitMenus.
Constructor Details
#initialize(agentInstanceId, path) ⇒ InitMenus
Returns a new instance of InitMenus.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/cloudscale/monitor/agent/init_menus.rb', line 16 def initialize(agentInstanceId, path) if (agentInstanceId == nil) raise "InitMenu.new(): AgentInstanceId may not be null" end @log = Logger.new(STDOUT) @log.info("Initializing Menu") @client = RestClientWrapper.instance file = File.read(path); plugin = YAML.load(JSON.parse(file).to_yaml) plugin.each do | key, value | (value, agentInstanceId) end end |
Instance Attribute Details
#agentInstanceId ⇒ Object
Returns the value of attribute agentInstanceId.
14 15 16 |
# File 'lib/cloudscale/monitor/agent/init_menus.rb', line 14 def agentInstanceId @agentInstanceId end |
#client ⇒ Object
Returns the value of attribute client.
14 15 16 |
# File 'lib/cloudscale/monitor/agent/init_menus.rb', line 14 def client @client end |
#customer ⇒ Object
Returns the value of attribute customer.
14 15 16 |
# File 'lib/cloudscale/monitor/agent/init_menus.rb', line 14 def customer @customer end |
#log ⇒ Object
Returns the value of attribute log.
14 15 16 |
# File 'lib/cloudscale/monitor/agent/init_menus.rb', line 14 def log @log end |
#server ⇒ Object
Returns the value of attribute server.
14 15 16 |
# File 'lib/cloudscale/monitor/agent/init_menus.rb', line 14 def server @server end |
Instance Method Details
#init_menu(menuItem, agentInstanceId) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/cloudscale/monitor/agent/init_menus.rb', line 32 def (, agentInstanceId) ["agentInstanceId"] = agentInstanceId = @client.searchOne("menus", "findByAgentInstanceIdAndMenuId", { :agentInstanceId => agentInstanceId, :menuId => ["menuId"]}) if ( == nil) client.post("menus", ) else client.patch("menus", RestClientWrapper.load_entity_id(), ) end end |