[Backlogmanager] [FIWARE-JIRA] (HELP-15567) [fiware-stackoverflow] Accessing Orion CB with python script

Fernando Lopez (JIRA) jira-help-desk at jira.fiware.org
Thu Mar 14 08:42:00 CET 2019


     [ https://jira.fiware.org/browse/HELP-15567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Lopez updated HELP-15567:
----------------------------------
    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)?


  was:

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)?


     HD-Enabler: Orion

> [fiware-stackoverflow] Accessing Orion CB with python script
> ------------------------------------------------------------
>
>                 Key: HELP-15567
>                 URL: https://jira.fiware.org/browse/HELP-15567
>             Project: Help-Desk
>          Issue Type: Monitor
>          Components: FIWARE-TECH-HELP
>            Reporter: Backlog Manager
>            Assignee: Jose Manuel Cantera
>              Labels: fiware, fiware-orion, python
>
> 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)?



--
This message was sent by Atlassian JIRA
(v6.4.1#64016)


More information about the Backlogmanager mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy