2013-06-18 11:29:42 -04:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/vcloudng/models/compute/organization'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Vcloudng
|
|
|
|
|
|
|
|
class Organizations < Fog::Collection
|
|
|
|
model Fog::Compute::Vcloudng::Organization
|
|
|
|
|
|
|
|
def all
|
|
|
|
data = service.get_organizations.body
|
2013-06-19 11:06:44 -04:00
|
|
|
org = data[:Org]
|
|
|
|
org[:id] = org[:href].split('/').last
|
|
|
|
load([org])
|
2013-06-18 11:29:42 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def get(organization_id)
|
2013-06-19 11:06:44 -04:00
|
|
|
data = service.get_organization(organization_id).body
|
|
|
|
data.delete(:Link)
|
|
|
|
data[:id] = data[:href].split('/').last
|
|
|
|
new(data)
|
2013-06-18 11:29:42 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|