1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/vcloudng/models/compute/organizations.rb

31 lines
674 B
Ruby
Raw Normal View History

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 < Collection
2013-06-18 11:29:42 -04:00
model Fog::Compute::Vcloudng::Organization
2013-07-08 10:57:40 -04:00
2013-07-09 07:32:33 -04:00
private
2013-06-18 11:29:42 -04:00
2013-07-08 10:57:40 -04:00
def get_by_id(org_id)
2013-07-08 14:13:36 -04:00
org = service.get_organization(org_id).body
org.delete(:Link)
service.add_id_from_href!(org)
org
2013-06-18 11:29:42 -04:00
end
2013-07-08 10:57:40 -04:00
def item_list
2013-07-08 10:57:40 -04:00
data = service.get_organizations.body
org = data[:Org] # there is only a single Org
service.add_id_from_href!(org)
[org]
end
2013-06-18 11:29:42 -04:00
end
end
end
end