Software AG Products 10.7 | Using API Gateway | API Gateway Administration | Quiesce Mode
 
Quiesce Mode
Quiescing API Gateway temporarily disables access to the server so you can perform the required tasks while the server is not connected to any external resources. In API Gateway the quiesce mode is used during the zero downtime upgrade wherein the access to the server is temporarily disabled, so you can perform the upgrade tasks. For details about zero downtime upgrade, see https://github.com/SoftwareAG/webmethods-api-gateway/tree/10.7/docs/articles/operations/Upgrading%20API%20Gateway%20in%20zero%20downtime.
API Gateway supports the following two types of quiesce mode:
*Type 1: Blocks only design time requests.
In this mode API Gateway server blocks all design time requests such as all the CRUD operations for API Gateway assets like APIs, policies, applications, and so on, and returns an appropriate status code (503) to the client. The following requests are an exception and are still allowed by API Gateway:
*All GET requests
*/rest/apigateway/quiescemode
*/rest/apigateway/search
*/rest/facade/apigateway/searchApis
*Type 2: Blocks all requests
In this mode API Gateway becomes unreachable for all the requests, design time, and runtime. Any requests that are already in progress are permitted to finish, but any new inbound requests to the server are blocked. This mode is an extension of the Integration Server quiesce mode, where API Gateway flushes the Quota, performance, and transaction license metrics data to the data store before the API Gateway package is disabled. While flushing the performance, license, and quota metrics data, API Gateway performs the following operations:
*Resets performance and license metrics intervals of the corresponding scheduler for all the APIs to be run immediately and flushes the data to be persisted into the database. For example:
*API Gateway publishes performance metrics as per the Publish interval configured. That is, if the Publish interval is set as 60 seconds, then API Gateway publishes the performance metrics to the configured destination after 60 seconds. But, in quiesce mode API Gateway immediately publishes the performance metrics to the database.
*API Gateway publishes transaction license metrics after 30 minutes, which is the default interval scheduled to publish the license metrics, to the data store. But in quiesce mode API Gateway immediately publishes the license metrics to the data store.
In a cluster, only the controlling node performs this operation.
*Starts the subscription quota intervals and counters persisting scheduler immediately to store the data in the database. For example, API Gateway runs the subscription quota counters for an interval configured as per the pgmen.quotaSurvival.interval extended setting and publishes the data after the specified interval to the data store. But in quiesce mode API Gateway immediately publishes the quota metrics to the data store.
When all the performance metrics and other data are flushed completely, a notification mentioning that quiesce mode for all is enabled is sent through a webhook. The CRUD operations of webhook objects are supported in the Administration REST API of API Gateway. For details about the Administration REST API, see API Gateway Administration.
For details about quiesce mode in Integration Server, see webMethods Integration Server Administrator’s Guide.
Enabling and Disabling Quiesce Mode
API Gateway provides a REST API to enable quiesce mode.
Enable or disable quiesce mode with the following REST call:
PUT /rest/apigateway/quiescemode
{
"enable": true/false,
"block": "designtime/all"
"flush": [
"license_metrics",
"performance_metrics",
"subscription_quota"
]
}
Set the block parameter as designtime to block only design time requests. The flush parameter is not applicable when you set the block parameter as designtime.
Set the block parameter as all to block all requests. The flush parameter is applicable when you set the block parameter as all. In the above example, when you set the block parameter as all, API Gateway blocks all the requests and flushes the license metrics, performance metrics, and subscription quota data. If you do not specify anything for the flush parameter, then all the data is flushed.
Set the enable parameter as true to enable quiesce mode.
Set the enable parameter as false to disable the quiesce mode. This is supported only when the block parameter is set as designtime. When the block parameter is set as all, API Gateway is quiesced and is unreachable. Hence, you cannot disable the API Gateway quiesce mode by invoking this API.
Use the Integration Server API POST /invoke/wm.server.quiesce/setActiveModeinvoke/wm.server.quiesce/setActiveMode, which is accessed through the quiesce port, to disable the Integration Server quiesce mode when the block parameter is set as all. This, in turn, disables the quiesce mode for all requests in API Gateway.
Note:
For invoking the quiesce mode for all requests, you must specify the port through which the server enters and exits quiesce mode. For details about specifying the quiesce port, see webMethods Integration Server Administrator’s Guide.
Retrieve the quiesce mode settings as well as the current status with the following REST call.
GET /rest/apigateway/quiescemode
{
"enable": true/false,
"block": "designtime/all"
"flush": [
"license_metrics",
"performance_metrics",
"subscription_quota"
],
"status": "success",
"failureReason": null
}