Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This short tutorial shows how to retrieve data from the staging service with python and requests.

For IDL you can take a similar route by adapting these instructions to Access to REST-Services in IDL.

Routes

First of all you should decide which route to use. Take a look at the swagger UI (http://localhost:8005/ui/ or http://cluster-r730-1:8005/ui/).

 

Image Added

 

For this tutorial we will use the route to retrieve all available SWPC events.

  • /swpc_event/list

Implementation

Retrieve

Use Python package requests.

For retrieving all SWPC events which are stored within the database we can use a GET request with the address given below.

Code Block
languagepy
# retrieving data
print('downloading all data...')
# swpc_events = requests.get("http://localhost:8005/swpc_event/list").json()
swpc_events = requests.get("http://cluster-r730-1:8005/swpc_event/list").json()

print(swpc_events)

Source Code

Here you can download the full python source code.

staging_request_ingest.py