Menu

UpdateDevice

Jim

Update Device

changes the device in the domain of an owner identified by the apikey
the full device is replaced, not a delta to the existing one

Path: cs-ws/resources/admin/device Method: PUT
Alternative: cs-ws/resources/admin/device/put Method: POST

Parameters

  • apikey

Data

<device>
   <name>...</name>
   <model>..</model>
   <config>                optional device configuration parameters
      <name>...</name>
      <value>...</value>
   </config>
   ...
   <sensor>                optional if sensor configuration parameters are set
      <name>...</name>     
      <config>             
         <name>...</name>
         <value>...</value>
      </config>
      ...
   </sensor>
   ...
   <actor>                 optional if actor configuration parameters are set
      <name>...</name>     
      <config>             
         <name>...</name>
         <value>...</value>
      </config>
      ...
   </actor>
   ...
</device>

Errors:

  • 401 UNAUTHORIZED if key is invalid or not admin key
  • 404 NOT FOUND if the device model in the post data is not existing

Example

PUT http://localhost/cs-ws/resources/admin/device/?apikey=1234 HTTP/1.1
<device>
   <name>MyTempDev</name>
   <model>MyTemperatureDeviceModel</model>
   <actor>
      <name>position</name>
      <config>
         <name>max</name>
         <value>100</value>
      </config>
   </actor>
   <config>
      <name>maxpos</name>
      <value>999</value>
   </config>
</device>

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.