Skip to main content
Glama
connection.py1.28 kB
from typing import Dict, Optional import uuid from redfish_client.client import RedfishClient from redfish_client.config import setup_logging, load_endpoints setup_logging(console_level="INFO") load_endpoints() class ConnectionRegistry: def __init__(self) -> None: self._clients: Dict[str, RedfishClient] = {} def login( self, host: str, port: int = 443, username: str = "", password: str = "", verify_ssl: bool = False, timeout: int = 60, bmc_type: str = "default", ) -> str: client = RedfishClient( host=host, port=port, username=username, password=password, verify_ssl=verify_ssl, timeout=timeout, bmc_type=bmc_type, ) if not client.login(): return "" cid = str(uuid.uuid4()) self._clients[cid] = client return cid def get(self, connection_id: str) -> Optional[RedfishClient]: return self._clients.get(connection_id) def logout(self, connection_id: str) -> bool: client = self._clients.pop(connection_id, None) if not client: return False return client.logout() registry = ConnectionRegistry()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hankerbiao/redfish-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server