#------------------------------------------------------------------ # Proxy Script Generated by Delphi Microservices Container 4.3.20 # Do not modify this code! # Generated at: 2025-04-26 18.03.45 #------------------------------------------------------------------ import requests import urllib3 urllib3.disable_warnings() class SupervisorServerRPCException(Exception): pass class SupervisorServerRPCProxy: def __init__(self, base_url): self.__id = 1 self.base_url = base_url self.headers = { "content-type": "application/json", "accept": "application/json" } def __get_next_id(self): self.__id += 1 return self.__id def __execute(self, req): isnotif = req.get("id") is None res = requests.post(self.base_url, json=req, headers=self.headers, verify=False) if res.status_code == 204: # no content if isnotif: return None else: raise SupervisorServerRPCException(0,"Protocol error for Notification") if res.headers["content-type"].lower().find("application/json") != 0: raise SupervisorServerRPCException("Invalid ContentType in response: " + res.headers["content-type"]) jres = res.json() if "error" in jres: raise SupervisorServerRPCException(jres.get("error").get("message")) if not "result" in jres: raise SupervisorServerRPCException(0,"Protocol error in JSON-RPC response - no result nor error node exists") return jres["result"] def __new_req(self, method, typ): req = dict(jsonrpc="2.0", method=method, params=[]) if typ == "request": req["id"] = self.__get_next_id() return req # end of library code # Following methods are automatically generated def keep_alive(self, customer, email, expiredate, licenselevel, licensehash, machinefingerprint, data): """ Invokes [function KeepAlive(const Customer: string; const Email: string; const ExpireDate: string; const LicenseLevel: string; const LicenseHash: string; const MachineFingerPrint: string; const Data: TJsonObject): TJsonObject] Makes DMSContainer shining """ req = self.__new_req("KeepAlive", "request") req["params"].append(customer) req["params"].append(email) req["params"].append(expiredate) req["params"].append(licenselevel) req["params"].append(licensehash) req["params"].append(machinefingerprint) req["params"].append(data) result = self.__execute(req) return result # end of generated proxy