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.



23
24
25
# File 'lib/vra/catalog.rb', line 23

def initialize(client)
  @client = client
end

Instance Attribute Details

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



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

def all_items
  fetch_resources Vra::CatalogItem
end

#all_sourcesObject



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

def all_sources
  fetch_resources Vra::CatalogSource
end

#all_typesObject



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