[ https://jira.fiware.org/browse/HELP-13411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fernando Lopez deleted HELP-13411: ---------------------------------- > [fiware-stackoverflow] Create entity in a service using IDAS and ContextBroker > ------------------------------------------------------------------------------ > > Key: HELP-13411 > URL: https://jira.fiware.org/browse/HELP-13411 > Project: Help-Desk > Issue Type: Monitor > Reporter: Backlog Manager > Labels: fiware, fiware-orion > > Created question in FIWARE Q/A platform on 23-04-2015 at 18:04 > {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/29829266/create-entity-in-a-service-using-idas-and-contextbroker > +Question:+ > Create entity in a service using IDAS and ContextBroker > +Description:+ > So I'm having some problems connection virtual devices to the contextBroker and i thing it's because of the Fiware-Service. I don't want to use the OpenIoT (even though that didn't worked for me either). I didn't manage to find any documentation about service creation and maybe i'm creating it wrong. > I did Python CreateService bus_auto 4jggokgpepnvsb2uv4s40d59ovand i'm not sure it returns me 201. I updated the config.ini file to work on MY service but when i send the observations it doesn't change the value of the entity on the contextBroker > I'm now running it in > My config.ini file: > [user] > # Please, configure here your username at FIWARE Cloud and a valid Oauth2.0 TOKEN for your user (you can use get_token.py to obtain a valid TOKEN). > username= > token=NULL > [contextbroker] > host=127.0.0.1 > port=1026 > OAuth=no > # Here you need to specify the ContextBroker database you are querying. > # Leave it blank if you want the general database or the IDAS service if you are looking for IoT devices connected by you. > fiware_service=bus_auto > [idas] > host=130.206.80.40 > adminport=5371 > ul20port=5371 > OAuth=no > # Here you need to configure the IDAS service your devices will be sending data to. > # By default the OpenIoT service is provided. > fiware-service=bus_auto > fiware-service-path=/ > apikey=4jggokgpepnvsb2uv4s40d59ov > [local] > #Choose here your System type. Examples: RaspberryPI, MACOSX, Linux, ... > host_type=CentOS > # Here please add a unique identifier for you. Suggestion: the 3 lower hexa bytes of your Ethernet MAC. E.g. 79:ed:af > # Also you may use your e-mail address. > host_id=db:00:ff > I'm using the python script GetEntity.py: > python2.7 GetEntity.py bus_auto_2 > I also tried using a python script that i created: > import json > import urllib > import urllib2 > BASE_URL = 'http://127.0.0.1:1026' > QUERY_URL = BASE_URL+'/v1/queryContext' > HEADERS = { > 'Content-Type': 'application/json', > 'Accept': 'application/json' > } > QUERY_EXAMPLE = { > "entities": [ > { > "type": "bus_auto_2", > "isPattern": "false", > "id": "Room1" > } > ] > } > def post(url, data): > """""" > req = urllib2.Request(url, data, HEADERS) > f = urllib2.urlopen(req) > result = json.loads(f.read()) > f.close() > return result > if __name__ == "__main__": > print post(UPDATE_URL, json.dumps(UPDATE_EXAMPLE)) > print post(QUERY_URL, json.dumps(QUERY_EXAMPLE)) -- 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