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.

CMDBGraphQuery function

The CMDBGraphQuery function searches for relationships and endpoints related to a specific CI.

Synopsis


#include "ar.h"
#include "arextern.h"
#include "cmdb.h"

int CMDBGraphQuery(
      ARControlStruct *control,
      CMDBClassNameId *startClassNameId,
      ARNameType datasetId,
      unsigned int getMask,
      ARNameType startExtensionId,
      ARNameType startInstanceId,
      int numLevels,
      int direction,
      ARBoolean noMatchProceed,
      ARBoolean onMatchProceed,
      CMDBGraphList *queryGraph,
      CMDBGetObjectList *objects,
      CMDBGetRelationList *relations,
      ARStatusList *status)

Input arguments



Input argument

Description

control

The control record for the operation, which contains information about the user requesting the operation and the server on which the operation is to be performed.

startClassNameId

The name of the class for which you want to retrieve relationships and instances. The classNameID argument contains the namespace name and the unique class name.

datasetId

The unique identifier for the dataset. The data in the return values are based on the dataset ID specified in this parameter.

getMask

The ID that specifies the type of dataset on which to perform the operation.

  • 0: None--Based on the datasetId being passed, instances are retrieved from either the overlay or the original dataset (CMDB_GET_MASK_NONE ).
  • 1<<0: Current Mode--Allows you to retrieve instances from the current dataset only (CMDB_GET_DATASET_MODE_CURRENT ).

startExtensionId

The extension ID of the class for which you want to retrieve relationships and instances. This is required if the query graph contains the same CI class more than once and needs to distinguish one from another.

startInstanceId

The instance ID of the class for which you want to retrieve relationships and instances.

numLevels

The number of levels to traverse in the specified queryGraph. The value A-1 specifies the query to traverse to the end of the graph.

direction

The direction in which the graph is to traverse.

  • 0: Out--Return all relationships for the starting node where an endpoint is the destination node (CMDB_RELATIONSHIP_DIRECTION_OUT ).
  • 1: In--Return all relationships for the starting node where an endpoint is the source node (CMDB_RELATIONSHIP_DIRECTION_IN ).
  • 2: Both--Return all relationships for the starting node where an endpoint is source or destination(CMDB_RELATIONSHIP_DIRECTION_BOTH ).

noMatchProceed

Specifies whether to proceed with the query when the node returned for a given relationship instance does not match the criteria.T (1): When the node returned for a given relationship instance does not match the criteria specified, proceed to the next relationship. No relationship information is returned because the returned components might not be connected (because the nonmatching nodes are skipped).F (0): When the node returned for a given relationship instance does not match the criteria specified, do not proceed any further.

onMatchProceed

Specifies whether to proceed with the query when the node returned for a given relationship instance matches the criteria.T (1): When the node returned for a given relationship instance matches the criteria specified, proceed to the next relationship.F (0): When the node returned for a given relationship instance matches the criteria specified, do not proceed further.

queryGraph

Indicates the path that needs to be queried to return the desired CIs and relationships

Return values



Return value

Description

objects

List of one or more CI instances matching the specified criteria. The starting node is not included.

relations

List of relationship instances that connects the returned CIs and that match the specified criteria.

status

A list of zero or more notes, warnings, or errors generated from a call of this function.

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

Comments