1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/slicehost/helper.rb

51 lines
1,014 B
Ruby
Raw Normal View History

module Slicehost
def self.[](service)
@@connections ||= Hash.new do |hash, key|
credentials = Fog.credentials.reject do |k, v|
![:slicehost_password].include?(k)
end
hash[key] = case key
when :slices
Fog::Slicehost.new(credentials)
end
end
@@connections[service]
end
module Formats
BACKUP = {
'date' => String,
'id' => Integer,
'name' => String,
'slice-id' => Integer
}
FLAVOR = {
'id' => Integer,
'name' => String,
'price' => Integer,
'ram' => Integer
}
IMAGE = {
'id' => Integer,
'name' => String
}
SLICE = {
'addresses' => [String],
'bw-in' => Float,
'bw-out' => Float,
'flavor-id' => Integer,
'id' => Integer,
'image-id' => Integer,
'name' => String,
'progress' => Integer,
'status' => String
}
end
end