Property Collector Program in Java for Web
Services SDKLast Updated December 16, 2024
PropertyCollector
provides a powerful, flexible, and efficient way to collect data from a vCenter Server or ESXi
host.Simple PropertyCollector Example (Java)
is a simple
PropertyCollector
example
written in Java. The example uses a
ContainerView
for efficient
access to the inventory and a
PropertyFilterSpec
that
contains one
ObjectSpec
, one
TraversalSpec
, and one
PropertySpec
. The program
performs the following tasks:
- Accepts command line arguments for the vSphere server name (DNS name or IP address), user name, and password.
- Connects to a vSphere server.
- Uses aContainerViewto create a subset of the inventory; the subset contains only virtual machines.
- Uses theRetrievePropertiesExmethod for a single retrieval operation.
- Collects the names of all of the virtual machines in the inventory and prints the names using the standard output stream.
- Closes the connection to the server.
Figure 1
shows the objects used in
Simple PropertyCollector Example (Java).
The figure represents properties that identify inventory elements directly or
indirectly. It does not show all the properties for the different objects.
Property Filter Specification

Simple PropertyCollector Example
(Java)