Difference between revisions of "Topic sensor network"

From AMTech WikiDocs
Jump to: navigation, search
Line 5: Line 5:
 
If an error occurs an observation type observationoutputmsg get send to the sensor network topic
 
If an error occurs an observation type observationoutputmsg get send to the sensor network topic
  
    {
+
    {
 
         "topic": "/sensor_network/observation_errors/observationresourcecrud",
 
         "topic": "/sensor_network/observation_errors/observationresourcecrud",
 
         "_tenant": "m2mcreator",
 
         "_tenant": "m2mcreator",
 
         "@type": "/amtech/linkeddata/types/composite/observation/observationoutputmsg",
 
         "@type": "/amtech/linkeddata/types/composite/observation/observationoutputmsg",
         "resource": "{\"topic\":\" /helloWorld/asynch\",\"_tenant\":\"m2mcreator\",\"targetthings\":\"[]\",\"@type\":\"/amtech/linkeddata/types/composite/observation/observationresourcecrud\",\"propId\":\"hwgreetingLabel\",\"resourceuri\":\"/amtech/things/entities/HelloWorld/helloWorld\",\"resourcetype\":\"/amtech/linkeddata/types/composite/entity/HelloWorld\",\"newvalue\":\"heyWithError\",\"guesttenants\":[],\"oldvalue\":\"hey\",\"crudoperation\":\"PUT\",\"producer\":\"helloWorld\",\"detectiontime\":\"2016-04-22T18:33:11.481Z\",\"@id\":\"/amtech/things/observations/helloWorld5226521372857087\",\"occurrencetime\":\"2016-04-22T18:33:10.948Z\",\"_user\":\"m2mcreator@amtech.mx\"}",
+
         "resource": "{\"topic\":\" /helloWorld/asynch\",\"_tenant\":\"m2mcreator\",
 +
        \"targetthings\":\"[]\",
 +
        \"@type\":\"/amtech/linkeddata/types/composite/observation/observationresourcecrud\",
 +
        \"propId\":\"hwgreetingLabel\",\"resourceuri\":\"/amtech/things/entities/HelloWorld/helloWorld\",
 +
        \"resourcetype\":\"/amtech/linkeddata/types/composite/entity/HelloWorld\",
 +
        \"newvalue\":\"heyWithError\",\"guesttenants\":[],
 +
        \"oldvalue\":\"hey\",\"crudoperation\":\"PUT\",
 +
        \"producer\":\"helloWorld\",\"detectiontime\":\"2016-04-22T18:33:11.481Z\",
 +
        \"@id\":\"/amtech/things/observations/helloWorld5226521372857087\",
 +
        \"occurrencetime\":\"2016-04-22T18:33:10.948Z\",\"_user\":\"m2mcreator@amtech.mx\"}",
 
         "_name": "idbf740e7d83064ba492c9ca33d20617a0",
 
         "_name": "idbf740e7d83064ba492c9ca33d20617a0",
 
         "resourcetype": "/amtech/linkeddata/types/composite/observation/observationresourcecrud",
 
         "resourcetype": "/amtech/linkeddata/types/composite/observation/observationresourcecrud",
Line 18: Line 27:
 
         "@id": "/amtech/things/observations/6de7bf42-2ea6-4140-a8f4-a427bc119701",
 
         "@id": "/amtech/things/observations/6de7bf42-2ea6-4140-a8f4-a427bc119701",
 
         "success": false,
 
         "success": false,
         "messagedetail": "Error registering topic '/amtech/things/eventsources/ ': Resource /amtech/things/eventsources/  is not valid for its type definition. Property @idcannot contain blank spaces. ",
+
         "messagedetail":  
 +
        "Error registering topic '/amtech/things/eventsources/ ': Resource /amtech/things/eventsources/  is not valid for its type definition. Property @idcannot contain blank spaces. ",
 
         "_user": "m2mcreator@amtech.mx"
 
         "_user": "m2mcreator@amtech.mx"
 
     }
 
     }

Revision as of 14:37, 22 April 2016

When an observation type instance is posted to the endpoint /amtech/things/events:

  • the observation gets validated versus the semantic of the '@type'
  • #{placeholders} get enriched
  • location and proximity enrichment happens

If an error occurs an observation type observationoutputmsg get send to the sensor network topic

    {
       "topic": "/sensor_network/observation_errors/observationresourcecrud",
       "_tenant": "m2mcreator",
       "@type": "/amtech/linkeddata/types/composite/observation/observationoutputmsg",
       "resource": "{\"topic\":\" /helloWorld/asynch\",\"_tenant\":\"m2mcreator\",
       \"targetthings\":\"[]\",
       \"@type\":\"/amtech/linkeddata/types/composite/observation/observationresourcecrud\",
       \"propId\":\"hwgreetingLabel\",\"resourceuri\":\"/amtech/things/entities/HelloWorld/helloWorld\",
       \"resourcetype\":\"/amtech/linkeddata/types/composite/entity/HelloWorld\",
       \"newvalue\":\"heyWithError\",\"guesttenants\":[],
       \"oldvalue\":\"hey\",\"crudoperation\":\"PUT\",
       \"producer\":\"helloWorld\",\"detectiontime\":\"2016-04-22T18:33:11.481Z\",
       \"@id\":\"/amtech/things/observations/helloWorld5226521372857087\",
       \"occurrencetime\":\"2016-04-22T18:33:10.948Z\",\"_user\":\"m2mcreator@amtech.mx\"}",
       "_name": "idbf740e7d83064ba492c9ca33d20617a0",
       "resourcetype": "/amtech/linkeddata/types/composite/observation/observationresourcecrud",
       "message": "Failed registering topic for observation",
       "guesttenants": [],
       "producer": "enrichment-topology",
       "detectiontime": "Fri Apr 22 18:33:11 UTC 2016",
       "@id": "/amtech/things/observations/6de7bf42-2ea6-4140-a8f4-a427bc119701",
       "success": false,
       "messagedetail": 
       "Error registering topic '/amtech/things/eventsources/ ': Resource /amtech/things/eventsources/  is not valid for its type definition. Property @idcannot contain blank spaces. ",
       "_user": "m2mcreator@amtech.mx"
   }