diff --git a/edge_cloud_management_api/configs/env_config.py b/edge_cloud_management_api/configs/env_config.py index 1be9acadb197eab96e9f28088eef04700e9e4210..87c5878db2f60446a3c50d87f0dfc79de6a6e4be 100644 --- a/edge_cloud_management_api/configs/env_config.py +++ b/edge_cloud_management_api/configs/env_config.py @@ -11,6 +11,7 @@ class Configuration(BaseSettings): PI_EDGE_USERNAME: str = os.getenv("PI_EDGE_USERNAME") PI_EDGE_PASSWORD: str = os.getenv("PI_EDGE_PASSWORD") HTTP_PROXY: str = os.getenv("HTTP_PROXY") + FEDERATION_MANAGER_HOST=os.getenv("FEDERATION_MANAGER_HOST") config = Configuration() diff --git a/edge_cloud_management_api/controllers/app_controllers.py b/edge_cloud_management_api/controllers/app_controllers.py index de06d7db698a16dc5f8f896bc71da2ace65416c7..c31b4a3a0652dca8e3ddbe37c9702cfbd3a504e2 100644 --- a/edge_cloud_management_api/controllers/app_controllers.py +++ b/edge_cloud_management_api/controllers/app_controllers.py @@ -101,7 +101,7 @@ def delete_app(appId, x_correlator=None): # noqa: E501 pi_edge_factory = PiEdgeAPIClientFactory() api_client = pi_edge_factory.create_pi_edge_api_client() response = api_client.delete_app(appId=appId) - return response.json() + return response # with MongoManager() as db: # number_of_deleted_documents = db.delete_document("apps", {"_id": appId}) # if number_of_deleted_documents == 0: @@ -124,6 +124,80 @@ def delete_app(appId, x_correlator=None): # noqa: E501 ) +#def create_app_instance(): + # logger.info("Received request to create app instance") + + # try: + # Step 1: Get request body + # body = request.get_json() + # logger.debug(f"Request body: {body}") + + # Step 2: Validate body format + # app_id = body.get('appId') + # app_zones = body.get('appZones') + + # if not app_id or not app_zones: + # return jsonify({"error": "Missing required fields: appId or appZones"}), 400 + + # Step 3: Connect to Mongo and check if app exists + # with MongoManager() as mongo_manager: + # app_data = mongo_manager.find_document("apps", {"_id": app_id}) + # pi_edge_client_factory = PiEdgeAPIClientFactory() + # pi_edge_client = pi_edge_client_factory.create_pi_edge_api_client() + # app_data = pi_edge_client.get_app(app_id) + + # if len(app_data)<1: + # logger.warning(f"No application found with ID {app_id}") + # return jsonify({"error": "App not found", "details": f"No application found with ID {app_id}"}), 404 + + # logger.info(f"Application {app_id} found in database") + + # Step 4: Deploy app instance using Pi-Edge client + + + #logger.info(f"Preparing to send deployment request to SRM for appId={app_id}") + + # deployment_payload = { + # "appId": app_id, + # "appZones": app_zones + #} + + #Print everything before sending + # print("\n=== Preparing Deployment Request ===") + # print(f"Endpoint: {pi_edge_client.base_url}/deployedServiceFunction") + # print(f"Headers: {pi_edge_client._get_headers()}") + # print(f"Payload: {deployment_payload}") + # print("=== End of Deployment Request ===\n") + + #Try sending to Pi-Edge, catch connection errors separately + # try: + # response = pi_edge_client.deploy_service_function(data=deployment_payload) + + # if isinstance(response, dict) and "error" in response: + # logger.warning(f"Failed to deploy service function: {response}") + # return jsonify({ + # "warning": "Deployment not completed (SRM service unreachable)", + # "details": response + # }), 202 # Still accept the request but warn + + # logger.info(f"Deployment response from SRM: {response}") + + # except Exception as inner_error: + # logger.error(f"Exception while trying to deploy to SRM: {inner_error}") + # return jsonify({ + # "warning": "SRM backend unavailable. Deployment request was built correctly.", + # "details": str(inner_error) + # }), 202 # Still accept it (because your backend worked) + + # return jsonify({"message": f"Application {app_id} instantiation accepted"}), 202 + + # except ValidationError as e: + # logger.error(f"Validation error: {str(e)}") + # return jsonify({"error": "Validation error", "details": str(e)}), 400 + #except Exception as e: + # logger.error(f"Unexpected error in create_app_instance: {str(e)}") + # return jsonify({"error": "An unexpected error occurred", "details": str(e)}), 500 + def create_app_instance(): logger.info("Received request to create app instance") @@ -136,12 +210,12 @@ def create_app_instance(): edge_zone_id = body.get("edgeCloudZoneId") k8s_ref = body.get("kubernetesClusterRef") - if not app_id or not edge_zone_id or not k8s_ref: - return jsonify({"error": "Missing required fields: appId, edgeCloudZoneId, or kubernetesCLusterRef"}), 400 + # if not app_id or not edge_zone_id: + # return jsonify({"error": "Missing required fields: appId or edgeCloudZoneId"}), 400 logger.info(f"Preparing to send deployment request to SRM for appId={app_id}") - pi_edge_client_factory = PiEdgeAPICLientFactory() + pi_edge_client_factory = PiEdgeAPIClientFactory() pi_edge_client = pi_edge_client_factory.create_pi_edge_api_client() print("\n === Preparing Deployment Request ===") @@ -151,7 +225,7 @@ def create_app_instance(): print("=== End of Deployment Request ===\n") try: - response = pi_edge_client_deploy_service_function(data=body) + response = pi_edge_client.deploy_service_function(data=body) if isinstance(response, dict) and "error" in response: logger.warning(f"Failed to deploy service function: {response}") @@ -169,7 +243,7 @@ def create_app_instance(): "details": str(inner_error) }),202 - return jsonify({"message": f"Application {app_id} instantiation accepted"}), 202 + return response except ValidationError as e: logger.error(f"Validation error: {str(e)}") return jsonify({"error": "Validation error", "details": str(e)}), 400 @@ -219,7 +293,12 @@ def get_app_instance(app_id=None, x_correlator=None, app_instance_id=None, regio def delete_app_instance(appInstanceId: str, x_correlator=None): - + """ + Terminate an Application Instance + + - Removes a specific app instance from the database. + - Returns 204 if deleted, 404 if not found. + """ try: pi_edge_client_factory = PiEdgeAPIClientFactory() pi_edge_client = pi_edge_client_factory.create_pi_edge_api_client() diff --git a/edge_cloud_management_api/controllers/edge_cloud_controller.py b/edge_cloud_management_api/controllers/edge_cloud_controller.py index 7212296cefb095d7ed99dd7a9b9b38890a4ed47b..48b17a88248ba082753c938589f4d962d887bca7 100644 --- a/edge_cloud_management_api/controllers/edge_cloud_controller.py +++ b/edge_cloud_management_api/controllers/edge_cloud_controller.py @@ -119,3 +119,6 @@ def get_edge_cloud_zones(x_correlator: str | None = None, region=None, status=No "message": f"An error occurred: {str(e)}", } return jsonify(error_info), 500 + + def get_zone_details(zoneId:str): + pass diff --git a/edge_cloud_management_api/controllers/federation_manager_controller.py b/edge_cloud_management_api/controllers/federation_manager_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..0fffc41deba3fbce21fc80b9c6b89597bf9c92df --- /dev/null +++ b/edge_cloud_management_api/controllers/federation_manager_controller.py @@ -0,0 +1,53 @@ +from flask import request, jsonify +from edge_cloud_management_api.services.federation_services import FederationManagerClientFactory + +factory = FederationManagerClientFactory() +federation_client = factory.create_federation_client() + +def create_federation(): + """ + POST /partner + Forwards the federation creation request to Federation Manager. + """ + try: + body = request.get_json() + result = federation_client.post_partner(body) + return jsonify(result), 200 if "error" not in result else 502 + except Exception as e: + return jsonify({"error": str(e)}), 400 + + +def get_federation(federationContextId): + """ + GET /{federationContextId}/partner + Forwards the GET federation info request. + """ + try: + result = federation_client.get_partner(federationContextId) + return jsonify(result), 200 if "error" not in result else 502 + except Exception as e: + return jsonify({"error": str(e)}), 400 + + +def delete_federation(federationContextId): + """ + DELETE /{federationContextId}/partner + Forwards the DELETE federation request. + """ + try: + result = federation_client.delete_partner(federationContextId) + return jsonify(result), 200 if "error" not in result else 502 + except Exception as e: + return jsonify({"error": str(e)}), 400 + + +def get_federation_context_ids(): + """ + GET /fed-context-id + Forwards the request to fetch federation context IDs. + """ + try: + result = federation_client.get_federation_context_ids() + return jsonify(result), 200 if "error" not in result else 502 + except Exception as e: + return jsonify({"error": str(e)}), 500 diff --git a/edge_cloud_management_api/controllers/network_functions_controller.py b/edge_cloud_management_api/controllers/network_functions_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..2ee80c30134d33e3345ce64324250d36196f5e49 --- /dev/null +++ b/edge_cloud_management_api/controllers/network_functions_controller.py @@ -0,0 +1,155 @@ +from flask import jsonify +from pydantic import BaseModel, Field, ValidationError +from typing import List +from edge_cloud_management_api.managers.log_manager import logger +from edge_cloud_management_api.services.pi_edge_services import PiEdgeAPIClientFactory + +def create_qod_session(body: dict): + """ + Creates a new QoD session + """ + try: + # Validate the input data using Pydantic + # validated_data = AppManifest(**body) + # validated_data_dict = validated_data.model_dump(mode="json") + # validated_data_dict["_id"] = str(uuid.uuid4()) + pi_edge_factory = PiEdgeAPIClientFactory() + api_client = pi_edge_factory.create_pi_edge_api_client() + response = api_client.create_qod_session(body) + # Insert into MongoDB + # with MongoManager() as db: + # document_id = db.insert_document("apps", validated_data_dict) + # return ( + # jsonify({"appId": str(document_id)}), + # 201, + # ) + return response + + except ValidationError as e: + return jsonify({"error": "Invalid input", "details": e.errors()}), 400 + + except Exception as e: + return ( + jsonify({"error": "An unexpected error occurred", "details": str(e)}), + 500, + ) + +def delete_qod_session(sessionId: str): + """ + Creates a new QoD session + """ + try: + # Validate the input data using Pydantic + # validated_data = AppManifest(**body) + # validated_data_dict = validated_data.model_dump(mode="json") + # validated_data_dict["_id"] = str(uuid.uuid4()) + pi_edge_factory = PiEdgeAPIClientFactory() + api_client = pi_edge_factory.create_pi_edge_api_client() + response = api_client.delete_qod_session(sessionId=sessionId) + # Insert into MongoDB + # with MongoManager() as db: + # document_id = db.insert_document("apps", validated_data_dict) + # return ( + # jsonify({"appId": str(document_id)}), + # 201, + # ) + return response.json() + + except ValidationError as e: + return jsonify({"error": "Invalid input", "details": e.errors()}), 400 + + except Exception as e: + return ( + jsonify({"error": "An unexpected error occurred", "details": str(e)}), + 500, + ) +def get_qod_session(sessionId: str): + """ + Creates a new QoD session + """ + try: + # Validate the input data using Pydantic + # validated_data = AppManifest(**body) + # validated_data_dict = validated_data.model_dump(mode="json") + # validated_data_dict["_id"] = str(uuid.uuid4()) + pi_edge_factory = PiEdgeAPIClientFactory() + api_client = pi_edge_factory.create_pi_edge_api_client() + response = api_client.get_qod_session(sessionId=sessionId) + # Insert into MongoDB + # with MongoManager() as db: + # document_id = db.insert_document("apps", validated_data_dict) + # return ( + # jsonify({"appId": str(document_id)}), + # 201, + # ) + return response.json() + + except ValidationError as e: + return jsonify({"error": "Invalid input", "details": e.errors()}), 400 + + except Exception as e: + return ( + jsonify({"error": "An unexpected error occurred", "details": str(e)}), + 500, + ) + +def create_traffic_influence_resource(body: dict): + try: + pi_edge_factory = PiEdgeAPIClientFactory() + api_client = pi_edge_factory.create_pi_edge_api_client() + response = api_client.create_traffic_influence_resource(body) + return response + except ValidationError as e: + return jsonify({"error": "Invalid input", "details": e.errors()}), 400 + + except Exception as e: + return ( + jsonify({"error": "An unexpected error occurred", "details": str(e)}), + 500, + ) + +def get_traffic_influence_resource(id: str): + try: + pi_edge_factory = PiEdgeAPIClientFactory() + api_client = pi_edge_factory.create_pi_edge_api_client() + response = api_client.get_traffic_influence_resource(id) + return response + except ValidationError as e: + return jsonify({"error": "Invalid input", "details": e.errors()}), 400 + + except Exception as e: + return ( + jsonify({"error": "An unexpected error occurred", "details": str(e)}), + 500, + ) + + +def delete_traffic_influence_resource(id: str): + try: + pi_edge_factory = PiEdgeAPIClientFactory() + api_client = pi_edge_factory.create_pi_edge_api_client() + response = api_client.delete_traffic_influence_resource(id) + return response + except ValidationError as e: + return jsonify({"error": "Invalid input", "details": e.errors()}), 400 + + except Exception as e: + return ( + jsonify({"error": "An unexpected error occurred", "details": str(e)}), + 500, + ) + +def get_all_traffic_influence_resources(): + try: + pi_edge_factory = PiEdgeAPIClientFactory() + api_client = pi_edge_factory.create_pi_edge_api_client() + response = api_client.get_all_traffic_influence_resources() + return response + except ValidationError as e: + return jsonify({"error": "Invalid input", "details": e.errors()}), 400 + + except Exception as e: + return ( + jsonify({"error": "An unexpected error occurred", "details": str(e)}), + 500, + ) \ No newline at end of file diff --git a/edge_cloud_management_api/models/federation_manager_models.py b/edge_cloud_management_api/models/federation_manager_models.py new file mode 100644 index 0000000000000000000000000000000000000000..83815934fc2eccf2038a66d51931281db0825fe0 --- /dev/null +++ b/edge_cloud_management_api/models/federation_manager_models.py @@ -0,0 +1,52 @@ +from pydantic import BaseModel, Field +from typing import List, Optional + + +class MobileNetworkIds(BaseModel): + mncs: List[str] + mcc: str + + +class FixedNetworkIds(BaseModel): + __root__: List[str] + + +class CallbackCredentials(BaseModel): + tokenUrl: str + clientId: str + clientSecret: str + + +class ServiceEndpoint(BaseModel): + ipv4Addresses: Optional[List[str]] = None + ipv6Addresses: Optional[List[str]] = None + port: Optional[int] = None + fqdn: Optional[str] = None + + +class ZoneDetails(BaseModel): + geographyDetails: str + zoneId: str + geolocation: str + + +class FederationRequestData(BaseModel): + origOPFederationId: str + origOPCountryCode: Optional[str] + origOPMobileNetworkCodes: Optional[MobileNetworkIds] + origOPFixedNetworkCodes: Optional[List[str]] + initialDate: str + partnerStatusLink: str + partnerCallbackCredentials: Optional[CallbackCredentials] + + +class FederationResponseData(BaseModel): + federationContextId: str + partnerOPFederationId: str + partnerOPCountryCode: Optional[str] + partnerOPMobileNetworkCodes: Optional[MobileNetworkIds] + partnerOPFixedNetworkCodes: Optional[List[str]] + offeredAvailabilityZones: Optional[List[ZoneDetails]] + platformCaps: List[str] + edgeDiscoveryServiceEndPoint: Optional[ServiceEndpoint] + lcmServiceEndPoint: Optional[ServiceEndpoint] diff --git a/edge_cloud_management_api/services/federation_services.py b/edge_cloud_management_api/services/federation_services.py new file mode 100644 index 0000000000000000000000000000000000000000..a7ef7619e99084ff9a68d7eb225b1588a84e8047 --- /dev/null +++ b/edge_cloud_management_api/services/federation_services.py @@ -0,0 +1,108 @@ +import requests +from requests.exceptions import Timeout, ConnectionError +from edge_cloud_management_api.configs.env_config import config +from edge_cloud_management_api.managers.log_manager import logger + +class FederationManagerClient: + def __init__(self, base_url=None): + self.base_url = base_url or config.FEDERATION_MANAGER_HOST + + def _get_headers(self): + return { + "Content-Type": "application/json", + "Accept": "application/json" + } + + def post_partner(self, data: dict): + url = f"{self.base_url}/partner" + try: + response = requests.post(url, json=data, headers=self._get_headers(), timeout=10) + response.raise_for_status() + return response.json() + except Timeout: + logger.error("POST /partner timed out") + return {"error": "Request timed out"} + except ConnectionError: + logger.error("POST /partner connection error") + return {"error": "Connection error"} + except requests.exceptions.HTTPError as http_err: + logger.error(f"POST /partner HTTP error: {http_err}") + return {"error": str(http_err), "status_code": response.status_code} + except Exception as e: + logger.error(f"POST /partner unexpected error: {e}") + return {"error": str(e)} + + def get_partner(self, federation_context_id: str): + url = f"{self.base_url}/{federation_context_id}/partner" + try: + response = requests.get(url, headers=self._get_headers(), timeout=10) + response.raise_for_status() + return response.json() + except Timeout: + logger.error("GET /{id}/partner timed out") + return {"error": "Request timed out"} + except ConnectionError: + logger.error("GET /{id}/partner connection error") + return {"error": "Connection error"} + except requests.exceptions.HTTPError as http_err: + logger.error(f"GET /{id}/partner HTTP error: {http_err}") + return {"error": str(http_err), "status_code": response.status_code} + except Exception as e: + logger.error(f"GET /{id}/partner unexpected error: {e}") + return {"error": str(e)} + + def delete_partner(self, federation_context_id: str): + url = f"{self.base_url}/{federation_context_id}/partner" + try: + response = requests.delete(url, headers=self._get_headers(), timeout=10) + if response.content: + return response.json() + return {"status": response.status_code} + except Timeout: + logger.error("DELETE /{id}/partner timed out") + return {"error": "Request timed out"} + except ConnectionError: + logger.error("DELETE /{id}/partner connection error") + return {"error": "Connection error"} + except requests.exceptions.HTTPError as http_err: + logger.error(f"DELETE /{id}/partner HTTP error: {http_err}") + return {"error": str(http_err), "status_code": response.status_code} + except Exception as e: + logger.error(f"DELETE /{id}/partner unexpected error: {e}") + return {"error": str(e)} + + def get_federation_context_ids(self): + url = f"{self.base_url}/fed-context-id" + try: + response = requests.get(url, headers=self._get_headers(), timeout=10) + response.raise_for_status() + return response.json() + except Timeout: + logger.error("GET /fed-context-id timed out") + return {"error": "Request timed out"} + except ConnectionError: + logger.error("GET /fed-context-id connection error") + return {"error": "Connection error"} + except requests.exceptions.HTTPError as http_err: + logger.error(f"GET /fed-context-id HTTP error: {http_err}") + return {"error": str(http_err), "status_code": response.status_code} + except Exception as e: + logger.error(f"GET /fed-context-id unexpected error: {e}") + return {"error": str(e)} + + +class FederationManagerClientFactory: + def __init__(self): + self.default_base_url = config.FEDERATION_MANAGER_HOST + + def create_federation_client(self, base_url=None): + base_url = base_url or self.default_base_url + return FederationManagerClient(base_url=base_url) + + +if __name__ == "__main__": + factory = FederationManagerClientFactory() + client = factory.create_federation_client() + + result = client.get_federation_context_ids() + logger.info("Federation Context IDs: %s", result) diff --git a/edge_cloud_management_api/services/pi_edge_services.py b/edge_cloud_management_api/services/pi_edge_services.py index ea7d5a45e51e673adeb6d2b88f3c502a04ca1ad4..62f8fe4bf9056ae83bd83e3ce33a08bf941eb9a3 100644 --- a/edge_cloud_management_api/services/pi_edge_services.py +++ b/edge_cloud_management_api/services/pi_edge_services.py @@ -239,7 +239,7 @@ class PiEdgeAPIClient: url = f"{self.base_url}/node" #try: request_headers = self._get_headers() - response = requests.get(url, headers=request_headers,verify=False) + response = requests.get(url, headers=request_headers, verify=False) response.raise_for_status() nodes = response.json() if not nodes: @@ -264,6 +264,87 @@ class PiEdgeAPIClient: #except Exception as err: # return {"error": f"An unexpected error occurred: {err}"} + def create_qod_session(self, body:dict): + + url = f"{self.base_url}/sessions" + request_headers = self._get_headers() + try: + response = requests.post(url, json=body, headers=request_headers,verify=False) + response.raise_for_status() + return response.json() + except Exception as e: + logger.info(e.args) + return e.args + + def get_qod_session(self, sessionId: str): + + url = f"{self.base_url}/sessions/"+sessionId + request_headers = self._get_headers() + try: + response = requests.get(url, headers=request_headers,verify=False) + response.raise_for_status() + return response + except Exception as e: + logger.info(e.args) + return e.args + + def delete_qod_session(self, sessionId: str): + + url = f"{self.base_url}/sessions/"+sessionId + request_headers = self._get_headers() + try: + response = requests.delete(url, headers=request_headers,verify=False) + response.raise_for_status() + return response + except Exception as e: + logger.info(e.args) + return e.args + + def create_traffic_influence_resource(self, body_dict): + url = f"{self.base_url}/traffic-influences/" + request_headers = self._get_headers() + try: + response = requests.post(url, json=body_dict, headers=request_headers,verify=False) + response.raise_for_status() + return response.json() + except Exception as e: + logger.info(e.args) + return e.args + + def delete_traffic_influence_resource(self, id: str): + url = f"{self.base_url}/traffic-influences/"+id + request_headers = self._get_headers() + try: + response = requests.delete(url, headers=request_headers,verify=False) + response.raise_for_status() + return response + except Exception as e: + logger.info(e.args) + return e.args + + def get_traffic_influence_resource(self, id: str): + url = f"{self.base_url}/traffic-influences/"+id + request_headers = self._get_headers() + try: + response = requests.get(url, headers=request_headers,verify=False) + response.raise_for_status() + return response.json() + except Exception as e: + logger.info(e.args) + return e.args + + def get_all_traffic_influence_resources(self): + url = f"{self.base_url}/traffic-influences/" + request_headers = self._get_headers() + try: + response = requests.get(url, headers=request_headers,verify=False) + response.raise_for_status() + return response.json() + except Exception as e: + logger.info(e.args) + return e.args + + class PiEdgeAPIClientFactory: """ diff --git a/edge_cloud_management_api/specification/openapi.yaml b/edge_cloud_management_api/specification/openapi.yaml index 1f98123e7b4adf657cf1441c03cf9d1935a86768..598763ee09813efa18e6fe311b7f5fdd235ff79e 100644 --- a/edge_cloud_management_api/specification/openapi.yaml +++ b/edge_cloud_management_api/specification/openapi.yaml @@ -675,6 +675,130 @@ paths: $ref: "#/components/responses/500" "503": $ref: "#/components/responses/503" + /sessions: + post: + tags: + - Quality on Demand Functions + summary: Creates a new QoD Session + operationId: edge_cloud_management_api.controllers.network_functions_controller.create_qod_session + requestBody: + description: QoD Session body. + content: + application/json: + schema: + $ref: '#/components/schemas/' + responses: + "200": + description: Session created. + /sessions/{sessionId}: + get: + tags: + - Quality on Demand Functions + summary: Retrieve details of a QoD Session + operationId: edge_cloud_management_api.controllers.network_functions_controller.get_qod_session + parameters: + - name: sessionId + in: path + description: Represents a QoD Session. + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: QoD Session found + "405": + description: Method not allowed + "404": + description: Session not found + delete: + tags: + - Quality on Demand Functions + summary: Remove QoD Session + operationId: edge_cloud_management_api.controllers.network_functions_controller.delete_qod_session + parameters: + - name: sessionId + in: path + description: Represents a QoD Session. + required: true + style: simple + explode: false + schema: + type: string + responses: + "201": + description: QoD Session deleted + "405": + description: Method not allowed + "404": + description: Session not found + /traffic-influences: + post: + tags: + - Traffic Influence Functions + summary: Creates a new TrafficInfluence resource + operationId: edge_cloud_management_api.controllers.network_functions_controller.create_traffic_influence_resource + requestBody: + description: TrafficInfluence body. + content: + application/json: + schema: + $ref: '#/components/schemas/' + responses: + "200": + description: Resource created. + get: + tags: + - Traffic Influence Functions + summary: Retrieves all TrafficInfluence resources + operationId: edge_cloud_management_api.controllers.network_functions_controller.get_all_traffic_influence_resources + responses: + "200": + description: Resources retrieved. + /traffic-influences/{id}: + get: + tags: + - Traffic Influence Functions + summary: Retrieve details of a TrafficInfluence resource + operationId: edge_cloud_management_api.controllers.network_functions_controller.get_traffic_influence_resource + parameters: + - name: id + in: path + description: Represents a TrafficInfluence resource. + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: TrafficInfluence resource found + "405": + description: Method not allowed + "404": + description: Session not found + delete: + tags: + - Traffic Influence Functions + summary: Remove TrafficInfluence resource + operationId: edge_cloud_management_api.controllers.network_functions_controller.delete_traffic_influence_resource + parameters: + - name: id + in: path + description: Represents a TrafficInfluence resource + required: true + style: simple + explode: false + schema: + type: string + responses: + "201": + description: TrafficInfluence resource deleted + "405": + description: Method not allowed + "404": + description: Session not found /partner: post: @@ -1083,12 +1207,6 @@ paths: application/json: schema: $ref: '#/components/schemas/inline_response_200_2' - "400": - description: Bad request - content: - application:/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' "401": description: Unauthorized content: @@ -1101,38 +1219,6 @@ paths: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' - "409": - description: Conflict - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - "422": - description: Unprocessable Entity - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - "500": - description: Internal Server Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - "503": - description: Service Unavailable - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - "520": - description: Web Server Returned an Unknown Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - default: - description: Generic Error components: # securitySchemes: @@ -1210,7 +1296,7 @@ components: AppInstanceName: type: string - pattern: ^[A-Za-z][A-Za-z0-9_]{1,63}$ + #pattern: ^[A-Za-z][A-Za-z0-9_]{1,63}$ description: Name of the App instance, scoped to the AppProvider AppInstanceInfo: @@ -1244,7 +1330,7 @@ components: properties: interfaceId: type: string - pattern: ^[A-Za-z0-9][A-Za-z0-9_]{6,30}[A-Za-z0-9]$ + #pattern: ^[A-Za-z0-9][A-Za-z0-9_]{6,30}[A-Za-z0-9]$ description: | This is the interface Identifier that Application Provider defines when application is being submitted. diff --git a/pyproject.toml b/pyproject.toml index 7ea8824cd4e1d58719a915af1bbbe5caa777411e..be24467d285e6e1d0e138fa935e76f8463d0c57c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,10 +51,3 @@ skip-magic-trailing-comma = false line-ending = "auto" docstring-code-format = false docstring-code-line-length = "dynamic" - - -[tool.hatch.build.targets.wheel] -packages = ["edge_cloud_management_api"] - - -