Menu

CreateSensorModel

Jim

Create new Sensor Model

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

Path: cs-ws/resources/admin/sensormodel Method: POST

Parameters

  • apikey

Data

<sensormodel>
   1..n attributes containing name and datatype of the attribute
   <attribute>
      <name>...</name>
      <type>...</type>  one of Number, Date, Boolean, Text, GpsData
   </attribute>
   ...
   1..n configuration parameters containing a display name and an internal name
   values are assigned when a sensor based on the sensor model is created
   <config>
      <displayname>...</displayname>
      <name>...</name>
   </config>
   ...
   <name>...</name>
</sensormodel>

Errors:

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

Example

POST http://localhost/cs-ws/resources/admin/sensormodel?apikey=1234 HTTP/1.1
<sensormodel>
   <attribute>
      <name>Temperature</name>
      <type>Number</type>
   </attribute>
   <config>
      <displayname>Unit</displayname>
      <name>unit</name>
   </config>
   <config>
      <displayname>Maximum</displayname>
      <name>max</name>
   </config>
   <name>NewSensorModel</name>
</sensormodel>

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.