This topic explains federated configuration management database queries.
You can execute federated configuration management database queries using the command line client.
At the COSMOS prompt, type smlmdr query followed by the path to the query file, to run a query against the SML MDR. If you are querying the Example MDR, the command is examplemdr.
Query files are located in the following directories:
When prompted for the EPR for the SML MDR or the Example MDR, you can copy the EPR from the output of the broker getDataManagers command described in the section "Data Managers Registered at the Broker Query."
Output Samples
COSMOS>smlmdr query __\cosmos-demo\cosmos-client\cmdbf-queries\SMLMDR\testInstanceIdQuery.txt
EPR of SML Repository MDR (terminate by an empty line):
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>
http://____:8080/cosmos/services/org.eclipse.cosmos.rm.sml.mdr.impl.SmlRepositoryMdr
</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">SML_REPO_ID
</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsa:EndpointReference>
Query response:
<?xml version="1.0" encoding="UTF-8"?>
<dyn:queryResponseType xmlns:dyn="http://www.eclipse.org/cosmos/mdrquery">
<dyn:queryResponseType xmlns="http://cmdbf.org/schema/1-0-0/datamodel">
<nodes templateId="cableTemplate">
........ Content omitted .........
</nodes>
</dyn:queryResponseType>
</dyn:queryResponseType>
You can invoke queries on the Example MDR using the command line client.
COSMOS>examplemdr query __\cosmos-demo\cosmos-client\cmdbf-queries\ExampleMDR\all-students.txt
EPR of SML Repository MDR (terminate by an empty line):
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>
http://_____:8080/examplemdr/services/org.eclipse.cosmos.example.mdr.ExampleMdr
</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">Example
</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsa:EndpointReference>
Query response:
<?xml version="1.0" encoding="UTF-8"?>
<dyn:queryResponseType xmlns:dyn="http://www.eclipse.org/cosmos/mdrquery">
<dyn:queryResponseType xmlns="http://cmdbf.org/schema/1-0-0/datamodel">
<nodes templateId="items">
........ Content omitted .........
</nodes>
</dyn:queryResponseType>
</dyn:queryResponseType>
Review the following tutorials: