1 Reply Latest reply on Sep 12, 2018 2:07 AM by Jigisha Pandya

    Using graphwalk REST API

    Jaffer Mahsoob
      Share:|

      I am trying to use the CMDB API graphwalk via REST, I would like to know how to use it properly....

       

      For Example, I have a BMC_ComputerSystem with InstanceId OI-123456789, I want to return all of the child objects like BMC_IPEndpoint, BMC_LANEndpoint, BMC_CPU, etc.

       

      How would I construct such a request?

       

      Thanks,

      Jaffer

        • 1. Re: Using graphwalk REST API
          Jigisha Pandya

          Hi Jaffer,

          Please find following example, I have used multiple relationship and multiple classes for your reference:

           

          {

          "start_node": {

          "class_name_key": {

          "name": "BMC_ComputerSystem",

          "namespace": "BMC.CORE"

          },

          "instance_id": "$<ciId_0>$"

          },

          "dataset_id": "$<graphwalkDatasetId>$",

          "dataset_mask": 0,

          "num_levels_to_traverse": 1,

          "query_mode": "STOP_IF_NO_MATCH_FOUND",

          "default_return_relationship_ci_attributes": "ALL",

          "default_return_class_ci_attributes": "NONE",

          "default_return_class_cis": "NONE",

          "relationship_selectors_filters": [{

          "class_name_key": {

          "name": "BMC_Dependency",

          "namespace": "BMC.CORE"

          },

          "return_attributes": [

          "InstanceId",

          "Name",

          "HasImpact",

          "ImpactWeight",

          "ImpactPropagationModel",

          "ImpactWeight",

          "ImpactDirection",

          "ImpactSourceId",

          "ImpactDestinationId",

          "Source.InstanceId",

          "Destination.InstanceId"

          ],

          "direction_to_walk": "BOTH",

          "is_impact_graph_walk": "false",

          "qualification": "1=1"

          }, {

          "class_name_key": {

          "name": "BMC_HostedAccessPoint",

          "namespace": "BMC.CORE"

          },

          "return_attributes": [

          "InstanceId",

          "Name",

          "HasImpact",

          "ImpactWeight",

          "ImpactPropagationModel",

          "ImpactWeight",

          "ImpactDirection",

          "ImpactSourceId",

          "ImpactDestinationId",

          "Source.InstanceId",

          "Destination.InstanceId"

          ],

          "direction_to_walk": "BOTH",

          "is_impact_graph_walk": "false",

          "qualification": "1=1"

          }, {

          "class_name_key": {

          "name": "BMC_HostedSystemComponents",

          "namespace": "BMC.CORE"

          },

          "return_attributes": [

          "InstanceId",

          "Name",

          "HasImpact",

          "ImpactWeight",

          "ImpactPropagationModel",

          "ImpactWeight",

          "ImpactDirection",

          "ImpactSourceId",

          "ImpactDestinationId",

          "Source.InstanceId",

          "Destination.InstanceId"

          ],

          "direction_to_walk": "BOTH",

          "is_impact_graph_walk": "false",

          "qualification": "1=1"

          }],

          "class_selectors_filters": [{

          "class_name_key": {

          "name": "BMC_IPEndpoint",

          "namespace": "BMC.CORE"

          },

          "return_attributes": [

          "InstanceId",

          "Name",

          "ShortDescription",

          "PermanentAddress",

          "SystemName",

          "Speed",

          "FullDuplex",

          "LinkTechnology",

          "Category",

          "Type",

          "Item"

          ],

          "qualification": "1=1"

          }, {

          "class_name_key": {

          "name": "BMC_LANEndpoint",

          "namespace": "BMC.CORE"

          },

          "return_attributes": [

          "InstanceId",

          "Name",

          "ShortDescription",

          "PermanentAddress",

          "SystemName",

          "Speed",

          "FullDuplex",

          "LinkTechnology",

          "Category",

          "Type",

          "Item"

          ],

          "qualification": "1=1"

          }, {

          "class_name_key": {

          "name": "BMC_NetworkPort",

          "namespace": "BMC.CORE"

          },

          "return_attributes": [

          "InstanceId",

          "Name",

          "ShortDescription",

          "PermanentAddress",

          "SystemName",

          "Speed",

          "FullDuplex",

          "LinkTechnology",

          "Category",

          "Type",

          "Item"

          ],

          "qualification": "1=1"

          }]

          }

           

          Thanks

          -Jigisha

          1 of 1 people found this helpful