Maintenance API

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.

Configure the Maintenance API

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.

API Methods

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

/Start (POST)

This is the main method, the one that starts the maintenance. It receives an "options" object which can take three options inside:

  • reindex (boolean) -> Makes it so that it re-indexes as soon as the maintenance starts.
  • reindex_items (string array) -> Specifies what to re-index exactly (If not specified, re-indexation will use the default parameters).
  • auto_end_maintenance (boolean) -> Automatically ends the maintenance after the re-indexation finishes.

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."

}

/End (GET)

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

}

/GetStatus (GET)

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
  }

}