z/OS Connect

z/OS Connect

z/OS Connect

Truly RESTful APIs to and from your IBM Z mainframe

 View Only

APIs for managing OpenAPI 3 APIs

By Andrew Smithson posted Wed January 29, 2025 04:24 AM

  

IBM z/OS Connect feature zosConnect-3.0, (OpenAPI 3 specification APIs) uses WAR files to deploy APIs. Unlike previous z/OS Connect API’s, we can now utilise the functionality provided by the Liberty server to query and control deployed APIs. With the z/OS Connect feature zosConnect-2.0, (OpenAPI 2 specification APIs),  AARs and SARs are used to deploy APIs. Some of the APIs that were available for querying and controlling these zosConnect-2.0 APIs aren’t available for the zosConnect-3.0 feature.

These APIs for querying and controlling APIs are already part of Liberty server which is what z/OS Connect is built on. With the zosConnect-3.0 feature, and u sing WAR files to deploy APIs, we can now utilise this Liberty server feature.The Liberty server APIs themselves are provided by the restConnector-2.0 feature. This provides access to information in the z/OS Connect Server and the applications that are deployed which includes the zosConnect-3.0 (OpenAPI 3) WAR files. Using these Liberty server APIs enables us to list all the APIs that have been deployed, and optionally stop and start them as required.

With the following configuration in place, requests can be sent to the HTTPS port to retrieve the installed APIs:

<server>
   <featureManager>
      <feature>restConnector-2.0</feature>
   </featureManager>

   <basicRegistry>
      <user name="admin" password="admin"/>

      <group name="admins">
         <member name="admin"/>
      </group>
   </basicRegistry>

   <administrator-role>
      <group>admins</group>
   </adminstrator-role>
</server>

And the following request will return all the installed APIs:
GET /IBMJMXConnectorREST/mbeans/?className=com.ibm.ws.app.manager.internal.ApplicationConfigurator$NamedApplication$2

The returned array contains an Object for each API and the objectName value is then used to interact with the state of API individually using the
/IBMJMXConnectorREST/mbeans/{objectName}/attributes/State

endpoint. 

An example program to output all the APIs and their status is available here.

If you have any questions, please start a discussion in the z/OS Connect community discussion forum.  Looking forward to hearing from you.


0 comments
18 views

Permalink