mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
9d4b6a8bfb
have added new parser and request for get_zones. As slicehost docs are sparse, parser has not been updated. Will do so once I analyze xml that comes back from request (ie next checkin should have working parser)
35 lines
808 B
Ruby
35 lines
808 B
Ruby
module Fog
|
|
module Parsers
|
|
module Slicehost
|
|
module Compute
|
|
|
|
class GetZones < Fog::Parsers::Base
|
|
|
|
def reset
|
|
@zone = {}
|
|
@response = { 'zones' => [] }
|
|
end
|
|
|
|
def end_element(name)
|
|
case name
|
|
when 'address'
|
|
@slice['addresses'] ||= []
|
|
@slice['addresses'] << @value
|
|
when 'backup-id', 'flavor-id', 'id', 'image-id', 'progress'
|
|
@slice[name] = @value.to_i
|
|
when 'bw-in', 'bw-out'
|
|
@slice[name] = @value.to_f
|
|
when 'name', 'status'
|
|
@slice[name] = @value
|
|
when 'slice'
|
|
@response['slices'] << @slice
|
|
@slice = {}
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|