Lyzer Hub Get Key -
GET /api/v1/metrics HTTP/1.1 Host: your-lyzer-hub.example.com Authorization: Bearer lyz_a1b2c3d4e5f6g7h8i9j0
def get_key(self): if time.time() >= self.expires_at - 60: # refresh 1 min early resp = requests.post(self.auth_url, json= "username": self.creds[0], "password": self.creds[1] ) data = resp.json() self.current_key = data["key"] self.expires_at = time.time() + data["expires_in_seconds"] return self.current_key Once obtained, include the key in every API call: Lyzer Hub Get Key
import time import requests class LyzerHubKeyManager: def (self, auth_url, username, password): self.auth_url = auth_url self.creds = (username, password) self.current_key = None self.expires_at = 0 GET /api/v1/metrics HTTP/1
Replace your-lyzer-hub with the actual hostname. Use HTTPS always. Method 2: Using Python SDK (hypothetical lyzer-hub-client) If Lyzer Hub provides an SDK: To revoke a key (e
The returned key will only work for that tenant’s data. To revoke a key (e.g., after a team member leaves):
A: Conceptually yes, but specific implementations may differ. Check your hub’s documentation.
Example auto-refresh pattern in Python: