This documentation supports the 9.1 to 9.1 Service Pack 3 version and its patches of BMC Atrium Core. The documentation for version 9.1.04 and its patches is available here.

To view the latest version, select the version from the Product version menu.

CMDBf Query function

Retrieves data for the specified qualifications.from a Management Data Repository (MDR) that stores federated data.

Unlike the BMC Atrium CMDB GraphQuery operation, CMDBf GraphQuery can work with any federated CMDB or MDR. If you want to query BMC Atrium CMDB, you can use GraphQuery.

Queries can select and return items, relationships, or graphs containing items and relationships, and the data records associated with each item and relationship. An MDR or a federating CMDB can declare the data record types that its Query Service supports

A GraphQuery request describes the items and relationships of interest in the form of a graph. Constraints can be applied to the nodes (items) and edges (relationships) in that graph to further refine them. The GraphQuery response contains the items and relationships that, through their combination, compose a graph that satisfies the constraints of the graph in the query.

Note

  • The first <itemTemplate> element must have a <DatasetId> element to specify the dataset to query. If you do not specify the dataset ID, the query uses BMC.ASSET by default.
  • CMDBf Query does not use xpath.

WSDL operation

<operation name="GraphQuery">
	<input message="tns:QueryRequest" />
	<output message="tns:QueryResponse" />
	<fault name="UnkownTemplateID" message="tns:UnkownTemplateIDFault"/>
	<fault name="InvalidPropertyType" message="tns:InvalidPropertyTypeFault"/>
	<fault name="XPathError" message="tns:XPathErrorFault"/>
	<fault name="UnsupportedConstraint" message="tns:UnsupportedConstraintFault"/>
	<fault name="UnsupportedSelector" message="tns:UnsupportedSelectorFault"/>
	<fault name="QueryError" message="tns:QueryErrorFault"/>
</operation>

WSDL messages

<message name="QueryRequest">
	<part name="body" element="cmdbf:query" />
</message>
<message name="QueryResponse">
	<part name="body" element="cmdbf:queryResult" />
</message>
<message name="UnkownTemplateIDFault">
	<part name="Detail" element="cmdbf:UnkownTemplateIDFault"/>
</message>
<message name="InvalidPropertyTypeFault">
	<part name="Detail" element="cmdbf:InvalidPropertyTypeFault"/>
</message>
<message name="XPathErrorFault">
	<part name="Detail" element="cmdbf:XPathErrorFault"/>
</message>
<message name="UnsupportedConstraintFault">
	<part name="Detail" element="cmdbf:UnsupportedConstraintFault"/>
</message>
<message name="UnsupportedSelectorFault">
	<part name="Detail" element="cmdbf:UnsupportedSelectorFault"/>
</message>
<message name="ExpensiveQueryErrorFault">
	<part name="Detail" element="cmdbf:ExpensiveQueryErrorFault"/>
</message>
<message name="QueryErrorFault">
	<part name="Detail" element="cmdbf:QueryErrorFault"/>
</message>

XSD schema

<xs:complexType name="QueryType">
  <xs:sequence>
    <xs:element name="itemTemplate" type="cmdbf:ItemTemplateType"minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="relationshipTemplate"type="cmdbf:RelationshipTemplateType" 
    minOccurs="0" maxOccurs="unbounded" />
  </xs:sequence>
</xs:complexType>
</xs:complexType>
<xs:complexType name="ItemTemplateType">
  <xs:sequence>
    <xs:group ref="cmdbf:Constraints" />
    <xs:any namespace="##other" processContents="lax" minOccurs="0" 
    maxOccurs="unbounded" />
  </xs:sequence>
  <xs:attribute name="id" type="xs:ID" use="required" />
  <xs:attribute name="suppressFromResult" type="xs:boolean" use="optional" 
    default="false"/>
</xs:complexType>
</xs:complexType>
<xs:group name="Constraints" >
  <xs:sequence>
    <xs:element name="contentSelector" type="cmdbf:ContentSelectorType" 
      minOccurs="0" maxOccurs="1" />
    <xs:element name="instanceIdConstraint"       type="cmdbf:InstanceIdConstraintType" minOccurs="0" maxOccurs="1" />
    <xs:element name="recordConstraint" type="cmdbf:RecordConstraintType" 
      minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
</xs:group>
</xs:group>
<xs:complexType name="RelationshipTemplateType">
  <xs:sequence>
    <xs:group ref="cmdbf:Constraints" />
    <xs:element name="sourceTemplate" type="cmdbf:RelationshipRefType" 
      minOccurs="0" maxOccurs="1" />
    <xs:element name="targetTemplate" type="cmdbf:RelationshipRefType" 
      minOccurs="0" maxOccurs="1" />
    <xs:element name="depthLimit" type="cmdbf:DepthLimitType" minOccurs="0" 
      maxOccurs="1" />
    <xs:any namespace="##other" processContents="lax" minOccurs="0" 
      maxOccurs="unbounded" />
  </xs:sequence>
  <xs:attribute name="id" type="xs:ID" use="required" />
  <xs:attribute name="suppressFromResult" type="xs:boolean" use="optional" 
    default="false"/>
