View Only

AIOps v3.2 - Topology API Part 2 : Create BookInfo App Topology using API

By Jeya Gandhi Rajan M posted Mon March 07, 2022 04:17 PM


This document explains about how to create Topology for BookInfo App using Topology Manager API.

The shell scripts to create a BookInfo Application topology using Topology API is available in files.

1. Retrieve Topology API Access Details

1. Login into OCP Cluster

Login into the OCP Cluster where WAIOps AIMgr is installed

oc login ....

2. Print the Topology Manager API and access details

Run the below script

sh files/

As a result, Topology API url and access details will be printed like the below.


2. Update

Update the below properties in files/ based on the Topology API url and access details we retrived in the above section.


3. Create Topology

  1. Get into the folder ./files in the cmd line.

  2. Run the below 2 files.

  1. It should have created a bookinfo app topology with the below nodes along with thier links.
  • productpage
  • details
  • reviews
  • ratings

4. Search and View Topology

  1. In the topology viewer, enter productpage and press enter key.

  1. The productpage related nodes/resources are displayed as below.

Click on View topology in productpage-svc node.

  1. The productpage-svc node and its associated nodes with 1 level are displayed

  1. Show all the nodes of the bookinfo by doing below
  • Change hop level to 4
  • Click on the Render button

  1. Change the layout style as below.

  1. Now the entire topology bookinfo is displayed with the below style.

  1. Show the Node/Resource Details by doing below
  • Right click on any Node to get the menu
  • Click on the Resource Details menu to see its detail

  1. The Resource Details are displayed here.

  1. Here property _id is autogenerated.

  2. Property uniqueId can be provided during the node creation.

4. Retrieve _id using uniqueId

We create node using the uniqueId. But for further actions like create link, delete node and etc, it requires _id. So we can use API to retrive _id using uniqueId.

Here is the script to retrive _id using uniqueId


The output of the above script could be like this.

getResourceIdByUniqueId ---> productpage-svc-id ==> XwHMVYYsTWukg60GPTmL5Q
getResourceIdByUniqueId ---> details-svc-id ==> 7wb8y5KmQTi5e5XDcDPPKA
getResourceIdByUniqueId ---> reviews-svc-id ==> xizKZpDlTNmBXUgDeBcN0g
getResourceIdByUniqueId ---> ratings-svc-id ==> LuR8kuOnTSSmZHqVjSdZEA

Note :

  1. The article is based on the the following.
  • RedHat OpenShift 4.8 on IBM Cloud (ROKS)
  • IBM Cloud Pak for Watson AIOps 3.2.0
  1. API service is not officially supported for production.

1 comment



Wed March 23, 2022 11:46 AM

Thanks, one suggestion here would be to use the generic rest or file observers to consume this data rather than the lower-level APIs.