# Managed Object - InventoryView(vim.view.InventoryView)

Returned by
  CreateInventoryView
Extends
  ManagedObjectView
See also
  ManagedEntity
Since
  VI API 2.5

## Managed Object Description

The InventoryView managed object provides a means of browsing the inventory and tracking changes to open folders. This managed object is particularly useful for UI clients that display a tree-based navigation panel of the inventory.

InventoryView maintains the View list of managed object references to inventory objects. When you create an inventory view (CreateInventoryView), the server initializes the view's object list with a single folder - the root folder.

InventoryView provides methods to open and close folders in the inventory. Use these methods to add and subtract objects from the View list. Use the InventoryView together with the PropertyCollector to manage the data resulting from OpenInventoryViewFolder and CloseInventoryViewFolder methods. By using the PropertyCollector, you have access to the modifications to the view, rather than processing the entire view list.

For example, you might use the following sequence of operations with an InventoryView and the PropertyCollector:

1. Create an InventoryView.
2. Create a filter specification for the PropertyCollector.
   - Use the InventoryView as the starting object in the ObjectSpec for the filter.
   - Use a set of TraversalSpec data objects to identify paths in possible inventory configurations.
   - Use the PropertySpec to identify object properties for retrieval.
3. Use either the CheckForUpdates or WaitForUpdates method to obtain InventoryView modifications. Both methods return an UpdateSet object that describes the changes returned by the PropertyCollector.
4. Call the OpenInventoryViewFolder or CloseInventoryViewFolder.

Properties

Name | Type | Description
--- | --- | ---
None
Properties inherited from ManagedObjectView
view
Properties inherited from View
None

Methods

Methods defined in this Managed Object
CloseInventoryViewFolder, OpenInventoryViewFolder
Methods inherited from ManagedObjectView
None
Methods inherited from View
DestroyView

# CloseInventoryViewFolder(closeFolder)

Notify the server that folder(s) have been closed, and changes for all its contained objects should no longer be sent. The associated child objects are removed from the view. The containers themselves will still be retained as open objects until their parent is closed.

May partially succeed if some entities could not be resolved. The operation will still succeed for all entities that could be resolved, and the list of those that failed is returned as the result.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the InventoryView used to make the method call.
entity P | ManagedObjectReference[] to a ManagedEntity[] | An array of managed object references. Each array entry is a reference to an entity to collapse. Since VI API 2.5

P Required privilege: entity

Return Value

Type | Description
--- | ---
ManagedObjectReference[] to a ManagedEntity[] | A list containing any entities in the argument could not be resolved.

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="CloseInventoryViewFolder" type="pbm:CloseInventoryViewFolderRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="CloseInventoryViewFolderResponse"> <complexType> <sequence> <element name="returnval" type="pbm:ManagedObjectReference" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>

# OpenInventoryViewFolder(openFolder)

Adds the child objects of a given managed entity to the view.

If a Datacenter is returned as a child, the implicit virtual machine folder and host folder objects are also returned. If a ComputeResource is returned, the implicit root ResourcePool and HostSystem objects are also returned.

May partially succeed if some entities could not be resolved. The operation will still succeed for all entities which could be resolved, and the list of those which failed is returned as the result.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the InventoryView used to make the method call.
entity P | ManagedObjectReference[] to a ManagedEntity[] | An array of managed object references. Each array entry is a reference to an entity to expand. Expands each entity in the order given. If an entity is not in the current view, expands the view as needed. Since VI API 2.5

P Required privilege: entity

Return Value

Type | Description
--- | ---
ManagedObjectReference[] to a ManagedEntity[] | A list containing any entities in the argument could not be resolved.

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="OpenInventoryViewFolder" type="pbm:OpenInventoryViewFolderRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="OpenInventoryViewFolderResponse"> <complexType> <sequence> <element name="returnval" type="pbm:ManagedObjectReference" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>