This documentation supports the 11.1 version of BMC Discovery.

To view an earlier version of the product, select the version from the Product version menu.

Traversals

A SEARCH expression creates a set of nodes, and a LOOKUP makes a set with just one node in it. With that set, a query can TRAVERSE from each of the nodes to a new set of related nodes. The format of a TRAVERSE expression is

TRAVERSE role:rel:role:kind [WHERE clause]

The WHERE clause allows the new set to be further filtered.
For example, to find all software instances that are running on Linux hosts:

SEARCH Host WHERE os_type HAS SUBWORD "Linux" 
TRAVERSE Host:HostedSoftware:RunningSoftware:SoftwareInstance

As with key expressions, elements of the traversal can be omitted as a wildcard mechanism. All matching relationships are followed, so this example finds software running on Linux hosts, and virtual machine software containing the hosts:

SEARCH Host WHERE os_type HAS SUBWORD "Linux" 
TRAVERSE :::SoftwareInstance

Adding some filtering:

SEARCH Host WHERE os_type HAS SUBWORD "Linux" 
TRAVERSE :HostedSoftware::SoftwareInstance
WHERE type HAS SUBSTRING "oracle"

The attributes that are accessed in the TRAVERSE WHERE clause are attributes of the nodes that have been traversed to, not attributes of the original nodes. The original nodes have been discarded from the set.

Traversals can be chained, so we can now find any business application instances related to the software instances:

SEARCH Host WHERE os_type HAS SUBWORD "Linux" 
TRAVERSE :HostedSoftware::SoftwareInstance
WHERE name HAS SUBSTRING "oracle"
TRAVERSE ContainedSoftware:SoftwareContainment:
         SoftwareContainer:BusinessApplicationInstance

At each stage, the result of a traversal is a set, so each node appears only once in the set, even if it is reached via relationships from more than one node.

A TRAVERSE clause performs one single traverse from each node in the current set. Sometimes it is useful to repeatedly traverse to find all the nodes that can be reached via particular relationships, using an EXPAND clause. This is useful for finding all applications that depend on a particular other application, for example:

SEARCH BusinessApplicationInstance WHERE <some condition>
  EXPAND DependedUpon:Dependency:Dependant:BusinessApplicationInstance

The set now contains the original nodes, plus all the nodes that depend upon them, via any number of intermediate dependencies. The EXPAND keeps performing traversals until no more nodes are found. The EXPAND always keeps the original set. If you want to EXPAND but not keep the original set, use a TRAVERSE followed by an EXPAND:

SEARCH BusinessApplicationInstance WHERE <some condition>
  TRAVERSE DependedUpon:Dependency:Dependant:BusinessApplicationInstance
  EXPAND DependedUpon:Dependency:Dependant:BusinessApplicationInstance

Just like a TRAVERSE clause, an EXPAND can have a WHERE clause. The filtering of the WHERE clause happens once the EXPAND has completed, not on every traversal iteration (since if it did it every iteration, it might never complete).

TRAVERSE and EXPAND move from one set of nodes to another set of nodes. Sometimes, you want to stop off at a relationship along the way. This is achieved with STEP IN, which replaces the set of nodes with a set of relationships. Given a set of relationships, you can STEP OUT to another set of nodes. To find critical Dependency relationships:

SEARCH BusinessApplicationInstance WHERE <some condition> 
STEP IN DependedUpon:Dependency WHERE critical

To find the BusinessApplicationInstances that have a critical dependency to the ones matched in the WHERE clause:

SEARCH BusinessApplicationInstance WHERE <some condition>
STEP IN DependedUpon:Dependency WHERE critical
STEP OUT Dependant:BusinessApplicationInstance
Was this page helpful? Yes No Submitting... Thank you

Comments