Skip to content
Snippets Groups Projects
Commit 5ae8521d authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge code cleanup

parent 7f3e4ea8
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!284Resolve: "(CNIT) Multi-Granular Optical Nodes and Optical Transpoders management"
{
"optical_links": [
{
"name": "R2-T2.1",
"optical_details": {
"src_port": "2",
"dst_port": "6",
"local_peer_port": "12",
"remote_peer_port": "6",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "5ba1d9b6-120a-5680-b745-2ea24aec1cc3"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "87d74166-65e3-595e-b643-122b4fd0303f"
}
},
"endpoint_uuid": {
"uuid": "61fd51ea-9896-5528-bcf3-3202a7668efb"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"
}
},
"endpoint_uuid": {
"uuid": "d1e7e6c7-f1d7-56f3-be32-8982a72966f6"
}
}
]
},
{
"name": "R2-T2.2",
"optical_details": {
"src_port": "3",
"dst_port": "6",
"local_peer_port": "13",
"remote_peer_port": "6",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "5f9f4309-d24d-52e0-9d60-ba84839a5bda"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"
}
},
"endpoint_uuid": {
"uuid": "463f5b52-bb8e-54e7-a63d-aeb4ad4b72bc"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "012c4e67-0024-5f30-b527-55ec6daf2639"
}
},
"endpoint_uuid": {
"uuid": "f2c1749b-0052-5ecb-931f-1b7889d7ed4d"
}
}
]
},
{
"name": "R1-T1.1",
"optical_details": {
"src_port": "2",
"dst_port": "1",
"local_peer_port": "12",
"remote_peer_port": "1",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "63c6a257-f171-59f8-b1e8-e3c4086ba36a"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "4dbdc2d8-cbde-5e48-a3c0-5161387a58c7"
}
},
"endpoint_uuid": {
"uuid": "5eb4f156-7811-53f3-9172-8402127cf7b9"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"
}
},
"endpoint_uuid": {
"uuid": "c7b7a565-0469-5463-809b-8ef4851d89c4"
}
}
]
},
{
"name": "T1.2-R1",
"optical_details": {
"src_port": "1",
"dst_port": "13",
"local_peer_port": "1",
"remote_peer_port": "3",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "817a2fcb-5dfd-55a6-b669-a141014cc38d"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"
}
},
"endpoint_uuid": {
"uuid": "27b6ed2a-b0d1-5be9-b9be-cc9a540ac0d1"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "27c2ed23-e74a-518f-820d-ae2c8ae23086"
}
},
"endpoint_uuid": {
"uuid": "cef46beb-6533-5a93-8541-ed5adc875452"
}
}
]
},
{
"name": "T2.2-R2",
"optical_details": {
"src_port": "6",
"dst_port": "13",
"local_peer_port": "6",
"remote_peer_port": "3",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "884c6c6a-ad1b-5228-a48f-e9db4bc174df"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"
}
},
"endpoint_uuid": {
"uuid": "be24d4af-c784-50cc-baa4-976a499fcd5a"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "012c4e67-0024-5f30-b527-55ec6daf2639"
}
},
"endpoint_uuid": {
"uuid": "f2c1749b-0052-5ecb-931f-1b7889d7ed4d"
}
}
]
},
{
"name": "R1-T1.3",
"optical_details": {
"src_port": "4",
"dst_port": "1",
"local_peer_port": "14",
"remote_peer_port": "1",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "89e3a6c6-d613-55bf-925c-c817ee24a133"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"
}
},
"endpoint_uuid": {
"uuid": "4fca89b8-237c-52bd-8131-9129316b524f"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "cf618e18-c0a1-58c4-9827-943a2c0523d6"
}
},
"endpoint_uuid": {
"uuid": "dcaae3e3-42c5-50b5-bafb-d3097d567d09"
}
}
]
},
{
"name": "R1-T1.2",
"optical_details": {
"src_port": "3",
"dst_port": "1",
"local_peer_port": "13",
"remote_peer_port": "1",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "b11e2e7b-ef00-5c11-9dc6-5fd34bd11f6e"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"
}
},
"endpoint_uuid": {
"uuid": "1a8d66e2-5d94-520f-b94a-0aca4cfd891f"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "27c2ed23-e74a-518f-820d-ae2c8ae23086"
}
},
"endpoint_uuid": {
"uuid": "cef46beb-6533-5a93-8541-ed5adc875452"
}
}
]
},
{
"name": "T2.3-R2",
"optical_details": {
"src_port": "6",
"dst_port": "14",
"local_peer_port": "6",
"remote_peer_port": "4",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "be7afc05-6e45-5899-896b-b331d6ab65c8"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "ce0cdfdd-2182-5027-8177-676ca3244f9d"
}
},
"endpoint_uuid": {
"uuid": "615c29eb-3528-5e70-9f43-2491aeb6478b"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"
}
},
"endpoint_uuid": {
"uuid": "ac9e9079-6cf5-5d21-834d-1940c76fd78d"
}
}
]
},
{
"name": "R2-T2.3",
"optical_details": {
"src_port": "4",
"dst_port": "6",
"local_peer_port": "14",
"remote_peer_port": "6",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "d4e89764-11c5-5f59-b7d6-a3aa2dab43df"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "ce0cdfdd-2182-5027-8177-676ca3244f9d"
}
},
"endpoint_uuid": {
"uuid": "615c29eb-3528-5e70-9f43-2491aeb6478b"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"
}
},
"endpoint_uuid": {
"uuid": "88a0bc2f-1ebf-5aca-b472-c339a1c302f9"
}
}
]
},
{
"name": "R1-R2",
"optical_details": {
"src_port": "101",
"dst_port": "111",
"local_peer_port": "111",
"remote_peer_port": "101",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "e273644c-0dfa-5053-8850-0722995e7ba3"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"
}
},
"endpoint_uuid": {
"uuid": "811b34f9-112c-5cc5-a4e0-6e5f5e0bdada"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"
}
},
"endpoint_uuid": {
"uuid": "d777e553-af96-5ee7-a957-ce70b49e36ac"
}
}
]
},
{
"name": "T1.1-R1",
"optical_details": {
"src_port": "1",
"dst_port": "12",
"local_peer_port": "1",
"remote_peer_port": "2",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "e8bd9082-ebad-55b8-b110-7c21fddaf1cf"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "4dbdc2d8-cbde-5e48-a3c0-5161387a58c7"
}
},
"endpoint_uuid": {
"uuid": "5eb4f156-7811-53f3-9172-8402127cf7b9"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"
}
},
"endpoint_uuid": {
"uuid": "690284c6-a8f7-54a0-82ed-19e721976221"
}
}
]
},
{
"name": "R2-R1",
"optical_details": {
"src_port": "101",
"dst_port": "111",
"local_peer_port": "111",
"remote_peer_port": "101",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "eae23f48-40de-5aae-b3d1-fa3cda231678"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"
}
},
"endpoint_uuid": {
"uuid": "4255273d-5038-512d-9838-d5dd921cb858"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"
}
},
"endpoint_uuid": {
"uuid": "f45593bb-41b1-50af-8944-524212ca012a"
}
}
]
},
{
"name": "T2.1-R2",
"optical_details": {
"src_port": "6",
"dst_port": "12",
"local_peer_port": "6",
"remote_peer_port": "2",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "ebb2ca0f-d4c1-51c4-ab41-dceea90f811f"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "c944aaeb-bbdf-5f2d-b31c-8cc8903045b6"
}
},
"endpoint_uuid": {
"uuid": "1b9f85aa-8cc9-5b9d-99dc-8f0eec714d67"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "87d74166-65e3-595e-b643-122b4fd0303f"
}
},
"endpoint_uuid": {
"uuid": "61fd51ea-9896-5528-bcf3-3202a7668efb"
}
}
]
},
{
"name": "T1.3-R1",
"optical_details": {
"src_port": "1",
"dst_port": "14",
"local_peer_port": "1",
"remote_peer_port": "4",
"c_slots": {
"1": 1,
"2": 1,
"3": 1,
"4": 1,
"5": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1,
"15": 1,
"16": 1,
"17": 1,
"18": 1,
"19": 1,
"20": 1
},
"l_slots": {
"101": 1,
"102": 1,
"103": 1,
"104": 1,
"105": 1,
"106": 1,
"107": 1,
"108": 1,
"109": 1,
"110": 1,
"111": 1,
"112": 1,
"113": 1,
"114": 1,
"115": 1,
"116": 1,
"117": 1,
"118": 1,
"119": 1,
"120": 1
},
"s_slots": {
"501": 1,
"502": 1,
"503": 1,
"504": 1,
"505": 1,
"506": 1,
"507": 1,
"508": 1,
"509": 1,
"510": 1,
"511": 1,
"512": 1,
"513": 1,
"514": 1,
"515": 1,
"516": 1,
"517": 1,
"518": 1,
"519": 1,
"520": 1
}
},
"link_id": {
"link_uuid": {
"uuid": "f79a817c-a6a0-55d5-9398-a582a9835be9"
}
},
"link_endpoint_ids": [
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "68741528-2e94-5274-ab3c-fddcd8dc05ef"
}
},
"endpoint_uuid": {
"uuid": "dad62073-9e4f-5b05-947d-571e6c3a6068"
}
},
{
"topology_id": {
"context_id": {
"context_uuid": {
"uuid": "43813baf-195e-5da6-af20-b3d0922e71a7"
}
},
"topology_uuid": {
"uuid": "c76135e3-24a8-5e92-9bed-c3c9139359c8"
}
},
"device_id": {
"device_uuid": {
"uuid": "cf618e18-c0a1-58c4-9827-943a2c0523d6"
}
},
"endpoint_uuid": {
"uuid": "dcaae3e3-42c5-50b5-bafb-d3097d567d09"
}
}
]
}
]
}
\ No newline at end of file
......@@ -280,7 +280,7 @@ def update(config_uuid,channel_name):
return redirect(url_for('opticalconfig.show_details',config_uuid=config_uuid))
except Exception as e: # pylint: disable=broad-except
flash(f'Problem updating the device. {e}', 'danger')
return render_template('myabout/update.html', device=response, form=form, submit_text='Update Device',channel_name=channel_name)
return render_template('device/update.html', device=response, form=form, submit_text='Update Device',channel_name=channel_name)
@opticalconfig.route('refresh_all',methods=['POST','GET'])
......
......@@ -17,7 +17,7 @@
{% extends 'base.html' %}
{% block content %}
<h1>My Configurations</h1>
<h1>Optical Configurations</h1>
<div class="row">
<div class="col">
......@@ -33,8 +33,4 @@
</a>
</div>
</div>
{% endblock %}
\ No newline at end of file
{% endblock %}
......@@ -21,7 +21,7 @@
{% block content %}
<h1>My Configurations</h1>
<h1>Optical Configurations</h1>
<div class="row">
......
......@@ -17,7 +17,7 @@
{% extends 'base.html' %}
{% block content %}
<h1>My Configurations</h1>
<h1>Optical Configurations</h1>
{% if config %}
<div class="row">
<div class="col-sm-12">
......
from ncclient import manager
from ncclient.xml_ import *
import lxml.etree as ET
import re
from typing import Optional, Union
from uuid import UUID, uuid4, uuid5
import logging
create_media='''
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<wavelength-router xmlns="http://openconfig.net/yang/wavelength-router">
<media-channels>
<channel operation="create">
<index>2</index>
<config>
<name>C_BAND</name>
<optical-band-parent xmlns="http://flex-scale-project.eu/yang/flex-scale-mg-on">1</optical-band-parent>
<index>2</index>
<lower-frequency>192006250</lower-frequency>
<upper-frequency>192106250</upper-frequency>
</config>
<source>
<config>
<port-name>port-1-in</port-name>
</config>
</source>
</channel>
</media-channels>
</wavelength-router>
</config>
'''
delete_media_channel='''
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<wavelength-router xmlns="http://openconfig.net/yang/wavelength-router">
<media-channels>
<channel operation="delete">
<index>1</index>
<config>
<index>1</index>
</config>
</channel>
</media-channels>
</wavelength-router>
</config>
'''
delete_optical_band= '''
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<wavelength-router xmlns="http://openconfig.net/yang/wavelength-router">
<optical-bands xmlns="http://flex-scale-project.eu/yang/flex-scale-mg-on">
<optical-band operation="delete">
<index>1</index>
<config>
<index>1</index>
</config>
</optical-band>
</optical-bands>
</wavelength-router>
</config>
'''
edit_optical_channel= '''
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<components xmlns="http://openconfig.net/yang/platform">
<component>
<name>channel-7</name>
<config>
<name>channel-7</name>
</config>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<target-output-power>300</target-output-power>
<frequency>3400000</frequency>
<operational-mode>1</operational-mode>
</config>
</optical-channel>
</component>
</components>
<terminal-device xmlns="http://openconfig.net/yang/terminal-device">
<logical-channels>
<channel>
<index>7</index>
<config>
<index>7</index>
<admin-state>ENABLED</admin-state>
</config>
</channel>
</logical-channels>
</terminal-device>
</config>
'''
def extract_channel_xmlns (data_xml:str,is_opticalband:bool):
xml_bytes = data_xml.encode("utf-8")
root = ET.fromstring(xml_bytes)
namespace=None
channels=None
if (not is_opticalband) :
optical_channel_namespaces = {
'ns': 'urn:ietf:params:xml:ns:netconf:base:1.0',
'oc': 'http://openconfig.net/yang/platform',
}
channels= root.find('.//{*}optical-channel',optical_channel_namespaces)
if channels is not None :
optical_channel_namespace = channels.tag.replace("optical-channel", "")
namespace=optical_channel_namespace.replace("{", "").replace("}", "")
else :
optical_band_namespaces= {
'oc':'http://openconfig.net/yang/wavelength-router'
}
channels= root.find('.//{*}optical-bands',optical_band_namespaces)
if channels is not None:
optical_channel_namespace = channels.tag.replace("optical-bands", "")
namespace=optical_channel_namespace.replace("{", "").replace("}", "")
return namespace
def extract_roadm_ports (xml_data:str):
ports =[]
pattern2=r'\bMG_ON_PORT_TYPE'
pattern = r'\bMG_ON_OPTICAL_PORT_WAVEBAND\b'
xml_bytes = xml_data.encode("utf-8")
root = ET.fromstring(xml_bytes)
namespace = {'oc': 'http://openconfig.net/yang/platform'}
ports = []
components = root.findall('.//oc:component',namespace)
#print(f"component {components}")
for component in components:
properties = component.find(".//oc:properties",namespace)
if (properties is not None):
for property in properties :
value = property.find(".//oc:value",namespace)
name= property.find('.//oc:name',namespace)
if (re.search(pattern2,name.text)):
value = property.find(".//oc:value",namespace)
name_element= component.find(".//oc:name",namespace)
print('value',value.text)
ports.append((name_element.text,value.text))
# if (re.search(pattern2,value.text)):
# #print('value',value.text)
# name_element= component.find(".//oc:name",namespace)
# ports.append(name_element.text)
return ports
device = {
'host': '172.17.254.22', # IP address or hostname of the remote machine
'port': 2022, # SSH port (default: 22)
'username': 'admin', # SSH username
'password': 'admin', # SSH password
'device_params': {'name': 'default'},
'hostkey_verify':False,
"allow_agent":False
,"look_for_keys":False
}
if __name__ == '__main__':
with manager.connect(host=device['host']
,port=device['port']
,username=device['username']
,password=device['password']
,hostkey_verify=device['hostkey_verify']
,allow_agent=device['allow_agent']
,look_for_keys=device['look_for_keys']) as m :
#edit_result = m.edit_config (target="running",config=delete_media_channel )
result = m.get_config (source="running").data_xml
#ports = extract_roadm_ports(result)
# optical_band_namespaces="http://flex-scale-project.eu/yang/flex-scale-mg-on"
#namespaces={"oc":"http://openconfig.net/yang/wavelength-router"}
#obj=extract_media_channels(result,namespaces)
#obj1=extract_optical_bands(result,namespaces)
# road_info= extract_openroadm_info(result)
# circuits=extract_roadm_circuits_pack(result)
#print (f'edit result {edit_result}')
print(f"result {result}")
#print(f"media_cahnnels {obj}")
#print(f"optical_bands {obj1}")
#print(f"circuits {circuits}")
# with open("context.log","w") as f:
# print (result,file=f)
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