Skip to content
Snippets Groups Projects
Verified Commit 2d28bf5e authored by !! Julian Keck (old Account; do not use) !!'s avatar !! Julian Keck (old Account; do not use) !! :ghost:
Browse files

ADD: raw_path to json-attachment

parent 07cc9c1a
No related branches found
No related tags found
No related merge requests found
Pipeline #401875 passed
......@@ -295,6 +295,47 @@ def validate_patch_request_actions(conn, user, actions: list[APIPatchRequestActi
r_name=inner_port['name'],
)
full_path_ta = [
{
"name": "nd.p_port.list",
"idx": "orig_start_port",
"old": {
"gpk": "8af344b1-5529-4ff3-a0e7-060b0343bb3f"
}
},
{
"name": "nd.p_port.list",
"idx": "inner_start_port",
"inner_join_ref": {
"orig_start_port": "api_fkey_nd_p_port_conn_int"
}
},
{
"name": "nd.p_port.list",
"idx": "start_ports",
"union_join_ref": {
"orig_start_port": "self",
"inner_start_port": "self"
}
},
{
"name": "nd.p_port.list",
"idx": "all_ports",
"inner_join_ref": {
"start_ports": "api_func_nd_p_port_is_contained_by_conn_id_gfk_list"
}
}
]
full_path_result = execute_wapi_function(conn, full_path_ta, superuser=True)
path_port_list = []
if len(full_path_result['all_ports']) > 0:
path_order = full_path_result['all_ports'][0]['connection_id_gfk_list']
all_ports = map_array_of_dicts(full_path_result['all_ports'], lambda p: p.get('gpk'))
for p_gpk in path_order:
path_port_list.append(all_ports.get(p_gpk, {'gpk': None}))
internal_action.raw_path = path_port_list
internal_action.p_port = Port(**r['port_list'][0])
internal_action.module = Module(**r['module_list'][0])
internal_action.room = Room(**r['room_list'][0])
......
......@@ -46,6 +46,7 @@ class PatchRequestAction(BaseModel):
new_insert_type: Optional[str] = Field(default=None)
new_insert_assignment: list[APIInsertBCDAssignment] = Field(default=[])
vlan_ids: list[str] = Field(default=[])
raw_path: Optional[list[dict]] = Field(default=None)
class PatchRequestFormRequest(BaseModel):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment