Loading mcp_module/tools/edge_application.py +8 −4 Original line number Diff line number Diff line Loading @@ -16,9 +16,13 @@ env_path = root_dir / ".env" # Load the .env file load_dotenv(dotenv_path=env_path) SESSION_SERVICE_URL = os.getenv("OEG_SERVICE_URL") if not SESSION_SERVICE_URL: def get_session_service_url() -> str: session_service_url = os.getenv("OEG_SERVICE_URL") if not session_service_url: raise EnvironmentError("OEG_SERVICE_URL environment variable is not set") return session_service_url async def get_app_definitions() -> dict: Loading @@ -26,7 +30,7 @@ async def get_app_definitions() -> dict: Get the list of all existing Application definitions from the Edge Cloud Provider that the user has permission to view. """ url = f"{SESSION_SERVICE_URL}/apps" url = f"{get_session_service_url()}/apps" headers = {"accept": "application/json"} logger.debug("Fetching edge application definitions from: %s", url) Loading mcp_module/tools/qod.py +9 −6 Original line number Diff line number Diff line Loading @@ -21,9 +21,12 @@ root_dir = Path(__file__).resolve().parent.parent env_path = root_dir / ".env" load_dotenv(dotenv_path=env_path) SESSION_SERVICE_URL = os.getenv("OEG_SERVICE_URL") if not SESSION_SERVICE_URL: def get_session_service_url() -> str: session_service_url = os.getenv("OEG_SERVICE_URL") if not session_service_url: raise EnvironmentError("OEG_SERVICE_URL environment variable is not set") return session_service_url async def create_qod_session_oai(inp: CreateQoDSessionOAIInput) -> dict: Loading @@ -50,7 +53,7 @@ async def create_qod_session_oai(inp: CreateQoDSessionOAIInput) -> dict: payload["qosProfile"] = inp.qosProfile payload["duration"] = inp.duration session_url = f"{SESSION_SERVICE_URL}/sessions" session_url = f"{get_session_service_url()}/sessions" logger.debug("Create QoD session payload: %s", json.dumps(payload, indent=2)) logger.debug("Calling endpoint: %s", session_url) Loading @@ -73,7 +76,7 @@ async def get_qod_session_oai(inp: GetQoDSessionInput) -> QoDSessionFullResponse Retrieves QoS session based on session id """ session_url = f"{SESSION_SERVICE_URL}/sessions/{inp.sessionId}" session_url = f"{get_session_service_url()}/sessions/{inp.sessionId}" logger.debug("Fetching session details from: %s", session_url) try: Loading Loading @@ -105,7 +108,7 @@ async def get_qod_session_oai(inp: GetQoDSessionInput) -> QoDSessionFullResponse async def delete_qod_session_oai(inp: GetQoDSessionInput) -> List[Any]: session_url = f"{SESSION_SERVICE_URL}/sessions/{inp.sessionId}" session_url = f"{get_session_service_url()}/sessions/{inp.sessionId}" logger.debug("Deleting session at: %s", session_url) async with httpx.AsyncClient(trust_env=True) as client: Loading Loading
mcp_module/tools/edge_application.py +8 −4 Original line number Diff line number Diff line Loading @@ -16,9 +16,13 @@ env_path = root_dir / ".env" # Load the .env file load_dotenv(dotenv_path=env_path) SESSION_SERVICE_URL = os.getenv("OEG_SERVICE_URL") if not SESSION_SERVICE_URL: def get_session_service_url() -> str: session_service_url = os.getenv("OEG_SERVICE_URL") if not session_service_url: raise EnvironmentError("OEG_SERVICE_URL environment variable is not set") return session_service_url async def get_app_definitions() -> dict: Loading @@ -26,7 +30,7 @@ async def get_app_definitions() -> dict: Get the list of all existing Application definitions from the Edge Cloud Provider that the user has permission to view. """ url = f"{SESSION_SERVICE_URL}/apps" url = f"{get_session_service_url()}/apps" headers = {"accept": "application/json"} logger.debug("Fetching edge application definitions from: %s", url) Loading
mcp_module/tools/qod.py +9 −6 Original line number Diff line number Diff line Loading @@ -21,9 +21,12 @@ root_dir = Path(__file__).resolve().parent.parent env_path = root_dir / ".env" load_dotenv(dotenv_path=env_path) SESSION_SERVICE_URL = os.getenv("OEG_SERVICE_URL") if not SESSION_SERVICE_URL: def get_session_service_url() -> str: session_service_url = os.getenv("OEG_SERVICE_URL") if not session_service_url: raise EnvironmentError("OEG_SERVICE_URL environment variable is not set") return session_service_url async def create_qod_session_oai(inp: CreateQoDSessionOAIInput) -> dict: Loading @@ -50,7 +53,7 @@ async def create_qod_session_oai(inp: CreateQoDSessionOAIInput) -> dict: payload["qosProfile"] = inp.qosProfile payload["duration"] = inp.duration session_url = f"{SESSION_SERVICE_URL}/sessions" session_url = f"{get_session_service_url()}/sessions" logger.debug("Create QoD session payload: %s", json.dumps(payload, indent=2)) logger.debug("Calling endpoint: %s", session_url) Loading @@ -73,7 +76,7 @@ async def get_qod_session_oai(inp: GetQoDSessionInput) -> QoDSessionFullResponse Retrieves QoS session based on session id """ session_url = f"{SESSION_SERVICE_URL}/sessions/{inp.sessionId}" session_url = f"{get_session_service_url()}/sessions/{inp.sessionId}" logger.debug("Fetching session details from: %s", session_url) try: Loading Loading @@ -105,7 +108,7 @@ async def get_qod_session_oai(inp: GetQoDSessionInput) -> QoDSessionFullResponse async def delete_qod_session_oai(inp: GetQoDSessionInput) -> List[Any]: session_url = f"{SESSION_SERVICE_URL}/sessions/{inp.sessionId}" session_url = f"{get_session_service_url()}/sessions/{inp.sessionId}" logger.debug("Deleting session at: %s", session_url) async with httpx.AsyncClient(trust_env=True) as client: Loading