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.
24 25 26 |
# File 'lib/vra/catalog.rb', line 24 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
22 23 24 |
# File 'lib/vra/catalog.rb', line 22 def client @client end |
Instance Method Details
#all_items ⇒ Object
36 37 38 |
# File 'lib/vra/catalog.rb', line 36 def all_items fetch_resources Vra::CatalogItem end |
#all_sources ⇒ Object
32 33 34 |
# File 'lib/vra/catalog.rb', line 32 def all_sources fetch_resources Vra::CatalogSource end |
#all_types ⇒ Object
28 29 30 |
# File 'lib/vra/catalog.rb', line 28 def all_types fetch_resources Vra::CatalogType end |
#entitled_items(project_id) ⇒ Object
44 45 46 |
# File 'lib/vra/catalog.rb', line 44 def entitled_items(project_id) fetch_entitlements(project_id, 'CatalogItemIdentifier') end |
#entitled_sources(project_id) ⇒ Object
40 41 42 |
# File 'lib/vra/catalog.rb', line 40 def entitled_sources(project_id) fetch_entitlements(project_id, 'CatalogSourceIdentifier') end |
#fetch_catalog_items(catalog_name) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/vra/catalog.rb', line 52 def fetch_catalog_items(catalog_name) fetch_resources( Vra::CatalogItem, '/catalog/api/admin/items', "search=#{catalog_name}" ) end |
#request(*args) ⇒ Object
48 49 50 |
# File 'lib/vra/catalog.rb', line 48 def request(*args) Vra::DeploymentRequest.new(@client, *args) end |