Created by: John McDonough on 14-07-2010 06:35:45 PM When you first open the UCS Manager GUI application, you'll see a on the lower right in the Status Bar a progress indicator showing that data is being retrieved. If you were to capture this traffic in WireShark or some other traffic sniffing applicaiton you would see multiple query requests being made from the UCS Manager back to the UCS itself. These queries are responsible for populating the information displayed in the manager interface.
Queries are also the heart of the Visore application that ships with UCS Manager. For those unfamiliar with Visore it is a browser based UCS Object browser. To access Visore point you browser (works best in Firefox, and Chrome) to http://<ucs-ip-address>/visore.html, enter login information and authenticate. If the provided credentials are valid the browser will be populated with the top-level UCS Objects.
Utilizing Visore is not the subject of this post, however I did want to point out a link on the Visore interface. The link near the top of the page "Display XML of last query", when clicked will show the query that was used to populate the page. This can be invaluable information when developing queries for use in you application.
On to the Queries, there are eight essential queries
- configFindDnsByClassId - Retrieve a list of distinguished names of a particular class type - configResolveChildren - Query UCS object Children - configResolveClass - Query UCS Oject by Class - configResolveClasses - Query UCS Oject by Classes - configResolveDn - Query UCS Object by distinguised name - configResolveDns - Query UCS Objects by distinguised names - configResolveParent - Query UCS Object Parent - configScope - Achor the Object Query to a specific point in the object tree
Queries are useful in so many ways, monitoring, managemnt, inventory reporting, statistics gathering, gathering input for configuartion calls, etc...
Let's start with the basic queries configResolveClass and configResolveDn.
Objects in UCS have a dn or Distinguoshed name, this name is an unambiguous reference to the object. Objects are also of a specific class type. Objects can have only one dn that refencees them and can only have one class type.
When you query with the confgResolveDn method only a single object is returned and perhaps it's children objects if the attribute inHierarchical for the query is set to "true". When you query with the configResolveClass method multiple objects can be returned based on the class and the UCS configuration, chidlren objects of those objects could also be returned based inHierarchical attribute.
configResolveDn query to get information about Chassis-1 <configResolveDn cookie="1276271945/81b81df3-e2d9-42ea-80ac-6a2e535f232e" inHierarchical="false" dn="sys/chassis-1"/>
The response has one object of equipmentChassis class
configResolveClass query to get information about the class equipmentChassis, this is the class that Chassis belong to <configResolveClass cookie="1276271945/81b81df3-e2d9-42ea-80ac-6a2e535f232e" inHierarchical="false" classId="equipmentChassis"/>
The response for this UCS has multiple objects of class equipmentChassis because there are multiple chassis.
Let's look at a single Service Profile with inHierarchical set to true, the dn is org-root/org-jomcdono/ls-esx4-01-node-01 <configResolveDn cookie="1276271945/81b81df3-e2d9-42ea-80ac-6a2e535f232e" inHierarchical="true" dn="org-root/org-jomcdono/ls-esx4-01-node-01"/>
Had I queried for the Class lsServer I would have gotten all the Service Profiles on the system, associated with blades or not and service profile templates. Had I only wanted associated blades that are actual Service Profiles not templates then I would have used a filter in my query. Query filters will be the subject of a later post.
What is I want multiple classes or more than one dn, there are queries for that as well... configResolveClasses and configResolveDns
In these queries a list of dns or classes is passed as part of the query configResolveDns <configResolveDns cookie="1276279335/68222b90-d124-4e61-987d-21d2faccb43c" inHierarchical="false"> <inDns> <dn value="org-root/org-jomcdono/ls-esx4-01-node-01"/> <dn value="org-root/org-jomcdono/ls-esx4-01-node-02"/> <dn value="sys/Chassis-1"/> </inDns> </configResolveDns>
The output from these queries would be similar in that they would both contain lsServer and equipmentchassis objects. The classes query would most likely contain more objects unless the UCS being queried only had one chassis and two service profiles defined.
configResolveParent and configResolveChildren are pretty straight forward and act much as you would expect them to, although there is an option that can be employeed with configResolveChildren that allows for the retrieval of all the children objects or just the children objects of a specific class.
configResolveParent, allows for the retrieval of the parent of an object based on the provided dn. <configResolveParent cookie="1278509820/594928ca-9672-40a3-a9e7-ddd14b77bc89" inHierarchical="false" dn="sys/switch-B/psu-2/fault-F0378"/>
configResolveParent could be replaced with configResloveDn since we know the dn of the child object the application issuing the query could easily remove
the last object from the dn that we have and issue a configResolveDn.
configResolveChildren allows for the retrieval of all the children objects of a dn or all the children objects of a dn of a specific class. For example if we only wnated to find the external Ethernet interface (adaptorExtEthIf) child objects of a blade adaptor (adaptorUnit) the following query could be used <configResolveChildren cookie="1279126960/fe35a472-618c-491b-b0c4-44efce2b8607" inHierarchical="false" inDn="sys/chassis-1/blade-1/adaptor-1" classId="adaptorExtEthIf" />
The query that gets all the children objects of adaptorUnit is very similar to the one above except that it does not have the classId attribute specified in the query as shown below. <configResolveChildren cookie="1279126960/fe35a472-618c-491b-b0c4-44efce2b8607" inHierarchical="false" inDn="sys/chassis-1/blade-1/adaptor-1" />
The query would return all the children objects of the specified dn.
configFindDnsByClassId returns a list of dns of a specified class type, some uses would be to get all the dns of the chassis (equipmentChassis) or blades (computeBlades) or service profiles (lsServer) or perhaps all the dns for objects that represent fan speed statistics (equipmentFanStats)Chassis (running against a single chassis UCS)
Notice two things about the query, in the query the inHierarchical attribute is not used and in the response there is no specific order in which the dns are returned.
configScope allows for the rooting of a query at a specific point in the tree, the root is specified by a dn and a class is specified as the object type to return. For example suppose you only wanted to retrieve the fan speed statistics for fan module 8 in chassis 1, sys/chassis-1/fan-module-1-8 the configScope query would look like this <configScope cookie="1279126960/fe35a472-618c-491b-b0c4-44efce2b8607" dn="sys/chassis-1/fan-module-1-8" inClass="equipmentFanStats" />
How is configScope different from configResolveChildren? Notice that the configScope query specifies the root dn as sys/chassis-1/fan-module-1-8 for a configResolveChildren the stats object is a child of the fan-1 or fan-2 object under the fan-module object. In order to get both stats objects for the fan-module two configResolveChildren queries would need to be run to get the fan speed stats objects. One query for sys/cahssis-1/fan-module-1-8/fan-1 and one for sys/cahssis-1/fan-module-1-8/fan-2
Next time I'll discuss filters and regular expressions.
John McDonough Cisco Advanced Services UCS Compute and Virtualization Practice
Sandbox af205c78-86ac-4be0-a563-a030052f9a0f that is linked from:https://developer.cisco.com/learning/lab/imc-redfish-rest-api-101/step/1seems not longer available.Is there another sandbox with access to the Redfish interface from an C-series system ?Than...
Hi developers, I am trying to install the ACItoolkit into my windows 10 machine. I have downloaded it, but when trying to install it using the power shell, i am getting a permission denied error - PS D:\ACItoolKit\acitoolkit-master> lsDirect...
Hi,I am looking for a way to get the LLDP and CDP information of each ethernet-port of a fabric via REST-interface of DCNM?Infrastructure:DCNM, LAN Fabric, Version 11.3NK9-switchesIs this possible? Can someone give me a hint.... ThanksJuergen
Dear DevNet members.I'm looking for a way to send a REST API query to retrieve the field of "Overall Status" that appears in UCS Manager -> Equipment -> Chassis (see attached). This is just an example of trying to retrieve overall of status of Cisco...