The MIT allows operations such as search, traversal, insertion, and deletion. One of the most common operations is a search to query information from the MIT.
The following types of queries are supported:
- tree-level query: search the MIT for objects of a specific subtree.
- class-level query: search the MIT for objects of a specific class.
- object-level query: search the MIT for a specific DN.
Each of these query types support numerous filtering and subtree options, but the primary difference is the way that each type is used.
A class-based query is useful for searching for a specific type of information without knowing all the details, or only knowing partial details. Because a class-based query can return a range of results from zero to many, it can be a helpful means of querying the fabric for information when the full details are not known. A class-based query combined with filtering can be a powerful tool for extracting data from the MIT. For example, a class-based query can be used to find all interfaces that are functioning as uplink interfaces on leaf switches in a datacenter fabric and extract their CDP/LLDP information, for a way to rapidly create a cable plan of the fabric.
An object-based (DN) query returns a single match, and the full DN for an object must be provided for a match to be found. Combined with an initial class query, a DN query can be helpful for finding more details about an object referenced from another object, or for updating a local copy of information.
Both query types support tree-level queries with scope and filtering criteria. Thus, you can query the MIT for all objects of a specific class or DN and then retrieve the children or complete subtree for the returned objects. Furthermore, the data sets can be filtered to return only records of interest for the current purpose.
The next chapter, which discusses the REST API, provides more information about how to build and run these queries.