Difference between revisions of "Edge Management"

From RifidiWiki

Jump to: navigation, search
(startsession command example)
(Command Example)
Line 47: Line 47:
 
*save - Saves the current state of the Edge Server configuration (such as created readers/sensors, modified properties etc..
 
*save - Saves the current state of the Edge Server configuration (such as created readers/sensors, modified properties etc..
  
=Command Example=
+
==Command Example==
  
 
Note: localhost can be substituted with IP address/Host name of Rifidi Edge Server. Port can be changed in Rifidi configuration
 
Note: localhost can be substituted with IP address/Host name of Rifidi Edge Server. Port can be changed in Rifidi configuration

Revision as of 10:39, 27 September 2014

Introduction

Prior to Rifidi 3.1 (coming Fall 2014) Edge Management is available through RMI (currently used by Rifidi Workbench if looking for code examples). Starting in 3.1 Edge Management is now accessible though Restful Services (leveraging Restlet plugin. Restlet allows all Rifidi Edge Management operations available through workbench to be accessible via Restful Services.

The types of operations available through Restful Services include:

  • All "session" commands (for stopping and starting reader/sensor sessions)
  • ExecuteCommand and deleteCommand (for commands supported by a sensor such as a tag read)
  • Readers (for getting a list of readers/sensors available on Edge Server instance)
  • Commands (for issuing command line operations such as saving the Edge Server Configuration currently in memory)
  • Get and Set Properties (for setting and getting sensor properties such as Setting the LLRP Reader Configuration dynamically)
  • Create Reader (for creating a new reader connection)
  • Managing Rifidi Applications (for stopping/starting, listing and deploying Rifidi Apps)

Additional features can be found on Restlet User Guide

Configuration

In rifidiserver.ini - A full list of Rifidi Edge configuartion parameters can be found Edge_Server_Configuration

  • Port can be set

-Dorg.rifidi.restlet.port=8111

  • Restlet starts by default this can be changed

-Dorg.rifidi.restlet.enabled=true


Source for Restful Rifidi Management Commands - https://transcends.svn.cloudforge.com/rifidi/rifidi/trunk/org.rifidi.edge/src/org/rifidi/edge/rest/

Commands

List of available Rifidi API Commands

Note: Please refer to the Rifidi Edge Source Rifidi Edge/Workbench Source SVN and JavaDocs Edge_Server_API for details on how these commands function

  • apps - returns a list of available applications
  • stopapp/{appID} - stops a Rifidi Application
  • startapp/{appID} - starts a Rifidi Application
  • commandtypes - returns a list of available command types
  • readertypes - returns a list of available reader/sensor types (such as LLRP, Alien, BarCode etc..)
  • createreader/{readerType}/{properties} -creates a reader/sensor configuration
  • readers - returns a list of readers/senors managed by the Edge Server
  • getproperties/{readerID} - returns the reader/sensor properties
  • setproperties/{readerID}/{properties}" - sets the reader/sensor properties
  • commands - returns a list of available commands
  • createsession/{readerID} - creates a session (with corresponding reader/sensor configuration) and returns status code (such as successful)
  • startsession/{readerID}/{sessionID} - starts a session for a given reader/sensor and returns status code (such as successful)
  • readerstatus/{readerID} - retuns teh status of a given reader/sensor
  • stopsession/{readerID}/{sessionID} - stops a session for a given reader/sensor and returns status code (such as successful)
  • executecommand/{readerID}/{sessionID}/{commandID}/{repeatInterval} - Executes a command for a given session
  • deletesession/{readerID}/{sessionID} - deletes a session and returns status code (such as successful)
  • save - Saves the current state of the Edge Server configuration (such as created readers/sensors, modified properties etc..

Command Example

Note: localhost can be substituted with IP address/Host name of Rifidi Edge Server. Port can be changed in Rifidi configuration

apps command example

Request (via HTTP Post/Get) "apps" command like this:

http://localhost:8111/apps

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <apps>
      <app>
         <id>AppService:ReadZones</id>
         <number>0</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>AppService:SensorStatus</id>
         <number>1</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>RifidiManagement:RifidiManagementApp</id>
         <number>2</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>AppService:UniqueTagInterval</id>
         <number>3</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>AppService:StableSet</id>
         <number>4</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>AppService:LimitStableSet</id>
         <number>5</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>AppService:UniqueTagBatchInterval</id>
         <number>6</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>AppService:RSSI</id>
         <number>7</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>Diagnostic:GPIO</id>
         <number>8</number>
         <status>STOPPED</status>
      </app>
      <app>
         <id>Diagnostic:Serial</id>
         <number>9</number>
         <status>STOPPED</status>
      </app>
      <app>
         <id>Diagnostic:Tags</id>
         <number>10</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>Diagnostic:TagGenerator</id>
         <number>11</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>Monitoring:ReadZones</id>
         <number>12</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>Monitoring:Tags</id>
         <number>13</number>
         <status>STARTED</status>
      </app>
      <app>
         <id>Monitoring:SensorStatus</id>
         <number>14</number>
         <status>STARTED</status>
      </app>
   </apps>
</response>

stop appcommand example

Request (via HTTP Post/Get) "stopapp" command like this:

http://localhost:8111/stopapp/2

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

startapp command example

Request (via HTTP Post/Get) "startapp" command like this:

http://localhost:8111/startapp/2

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

commandtypes command example

Request (via HTTP Post/Get) "commandtypes" command like this:

http://localhost:8111/commandtypes

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <commands>
      <command>
         <factoryID>ThingMagic-Poll</factoryID>
         <description>Poll the ThingMagic reader for its tags. For monitoring of the read zone, submit this command for recurring execution.</description>
      </command>
      <command>
         <factoryID>LLRP-ADD_ROSPEC-File</factoryID>
         <description>Configure the LLRP reader via an XML file.  Any changes made to the reader are determined by the contents of the file.  To generate xml code for the commands you want to submit, check out LLRP Commander here: http://www.fosstrak.org/llrp/index.html</description>
      </command>
      <command>
         <factoryID>Awid3014-Push-Stop</factoryID>
         <description>Command the Awid reader to stop sending back tags. To use, submit this command for a one-time execution.</description>
      </command>
      <command>
         <factoryID>Awid2010-Poll</factoryID>
         <description>Configure the Awid reader to send back tags using the Gen 2 Portal ID command. To monitor a read zone, submit this command for a one-time execution.</description>
      </command>
      <command>
         <factoryID>Alien-Poll</factoryID>
         <description>Poll the Alien reader for its tag list. For monitoring of the read zone, submit this command for recurring execution.</description>
      </command>
      <command>
         <factoryID>LLRP-Configure</factoryID>
         <description>Configure the LLRP reader to collect tags.  By default, this command will cause the LLRP reader to push back tag reads automatically.  If you would rather use the Poll mode, you will need to use the LLRP Poll command. To use the LLRP Configure command, submit it for a one-time execution</description>
      </command>
      <command>
         <factoryID>Alien-Push-Start</factoryID>
         <description>Configure the Alien reader to send back tags using the autonomous mode. To monitor a read zone, configure an Alien autonomous reader to listen.  Then submit this command for a one-time execution.</description>
      </command>
      <command>
         <factoryID>Thingmagic6-Push</factoryID>
         <description>Sets the Thingmagic to push tags back to the edge server</description>
      </command>
      <command>
         <factoryID>Awid3014-Poll</factoryID>
         <description>Configure the Awid reader to send back tags using the Gen 2 Portal ID command. To monitor a read zone, submit this command for a one-time execution.</description>
      </command>
      <command>
         <factoryID>Awid-Mask-Poll</factoryID>
         <description>Configure the Awid reader to send back tags using the Gen 2 Portal ID With Mask command. To monitor a read zone and read a specific memory bank, submit this command for a one-time execution.</description>
      </command>
      <command>
         <factoryID>Awid-Read-Block-Data</factoryID>
         <description>Configure the Awid reader to send back memory bank tags using the Read Block Data commmand. To monitor a read zone and read a specific memory bank, submit this command for a one-time execution.</description>
      </command>
      <command>
         <factoryID>LLRP-Poll</factoryID>
         <description>Poll the LLRP reader for its tags. For monitoring of the read zone, first use the LLRP Configure command to configure the LLRP reader for Poll Mode. Then submit this command for recurring execution.</description>
      </command>
      <command>
         <factoryID>LLRP-Push-Stop</factoryID>
         <description>Command the LLRP reader to stop sending back tags.  To use, supply the RO Spec that is currently executing on the reader, and submit this command for a one-time execution.</description>
      </command>
      <command>
         <factoryID>Alien-Push-Stop</factoryID>
         <description>Command the Alien reader to stop sending back tags in autonomous mode.  To use, submit this command for a one-time execution.</description>
      </command>
      <command>
         <factoryID>Awid2010-Push-Stop</factoryID>
         <description>Command the Awid reader to stop sending back tags. To use, submit this command for a one-time execution.</description>
      </command>
   </commands>
</response>

readertypes command example

Request (via HTTP Post/Get) "readertypes" command like this:

http://localhost:8111/readertypes

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <sensors>
      <sensor>
         <factoryID>Generic</factoryID>
         <description>A generic Rifidi Adapter.</description>
      </sensor>
      <sensor>
         <factoryID>Opticon</factoryID>
         <description>The Rifidi Adapter for the Opticon Barcode Sensor</description>
      </sensor>
      <sensor>
         <factoryID>Alien-Autonomous</factoryID>
         <description>The Rifidi Alien autonomous adapter is an endpoint to passively receive tag reads from an Alien reader operating in autonomous mode. You cannot send any commands on the alien autonomous session</description>
      </sensor>
      <sensor>
         <factoryID>Awid2010</factoryID>
         <description>The Rifidi Awid adapater supports the Awid TCP/IP protocol on the 2010 and 3014</description>
      </sensor>
      <sensor>
         <factoryID>Thingmagic6</factoryID>
         <description>Sensor plugin for Thingmagic 6 readers</description>
      </sensor>
      <sensor>
         <factoryID>LLRP</factoryID>
         <description>The Rifidi LLRP adapter supports any reader that exposes a Low Level Reader Protocol (LLRP) interface. LLRP is a standard from EPCglobal.</description>
      </sensor>
      <sensor>
         <factoryID>Awid3014</factoryID>
         <description>The Rifidi Awid adapater supports the Awid TCP/IP protocol on the 2010 and 3014</description>
      </sensor>
      <sensor>
         <factoryID>Alien</factoryID>
         <description>The Rifidi Alien adapter supports the Alien ALR protocol on the 9900, 9800, 8800 readers.</description>
      </sensor>
      <sensor>
         <factoryID>Thinkify50</factoryID>
         <description>Sensor plugin for Thinkify TR50 readers</description>
      </sensor>
      <sensor>
         <factoryID>ThingMagic</factoryID>
         <description>The Rifidi ThingMagic adapater supports the ThingMagic RQL protocol on the Mercury 4 and Mercury 5 readers</description>
      </sensor>
   </sensors>
</response>

createreader command example

Request (via HTTP Post/Get) "createreader" command like this (splitting all property key/value pairs by a semicolon):

http://localhost:8111/createreader/LLRP/IpAddress=127.0.0.1;Port=5084

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

readers command example

Request (via HTTP Post/Get) "readers" command like this:

http://localhost:8111/readers

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <sensors>
      <sensor>
         <serviceID>Alien_1</serviceID>
         <factoryID>Alien</factoryID>
      </sensor>
      <sensor>
         <serviceID>Alien_2</serviceID>
         <factoryID>Alien</factoryID>
      </sensor>
   </sensors>
</response>


getproperties command example

Request (via HTTP Post/Get) "getproperties" command like this:

http://localhost:8111/getproperties/LLRP_1


Response:


setproperties command example

Request (via HTTP Post/Get) setproperties" like this (splitting all property key/value pairs by a semicolon):

http://localhost:8111/setproperties/Alien_1/MaxNumConnectionAttempts=11;DisplayName=Alien_Name

Response


<response><message>Success</message></response>


commands command example

Request (via HTTP Post/Get) "commands" command like this:

http://localhost:8111/commands

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <commands>
      <command>
         <commandID>LLRP_Configure_1</commandID>
         <factoryID>LLRP-Configure</factoryID>
      </command>
   </commands>
</response>

createsession command example

Request (via HTTP Post/Get) "createsession" command like this:

http://localhost:8111/createsession/LLRP_1

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

startsession command example

Request (via HTTP Post/Get) "startsession" command like this:

http://localhost:8111/startsession/LLRP_1/1

Response: Success

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

Response: Success

<?xml version="1.0" encoding="UTF-8"?> 
<response> <message>Fail</message>
   <Description>Unable to start session  - See Rifidi Edge Sever Log for details</Description>

</response>

readerstatus command example

Request (via HTTP Post/Get) "readerstatus" command like this:

http://localhost:8111/readerstatus/LLRP_1

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <sensor>
      <serviceID>LLRP_1</serviceID>
      <factoryID>LLRP</factoryID>
   </sensor>
   <sessions>
      <session>
         <ID>1</ID>
         <status>PROCESSING</status>
      </session>
   </sessions>
</response>

stopsession command example

Request (via HTTP Post/Get) "stopsession" command like this:

http://localhost:8111/stopsession/LLRP_1/1

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

executecommand command example

Request (via HTTP Post/Get) "executecommand" command like this:

http://localhost:8111/executecommand/LLRP_1/1/LLRP_Configure_1/-1

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

deletesession command example

Request (via HTTP Post/Get) "deletesession" command like this:

http://localhost:8111/deletesession/LLRP_1/1

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>


save command example

Request (via HTTP Post/Get) "save" command like this:

http://localhost:8111/save

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>
Personal tools