PropertyCollector Data

This document assumes that you want to keep up with changes in the configuration of the vCenter Server, and therefore plan to use the update tracking capability of the PropertyCollector.

The PropertyCollector requires two fairly complex arguments: the PropertySpec and the ObjectSpec. The ObjectSpec contains instructions to the PropertyCollector describing where to look for the desired data. Because configuration information in vSphere is organized like a directory tree, the ObjectSpec must describe how to traverse the tree to obtain the desired information. The net result is a complex, nested, and recursive list of instructions. Fortunately, once you have determined the location of all the desired information, the ObjectSpec needed to determine the layout of a vSphere object hierarchy can be a static unvarying object. See the code example in section Understanding an ObjectSpec.

The PropertySpec is a list of desired property information. Formulating a list that includes all of the desired information can take some effort to compile, but once determined, this can be a static object also.

The data returned from the PropertyCollector is a container class called PropertyFilterUpdate, which contains an objectSet with an item-by-item list of changes to object properties. Every item in this container is identified with one of the following keys: enter (add), leave (delete), and modify. On the first data request, every data item is included, and “enter” is marked for every data item.

The PropertyCollector presents its results in what amounts to random order. Since all managed objects have a “parent” property, you can reconstruct the configuration hierarchy by building a tree in memory, using the parent identification to organize. The root folder is identified as the only folder without a parent.