REST in the OPC Router: Structure and Responsibilities
This chapter describes the common terminology used in the REST documentation for the OPC Router. It explains the functions performed by each plug-in, trigger object, and transfer object, and when each element is used.
The focus is on the mapping of OPC Router elements, not on general roles within a RESTful web service.
At a Glance
There are two technical roles in the REST section of the OPC Router:
- The REST client calls external REST interfaces.
- The REST server provides its own REST endpoints that can be called by external systems.
Different elements are used for these roles:
| Purpose | Plug-in | Trigger or Transfer Object in the Flow |
|---|---|---|
| Call an external REST interface | REST Client plug-in | REST Client transfer object |
| Provide a custom REST endpoint in OPC Router | REST Server Plug-in | REST Trigger |
Responsibilities of the Elements
| Element | Responsibility |
|---|---|
| REST Client Plug-in | Provides the connection to an external REST interface. For example, the host URL, authentication, certificates, and OpenAPI file are configured here. |
| REST Client Transfer Object | Uses a REST client connection within a flow to execute a specific REST call. |
| REST Server Plug-in | Provides the technical foundation for custom REST endpoints in OPC Router, such as port, route prefix, authentication, and SSL. |
| REST Trigger | Uses a REST server connection within a flow to provide a specific endpoint and execute a transfer when called. |
Difference Between a Plug-in and a Trigger or Transfer Object
Plug-ins define general technical accessibility and security. Trigger and transfer objects within a flow define the specific data flow.
This means:
- The plug-in specifies where and how a REST interface can be accessed.
- The transfer object or trigger specifies which endpoint is used and which data is transferred.
Common Terms
Endpoint
An endpoint is the specific address of a REST function.
- For a REST client, this is the target path of an external interface.
- For a REST trigger, this is the path under which the OPC Router itself provides a function.
HTTP Method
The HTTP method specifies what type of action a call to an endpoint triggers. Common methods include:
GET– Retrieve dataPOST– Send data or initiate a processPUT– Create or completely replace dataDELETE– Delete data
Request Parameters
Request parameters are values sent with a REST call. These include, for example:
- URL segments
- Query parameters
- Header fields
- Content in the request body
Response Parameters
Response parameters describe the data that is read from a REST response or returned in a REST response.
- In the REST client, response parameters are read from the response of an external RESTful web service.
- In the REST trigger, response parameters are sent back to the calling client.
Authentication
Authentication is generally configured in the respective plug-in.
- For the REST client, it pertains to access to an external RESTful web service.
- For the REST server, it pertains to external clients’ access to the endpoints provided by the OPC Router.
OpenAPI
OpenAPI is a standardized format that describes the endpoints and parameters of a REST interface in a machine-readable format (as a JSON or YAML file). If such a description is available, endpoints and parameters can be imported into the OPC Router more conveniently rather than having to be entered manually.
Decision Guide
Use the following combinations:
- To call an external REST interface: REST Client plug-in and REST Client transfer object
- To provide your own REST endpoint in the OPC Router: REST Server Plug-in and REST Trigger