2013-06-18 17:29:42 +02:00
|
|
|
require 'fog/core/collection'
|
2013-08-27 11:19:54 +02:00
|
|
|
require 'fog/vcloud_director/models/compute/organization'
|
2013-06-18 17:29:42 +02:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
2013-08-27 11:19:54 +02:00
|
|
|
class VcloudDirector
|
2013-06-18 17:29:42 +02:00
|
|
|
|
2013-07-09 14:19:21 +02:00
|
|
|
class Organizations < Collection
|
2013-08-27 11:19:54 +02:00
|
|
|
model Fog::Compute::VcloudDirector::Organization
|
2013-06-18 17:29:42 +02:00
|
|
|
|
2013-07-08 16:57:40 +02:00
|
|
|
|
2013-07-09 13:32:33 +02:00
|
|
|
private
|
2013-06-18 17:29:42 +02:00
|
|
|
|
2013-07-08 16:57:40 +02:00
|
|
|
def get_by_id(org_id)
|
2013-07-08 20:13:36 +02:00
|
|
|
org = service.get_organization(org_id).body
|
|
|
|
org.delete(:Link)
|
|
|
|
service.add_id_from_href!(org)
|
|
|
|
org
|
2013-06-18 17:29:42 +02:00
|
|
|
end
|
2013-07-08 16:57:40 +02:00
|
|
|
|
2013-07-09 14:19:21 +02:00
|
|
|
def item_list
|
2013-07-08 16:57:40 +02: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 17:29:42 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|