From 41cfb42f265591d27d4bf2f377c0dc75bfa6f29d Mon Sep 17 00:00:00 2001 From: fragkosd Date: Tue, 24 Jun 2025 12:11:07 +0000 Subject: [PATCH 1/2] add supported features for Logging API --- .../api_invocation_logs/core/invocationlogs.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py index 1e8ddf4f..614181d9 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py @@ -12,6 +12,17 @@ from .redis_event import RedisEvent from .resources import Resource from .responses import internal_server_error, make_response, not_found_error, unauthorized_error +TOTAL_FEATURES = 1 +SUPPORTED_FEATURES_HEX = "0" + +def return_negotiated_supp_feat_dict(supp_feat): + + final_supp_feat = bin(int(supp_feat, 16) & int(SUPPORTED_FEATURES_HEX, 16))[2:].zfill(TOTAL_FEATURES)[::-1] + + return { + "SliceBasedAPIExposure": True if final_supp_feat[0] == "1" else False, + "Final": hex(int(final_supp_feat[::-1], 2))[2:] + } class LoggingInvocationOperations(Resource): @@ -78,6 +89,8 @@ class LoggingInvocationOperations(Resource): if result is not None: return result + invocationlog.supported_features = return_negotiated_supp_feat_dict(invocationlog.supported_features)["Final"] + current_app.logger.debug("Check service apis") event = None invocation_log_base = json.loads(json.dumps( -- GitLab From afd06a811be779a9585ed0b1df20537c76a67779 Mon Sep 17 00:00:00 2001 From: fragkosd Date: Tue, 24 Jun 2025 12:11:50 +0000 Subject: [PATCH 2/2] set supported_features equal to 0 for the Logging API test --- tests/libraries/api_logging_service/bodyRequests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/libraries/api_logging_service/bodyRequests.py b/tests/libraries/api_logging_service/bodyRequests.py index a4d2a187..0de84c28 100644 --- a/tests/libraries/api_logging_service/bodyRequests.py +++ b/tests/libraries/api_logging_service/bodyRequests.py @@ -3,7 +3,7 @@ def create_log_entry(aefId, apiInvokerId, apiId, apiName, results=['200','500'], "aefId": aefId, "apiInvokerId": apiInvokerId, "logs": [], - "supportedFeatures": "ffff" + "supportedFeatures": "0" } if len(results) > 0: count=0 @@ -52,7 +52,7 @@ def create_log_entry_bad_service(aefId, apiInvokerId, result='500'): "fwdInterface": "string" } ], - "supportedFeatures": "ffff" + "supportedFeatures": "0" } return data @@ -89,4 +89,4 @@ def create_log(apiId, apiName, result, api_version='v1'): ] } } - return log \ No newline at end of file + return log -- GitLab