Resetting trained APIs
Reset trained application programming interface (API)s using Reset Trained
API
REST API of API Behavioral Security (ABS).
Before you begin
-
Make sure that API Security Enforcer (ASE) and ABS AI Engine communication is disabled. The communication between ASE and ABS is disabled so that no new access log files are sent to the AI Engine for processing. The training can be reset only when all the access logs available with ABS are processed.
-
Wait for all the access logs available with ABS to be processed.
About this task
Use the API with DELETE method when you want to retrain the model with more inclusive API traffic or the API JavaScript Object Notation (JSON) definition has changed in ASE. When an AI model training is reset, all the training data, detected attacks for those APIs and the generated thresholds are lost. However, the metrics data is retained even after the API is retrained. Using the Reset Trained
API
, you can retrain one or more than one API at the same time. If ABS is deployed in a cluster setup, you can run the API on any of the ABS cluster nodes.
Complete the following steps to retrain the APIs:
Steps
-
Disable access log upload from ASE to ABS by running the following command on the ASE command-line interface (CLI):
/opt/pingidentity/ase/bin/cli.sh -u admin -p admin disable_abs
-
Update the API JSON definition in ASE if there are any changes in API.
-
Run the
reset
API in ABS.The following is the URL for the
reset
API.https://<ABS_host>:<ABS_port>/v4/abs/reset
-
Method: DELETE
-
Body:
{ “apis” :[“shop”,“electronics”] }
If you run the
reset
API when the ABS AI engine is processing access logs, you get an error message with 409 status code.+
{ “error” : “AI engine is processing access logs; try later. To complete the process, make sure to disable access log upload from ASE. For more information, see the ABS admin guide.” }
-
-
Wait for the ABS AI Engine successfully to reset the APIs.
Result:
You receive the following success message:
{ “status” : “API training reset is successful” “apis” : [ “shop”, “electronics”] }