Commit d9c37264 authored by Paris Stentoumis's avatar Paris Stentoumis
Browse files

feat: srm support for Service Level dict creation

parent 7c9c1218
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -31,9 +31,14 @@ def create_intent(body):
    characteristic = body.get("characteristic")[0]
    if characteristic.get("name") == "appId":
        res = tf_sdk.onboard_intent(body)
    elif characteristic.get("name") == "service_level_group_id":
        service_level_group = characteristic.get("value")
        res = tf_sdk.save_service_level(body, service_level_group)
        if res == 3:
            res = tf_sdk.submit_combined_service_levels(service_level_group)
    else:
        logger.exception("appId is not present in characteristic")
        return {"error": "appId is not present in characteristic"}, 400
        logger.exception("appId or service_level_group_id are not present in characteristic")
        return {"error": "appId or service_level_group_id are not present in characteristic"}, 400
    # Adapter returned HTTP response
    try:
        if not res.content: