[ https://jira.fiware.org/browse/HELP-13081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=98168#comment-98168 ] Fernando Lopez edited comment on HELP-13081 at 11/12/18 9:35 AM: ----------------------------------------------------------------- Comment by juliozinga at gmail.com : Hi, I don't understand exactely your question, but i suposed you need to use the keyValue mode ?options=keyValues In this example ( https://github.com/Fiware/dataModels/blob/master/Device/Device/doc/spec.md) Examples: url: host:port/v2/entities?options=keyValues Example in python( adapted from http://telefonicaid.github.io/fiware-orion/api/v2/stable/cookbook/): from urllib2 import Request, urlopenvalues = """ { "id": "device-9845A", "type": "Device", "category": ["sensor"], "controlledProperty": ["fillingLevel","temperature"], "controlledAsset": ["wastecontainer-Osuna-100"], "ipAddress": "192.14.56.78", "mcc": "214", "mnc": "07", "batteryLevel": 0.75, "serialNumber": "9845A", "refDeviceModel": "myDevice-wastecontainer-sensor-345", "value": "l=0.22;t=21.2", "deviceState": "ok", "dateFirstUsed": "2014-09-11T11:00:00Z", "owner": ["http://person.org/leon"] }"""headers = { 'Content-Type': 'application/json'}request = Request(' http://fiware-ngsi2.apiblueprint.org/v2/entities?options=keyValues ', data=values, headers=headers)response_body = urlopen(request).read()print response_body was (Author: fw.external.urser): Comment by juliozinga at gmail.com : Hi Simon Caban, I don't understand exactely your question, but i suposed you need to use the keyValue mode ?options=keyValues In this example ( https://github.com/Fiware/dataModels/blob/master/Device/Device/doc/spec.md) Examples: url: host:port/v2/entities?options=keyValues Example in python( adapted from http://telefonicaid.github.io/fiware-orion/api/v2/stable/cookbook/): from urllib2 import Request, urlopenvalues = """ { "id": "device-9845A", "type": "Device", "category": ["sensor"], "controlledProperty": ["fillingLevel","temperature"], "controlledAsset": ["wastecontainer-Osuna-100"], "ipAddress": "192.14.56.78", "mcc": "214", "mnc": "07", "batteryLevel": 0.75, "serialNumber": "9845A", "refDeviceModel": "myDevice-wastecontainer-sensor-345", "value": "l=0.22;t=21.2", "deviceState": "ok", "dateFirstUsed": "2014-09-11T11:00:00Z", "owner": ["http://person.org/leon"] }"""headers = { 'Content-Type': 'application/json'}request = Request(' http://fiware-ngsi2.apiblueprint.org/v2/entities?options=keyValues ', data=values, headers=headers)response_body = urlopen(request).read()print response_body > FIWARE.Request.Tech.References to data models. > ---------------------------------------------- > > Key: HELP-13081 > URL: https://jira.fiware.org/browse/HELP-13081 > Project: Help-Desk > Issue Type: extRequest > Components: FIWARE-TECH-HELP > Reporter: FW External User > Assignee: Jose Manuel Cantera > > SC sent a message using the contact form at > https://catalogue.fiware.org/. > Hello, > I'm preparing laboratory script for presenting features of of OCB, however > there is a misconception on how OCB references to Data Models defined by > FIWARE. I'm aware of parameter 'type', which is supplied along with new > entity. The problem is with OCB. How does it difference between data models? > I can add variables from other data model into other which don't match. I > can't find the controller for it and if there is no any that's really shame. > That way model can be mistaken and the example is not really educational. It > could be useful if after defining a model for entity, OCB could interact > somehow with user and check, or debug what it receives. That way it would be > more professional I guess and fore sure more safe to use. If OCB doen't have > that feature there is a possibility for further development from our side, > however it won't happen in the forthcoming year or so, because there is no a > student for taking care of it yet as a part of thesis. -- This message was sent by Atlassian JIRA (v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy