How can I use the AAI REST API to pull information similar to what is on the AAI monitoring tab?
search cancel

How can I use the AAI REST API to pull information similar to what is on the AAI monitoring tab?

book

Article ID: 265636

calendar_today

Updated On:

Products

Automation Analytics & Intelligence

Issue/Introduction

How can I use the AAI REST API to pull information similar to what is on the AAI monitoring tab, to see a list of completed, in progress, and/or forecasted jobstream runs over a specific time period?

Environment

Release : 6.4.6

Resolution

1. Access the the AAI REST API Swagger page using the URL http://<serverName>8080/aai/devPreview

 

2. To use the REST API endpoints on the Swagger page you must first Authenticate using the POST /authentication/login endpoint.

You can get there directly by accessing: http://<serverName>:8080/aai/devPreview/#!/authentication/login

 

3. To authenticate, click the example on the right hand side, which will copy the payload with the user credentials over to the left hand side, make any updates to your user and password and click "Try it now"

 

If you get a 200 return code you will be authenticated, if you get any other return code there was an issue logging in.

 

4. Once authenticated go to the GET /jobstreamRuns API endpoint on the swagger page.

You can get their directly with this URL: http://<serverName>:8080/aai/devPreview/#!/jobstreamRuns/getJobStreamRuns

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=zlkFqLNXoV+nfohvQOPjnQ==

 

5. There are quite a few options for this GET request, if you specify no jobstreamId or businessArea it will try to return all jobstreams.

  • If you want to filter to a specific jobstreamId or multiple Id's,  you can use the jobStreamId's from the GET /jobstreams or use the SQL query below to get a list of jobstreamdId's
    • select jobStreamId , description from JobStream order by description;
    • You can enter one or more jobstreamId's in a comma separated list 
  • If you want to use businessArea to filter your results, you will have to get a list of the businessAreaId's from either the GET /businessareas API call or using the SQL query below
    • select businessDomainId, businessDomainName from BusinessDomain order by businessDomainName;

    • You can use only one of the ID's in the businessDomainId column at a time for this GET request.

 

  • If you want to filter to COMPLETED, RUNNING, and/or FORECASTED, you can enter any of those values in the "types" field.

 

  • The default time frame of the results will be using Relative Time for the last 48 hours and the next 48 hours of forecasted runs.  You can adjust the time frame using actual dates and times using the fromTime and toTime fields, or using relativeFromTime and relativeToTime.