Вывод информации о состояниях сервера с идентификатором 1:
import pyone
auth_url = "http://127.0.0.1:2633/RPC2"
auth_user = "brestmaster1"
auth_token = "7e111fb1738e24285b31aed3d5ad039958b84254a07d6d855b2e027ac53f6a8b"
client = pyone.OneServer(auth_url, session=auth_user + ':' + auth_token)
brest_host = client.host.info(1)
HOST_STATES = ['INIT', 'MONITORING_MONITORED', 'ENABLED', 'ERROR','DISABLED',
'MONITORING_ERROR', 'MONITORING_INIT', 'MONITORING_DISABLED', 'OFFLINE']
print(HOST_STATES[brest_host.get_STATE()])
CODE
Вывод информации о всех серверах:
import pyone
auth_url = "http://127.0.0.1:2633/RPC2"
auth_user = "brestmaster1"
auth_token="7e111fb1738e24285b31aed3d5ad039958b84254a07d6d855b2e027ac53f6a8b"
client = pyone.OneServer(auth_url, session=auth_user + ':' + auth_token)
hostpool = client.hostpool.info()
host = hostpool.HOST[0]
id = host.NAME
print(id)
CODE