talkomatic.py
0.1.2
An easy-to-use Python versatile wrapper for the Talkomatic Bot interface ensuring best practices for making bots, and handling the REST API.
Loading...
Searching...
No Matches
server_health.py
Go to the documentation of this file.
1
"""
2
server_health.py
3
4
This example shows how to check the server health using the
5
Talkomatic REST API.
6
"""
7
8
from
talkomatic.api.v1
import
ServerHealth
# we import the ServerHealth class from the Talkomatic API module
9
10
from
datetime
import
datetime
# we import the datetime module to format the uptime
11
12
13
health = ServerHealth.get()
# we get the server health using the get method
14
15
print(f
"Server status: {health.status}"
)
# we print the server status
16
if
health.status:
17
uptime = datetime.fromtimestamp(health.uptime).strftime(
"%H:%M:%S"
)
# we format the uptime
18
print(f
"Server uptime: {uptime}"
)
# we print the server uptime
19
print(f
"Server version: {health.server_version}"
)
# we print the server version
talkomatic.api.v1
Definition
__init__.py:1
examples
api
server_health.py
Generated by
1.13.2