The maintenance API is a feature that allows the user to remotely manage maintenance tasks of a given platform. This is an alternative method to going to the WebAdmin panel and starting the maintenance/tasks manually.
There isn't really any special configuration for this feature, just make sure to configure a database in the "System Configuration" menu. Another thing to keep in mind is that you will need to have a WebAdmin instance in order for the API to work.
This API comes with three simple to use and understand methods to control it. In order to start making api calls to these methods, make sure you use a valid URL. Example:
http://localhost:5658/api/pt-PT/0/MaintenanceAPI/GetStatus
This is the main method, the one that starts the maintenance. It receives an "options" object which can take three options inside:
Request example:
{
"options": { "reindex": true, "reindex_items": ["CREATEDB", "CREATESP", "DROPFK", "CREATEHRDSCHEMA", "DELETELOGTRIGGERS", "CREATESCHEMA", "TBLREBUILD", "DROPCOLUMNS", "UPDATECFG", "UPDATESP", "DELETETMPDB", "ADDINDEX", "INVALIDZZSTATE", "CREATEFORMULASPROCS", "UPDATEREPLICAS", "RESETCALCFIELDS", "UPDATEFORMULAFIELDS", "FORMULASDAILYUPDATE", "UPDATEINTCOD", "CREATELOGTRIGGERS", "CREATELOGVIEWS", "CREATEDBLOG", "CREATESCHEMALOG", "CREATELOGVIEWSLOG", "CREATEDEFAULTUSER", "GRANTACCESSSP", "CREATEFK", "SHRINKDB", "DELROWS", "CTRLRECORDS", "FK2NULL" ], "auto_end_maintenance": true }
}
In this request, the maintenance will start, do a full re-indexation and end automatically.
Reponse Examples:
{
"Success": true
}
{
"Success": false, "Message": "A maintenance task is already scheduled."
}
This method allows the user to stop a maintenance. In case a re-indexation is ongoing, this one will be canceled first, otherwise the maintenance will end at once.
Reponse Examples:
{
"Success": true, "Message": "Canceling task..."
}
{
"Success": true
}
This method's purpose is to simply give the user some feedback of what is going on at the moment
{
"Status": "ongoing", "Message": "The maintenance task has started."
}
{
"Status": "reindexing", "Message": "The maintenance task is currently reindexing.", "Progress": { "Count": 14, "ActualScript": "CheckTable.sql...", "Completed": false }
}