Menu

RetrieveCommandByDevice

Jim

Retrieve Command by Device

Returns stored commands for all actors of a device

Path: cs-ws/resources/commands/device Method: GET

Parameters

  • apikey
  • device_name
  • from ... timestamp as yyyy-mm-dd hh:hh:ss.SSS
  • to ... timestamp as yyyy-mm-dd hh:hh:ss.SSS
  • direction ...=asc|desc: controls whether timestamped data are retrieved in ascending or descending order, ascending is default
  • sentOnly ...=True only commands are retrieved that are not sent up to now, otherwise all command are retrieved

Errors:

  • 401 UNAUTHORIZED if key is invalid
  • 404 NOT FOUND if the device is not found

Example

GET http://localhost/cs-ws/resources/commands/device?direction=asc&sentOnly=True&
to=3000-01-01%2001%3A00%3A00.000&from=1970-01-01%2001%3A00%3A00.000&
device_name=TempDev2&apikey=1234 HTTP/1.1
HTTP/1.1 200 OK
<devices>
   <command>
      <activation_time>2012-08-31 22:56:54.036</activation_time>
      <actor>Valve1</actor>
      <execution_time>1970-01-01 00:00:00.000</execution_time>
      <id>9</id>
      <model>TemperatureDevice</model>
      <name>TempDev2</name>
      <parameter>
         <name>WaterValve</name>
         <value>2</value>
      </parameter>
      <status>Sent</status>
   </command>
</devices>

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.