Example of Abend-AID REST API usage
This section describes the examples of Abend-AID REST API usage.
Query API: Curl request format for query API
Developers can create their own display of abends by using this API to query Abend-AID to get a list of report numbers for related reports. Teams can have a confluence or web page that displays the current abends that relate to their team. When a developer is setting up an automated testing pipeline, and an abend occurs, they can retrieve the Abend-AID report number (and report link) and retrieve the Diagnostic Summary to add to the log. The following example displays the sample code for retrieving any report for an S0C1 abend.
curl --request GET \
--url http://<CES Server:Port>/compuware/ws/abendaidapi/query?data=ABND=S0C1 \
--header 'Authorization: <CES Personal Access Token>' \
Diagnostic Summary API: Curl request format for Diagnostic Summary API
This is an API that retrieves the Abend-AID summary section for a specified abend. If a developer is using the Abend-AID Webhook to create new Help Tickets in JIRA, Service Now, or Helix ITSM, they can add the Diagnostic Summary to provide more information for a faster resolution. In the following example, a report number is specified that can be retrieved from the Abend-AID notification webhook. An optional JOBNAME is also added because some reports, such as CICS SVC dumps, can have multiple reports under one report number. You can use this JOBNAME to specify the required Diagnostic Summary.
curl --request GET \
--url http://<CES Server:Port>/compuware/ws/abendaidapi/diagnosticsummary?data=RPT=1234567,JOBNAME=ABCDEFG
--header 'Authorization: <CES Personal Access Token>' \
Add a Webhook: Curl request format for creating an Abend-AID webhook
When a developer deploys new code, they can add this API in the pipeline to create an alert webhook. The deploy will then set an Abend-AID webhook that notifies them if the code fails in production. The way this can work with Code Pipeline is that the Code Pipeline Deploy Webhook will provide the Set ID that was deployed. This can be used to call the Code Pipeline Set Information API which displays the module names that were deployed. These module names are then added to this Abend-AID API for webhook notifications on the programs. You can define an expiration timeframe in the API so that special alerts can expire after the specified number of days.
curl --location --request POST 'http:// ://<CES Server:Port>/compuware/ws/webhookext'
--header 'Authorization: <CES Personal Access Token>'
--header 'Content-Type: application/json'
--data {"webhook":{"enabled":true,
"name":"PTESTONE",
"request":
{"webhook":{"enabled":true,
"name":"AA6",
"request":{"url":"http://localhost:48080",
"httpHeaders":[],
"method":"POST",
"body":""},
"product":{"name":"AbendAID",
"@xsi.type":"abendAidWebhookProduct",
"programNames":["pg"],
"userIds":["ui","ui2"],
"abendCodes":["ac"],
"jobNames":["jn"],
"regions":["re"]},
"expierInDays":"-1"}}
Comments
Log in or register to comment.