RegisterCustomFunction
(RESTServicesInterface library)
| Description: | A module that registers a custom function endpoint for the VTScada REST interface. |
| Returns: | RESTResponseInfo Struct containing output from the registered function. |
Usage: ![]() |
Script Only. |
| Function Groups: | Database and Data Source, ODBC, REST Interface |
| Related to: | RegisterCustomTable |
Format: ![]() |
\RESTServicesInterface\RegisterCustomFunction(Name, CallbackObj) |
| Parameters: |
| Name | ||||||||
| Required. Name of the Function Module. | ||||||||
| CallbackObj | ||||||||
|
Required. Entered as "Self()" (see below examples) after the Name parameter, this invokes the "DoAction" callback of this custom function, specifically. Its parameters are as follows:
These parameters must be written in this order within the DoAction submodule, but they do not all need to be used or accessed. |
| Comments: | |||||||||||
| HTTP Error codes will be consistent with established HTML error conventions, see 'VTScada Thin Client Server Error Messages' for more information. | |||||||||||
| The user requires Remote Data Access privilege and access to the security realm containing the desired data in order to query it. | |||||||||||
|
The return value structure containing the function output. The fields are as follows:
|
The developer of the custom function is responsible for:
- Correctly handling the data passed to the callback module .
- Logging the actions caused by the customized REST script.
- Ensuring the custom REST APIs perform authentication and security checks when needed.
- Managing resource consumption of custom REST APIs.
For more information, refer to the "Security Guidelines Manual" included in the Documents folder at the root of your VTScada installation.
Examples
Function Registration examples, where both "Self()" and "CustomFuncObj" use DoAction callbacks:
\RESTServicesInterface.RegisterCustomFunction("CustomFunctionName", Self());
\RESTServicesInterface.RegisterCustomFunction("CustomFunctionName", CustomFuncObj);
See ' VTScada RESTInterface Module' for a detailed example of querying values with a custom function.
