Class: Vra::Catalog

Inherits:
Object
  • Object
show all
Defined in:
lib/vra/catalog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clientObject (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_itemsObject



36
37
38
# File 'lib/vra/catalog.rb', line 36

def all_items
  fetch_resources Vra::CatalogItem
end

#all_sourcesObject



32
33
34
# File 'lib/vra/catalog.rb', line 32

def all_sources
  fetch_resources Vra::CatalogSource
end

#all_typesObject



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