<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to UpdateDeviceModel</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateDeviceModel/</link><description>Recent changes to UpdateDeviceModel</description><atom:link href="https://sourceforge.net/p/m2mlabs/wiki/UpdateDeviceModel/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 23 Sep 2012 10:46:56 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/m2mlabs/wiki/UpdateDeviceModel/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage UpdateDeviceModel modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateDeviceModel/</link><description>&lt;pre&gt;--- v2
+++ v3
@@ -29,6 +29,11 @@
       &lt;displayname&gt;...&lt;/displayname&gt; gui name of config parameter
       &lt;name&gt;...&lt;/name&gt;               internal name of config parameter
    &lt;/config&gt;
+   ...
+   &lt;script&gt;                 optional, name and version of attached script
+      &lt;name&gt;...&lt;/name&gt;
+      &lt;version&gt;...&lt;/version&gt;   
+   &lt;/script&gt;
    ...
 &lt;/devicemodel&gt;
 ~~~~~~
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sun, 23 Sep 2012 10:46:56 -0000</pubDate><guid>https://sourceforge.net8078b9a0446ab5b4ed2705c4c47cc9d51b646376</guid></item><item><title>WikiPage UpdateDeviceModel modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateDeviceModel/</link><description>&lt;pre&gt;--- v1
+++ v2
@@ -13,22 +13,24 @@
 Data
 
 ~~~~~~
-&lt;actormodel&gt;
-   1..n attributes containing name and datatype of the attribute
-   &lt;attribute&gt;
-      &lt;name&gt;...&lt;/name&gt;
-      &lt;type&gt;...&lt;/type&gt;  one of Number, Date, Boolean, Text, GpsData
-   &lt;/attribute&gt;
+&lt;devicemodel&gt;
+   &lt;name&gt;...&lt;/name&gt;
+   &lt;sensor&gt;
+      &lt;name&gt;...&lt;/name&gt;      name of sensor within device model
+      &lt;model&gt;...&lt;/model&gt;    model of the sensor
+   &lt;/sensor&gt;
    ...
-   1..n configuration parameters containing a display name and an internal name
-   values are assigned when an actor based on the actor model is created
+   &lt;actor&gt;
+      &lt;name&gt;...&lt;/name&gt;      name of actor within device model
+      &lt;model&gt;...&lt;/model&gt;    model of the actor
+   &lt;/actor&gt;
+   ...
    &lt;config&gt;
-      &lt;displayname&gt;...&lt;/displayname&gt;
-      &lt;name&gt;...&lt;/name&gt;
+      &lt;displayname&gt;...&lt;/displayname&gt; gui name of config parameter
+      &lt;name&gt;...&lt;/name&gt;               internal name of config parameter
    &lt;/config&gt;
    ...
-   &lt;name&gt;...&lt;/name&gt;
-&lt;/actormodel&gt;
+&lt;/devicemodel&gt;
 ~~~~~~
 
 Errors:
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sat, 22 Sep 2012 18:56:20 -0000</pubDate><guid>https://sourceforge.net4750022224c53298ba63e2c1bbf837a324ff0d0a</guid></item><item><title>WikiPage UpdateDeviceModel modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateDeviceModel/</link><description>### 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

~~~~~~
&lt;actormodel&gt;
   1..n attributes containing name and datatype of the attribute
   &lt;attribute&gt;
      &lt;name&gt;...&lt;/name&gt;
      &lt;type&gt;...&lt;/type&gt;  one of Number, Date, Boolean, Text, GpsData
   &lt;/attribute&gt;
   ...
   1..n configuration parameters containing a display name and an internal name
   values are assigned when an actor based on the actor model is created
   &lt;config&gt;
      &lt;displayname&gt;...&lt;/displayname&gt;
      &lt;name&gt;...&lt;/name&gt;
   &lt;/config&gt;
   ...
   &lt;name&gt;...&lt;/name&gt;
&lt;/actormodel&gt;
~~~~~~

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
&lt;devicemodel&gt;
   &lt;name&gt;MyTemperatureDeviceModel&lt;/name&gt;
   &lt;sensor&gt;
      &lt;name&gt;TemperatureSensor1&lt;/name&gt;
      &lt;model&gt;SimpleTemperatureSensorModel&lt;/model&gt;
   &lt;/sensor&gt;
   &lt;sensor&gt;
      &lt;name&gt;TemperatureSensor2&lt;/name&gt;
      &lt;model&gt;SimpleTemperatureSensorModel&lt;/model&gt;
   &lt;/sensor&gt;
   &lt;actor&gt;
      &lt;name&gt;position&lt;/name&gt;
      &lt;model&gt;WaterValve&lt;/model&gt;
   &lt;/actor&gt;
   &lt;config&gt;
      &lt;displayname&gt;Maximum Position&lt;/displayname&gt;
      &lt;name&gt;maxpos&lt;/name&gt;
   &lt;/config&gt;
&lt;/devicemodel&gt;

HTTP/1.1 200 OK
~~~~~~
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sat, 22 Sep 2012 18:54:35 -0000</pubDate><guid>https://sourceforge.netd69c760eb7f665c82225bb0e32da7369cce2d1ee</guid></item></channel></rss>