</xs:complexType>
</xs:complexType>
<xs:complexType name="RelationshipRefType">
  <xs:attribute name="ref"     type="xs:IDREF" use="required" />
  <xs:attribute name="minimum" type="xs:int" />
  <xs:attribute name="maximum" type="xs:int" />
</xs:complexType>
</xs:complexType>
<xs:complexType name="DepthLimitType">
  <xs:attribute name="maxIntermediateItems"     type="xs:positiveInteger" />
  <xs:attribute name="intermediateItemTemplate" type="xs:IDREF" />
</xs:complexType>
</xs:complexType>
<xs:complexType name="ContentSelectorType">
  <xs:sequence>
    <xs:element name="selectedRecordType" type="cmdbf:SelectedRecordTypeType" 
    	                                        minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="xpathSelector" type="cmdbf:XPathExpressionType" 
    	 minOccurs="0" maxOccurs="1" />
    <xs:any namespace="##other" processContents="lax" minOccurs="0" 
      maxOccurs="unbounded" />
  </xs:sequence>
</xs:complexType>
</xs:complexType>
<xs:complexType name="SelectedRecordTypeType">
  <xs:sequence>
    <xs:element name="selectedProperty" type="cmdbf:QNameType" minOccurs="0" 
      maxOccurs="unbounded" />
  </xs:sequence>
  <xs:attribute name="namespace" type="xs:anyURI" use="required" />
  <xs:attribute name="localName" type="xs:NCName" use="required" />
</xs:complexType>
</xs:complexType>
<xs:complexType name="InstanceIdConstraintType">
  <xs:sequence>
    <xs:element ref="cmdbf:instanceId" minOccurs="1" maxOccurs="unbounded" />
  </xs:sequence>
</xs:complexType>
</xs:complexType>
<xs:complexType name="RecordConstraintType">
  <xs:sequence>
    <xs:element name="recordType" type="cmdbf:QNameType" minOccurs="0" 
      maxOccurs="unbounded" />
    <xs:element name="propertyValue" type="cmdbf:PropertyValueType" 
      minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="xpathConstraint" type="cmdbf:XPathExpressionType" 
      minOccurs="0" maxOccurs="1" />
    <xs:any namespace="##other" processContents="lax" minOccurs="0" 
      maxOccurs="unbounded" />
  </xs:sequence>
</xs:complexType>
</xs:complexType>
<xs:complexType name="PropertyValueType">
  <xs:sequence>
    <xs:element name="equal" type="cmdbf:EqualOperatorType" minOccurs="0" 
      maxOccurs="unbounded" />
    <xs:element name="less" type="cmdbf:ComparisonOperatorType" minOccurs="0" 
      maxOccurs="1" />
    <xs:element name="lessOrEqual" type="cmdbf:ComparisonOperatorType" 
      minOccurs="0" maxOccurs="1" />
    <xs:element name="greater" type="cmdbf:ComparisonOperatorType" minOccurs="0" 
      maxOccurs="1" />
    <xs:element name="greaterOrEqual" type="cmdbf:ComparisonOperatorType" 
      minOccurs="0" maxOccurs="1" />
    <xs:element name="contains" type="cmdbf:StringOperatorType" minOccurs="0" 
      maxOccurs="unbounded" />
    <xs:element name="like" type="cmdbf:StringOperatorType" minOccurs="0" 
      maxOccurs="unbounded" />
    <xs:element name="isNull" type="cmdbf:NullOperatorType" minOccurs="0" 
      maxOccurs="1" />
    <xs:any namespace="##other" processContents="lax" minOccurs="0" 
      maxOccurs="unbounded" />
  </xs:sequence>
  <xs:attribute name="namespace" type="xs:anyURI"  use="required" />
  <xs:attribute name="localName" type="xs:NCName"  use="required" />
  <xs:attribute name="recordMetadata" type="xs:boolean" use="optional" 
    default="false" />
  <xs:attribute name="matchAny" type="xs:boolean" use="optional" default="false"   />
</xs:complexType>

Input arguments

QueryType

The <query> element contains <itemTemplate> and <relationshipTemplate> elements. The <itemTemplate> and <relationshipTemplate> elements can have content selectors and constraints, which have the same form in both elements.

ItemTemplate

Identifies matching items (not relationships) that are returned in the graph response. This element has two attributes:

  • id--Unique identifier.
  • suppressFromResult--(optional) Indicates that the relationships that correspond to the template with this attribute should be absent in the results. You can use suppressFromResult to constrain other templates in the query.

DatasetID

Identifies the dataset to query.

The first <itemTemplate> element must have a <DatasetId> element to specify the dataset to query. If you do not specify the dataset ID, the query uses BMC.ASSET by default.

Constraints

