Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-15567

[fiware-stackoverflow] Accessing Orion CB with python script

    Details

      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': [

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

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2019-03-13 15:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-03-13 15:05|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-03-14 09:06|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-03-14 09:06|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-03-14 18:06|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-03-14 18:06|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-03-14 21:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2019-03-14 21:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            jmcantera Jose Manuel Cantera
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: