<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Frepple / REST webservice module</title> <link rel='stylesheet' href='../styles.css' type='text/css' /> <!--PageHeaderFmt--> </head> <body> <div id="container"> <div id="menubar"> <div id="logo" align="center"> <br/><img src='../frepple.bmp' alt="frepple" /><br/> <a href='http://www.frepple.com/'> <strong>a Free<br/>Production Planning<br/>Library</strong> </a></div> <div id="menu"> <br/> <h3><a href='../Main/HomePage.html'>Main</a></h3> <h3><a href='../UI/Main.html'>User Manual</a></h3> <h3><a href='../Tutorial/Main.html'>Tutorial</a></h3> <h3><a href='Main.html'>Reference Manual</a></h3> <h3><a href='../Main/FAQ.html'>FAQ</a></h3> <h3><a href='../reference/index.html'>C++ API</a></h3> <br/><div> </div> </div> </div> <div id="content"> <br/> <!--PageText--> <div id='wikitext'> <p><a class='wikilink' href='../Main/HomePage.html'>Main</a> > <span class='wikitrail'><a class='wikilink' href='Main.html'>Reference Manual</a> > <a class='wikilink' href='Modules.html'>Extension modules</a> > <a class='selflink' href='ModulesRESTWebservice.html'>REST webservice module</a></span> </p> <p class='vspace'>This module implements a multi-threaded REST webservice server.<br />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 <strong>Service Oriented Architecture</strong> (SOA), sharing information with other applications. </p> <p class='vspace'>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 <a class='wikilink' href='OverviewArchitecture.html'>architecture</a> to understand the difference. </p> <p class='vspace'>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. </p> <p class='vspace'>The module enables the following new objects: </p><ul><li>Python function <strong>RESTwebservice(address, port)</strong><br /> This function starts the service on the address and port specified.<br /> The default port is 8080 and the address of the default network card is detected by default. </li></ul><p class='vspace'>The XML messages have the structure as described in the modeling section. </p> <p class='vspace'>The following URLS serve information files: </p><ul><li><strong>http://<address>:<port>/frepple.xsd</strong>:<br /> Returns the main XSD schema definition of the frePPLe XML format.<br /> This XSD schema defines the top level structure. </li><li><strong>http://<address>:<port>/frepple_core.xsd</strong>:<br /> Returns the XSD schema definition of the XML format of the frePPLe objects.<br /> This XSD schema file is included from the previous one. </li></ul><p class='vspace'>HTTP GET-requests to the following URLs are used to <strong>read</strong> information from frePPLe: </p><ul><li><strong>http://<address>:<port>/</strong>:<br /> Returns the complete model </li><li><strong>http://<address>:<port>/buffer/</strong>:<br /> Returns all buffers. </li><li><strong>http://<address>:<port>/buffer/<name>/</strong>:<br /> Returns the specific buffer. </li><li><strong>http://<address>:<port>/calendar/</strong>:<br /> Returns all calendars. </li><li><strong>http://<address>:<port>/calendar/<name>/</strong>:<br /> Returns the specific calendar. </li><li><strong>http://<address>:<port>/customer/</strong>:<br /> Returns all customers. </li><li><strong>http://<address>:<port>/customer/<name>/</strong>:<br /> Returns the specific customer. </li><li><strong>http://<address>:<port>/demand/</strong>:<br /> Returns all demands. </li><li><strong>http://<address>:<port>/demand/<name>/</strong>:<br /> Returns the specific demand. </li><li><strong>http://<address>:<port>/flow/</strong>:<br /> Returns all flows. </li><li><strong>http://<address>:<port>/item/</strong>:<br /> Returns all items. </li><li><strong>http://<address>:<port>/item/<name>/</strong>:<br /> Returns the specific item. </li><li><strong>http://<address>:<port>/load/</strong>:<br /> Returns all loads. </li><li><strong>http://<address>:<port>/location/</strong>:<br /> Returns all locations. </li><li><strong>http://<address>:<port>/location/<name>/</strong>:<br /> Returns the specific location. </li><li><strong>http://<address>:<port>/operation/</strong>:<br /> Returns all operations. </li><li><strong>http://<address>:<port>/operation/<name>/</strong>:<br /> Returns the specific operation. </li><li><strong>http://<address>:<port>/operationplan/</strong>:<br /> Returns all operationplans. </li><li><strong>http://<address>:<port>/operationplan/<id>/</strong>:<br /> Returns the specific operationplan. </li><li><strong>http://<address>:<port>/problem/</strong>:<br /> Returns all problems. </li><li><strong>http://<address>:<port>/resource/</strong>:<br /> Returns all resources. </li><li><strong>http://<address>:<port>/resource/<name>/</strong>:<br /> Returns the specific resource. </li></ul><p class='vspace'>HTTP POST- and PUT-requests to the following URLs are used to <strong>write</strong> information to frePPLe.<br />Multiple fields can be specified as parameters to the URL.<br />The web service return the string "OK" or a description of the error(s) found. </p><ul><li><strong>http://<address>:<port>/</strong>:<br /> Create or update entities in frePPLe.<br /> The uploaded XML document can create, update or delete objects of any type. </li><li><strong>http://<address>:<port>/buffer/<name>/?<field>=<value></strong>:<br /> Create or update a buffer. </li><li><strong>http://<address>:<port>/calendar/<name>/?<field>=<value></strong>:<br /> Create or update a calendar. </li><li><strong>http://<address>:<port>/customer/<name>/?<field>=<value></strong>:<br /> Create or update a customer. </li><li><strong>http://<address>:<port>/demand/<name>/?<field>=<value></strong>:<br /> Create or update a demand. </li><li><strong>http://<address>:<port>/item/<name>/?<field>=<value></strong>:<br /> Create or update a item. </li><li><strong>http://<address>:<port>/location/<name>/?<field>=<value></strong>:<br /> Create or update a location. </li><li><strong>http://<address>:<port>/operation/<name>/?<field>=<value></strong>:<br /> Create or update a operation. </li><li><strong>http://<address>:<port>/operationplan/<id>/?<field>=<value></strong>:<br /> Create or update a operationplan. </li><li><strong>http://<address>:<port>/resource/<name>/?<field>=<value></strong>:<br /> Create or update a resource. </li></ul> </div> <!--PageFooterFmt--> <!--HTMLFooter--> </div></div> </body> </html>