Try to search your question here, if you can't find : Ask Any Question Now ?

Accessing Orion CB with python script

HomeCategory: stackoverflowAccessing Orion CB with python script
craig asked 2 weeks ago

Would like to access orion data using a python script (not using curlor Postman). 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)?

1 Answers
Best Answer
Amit answered 2 weeks ago
Your Answer

6 + 15 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com