Class: Vra::Catalog
- Inherits:
-
Object
- Object
- Vra::Catalog
- Defined in:
- lib/vra/catalog.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #all_items ⇒ Object
- #all_sources ⇒ Object
- #all_types ⇒ Object
- #entitled_items(project_id) ⇒ Object
- #entitled_sources(project_id) ⇒ Object
- #fetch_catalog_items(catalog_name) ⇒ Object
-
#initialize(client) ⇒ Catalog
constructor
A new instance of Catalog.
- #request(*args) ⇒ Object
Constructor Details
#initialize(client) ⇒ Catalog
Returns a new instance of Catalog.
23 24 25 |
# File 'lib/vra/catalog.rb', line 23 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
21 22 23 |
# File 'lib/vra/catalog.rb', line 21 def client @client end |
Instance Method Details
#all_items ⇒ Object
35 36 37 |
# File 'lib/vra/catalog.rb', line 35 def all_items fetch_resources Vra::CatalogItem end |
#all_sources ⇒ Object
31 32 33 |
# File 'lib/vra/catalog.rb', line 31 def all_sources fetch_resources Vra::CatalogSource end |
#all_types ⇒ Object
27 28 29 |
# File 'lib/vra/catalog.rb', line 27 def all_types fetch_resources Vra::CatalogType end |
#entitled_items(project_id) ⇒ Object
43 44 45 |
# File 'lib/vra/catalog.rb', line 43 def entitled_items(project_id) fetch_entitlements(project_id, "CatalogItemIdentifier") end |
#entitled_sources(project_id) ⇒ Object
39 40 41 |
# File 'lib/vra/catalog.rb', line 39 def entitled_sources(project_id) fetch_entitlements(project_id, "CatalogSourceIdentifier") end |
#fetch_catalog_items(catalog_name) ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/vra/catalog.rb', line 51 def fetch_catalog_items(catalog_name) fetch_resources( Vra::CatalogItem, "/catalog/api/items", "search=#{catalog_name}" ) end |
#request(*args) ⇒ Object
47 48 49 |
# File 'lib/vra/catalog.rb', line 47 def request(*args) Vra::DeploymentRequest.new(@client, *args) end |