ubdcc_shared_modules package¶
Submodules¶
ubdcc_shared_modules.App module¶
- class ubdcc_shared_modules.App.App(app_name=None, cwd=None, mgmt_port=None, logger=None, service=None, service_call=None, stop_call=None)[source]¶
Bases:
object
ubdcc_shared_modules.Database module¶
- class ubdcc_shared_modules.Database.Database(app=None)[source]¶
Bases:
object- add_credentials(account_group: str = None, api_key: str = None, api_secret: str = None) → str[source]¶
Store a Binance API key pair for the given account group. Returns the generated credential id (UUID). Raises ValueError on invalid parameters or unknown account_group.
- add_depthcache(exchange: str = None, market: str = None, desired_quantity: int = None, update_interval: int = None, refresh_interval: int = None) → bool[source]¶
- add_depthcache_distribution(exchange: str = None, market: str = None, pod_uid: str = None, scheduled_start_time: float = None) → bool[source]¶
- add_pod(name: str = None, uid: str = None, node: str = None, role: str = None, ip: str = None, api_port_rest: int = None, status: str = None, ubldc_version: str = None, version: str = None) → bool[source]¶
- assign_credentials(uid: str = None, account_group: str = None) → dict | None[source]¶
Assign (or return already-assigned) credential to a DCN uid. Load-balanced: picks credential with fewest ASSIGNED_DCNS. Returns full credential dict (incl. secret) or None if no keys available.
- delete_credentials(credential_id: str = None) → bool[source]¶
Remove a stored credential. Returns True on success, False when the id was not found.
- delete_depthcache_distribution(exchange: str = None, market: str = None, pod_uid: str = None) → bool[source]¶
- get_credentials(credential_id: str = None) → dict | None[source]¶
Return the full credential record (incl. secret) for the given id, or None if not found. Internal use only — do not leak through public endpoints.
- get_credentials_list(reveal_secrets: bool = False) → list[source]¶
Return list of credentials. With reveal_secrets=False (default) api_key/api_secret are masked for public consumption.
- release_credentials(uid: str = None) → bool[source]¶
Remove uid from ASSIGNED_DCNS of all credentials (called when DCN pod disappears).
- update_depthcache(desired_quantity: int = None, exchange: str = None, refresh_interval: int = None, market: str = None, update_interval: int = None) → bool[source]¶
ubdcc_shared_modules.RestEndpointsBase module¶
- class ubdcc_shared_modules.RestEndpointsBase.RestEndpointsBase(app=None)[source]¶
Bases:
object- static create_debug_response(process_start_time: float = None, url: str = None, post_body: dict = None, used_pods: list = None) → dict[source]¶
- get_error_response(event: str = None, error_id: str = None, message: str = None, params: dict = None, process_start_time: float = None, url: str = None, post_body: dict = None, used_pods: list = None)[source]¶
ubdcc_shared_modules.RestServer module¶
- class ubdcc_shared_modules.RestServer.RestServer(app=None, endpoints=None, port=None)[source]¶
Bases:
Thread- run() → None[source]¶
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

