Commit 41cfb42f authored by Dimitris Fragkos's avatar Dimitris Fragkos
Browse files

add supported features for Logging API

parent b773cdb8
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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(