Submit Queries to a Data Manager
This tutorial will go through the steps to create and submit a query to a Data Manager using the Basic Query Dialog.
Consider the "Resource Repository" which manages a repository that contains asset data. This data is modeled using the Service Modeling Language. The current repository contains asset information about a rack unit that has a set of mounted CPUs connected by cables and switches. Users can construct a CMDBf query to acquire asset information on these resources. We will submit a query to the "Resource Repository" by right-clicking the "Resource Repository" from the navigator. This will bring up a pop-up menu that shows three options. Select the "Submit Query" menu option as illustrated below.
Click on the option. This will bring up a dialog box that will allow the user to enter a CMDBf query. Let us submit the following CMDBf query. This query return information about a computer system.
<?xml version="1.0" encoding="UTF-8"?> <s:query xmlns:s="http://cmdbf.org/schema/1-0-0/datamodel"> <s:itemTemplate id="cableTemplate"> <s:instanceIdConstraint> <s:instanceId> <s:mdrId>http://cosmos.org/rm/sml/repository</s:mdrId> <s:localId>computer-systems/instance0.xml</s:localId> </s:instanceId> </s:instanceIdConstraint> </s:itemTemplate> </s:query>
Enter the above CMDBf query in the Dialog box and click "Submit" as shown below.
The graph response viewer should be shown in the details pane in the top right pane as shown below.
Click on the "Source" cell in the "Nodes and Edges" section of the view. The Record section of the view should show the cable information. Note that the asset information is displayed as a SML structure as follows:
<s:computerSystem> <s:manufacturer name="Dell"/> <s:processor name="processor"> <s:vendor name="Intel"/> <s:instructionSet label="x86"/> <s:clock multiplier="G" speed="2"/> <s:systemBoardUUID value="DC5678654-ABCD-9876-B023-89506DEB0000"/> </s:processor> <s:ram name="ram"> <s:size amount="2000" multiplier="M"/> </s:ram> <s:disk name="disk"> <s:size amount="120" multiplier="G"/> </s:disk> <s:network> <s:mac address="00:02:55:AA:F5:54"/> <s:ports> <s:port number="8080"/> <s:port number="5000"/> </s:ports> </s:network> <s:os sml:ref="true"> <sml:uri>operating-systems/instance0.xml</sml:uri> </s:os> </s:computerSystem>
We can see that the SML document that is displayed contains asset information about the computer system.