2010-04-16 21:31:00 -04:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
|
|
|
module Terremark
|
|
|
|
|
|
|
|
class GetNodeServices < Fog::Parsers::Base
|
|
|
|
|
|
|
|
def reset
|
|
|
|
@node_service = {}
|
|
|
|
@response = { 'NodeServices' => [] }
|
|
|
|
end
|
|
|
|
|
|
|
|
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
|
|
|
|
when 'NodeService'
|
|
|
|
@response['NodeServices'] << @node_service
|
|
|
|
@node_service = {}
|
2010-04-16 21:31:00 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|