Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseSCADA/Documentation/REST API

< EclipseSCADA
Revision as of 06:06, 29 November 2013 by Unnamed Poltroon (Talk) (Created page with "Starting with milestone release M2 Eclipse SCADA will have a REST API for accessing DA data using a REST based interface. It is based on JAX-RS 1.1 and should be compatible w...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Starting with milestone release M2 Eclipse SCADA will have a REST API for accessing DA data using a REST based interface.

It is based on JAX-RS 1.1 and should be compatible with Gyrex. However we tested it with the OSGi Connector https://github.com/hstaudacher/osgi-jax-rs-connector

All URIs in this example assume you are using the "OSGi - JAX-RS Connector 3.1.0", although there is no special magic involved. So it *should* work with other OSGi based JAX-RS implementations supporting JAX-RS 1.1.

The "contextId" in the following URIs is the ID of the configuration object configuring the REST context. Since not all items should be exposed to the REST interface for now, the items have to be preconfigured using the CA factory "org.eclipse.scada.da.server.exporter.rest.context".

Configuration

Deployment

You will need to install and start the following bundles including their dependencies:

  • org.eclipse.equinox.ds
  • org.eclipse.scada.da.server.exporter.rest

In addition to you need a Hive instance in the OSGi context:

  • org.eclipse.scada.da.server.osgi # if you want the OSGi based Hive

You will need some sort of OSGi HTTP Service implementation (e.g. Jetty):

  • org.eclipse.equinox.http.jetty
  • org.eclipse.equinox.http.registry
  • org.eclipse.equinox.http.servlet

And some JAX-RS implemenation (this sample uses "OSGi - JAX-RS Connector 3.1.0"):

  • com.eclipsesource.jaxrs.publisher
  • com.eclipsesource.jaxrs.provider.gson

Interface

The base URI is: http://<yourserver>:<port>/services/org.eclipse.scada/da

The following commands are supported (relative to the base URI):

/{contextId}/item/{itemId} : GET

Returns the current state of the item.

/{contextId}/item/value/{itemId} : POST

Writes the value in the body to the item.

If the write cannot be performed an exception is returned.

/{contextId}/item/attributes/{itemId} : POST

Writes the attribute (Map<String,Variant>) set to the item.

If the write cannot be performed still an "OK" result is returned. It contains an object containing the result state for each attribute written. This is different than writing to an item but is due to the fact that you can write multiple attributes at the same time, some might succeed and some might fail.

Back to the top