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.

Information Model Requirements

Example Model

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. Select the Message encoding standard.

  3. Check the box to Log data (E.g., the body of a request).

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

Message encoding

Encoding standard for messages

ISO-8859-1, UTF-16

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. Headers (Optional) - Enable the checkbox Headers for the configuration of the following fields:

    • Enter the name of the header

    • Enter the value

  4. Add multiple header entries by clicking the Add button

  5. Delete a header by clicking the Delete button

Rest_Client_Config
  1. Select the Authentication type

  2. Select the Message encoding standard

  3. Check the box to Log data (E.g., the body of a request).

Rest_Client_Config
  1. URL Parameters (Optional) - Select a custom variable node

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

Message encoding

Encoding standard for messages

ISO-8859-1, UTF-16