We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Deployment-Team/unimus-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
unimus_client.cpython-311.pyc•102 kB
�
;�Th�n � �| � d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
mZmZm
Z
mZmZ ddlZ ddlmZ ddlmZ dZn# e$ r dZdZdZY nw xY w ej e� � Zdefd �Zddefd�Z G d
� de� � Z G d� de� � Z G d� de� � Z! G d� de� � Z" G d� d� � Z#dS )z�
Unimus Client Library
This module provides a REST API client for Unimus network configuration management system.
Based on Unimus API v.2 documentation.
� N)�Any�Dict�List�Optional�Union)�TTLCache)�CacheTF�returnc � � t |� � � � � }| j ||d�} t j |dt
�� � }nK# t t f$ r7}t � d|� d�� � t |� � }Y d}~nd}~ww xY wt j |� d� � � � �
� � S )a
Generate a unique cache key for a function call.
Args:
func: The function being called
*args: Positional arguments (excluding 'self')
**kwargs: Keyword arguments
Returns:
MD5 hash string representing the unique cache key
)�func�args�kwargsT)� sort_keys�defaultz$Failed to serialize cache key data: z, using string representationN�utf-8)�sorted�items�__name__�json�dumps�str� TypeError�
ValueError�logger�warning�hashlib�md5�encode� hexdigest)r r
r �
kwargs_sorted�call_representation�serialized_call�es �9/Users/elvis/Developer/github/unimus-mcp/unimus_client.py�generate_cache_keyr% "