Skip to content

Commit

Permalink
made print nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
XaverStiensmeier committed Aug 22, 2023
1 parent 667edcf commit 3fe12b9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sample_rest_using.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
Example for an application using the REST API
"""
import pprint

import requests


Expand All @@ -13,7 +15,7 @@ def validate(cluster_id=None, configuration="test.yml"):
params = {}
response = requests.post("http://localhost:8000/bibigrid/validate", files=files, params=params, timeout=20)
response_data = response.json()
print(response_data)
pprint.pprint(response_data)


def create(cluster_id, configuration="test.yml"):
Expand All @@ -22,7 +24,7 @@ def create(cluster_id, configuration="test.yml"):
params = {"cluster_id": cluster_id}
response = requests.post("http://localhost:8000/bibigrid/create", files=files, params=params, timeout=20)
response_data = response.json()
print(response_data)
pprint.pprint(response_data)


def terminate(cluster_id, configuration="test.yml"):
Expand All @@ -31,7 +33,7 @@ def terminate(cluster_id, configuration="test.yml"):
params = {"cluster_id": cluster_id}
response = requests.post("http://localhost:8000/bibigrid/terminate", params=params, files=files, timeout=20)
response_data = response.json()
print(response_data)
pprint.pprint(response_data)


def info(cluster_id, configuration="test.yml"):
Expand All @@ -40,7 +42,7 @@ def info(cluster_id, configuration="test.yml"):
params = {"cluster_id": cluster_id}
response = requests.get("http://localhost:8000/bibigrid/info", params=params, files=files, timeout=20)
response_data = response.json()
print(response_data)
pprint.pprint(response_data)


def get_log(cluster_id, configuration="test.yml", lines=5):
Expand All @@ -49,4 +51,4 @@ def get_log(cluster_id, configuration="test.yml", lines=5):
params = {"cluster_id": cluster_id, "lines": lines}
response = requests.get("http://localhost:8000/bibigrid/log", params=params, files=files, timeout=20)
response_data = response.json()
print(response_data)
pprint.pprint(response_data)

0 comments on commit 3fe12b9

Please sign in to comment.