2010-04-16 21:31:00 -04:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
|
|
|
module Terremark
|
2010-04-16 03:20:02 -04:00
|
|
|
module Shared
|
2010-04-16 21:31:00 -04:00
|
|
|
|
2013-02-12 07:52:46 -05:00
|
|
|
class GetNodeServices < TerremarkParser
|
2010-04-16 21:31:00 -04:00
|
|
|
|
2010-04-16 03:20:02 -04:00
|
|
|
def reset
|
|
|
|
@node_service = {}
|
|
|
|
@response = { 'NodeServices' => [] }
|
|
|
|
end
|
2010-04-16 21:31:00 -04:00
|
|
|
|
2010-04-16 03:20:02 -04:00
|
|
|
def end_element(name)
|
|
|
|
case name
|
2010-04-19 06:04:52 -04:00
|
|
|
when 'Description', 'Href', 'Name', 'IpAddress'
|
2011-05-12 16:15:13 -04:00
|
|
|
@node_service[name] = value
|
2010-04-19 06:04:52 -04:00
|
|
|
when 'Enabled'
|
2011-05-12 16:15:13 -04:00
|
|
|
if value == 'true'
|
2010-04-19 06:04:52 -04:00
|
|
|
@node_service[name] = true
|
|
|
|
else
|
|
|
|
@node_service[name] = false
|
|
|
|
end
|
|
|
|
when 'Id', 'Port'
|
2011-05-12 16:15:13 -04:00
|
|
|
@node_service[name] = value.to_i
|
2010-05-10 17:16:53 -04:00
|
|
|
when 'NodeService'
|
|
|
|
@response['NodeServices'] << @node_service
|
|
|
|
@node_service = {}
|
2010-04-16 03:20:02 -04:00
|
|
|
end
|
2010-04-16 21:31:00 -04:00
|
|
|
end
|
2010-04-16 03:20:02 -04:00
|
|
|
|
2010-04-16 21:31:00 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|