Generating call chain analysis results by using API URLs

Before you begin

  1. If the authentication and authorization feature is enabled with the Authentication Server (DEX) installed and configured, the passwordConnector parameter must be added in the dex.yaml file. Also, a security token is needed. For more information, see step 1.4 in topic STEP 4. Configuring Authentication Server (DEX).
  2. If OrientDB SSL is enabled, add the following properties in file <IBM ADDI Installation Folder>/IBM AD Web Services/wlp/usr/servers/ad_server/jvm.options:
    • The path of the OrientDB certificates.
    • The passwords of the certificates.
    Example
    -Dclient.ssl.enabled=true
    -Dclient.ssl.keyStore=C:\certificates\orientdb.ks
    -Dclient.ssl.keyStorePass=password
    -Dclient.ssl.trustStore=C:\certificates\orientdb.ks
    -Dclient.ssl.trustStorePass=password
    
    Note: You can enter an encrypted Keystore Password. For more information, see Obtaining an encrypted keystore password.

    After the file is edited and saved, restart IBM® Application Discovery WebSphere® Liberty Profile Service.

About this task

The call chain web service runs on the Liberty server. After the call chain REST API is enabled, you can run requests to generate call chain analysis results by using URLs with other tools, for example, Postman. For more information about call chain analysis in IBM AD Analyze Client, see section Miscellaneous Reports.

Procedure

  1. Enter one of the following endpoints with the corresponding request body, and select the corresponding request method.
    Endpoint Request body Request method
    To conduct call chain analysis for one or more programs, you can use the following endpoint. Details can be specified in the request body.
    libertyURL/callchain/
    Example
    http://localhost:9080/callchain/
    Example
    {
        "direction" : "forward",
        "projectName" : "Regression",
        "depth" : "3",
        "programsList" : [
            {
                "prgName" : "DACI",
                "prgType" : ""
            },
            {
                "prgName" : "ZZCU0013",
                "prgType" : "COBOL"
            },
            {
                "prgName" : "DACD",
                "prgType" : ""
            },
            {
                "prgName" : "ABDRAC01",
                "prgType" : ""
            },
            {
                "prgName" : "COBMOD1",
                "prgType" : ""
            },
            {
                "prgName" : "U11RHC",
                "prgType" : "ASSEMBLER"
            },
            {
                "prgName" : "BONOUTOT",
                "prgType" : ""
            }
        ]
    }
    
    POST
    To conduct call chain analysis for one program per request, you can use the following endpoint. No request body is required. If the program type (prgType) is not specified for a program, analysis for all the programs with that name (prgName) will be returned.
    libertyURL/callchain/withParameters?
    direction=callchainDirection
    &projName=projectName
    &depth=depthNumber
    &prgName=programName
    &prgType=programType
    Example
    http://localhost:9080/callchain/withParameters?
    direction=forward
    &projName=Regression
    &depth=3
    &prgName=ZZCU0013
    &prgType=COBOL
      GET
    To check the programs that access the specified copybooks, you can use the following endpoint.
    libertyURL/callchain/includes
    Example
    http://localhost:9080/callchain/includes
    {
    	"$schema": "http://json-schema.org/draft-04/schema#",
    	"description": "The programs input schema for the callchain includes/copybooks analysis API.",
    	"type": "object",
    	"properties": {
    		"prjName": {
    			"type": "string",
    			"description": "The name of the project on which the analysis will be made."
    		},
    		"includes": {
    			"type": "array",
    			"description": "An array which contains the includes names for the analysis.",
    			"items": [
    				{
    					"type": "object",
    					"properties": {
    						"inclName": {
    							"type": "string",
    							"description": "The name of a copybook/include"
    						},
    						"inclType": {
    							"type": "string",
    							"description": "The source type of a copybook/include",
    							"default": ""
    						}
    					},
    					"required": [
    						"inclName"
    					]
    				}
    			]
    		}
    	},
    	"required": [
    		"prjName",
    		"includes"
    	]
    }
    
    Example
    {
    		"prjName": "Regression",
    		"includes": [
    			{
    				"inclName": "ACP1000R",
    				"inclType": "COBOL"
    			},
    			{
    				"inclName": "#K5003ZA",
    				"inclType": ""
    			}
    		]
        	}
    
    POST
    To check the programs that access one specified copybook per request, you can use the following endpoint. No request body is required. If the copybook type (inclType) is not specified for a copybook, analysis for all the copybooks with that name (inclName) will be returned.
    libertyURL/callchain/includes/withParameters?
    prjName=projectName
    &inclName=copybookName
    &inclType=copybookType
    Example
    http://localhost:9080/callchain/includes/withParameters?
    prjName=Regression
    &inclName=ACP1000R
    &inclType=COBOL
      GET
  2. Send the request.

