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
|
|
|
|
2010-04-16 03:20:02 -04:00
|
|
|
class GetNodeServices < Fog::Parsers::Base
|
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'
|
|
|
|
@node_service[name] = @value
|
|
|
|
when 'Enabled'
|
|
|
|
if @value == 'true'
|
|
|
|
@node_service[name] = true
|
|
|
|
else
|
|
|
|
@node_service[name] = false
|
|
|
|
end
|
|
|
|
when 'Id', 'Port'
|
|
|
|
@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
|