mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[vcloud|compute] add catalogs to an organization
This commit is contained in:
parent
5d3699569c
commit
f87750634c
2 changed files with 10 additions and 5 deletions
|
@ -7,8 +7,11 @@ module Fog
|
|||
|
||||
model Fog::Vcloud::Compute::Catalog
|
||||
|
||||
attribute :organization_uri
|
||||
|
||||
def all
|
||||
data = connection.get_organization(organization_uri).body[:Link].select { |link| link[:type] == "application/vnd.vmware.vcloud.catalog+xml" }
|
||||
org_uri = self.organization_uri || connection.default_organization_uri
|
||||
data = connection.get_organization(org_uri).body[:Link].select { |link| link[:type] == "application/vnd.vmware.vcloud.catalog+xml" }
|
||||
load(data)
|
||||
end
|
||||
|
||||
|
@ -20,10 +23,6 @@ module Fog
|
|||
nil
|
||||
end
|
||||
|
||||
def organization_uri
|
||||
@organization_uri ||= connection.default_organization_uri
|
||||
end
|
||||
|
||||
def item_by_name(name)
|
||||
res = nil
|
||||
items = all.collect { |catalog| catalog.catalog_items }
|
||||
|
|
|
@ -31,6 +31,12 @@ module Fog
|
|||
:href => href )
|
||||
end
|
||||
|
||||
def catalogs
|
||||
@catalogs ||= Fog::Vcloud::Compute::Catalogs.
|
||||
new( :connection => connection,
|
||||
:href => href )
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def collection_based_on_type(type, klass = nil)
|
||||
|
|
Loading…
Add table
Reference in a new issue