Difference between revisions of "Rifidi App API"

From RifidiWiki

Jump to: navigation, search
(Introduction)
(Introduction)
Line 9: Line 9:
 
*Get/Add Delete Readzones
 
*Get/Add Delete Readzones
 
*Get/Set Readzone Properties
 
*Get/Set Readzone Properties
 +
 +
=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==
 +
 +
*apps - returns a list of available applications
 +
 +
Request (via HTTP Post/Get) "apps" command like this:
 +
 +
http://localhost:8111/apps
 +
 +
Response:
 +
 +
<pre>
 +
<?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>
 +
</pre>
 +
 +
==stopapp command example==
 +
 +
*stopapp/{appID} - stops a Rifidi Application
 +
 +
Request (via HTTP Post/Get) "stopapp" command like this:
 +
 +
http://localhost:8111/stopapp/2
 +
 +
Response:
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<response>
 +
  <message>Success</message>
 +
</response>
 +
</pre>
 +
 +
==startapp command example==
 +
*startapp/{appID}  - starts a Rifidi Application
 +
Request (via HTTP Post/Get) "startapp" command like this:
 +
 +
http://localhost:8111/startapp/2
 +
 +
Response:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<response>
 +
  <message>Success</message>
 +
</response>
 +
</pre>

Revision as of 15:43, 30 October 2014

Introduction

Starting in Rifidi 3.1, Rifidi Apps can now be manged via rest

Note: In order for the properties to take effect the associated Rifidi App will need to be stopped and started. This allows for more fine grain control of when properties should take effect (as opposed to having the apps restart dynamically as properties change while a app is running)

The operations available are:

  • Get/Set Application and Group Properties
  • Get/Add Delete Readzones
  • Get/Set Readzone Properties

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

  • apps - returns a list of available applications

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>

stopapp command example

  • stopapp/{appID} - stops a Rifidi Application

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

  • startapp/{appID} - starts a Rifidi Application

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>