Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Maxine Python Client

The Python SDK provides a small, dependency-free client for the current Maxine API.

Install locally

pip install maxine-client

Usage

from maxine_client import MaxineClient

client = MaxineClient("http://localhost:8080")
client.sign_in("admin", "admin")

registration = {
    "hostName": "127.0.0.1",
    "nodeName": "orders-node",
    "serviceName": "orders-service",
    "port": 8081,
    "ssl": False,
    "timeOut": 10,
    "weight": 1,
}

client.register(registration)
discovery = client.discover_location("orders-service", "/health")
print(discovery["location"])

Background heartbeats

heartbeat = client.start_heartbeat(registration, interval_seconds=5)

# Later, when shutting down:
heartbeat.stop()