Commit f62bcc6c authored by Adrian Pino's avatar Adrian Pino
Browse files

Adds get_deployed_app placeholder method to aerOS & Kubernetes adapters

Adds a placeholder implementation for the `get_deployed_app` method in both the AEROS and Kubernetes adapters.

This method is intended to retrieve information about a specific deployed application instance, supporting CAMARA compliance.  The current implementation raises a `NotImplementedError` as the actual logic is adapter-specific and requires further development.
parent f90e0260
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ import uuid
from typing import Any, Dict, List, Optional

import yaml
from requests import Response

from sunrise6g_opensdk.edgecloud.adapters.aeros import config
from sunrise6g_opensdk.edgecloud.adapters.aeros.continuum_client import ContinuumClient
@@ -223,6 +224,21 @@ class EdgeApplicationManager(EdgeCloudManagementInterface):
                deployed.append({"appId": stored_app_id, "appInstanceId": instance_id})
        return deployed

    def get_deployed_app(
        self, app_instance_id: str, app_id: Optional[str] = None, region: Optional[str] = None
    ) -> Response:
        """
        Placeholder implementation for CAMARA compliance.
        Retrieves information of a specific application instance.

        :param app_instance_id: Unique identifier of the application instance
        :param app_id: Optional filter by application ID
        :param region: Optional filter by Edge Cloud region
        :return: Response with application instance details
        """
        # TODO: Implement actual aeros-specific logic for retrieving a specific deployed app
        raise NotImplementedError("get_deployed_app is not yet implemented for aeros adapter")

    def _purge_deployed_app_from_continuum(self, app_id: str) -> None:
        aeros_client = ContinuumClient(self.base_url)
        response = aeros_client.purge_service(app_id)
+16 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ import logging
from typing import Dict, List, Optional

from kubernetes.client import V1Deployment
from requests import Response

from sunrise6g_opensdk.edgecloud.adapters.kubernetes.lib.core.piedge_encoder import (
    deploy_service_function,
@@ -162,6 +163,21 @@ class EdgeApplicationManager(EdgeCloudManagementInterface):
        return response
        # return [{"appInstanceId": "abcd-efgh", "status": "ready"}]

    def get_deployed_app(
        self, app_instance_id: str, app_id: Optional[str] = None, region: Optional[str] = None
    ) -> Response:
        """
        Placeholder implementation for CAMARA compliance.
        Retrieves information of a specific application instance.

        :param app_instance_id: Unique identifier of the application instance
        :param app_id: Optional filter by application ID
        :param region: Optional filter by Edge Cloud region
        :return: Response with application instance details
        """
        # TODO: Implement actual kubernetes-specific logic for retrieving a specific deployed app
        raise NotImplementedError("get_deployed_app is not yet implemented for kubernetes adapter")

    def undeploy_app(self, app_instance_id: str) -> None:
        logging.info("Searching for deployed app with ID: " + app_instance_id + " in database...")
        print(f"Deleting app instance: {app_instance_id}")