Page tree

Versions Compared

Key

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

...

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

Routes

First of all we have to know which routes you should decide which route to use. For this, it is recommended to take Take a look at the swagger ui UI (http://localhost:8005/ui/ or http://cluster-r730-1:8005/ui/).

 

 

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

  • /swpc_event/list

Requests

The route in question is a GET route which requires them to be called with a GET request. To create simple get requests we recommend the python package requests.

A GET request needs only a single parameter: The address which is given by the route.

Code Block
languagepy
r = requests.get("http://httpbin.org/get")

Implementation

Retrieve

Implementation

Retrieve

Use Python package requests.

For retrieving all SWPC events which are stored within the database we can use now 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.

...