Configuring APIs

How to add the zosconnect_zosConnectAPIs element to server.xml and configure where API archive files are stored.
Note: For information about deploying APIs with the Administration Interface, see How to manage APIs.
The zosconnect_zosConnectAPIs element can override the default settings for APIs including the location where the API archive files are stored. This location is where they reside on the file system, not where they are deployed. For example,

<zosconnect_zosConnectAPIs location="/var/zosconnect/apis" updateTrigger="polled">
 <zosConnectAPI name="Health" />
 <zosConnectAPI name="Inventory" />
 <zosConnectAPI name="Ordering" />
</zosconnect_zosConnectAPIs>

The server.xml configuration file can contain the following elements:

zosconnect_zosConnectAPIs
  • zosconnect_zosConnectAPIs is a singleton element, so if you create multiple definitions, they are merged.
  • The location parameter is optional and specifies where the API archive files are deployed. If it is not defined, the ${server.config.dir}/resources/zosconnect/apis directory is used as the API archive file installation directory. When the server is started, all the API archive files in the location directory are deployed in the server.
    Note:
    1. The server does not create the API archive file installation directory. If the directory does not exist, APIs cannot be dynamically deployed by the API toolkit or RESTful administration interface. Either change the location to a directory that exists and restart the server, or create the required directories.
    2. The location parameter cannot be changed while the server is running. Its value is set when the server is started.
  • The updateTrigger parameter is optional and controls when IBM® z/OS® Connect is notified about changes in the apis directory. The apis directory is specified on the location parameter. For more information, see Configuration elements.
  • You can use the nested zosConnectAPI elements to specify the APIs that are expected to be in the location directory. If a defined API is not found in the location directory, a message is written to the log. If an API archive file is invalid, then the API fails to load and an error is written to the log.
zosConnectAPI
  • One or more zosConnectAPI elements can be contained in the zosconnect_zosConnectAPIs element.
  • Supports other optional attributes that, for example, can be used to define authentication, authorization, or interceptors specific to an API. For more information, see Configuration elements.
  • The attributes adminGroup, invokeGroup, operationsGroup, readerGroup, requireAuth, and requireSecure are available to specify authentication and authorization for an API. For more information, see Securing IBM z/OS Connect resources.
  • The attributes interceptorsRef and runGlobalInterceptors are available to specify interceptors for an API. For more information, see Configuring API-specific interceptors.
Note: The zosConnectAPI element can be dynamically updated while the server is running, provided the server is enabled for dynamic configuration. For more information about enabling the server for dynamic configuration, see Administering Liberty in the WebSphere Application Server Liberty documentation.