Details
-
Type:
Monitor
-
Status: Closed
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Enabler:Orion
Description
Created question in FIWARE Q/A platform on 13-03-2019 at 13:03
Please, ANSWER this question AT https://stackoverflow.com/questions/55142367/accessing-orion-cb-with-python-script
Question:
Accessing Orion CB with python script
Description:
Would like to access orion data using a python script (not using curlor Postmann. Below show the python script in my orion.pyscript:
import json
import requests
orion_endpoint="some-endpoint"
url_query=("orion_url" % (orion_endpoint))
body_dict = {
'entities': [
],
}
r_headers =
{'Content-Type': 'application/json'}#print(data["coordinates"][0][0])
r = requests.post(
url=url_query,
data=json.dumps(body_dict),
headers=r_headers
)
print(r.content)
Running this script dumps the entity information to the console. How do I use the script to subscribe for notification so I get notified (not just dumping context)?
Activity
Field | Original Value | New Value |
---|---|---|
Component/s | FIWARE-TECH-HELP [ 10278 ] |
Assignee | Jose Manuel Cantera [ jmcantera ] |
HD-Enabler | Orion [ 10875 ] | |
Description |
Created question in FIWARE Q/A platform on 13-03-2019 at 13:03 {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/55142367/accessing-orion-cb-with-python-script +Question:+ Accessing Orion CB with python script +Description:+ Would like to access orion data using a python script (not using curlor Postmann. Below show the python script in my orion.pyscript: import json import requests orion_endpoint="some-endpoint" url_query=("orion_url" % (orion_endpoint)) body_dict = { 'entities': [ { 'type': 'AirQualityObserved', 'idPattern': '.*', } ], } r_headers = {'Content-Type': 'application/json'} #print(data["coordinates"][0][0]) r = requests.post( url=url_query, data=json.dumps(body_dict), headers=r_headers ) print(r.content) Running this script dumps the entity information to the console. How do I use the script to subscribe for notification so I get notified (not just dumping context)? |
Created question in FIWARE Q/A platform on 13-03-2019 at 13:03
{color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/55142367/accessing-orion-cb-with-python-script +Question:+ Accessing Orion CB with python script +Description:+ Would like to access orion data using a python script (not using curlor Postmann. Below show the python script in my orion.pyscript: import json import requests orion_endpoint="some-endpoint" url_query=("orion_url" % (orion_endpoint)) body_dict = { 'entities': [ { 'type': 'AirQualityObserved', 'idPattern': '.*', } ], } r_headers = {'Content-Type': 'application/json'} #print(data["coordinates"][0][0]) r = requests.post( url=url_query, data=json.dumps(body_dict), headers=r_headers ) print(r.content) Running this script dumps the entity information to the console. How do I use the script to subscribe for notification so I get notified (not just dumping context)? |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Answered [ 10104 ] |
Resolution | Done [ 10000 ] | |
Status | Answered [ 10104 ] | Closed [ 6 ] |
Fix Version/s | 2021 [ 12600 ] |