Menu

UpdateDeviceModel

Jim

Update Device Model

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

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

Parameters

  • apikey

Data

<devicemodel>
   <name>...</name>
   <sensor>
      <name>...</name>      name of sensor within device model
      <model>...</model>    model of the sensor
   </sensor>
   ...
   <actor>
      <name>...</name>      name of actor within device model
      <model>...</model>    model of the actor
   </actor>
   ...
   <config>
      <displayname>...</displayname> gui name of config parameter
      <name>...</name>               internal name of config parameter
   </config>
   ...
   <script>                 optional, name and version of attached script
      <name>...</name>
      <version>...</version>   
   </script>
   ...
</devicemodel>

Errors:

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

Example

PUT http://localhost/cs-ws/resources/admin/devicemodel/?apikey=1234 HTTP/1.1
<devicemodel>
   <name>MyTemperatureDeviceModel</name>
   <sensor>
      <name>TemperatureSensor1</name>
      <model>SimpleTemperatureSensorModel</model>
   </sensor>
   <sensor>
      <name>TemperatureSensor2</name>
      <model>SimpleTemperatureSensorModel</model>
   </sensor>
   <actor>
      <name>position</name>
      <model>WaterValve</model>
   </actor>
   <config>
      <displayname>Maximum Position</displayname>
      <name>maxpos</name>
   </config>
</devicemodel>

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.