[vcloud|compute] add catalogs to an organization
This commit is contained in:
parent
5d3699569c
commit
f87750634c
|
@ -7,8 +7,11 @@ module Fog
|
||||||
|
|
||||||
model Fog::Vcloud::Compute::Catalog
|
model Fog::Vcloud::Compute::Catalog
|
||||||
|
|
||||||
|
attribute :organization_uri
|
||||||
|
|
||||||
def all
|
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)
|
load(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -20,10 +23,6 @@ module Fog
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def organization_uri
|
|
||||||
@organization_uri ||= connection.default_organization_uri
|
|
||||||
end
|
|
||||||
|
|
||||||
def item_by_name(name)
|
def item_by_name(name)
|
||||||
res = nil
|
res = nil
|
||||||
items = all.collect { |catalog| catalog.catalog_items }
|
items = all.collect { |catalog| catalog.catalog_items }
|
||||||
|
|
|
@ -31,6 +31,12 @@ module Fog
|
||||||
:href => href )
|
:href => href )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def catalogs
|
||||||
|
@catalogs ||= Fog::Vcloud::Compute::Catalogs.
|
||||||
|
new( :connection => connection,
|
||||||
|
:href => href )
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def collection_based_on_type(type, klass = nil)
|
def collection_based_on_type(type, klass = nil)
|
||||||
|
|
Loading…
Reference in New Issue