REST

Characteristics - REST

Representational state transfer (REST) is a software architectural style that describes a uniform interface between decoupled components in the Internet in a Client-Server architecture. To learn more about the standard visit the REST section in Wikipedia website.

Configuration - REST Server

The following sample configuration shows how variables can be made accessible over a REST server.

  1. Select the root model node in the tree on the left.

  2. Enter a path prefix.

  3. Configure the REST Server endpoint.

  • Enter the IP.

  • Enter the port.

  • Enter the Content-Type.

  1. Check the webapp checkbox and provide the WAR-file if you want to host an application.

  2. Click the Apply button and save the Channel by clicking the Save button on the upper right corner.

Rest_Server_Config

Description of configuration properties:

Property

Description

Example

pathPrefix

Prefix for the URL

e.g., demo

Port

Port of the REST server

e.g., 9002, 9000, ...

IP

IP address of the REST server

http://localhost

DefaultContentType

Is used to indicate the media type of the resource

application/json, application/xml, text/html, text/csv

webapp

Possibility to host an application

true, false

Configuration - REST Client

The following sample configuration shows a GET request using url parameters.

  1. Select the root model node in the tree on the left

  2. Select the content type - defines the media type of the associated representation

  3. Set the wait timeout

Rest_Client_Config
  1. Select the Command node

  2. Enable the Command routes checkbox for the configuration of the following fields:

    • Enter the URL - If URL parameters are used then add each parameter in the following syntax ${id}

    • Select the HTTP method.

  3. (Optional - Headers) Enable the checkbox Headers for the configuration of the following fields:

    • Enter the name of the header

    • Enter the value

  4. (Optional - Headers) You can add multiple header entries by clicking the Add button

  5. (Optional - Headers) Headers can be deleted by clicking the delete button

Rest_Client_Config
  1. (Optional - Authentication) Enable the checkbox Authentication for the configuration of the following fields:

    • Select the Type of the Authentication

    • Enter the Username and Password or select it from the Credentials Manager

Rest_Client_Config
  1. (Optional - URL Parameters) Select a custom variable and enable the command routes checkbox

  2. (Optional - URL Parameters) Enable the command routes for the configuration of the following fields:

    • Select the Content Type

    • (Optional) Enter a Field Name in case the Information Model Node is not matching the REST API

Rest_Client_Config

Description of configuration properties:

Property

Description

Example

URL

URL of the REST API.

http://localhost:8081/api/v1/dataPoint/${id}

HttpMethod

HTTP method for the action performed by the Client.

GET, POST, PUT

HeaderName and Header Value

To provide server and client with additional information

Retry-After: 12

Default Content Type

Is used to indicate the media type of the resource.

application/json

RouteHeaderConfiguration

Headers represent the meta-data associated with the API request

Name, Value

Authentication Type

Type of the Authentication

Basic, Digest, Kerberos, NTLM, SPNEGO

Content Type of Parameter Nodes

Type of the Parameter

Parameters, Body, Header, None

Field Name

For non-matching Information Model nodes and API spelling

String

WaitTimeoutDuration

Timeout in seconds until request is failing

10