These docs are for v7.0.0. Click to read the latest docs for v7.4.0.

Rest Service

ESF provides a built-in REST Service based on the osgi-jax-rs-connector project.

By default, REST service providers register their services using the context path /services.

The REST service provides the BASIC Authentication support and HTTPS client certificate authentication support.

REST API access is available on all HTTP ports defined in the HTTP/HTTPS Configuration section, unless access is restricted to dedicated ports using the corresponding configuration parameter (see below).

Certificate authentication support is only available on the HTTPS With Certificate Authentication Ports configured in HTTP/HTTPS Configuration section.

ESF Identity names and passwords can be used for BASIC Authentication. Certificate authentication follows the same rules as Gateway Administration Console Authentication.

JAX-RS roles are mapped to ESF permissions, the name of a permission associated with a JAX-RS role is the rest. prefix followed by the role name.
For example the assets role is mapped to the rest.assets permission.
REST related permissions can be assigned to an identity using the ESF Gateway Administration Console in the Identities section.

# RestService configuration

2920

The RestService configuration contains an Allowed Ports parameter that can be used to restrict REST API access to specific ports. If the port list is left empty, access will be enabled on all available ports.

Assets REST APIs

ESF exposes REST APIs for the Asset instances instantiated in the framework.
Assets REST APIs are available in the context path /services/assets.
Following, the supported REST endpoints:

MethodPathRoles AllowedEncodingRequest ParametersDescription
GET/assetsJSONNoneReturns the list of available assets.
GET/{pid}assetsJSONNoneReturns the list of available channels for the selected asset (specified by the corresponding PID)
GET/{pid}/_readassetsJSONNoneReturns the read for all the READ channels in the selected Asset
POST/{pid}/_readassetsJSONThe list of channels where the READ operation should be performed.
The expected format is:

{ "channels":[ "channel-1", "channel-2" ] }
Returns the result of the read operation for the specified channels.
POST/{pid}/_writeassetsJSONThe list of channels and associated values that will be used for the WRITE operation. The expected format is:
{ "channels":[ { "name":"channel-1", "type":"INTEGER", "value":10 } ] }
Performs the write operation for the specified channels returning the result of the operation.

🚧

Please refer to this page for an example on how to use Assets REST APIs

Other services exposing REST APIs: