MQL query service

The MQL query service resource retrieves model object data based on queries written in the Model Query Language (MQL).

Description

Use this resource to retrieve model object data using queries written in MQL. The MQL query service can provide more detailed information than is available from the Model Object Class resource.

URL

scheme//hostname:port/rest/model/MQLQuery
where:
scheme
The scheme of the URL (either HTTP: or HTTPS:).
hostname
The TCP/IP hostname or numeric IP address of the TADDM server.
port
The TCP/IP port on the TADDM server for the type of connection you are using (9430 for HTTP, or 9431 for HTTPS).

HTTP methods

GET
Queries model objects.

Parameters

depth=value
The depth of the query. The default value is 1.
Note: A query with a depth greater than 1 can return a large result set, causing low-memory conditions on the TADDM server. To avoid this problem, specify fetchSize=1 and use consecutive queries to scroll through the data one position at a time. Refer to the sample programs in the $COLLATION_HOME/sdk/examples/rest directory to see examples of how to use this technique.
feed={json|xml}

The format to use for the returned data. Specify json or xml. This parameter is optional.

If you do not specify the feed parameter, the server uses the format specified by the HTTP Accept header (application/json or application/xml). If this header is not specified, the results are returned in JSON format.

fetchSize=value
The maximum number of objects to return from the result set. The default value is 1.
longClassName={true|false}
Specifies whether all model object class names in the output must be specified using the fully qualified form (for example, com.collation.platform.model.topology.sys.ComputerSystem). Specify true or false. This option is valid only for JSON output. The default value is false.
mssGuid=value
The GUID value of the management software system (MSS) associated with the object. This parameter is optional.
position=value
The starting position in the result set for the objects you want returned from the query. The default value is 1 (the first object in the result set). If you specify a position that is greater than the total number of objects in the result set, no objects are returned.
query=value
The query string, written in MQL notation. This parameter is required.
Note: Model object queries can return large amounts of data. To avoid memory and performance problems, select only the columns you need.

Returns

If the query is successful, the server returns the HTTP return code 200, and the query result data in either JSON or XML format (as specified by the feed parameter or the HTTP Accept header). If the query returns no data, the result set is an empty JSON array or XML document, depending on the feed type.

The TADDMQueryComplete pragma header of the returned data indicates whether all available query results have been returned; true indicates that all results have been returned, and false indicates that more query results are available. You can control which results are returned by adjusting the values of the optional position and fetchSize parameters.

Example

This example queries model object data using the MQL query select displayName,OSRunning.OSName from ComputerSystem.
http://example.com:9430/rest/model/MQLQuery?query=select%20displayName,
OSRunning.OSName%20from%20ComputerSystem&position=2&fetchSize=2&feed=xm
l&depth=2&position=4