Menu

CreateMultipleCommands

Jim

Create Multiple new Commands

Creates multiple new commands in the domain of the owner identified by the apikey.

Path: cs-ws/resources/admin/command/list Method: POST

Parameters

  • apikey

Data

<devices>
<command>
   <name>...</name>                        device name
   <actor>...</actor>                      actor name
   <id>...</id>                            unique number
   <status>...</status>                    optional, if not given set to New
   <activation_time>...</activation_time>  
       time when command should be executed as yyyy-mm-dd hh:mm:ss.SSS
       it is guaranteed that command is not sent before activation time
   <execution_time>...</execution_time>
       time when command was actually executed
       should be set to 1970-01-01 00:00:00.000 in command creation
   <parameter>                             parameters as defined in actor model
       <name>...</name>
       <value>...</value>
   </parameter>
</command>
<command>
   ...
</command>
</devices>

Errors:

  • 401 UNAUTHORIZED if key is invalid or not admin key
  • 409 CONFLICT if command already exists

Example

POST http://localhost/cs-ws/resources/admin/command/list?apikey=1234 HTTP/1.1
<devices>
<command>
   <name>TempDev2</name>
   <actor>Valve1</actor>
   <id>6</id>
   <activation_time>2017-08-31 19:55:54.036</activation_time>
   <execution_time>1970-01-01 00:00:00.000</execution_time>
   <parameter>
      <name>WaterValve</name>
      <value>2.0</value>
   </parameter>
</command>
<command>
   ...
</command>
</devices>

HTTP/1.1 200 OK

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.