Results

After the request is sent, call chain analysis results are generated and displayed. See the following example of analysis results.
Example
{
    "longestChainLength": 3,
    "noOfPrgsNeverCalled": 3,
    "prgsDetails": [
        {
            "chains": [
                "DACI<-NCP-ENTER-RP<-DAKL<-NCD-PF9-RP"
            ],
            "noOfChains": 1,
            "prgName": "DACI",
            "type": "ADS Dialog"
        },
        {
            "chains": [
                "ZZCU0013:UTCBTRC<-ZZCU0013",
                "ZZCU0013:UTCOTRC<-ZZCU0013",
                "ZZCU0013:UTMSDEV<-ZZCU0013:UTCBTRC<-ZZCU0013",
                "ZZCU0013:UTMSDEV<-ZZCU0013:UTCOTRC<-ZZCU0013",
                "ZZCU0013:UTMSTRC<-ZZCU0013:UTCBTRC<-ZZCU0013",
                "ZZCU0013:UTMSTRC<-ZZCU0013:UTCOTRC<-ZZCU0013"
            ],
            "noOfChains": 6,
            "prgName": "ZZCU0013",
            "type": "COBOL"
        },
        {
            "chains": [
                "ABDRAC01<-ACRFUTST<-ZZCU0013:UTCBTRC<-ZZCU0013"
            ],
            "noOfChains": 1,
            "prgName": "ABDRAC01",
            "type": "COBOL"
        },
        {
            "chains": [
                "U11RHC:DTGDGBI<-U11RHC:GCBIAS",
                "U11RHC:SCAN<-U11RHC:DTGDGBI<-U11RHC:GCBIAS",
                "U11RHC:SCAN<-U11RHC:FNDREAN"
            ],
            "noOfChains": 3,
            "prgName": "U11RHC",
            "type": "ASSEMBLER"
        }
    ]
}
The call chain copybook analysis results follow the following schema:
{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"description": "The programs input schema for the callchain includes/copybooks analysis API.",
	"type": "object",
	"properties": {
		"prjName": {
			"type": "string",
			"description": "The name of the project on which the analysis will be made."
		},
		"includes": {
			"type": "array",
			"description": "An array which contains the includes names for the analysis.",
			"items": [
				{
					"type": "object",
					"properties": {
						"inclName": {
							"type": "string",
							"description": "The name of a copybook/include"
						},
						"inclType": {
							"type": "string",
							"description": "The source type of a copybook/include",
							"default": ""
						}
					},
					"required": [
						"inclName"
					]
				}
			]
		}
	},
	"required": [
		"prjName",
		"includes"
	]
}
Example
{
   "avgNoOfPrgsAccessingOneInclud": 2.0,
    "includesDetails": [
        {
            "allAccesses": 2,
            "distincPrgs": 2,
            "includeName": "#K5003ZA",
            "includePrgsDetails": [
                {
                    "occurrences": 1,
                    "prgName": "LWOUT1:INIT3",
                    "prgType": "PL1"
                },
                {
                    "occurrences": 1,
                    "prgName": "LWOUT1:NIT1",
                    "prgType": "PL1"
                }
            ],
	    "includeType": "PL1"
        },
        {
            "allAccesses": 2,
            "distincPrgs": 2,
            "includeName": "ACP1000R",
            "includePrgsDetails": [
                {
                    "occurrences": 1,
                    "prgName": "A50DBDWN",
                    "prgType": "COBOL"
                },
                {
                    "occurrences": 1,
                    "prgName": "A51DBDWN",
                    "prgType": "COBOL"
                }
            ],
	    "includeType": "COBOL"
        }
    ],
    "maxNoOfPrgsAccessingOneInclud": 2,
    "minNoOfPrgsAccessingOneInclud": 2,
    "noOfPrgsAccessingIncludes": 4
}