Mandatory steps to follow if you've increased Open/Automation API limits and are upgrading to QMetry 8.19.0 or above version (applicable to QMetry on-premise edition)

Mandatory steps to follow if you've increased Open/Automation API limits and are upgrading to QMetry 8.19.0 or above version (applicable to QMetry on-premise edition)

If you have previously increased the Open/Automation API limits and are planning to upgrade to QMetry v8.19.0 or above, follow these mandatory steps to ensure a smooth transition:

Pre-defined API Call Limits

QMetry Application has the below pre-defined API call limits to ensure optimum performance. However, depending upon the preferred usage of your automation teams and your server hardware capability, these limits may be modified (applicable to QMetry on-premise edition only)

Pre-defined API Call limits

API Type

Maximum API Calls

Details

API Type

Maximum API Calls

Details

Automation API

500 Per Day

Maximum API call limitation set for the entire QMetry Instance, including all users. The counter resets as per the UTC time zone.

All Open API’s

1000 Per Hour

 

All Open API’s

10000 Per Day

 

If your API limits exceed these values or you have modified them, follow the steps below:

Step 1: Check Running Docker Containers

Run the following command to view existing Docker containers running on the server:

docker ps

Step 2: Access the QMetry MySQL Docker

To enter the QMetry DB Docker , execute the following command:

docker exec -it <docker_name> bash

Example:

docker exec -it qmetryapp_db bash

Step 3: Log in to the QMetry Database

Replace [username] and [password] in the command below:

mysql -u[username] -p[password] qmetry -A

Step 4: Check Current API Limits

Execute the following query to view the currently set API limits:

SELECT name, value FROM productconfig WHERE name IN ('automationHourlyAPIRequestCount','dailyAPIRequestCount','hourlyAPIRequestCount');

Step 5: Verify API Limits in the `ClientApiRequestLimit` table

Run the following query to check the API limits stored in the ClientApiRequestLimit table:

SELECT apiRequestLimit.apiRequestType, apiRequestLimit.newValue FROM ( SELECT c.*, ROW_NUMBER() OVER (PARTITION BY clientID, apiRequestType ORDER BY createdDate DESC) AS rn FROM ClientApiRequestLimit c ) AS apiRequestLimit WHERE apiRequestLimit.rn = 1;

Step 6: Update API Limits

If the data in the ClientApiRequestLimit table does not match the productconfig table, update the values as follows:

  1. Turn off SQL safe updates:

    set sql_safe_updates = 0;
  1. Execute the following queries to update the limits:
    Note: Ensure to update the new/increased limit values under “newValue” column in the query below for dailyAPIRequest and hourlyAPIRequest. The query currently contains the default limits as listed in the table above.

    INSERT INTO `clientapirequestlimit` (`clientID`, `apiRequestType`, `newValue`, `createdDate`) SELECT clientID, 'automationDailyAPIRequest', '500', NOW() FROM client; INSERT INTO `clientapirequestlimit` (`clientID`, `apiRequestType`, `newValue`, `createdDate`) SELECT clientID, 'dailyAPIRequest', '10000', NOW() FROM client; INSERT INTO `clientapirequestlimit` (`clientID`, `apiRequestType`, `newValue`, `createdDate`) SELECT clientID, 'hourlyAPIRequest', '1000', NOW() FROM client;
  1. Turn SQL safe updates back on:

    set sql_safe_updates = 1;
  2. To check the updated values, run the query in Step 5 again.

    exit;

Step 7: Clear Redis Cache

In case you have the “Redis“ automation container installed on the same server OR a separate server, connect to that server and run the below commands :

  • To view existing containers: docker ps

  • Replace the container name seen in the above command:

    • docker exec -it container-name redis-cli FLUSHALL

    • Example: docker exec -it qmetry_redis_1 redis-cli FLUSHALL

Final Step: Restart Services

Restart QMetry Tomcat Services

  • Check the running containers using the following command:

docker ps
  • Restart both docker containers using the following commands:

docker stop qmetry_app_1 qmetryapp_db docker start qmetryapp_db docker start qmetry_app_1