Restrict the instances returned based on properties of the instances and associated records.

  • contentSelector--Determines how instances matching the template are returned in the response. If a template does not contain a <contentSelector> element, all matching instances and associated records are returned in the response.
  • instanceIdConstraint--Specifies instances by instance ID.
  • recordConstraint--Defines specific record types and related properties to be evaluated.

RelationshipTemplate

Identifies matching relationships (not items) that are returned in the graph response.

RelationshipTemplateType has two attributes:

  • id--Unique identifier.
  • suppressFromResult--(optional) Indicates that the relationships that correspond to the template with this attribute should be absent in the results. You can use suppressFromResult to constrain other templates in the query.

You can use the following elements with RelationshipTemplateType:

  • sourceTemplate--Source item of a relationship.
  • targetTemplate--Target item of a relationship.
  • depthLimit--The number of edges (relationships) between source and target nodes in the graph.

The <sourceTemplate> and <targetTemplate> elements each refer to an <itemTemplate> element using the required @ref attribute. The value of the @ref attribute must match the value of the @id attribute of an <itemTemplate> element in the query.|

DepthLimit

An optional element in the <relationshipTemplate> that extends the template to apply to other relationships and items.

  • maxIntermediateItems--The maximum number of intermediate items in the relationship chain between source and target items. A value of 1 indicates that the <relationshipTemplate> can traverse one intermediate item between the source item and target item. This attribute is optional. If it is not present, then the number of intermediate items between the source and the target is unlimited.
  • intermediateItemTemplate--The value of the intermediateItemTemplate corresponds to the @id attribute of an <itemTemplate> element that is used as a prototype for intermediate items in the relationship chain. The value of the @intermediateItemTemplate attribute is also used to represent the intermediate items in the <nodes> element of the query response.

ContentSelector

Determines how items or relationships matching the template are returned in the response. If a template contains a <contentSelector> element, the records and properties returned for the instances that match this template are limited to those explicitly selected.

Use only one of the following elements:

  • selectedRecordType--Selects records and properties explicitly by specifying their namespace and local name.

SelectedRecordType

If <selectedRecordType> is used without any <selectedProperty> child elements, all properties (child elements) of all records of the selected type are returned in the response.

You must provide the following attributes:

  • namespace--Specifies the URI.
  • localName--Specifies the non-qualified name.

You can use the <selectedProperty> element to define the properties of the selected record types that are returned in the response. For each <selectedProperty>, you must provide the namespace and localname attributes.|

InstanceIdConstraint

Specifies items or relationships by instance ID. A template element can have only one <instanceIdConstraint>, which must have at least one <instanceId> element.
You must include <recordConstraint> if you use <instanceIdConstraint>.

RecordConstraint

Specifies record types and related properties to evaluate. An <itemTemplate> or <relationshipTemplate> element can have any number of <recordConstraint> elements, which can have the following elements.

  • recordType--Defines the record types against which to evaluate the constraint.
  • propertyValue--Defines properties and values against which to evaluate the constraint.

recordType

If there are no <recordType> elements, the <propertyValue> element is evaluated against all record types. If the instance contains a record element that has, as the first child element, an element in the namespace corresponding to the value of the <recordType>/@namespace attribute and where the local name of that first child element is the value of the <recordType>/@localName attribute.

propertyValue

These records contain properties whose values are accessible through an XML representation of the instance. The <propertyValue> element can only be used on properties that have a type that is a subtype of the xs:anySimpleType type. While the type must be known, it is not required that an XML schema definition of the property be available.

The <propertyValue> element has the following attributes:

  • localName
  • namespace
  • recordMetadata--If set to true, indicates that the property to be evaluated is in the <recordMetadata> element of the record.
  • matchAny--Defines whether the operators inside that element are logically AND-ed or OR-ed.

The <propertyValue> element has child operator elements: less, lessOrEqual, greater, greaterOrEqual, contains, like, and isNull. Operator elements can have the following attributes:

  • caseSensitive
  • negate
 

Return value

QueryResponse

NodesType

List of items.

EdgesType

List of relationships.

 

Fault message

UnkownTemplateIDFault

This fault occurs when a <relationshipTemplate> includes an ID that refers to a <sourceTemplate>, <targetTemplate>, or <intermediateItemTemplate> that was not included in the query.

InvalidPropertyTypeFault

This fault occurs when the value in a constraint is invalid for the type of the property as defined by the schema for the property. For example, this fault occurs when the property is a date and the query includes a parameter to compare to the date that is a string that cannot be cast to a date, such as "foobar."

UnsupportedConstraintFault

A constraint element in the template was specified that is not supported by this MDR.

UnsupportedSelectorFault

A selector element in the template was specified that is not supported by this MDR.

ExpensiveQueryErrorFault

The query was valid, but the server determined that the query is too expensive to execute or that it would return a result set that is too large to return. The requestor is invited to retry, using a simpler and/or more constrained query. What constitutes "too expensive" or "too large" is determined by the server.

Was this page helpful? Yes No Submitting... Thank you

Comments