-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.py
26 lines (21 loc) · 856 Bytes
/
client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import json
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "http://localhost:8000"
)
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.DefaultApi(api_client)
try:
# Root
api_response = api_instance.root_get()
print("The response of DefaultApi->root_get:\n")
pprint(api_response.model_dump_json(exclude_defaults=True))
except ApiException as e:
print("Exception when calling DefaultApi->root_get: %s\n" % e)