Main > Reference Manual > Extension modules > REST webservice module

This module implements a multi-threaded REST webservice server.
Using the webservice frePPLe can make the plan information on-line accessible to other systems and users, and also receive updated information. FrePPLe can thus integrate flexibly in a Service Oriented Architecture (SOA), sharing information with other applications.

Note that the module works with the frePPLe objects loaded memory. It does not persist any data in the database. See the chapter on the architecture to understand the difference.

The module is coded in Python using the excellent CherryPy HTTP framework, which needs to be installed seperately. The webservice provides full read and write access to all frePPLe objects.

The module enables the following new objects:

  • Python function RESTwebservice(address, port)
    This function starts the service on the address and port specified.
    The default port is 8080 and the address of the default network card is detected by default.

The XML messages have the structure as described in the modeling section.

The following URLS serve information files:

  • http://<address>:<port>/frepple.xsd:
    Returns the main XSD schema definition of the frePPLe XML format.
    This XSD schema defines the top level structure.
  • http://<address>:<port>/frepple_core.xsd:
    Returns the XSD schema definition of the XML format of the frePPLe objects.
    This XSD schema file is included from the previous one.

HTTP GET-requests to the following URLs are used to read information from frePPLe:

  • http://<address>:<port>/:
    Returns the complete model
  • http://<address>:<port>/buffer/:
    Returns all buffers.
  • http://<address>:<port>/buffer/<name>/:
    Returns the specific buffer.
  • http://<address>:<port>/calendar/:
    Returns all calendars.
  • http://<address>:<port>/calendar/<name>/:
    Returns the specific calendar.
  • http://<address>:<port>/customer/:
    Returns all customers.
  • http://<address>:<port>/customer/<name>/:
    Returns the specific customer.
  • http://<address>:<port>/demand/:
    Returns all demands.
  • http://<address>:<port>/demand/<name>/:
    Returns the specific demand.
  • http://<address>:<port>/flow/:
    Returns all flows.
  • http://<address>:<port>/item/:
    Returns all items.
  • http://<address>:<port>/item/<name>/:
    Returns the specific item.
  • http://<address>:<port>/load/:
    Returns all loads.
  • http://<address>:<port>/location/:
    Returns all locations.
  • http://<address>:<port>/location/<name>/:
    Returns the specific location.
  • http://<address>:<port>/operation/:
    Returns all operations.
  • http://<address>:<port>/operation/<name>/:
    Returns the specific operation.
  • http://<address>:<port>/operationplan/:
    Returns all operationplans.
  • http://<address>:<port>/operationplan/<id>/:
    Returns the specific operationplan.
  • http://<address>:<port>/problem/:
    Returns all problems.
  • http://<address>:<port>/resource/:
    Returns all resources.
  • http://<address>:<port>/resource/<name>/:
    Returns the specific resource.

HTTP POST- and PUT-requests to the following URLs are used to write information to frePPLe.
Multiple fields can be specified as parameters to the URL.
The web service return the string "OK" or a description of the error(s) found.

  • http://<address>:<port>/:
    Create or update entities in frePPLe.
    The uploaded XML document can create, update or delete objects of any type.
  • http://<address>:<port>/buffer/<name>/?<field>=<value>:
    Create or update a buffer.
  • http://<address>:<port>/calendar/<name>/?<field>=<value>:
    Create or update a calendar.
  • http://<address>:<port>/customer/<name>/?<field>=<value>:
    Create or update a customer.
  • http://<address>:<port>/demand/<name>/?<field>=<value>:
    Create or update a demand.
  • http://<address>:<port>/item/<name>/?<field>=<value>:
    Create or update a item.
  • http://<address>:<port>/location/<name>/?<field>=<value>:
    Create or update a location.
  • http://<address>:<port>/operation/<name>/?<field>=<value>:
    Create or update a operation.
  • http://<address>:<port>/operationplan/<id>/?<field>=<value>:
    Create or update a operationplan.
  • http://<address>:<port>/resource/<name>/?<field>=<value>:
    Create or update a resource.