Search This Blog

Monday, February 26, 2024

How to use the Tools API with Maximo Manage

 The tools API was created to facilitate a simple way for clients to access CLI tools from outside of the Red Hat OpenShift cluster.


  • icheckerreport – Run Integrity Checker in “report” mode
  • icheckerrepair – Run Integrity Checker in “repair” mode
  • toolslog - Get a specified tools log or get a list of all tools logs
  • managestart - Start all Maximo Manage pods
  • managestop – Stop all Maximo Manage pods
  • submitUploadLogRequest - Upload logs from Maximo Manage UI, Cron, MEA, or Report pods to S3 Cloud Object Storage
  • (Note: this tool runs against the Manage Liberty pods, where the Manage application runs, to collect and upload logs to Cloud Object Storage, unlike CLI tools that run against the MAXINST pod)




Setting up the Environment

There are three things to do before executing commands. 


Set up S3 Cloud Object Storage and configure Maximo properties (used to submit upload log requests for Manage Liberty pod logs).  See the link for more information:

https://www.ibm.com/docs/en/mas-cd/maximo-manage/continuous-delivery?topic=documents-sending-log-output-s3-cloud-object-storage


Configure access to the signature option:
  1. In the Security Groups application, search for your security group
  2. On the applications tab, search for the Logging application
  3. Grant access to the "Load log files to object store" signature option
  4. Save the changes and log out and in again to apply the changes

image 12387

Generate an API key

In Manage 8.4 and newer versions:
  1. Navigate to Integration -> API Keys. 
  2. Click "Add API Key"
  3. Search for the user, and click "Create"

For Manage 8.3 and earlier versions:
  1. Navigate to the Administration -> Administration work center
  2. Click the link "API Keys"
  3. Click "Add API Key"
  4. Search for the user, and click "Add"
    image 12388
  5. Copy the API key
    image 12389

This key will be used in the next steps.


Setting up a rest client:

  1. In the example shown, Postman was used as the REST client.  
  2. Create new HTTP request
  3. Add a header called "apikey".  Past the copied key into the value field
image 12390

Executing CLI tools sending requests to the maxinst pod:

POST https://host:port/toolsapi/toolservice/icheckerreport - Generate an integrity checker log.

GET https://host:port/toolsapi/toolservice/toolslog?logfile=<name of report from icheckerreport request>

GET https://host:port/toolsapi/toolservice/toolslog - Get a list of all tools logs.

POST https://host:port/toolsapi/toolservice/icheckerrepair - Execute the integrity checker utility.

POST https://host:port/toolsapi/toolservice/managestop - Stop the Maximo Manage pods.

POST https://host:port/toolsapi/toolservice/managestart - Start the Maximo Manage pods.


Executing Logging service commands sending request to the Manage pod:

POST https://host:port/maximo/api/service/logging?action=wsmethod:submitUploadLogRequest - Upload logs from Maximo Manage pods to S3 Cloud Object Storage.
 
GET https://host:port/maximo/api/service/logging?action=wsmethod:streamLog - Stream the application log to the browser


Executing the integrity checker CLI

Executing Integrity Checker to write a report to logs

The URL for any of the toolsapi requests requires the url to your maxinst pod.  For this report, use the POST method. 

POST https://host:port/toolsapi/toolservice/icheckerreport

The body of the request is blank.

The response is shown in this screen capture:



image 12392


Getting lists of tools logs

GET https://host:port/toolsapi/toolservice/toolslog Get a list of all tools logs.


A list of available logs is shown in the screen capture:

image 12393
     

Streaming tools logs

To stream a particular log file output, add the logfile parameter along with the file name as shown:

GET https://host:port/toolsapi/toolservice/toolslog?logfile=ichecker_report1637953395961.log

image 12394

Stopping and starting Manage

Executing managestop

You stop the manage pods by using the Tools API against the MAXINST pod URL:

POST https://host:port/toolsapi/toolservice/managestop


Executing managestart

POST https://host:port/toolsapi/toolservice/managestart




Submit Upload Log Request to Cloud Object Storage

Submitting upload log requests is executed on Manage pods.  Upon executing this command, all logs from all Manage Liberty pods (cron, UI, MIF, RPT) are collected, compressed, and automatically uploaded to Cloud Object Storage.  This allows administrators to access the logs without the need for access to the Red Hat OpenShift console.

POST https://host:port/maximo/api/service/logging?action=wsmethod:submitUploadLogRequest

image 12391
Navigate to your Cloud Object Storage bucket to see the log returned in the output:


No comments:

Post a Comment

MAS and Manage custom resources are not reconciled

  After a change was applied to IBM Maximo Application Suite (MAS) or IBM Maximo Manage, the custom resources are not reconciled. For exampl...