2010-09-08 18:00:47 -04:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
|
|
|
module Slicehost
|
|
|
|
module Compute
|
|
|
|
|
|
|
|
class GetSlice < Fog::Parsers::Base
|
|
|
|
|
|
|
|
def reset
|
|
|
|
@response = {}
|
|
|
|
end
|
|
|
|
|
|
|
|
def end_element(name)
|
|
|
|
case name
|
|
|
|
when 'address'
|
|
|
|
@response['addresses'] ||= []
|
2011-05-12 16:15:13 -04:00
|
|
|
@response['addresses'] << value
|
2010-09-08 18:00:47 -04:00
|
|
|
when 'backup-id', 'flavor-id', 'id', 'image-id', 'progress'
|
2011-05-12 16:15:13 -04:00
|
|
|
@response[name] = value.to_i
|
2010-09-08 18:00:47 -04:00
|
|
|
when 'bw-in', 'bw-out'
|
2011-05-12 16:15:13 -04:00
|
|
|
@response[name] = value.to_f
|
2010-09-08 18:00:47 -04:00
|
|
|
when 'name', 'status'
|
2011-05-12 16:15:13 -04:00
|
|
|
@response[name] = value
|
2010-09-08 18:00:47 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|