Menu

CreateDeviceModel

Jim

Create new Device Model

Creates a new device model in the domain of the owner identified by the apikey

Path: cs-ws/resources/admin/devicemodel 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
  • 409 CONFLICT if device model already exists

Example

POST http://localhost/cs-ws/resources/admin/devicemodel?apikey=1234 HTTP/1.1
<devicemodel>
   <name>MyTemperatureDeviceModel</name>
   <sensor>
      <name>TemperatureSensor</name>
      <model>SimpleTemperatureSensorModel</model>
   </sensor>
   <actor>
      <name>position</name>
      <model>WaterValve</model>
   </actor>
   <config>
      <displayname>Maximum Position</displayname>
      <name>maxpos</name>
   </config>
   <script>
      <name>TestScript3</name>
      <version>1</version>   
   </script>
</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.