From 40d8114ac8b293a72b2ba6e226d43b418c1a7304 Mon Sep 17 00:00:00 2001 From: "Josephine.Rutten" Date: Wed, 27 Nov 2024 14:41:24 +0100 Subject: [PATCH] add the patch position to the file --- src/cnaas_nms/api/interface.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cnaas_nms/api/interface.py b/src/cnaas_nms/api/interface.py index a57b6258..7a61c782 100644 --- a/src/cnaas_nms/api/interface.py +++ b/src/cnaas_nms/api/interface.py @@ -30,6 +30,10 @@ "redundant_link": fields.Boolean(required=False, example=True), "tags": fields.List(fields.String(), required=False, description="List of tags", example=["tag1", "tag2"]), "cli_append_str": fields.String(required=False), + "patch_position": fields.String( + required=False, + description="Patch Position", + ), }, ) @@ -270,6 +274,13 @@ def put(self, hostname): errors.append( "cli_append_str must be a string, got: {}".format(if_dict["data"]["cli_append_str"]) ) + if "patch_postion" in if_dict["data"]: + if isinstance(if_dict["data"]["patch_postion"], str): + intfdata["patch_postion"] = if_dict["data"]["patch_postion"] + else: + errors.append( + "patch_postion must be a string, got: {}".format(if_dict["data"]["patch_postion"]) + ) elif "data" in if_dict and not if_dict["data"]: intfdata: None = None # type: ignore [no-redef]