2010-09-08 18:00:47 -04:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
module Slicehost
|
2010-09-08 18:00:47 -04:00
|
|
|
|
|
|
|
class CreateSlice < 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', 'root-password', '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
|