From 6528530251e0f0a7d2c10d12aa40b1f738d3e8a5 Mon Sep 17 00:00:00 2001 From: Mark90 Date: Mon, 10 Jun 2024 16:07:44 +0200 Subject: [PATCH] Update migrations to reflect generator enhancements Updated existing migrations with fixes from https://github.com/workfloworchestrator/orchestrator-core/pull/674 --- .../2023-10-27_a84ca2e5e4db_add_node.py | 8 +--- .../2023-11-02_c044b0da4126_add_port.py | 13 +++--- .../2023-11-16_1faddadd7aae_add_core_link.py | 44 +++++++++---------- .../2023-11-17_e2a0fed2a4c7_add_l2vpn.py | 35 +++++++-------- templates/node.yaml | 2 +- 5 files changed, 45 insertions(+), 57 deletions(-) diff --git a/migrations/versions/schema/2023-10-27_a84ca2e5e4db_add_node.py b/migrations/versions/schema/2023-10-27_a84ca2e5e4db_add_node.py index 560cd81..b295e9d 100644 --- a/migrations/versions/schema/2023-10-27_a84ca2e5e4db_add_node.py +++ b/migrations/versions/schema/2023-10-27_a84ca2e5e4db_add_node.py @@ -31,9 +31,7 @@ "description": "Network node", "tag": "NODE", "status": "active", - "product_blocks": [ - "Node", - ], + "root_product_block": "Node", "fixed_inputs": { "node_type": "Cisco", }, @@ -44,9 +42,7 @@ "description": "Network node", "tag": "NODE", "status": "active", - "product_blocks": [ - "Node", - ], + "root_product_block": "Node", "fixed_inputs": { "node_type": "Nokia", }, diff --git a/migrations/versions/schema/2023-11-02_c044b0da4126_add_port.py b/migrations/versions/schema/2023-11-02_c044b0da4126_add_port.py index 81793ef..428d333 100644 --- a/migrations/versions/schema/2023-11-02_c044b0da4126_add_port.py +++ b/migrations/versions/schema/2023-11-02_c044b0da4126_add_port.py @@ -33,9 +33,7 @@ "description": "Network port", "tag": "PORT", "status": "active", - "product_blocks": [ - "Port", - ], + "root_product_block": "Port", "fixed_inputs": { "speed": PortSpeed._10000.value, }, @@ -46,9 +44,7 @@ "description": "Network port", "tag": "PORT", "status": "active", - "product_blocks": [ - "Port", - ], + "root_product_block": "Port", "fixed_inputs": { "speed": PortSpeed._100000.value, }, @@ -68,11 +64,12 @@ "auto_negotiation": "is Ethernet auto negotiation enabled or not", "lldp": "is Link Llayer Discovery Protocol enabled or not", "enabled": "is port enabled in inventory management system?", - "node": "link to the Node product block the port is residing on", "ims_id": "ID of the node in the inventory management system", "nrm_id": "ID of the node in the network resource manager", }, - "depends_on_block_relations": [], + "depends_on_block_relations": [ + "Node", + ], }, }, "workflows": {}, diff --git a/migrations/versions/schema/2023-11-16_1faddadd7aae_add_core_link.py b/migrations/versions/schema/2023-11-16_1faddadd7aae_add_core_link.py index 0bb1525..38b0164 100644 --- a/migrations/versions/schema/2023-11-16_1faddadd7aae_add_core_link.py +++ b/migrations/versions/schema/2023-11-16_1faddadd7aae_add_core_link.py @@ -33,10 +33,7 @@ "description": "Core link", "tag": "CORE_LINK", "status": "active", - "product_blocks": [ - "CoreLink", - "CorePort", - ], + "root_product_block": "CoreLink", "fixed_inputs": { "speed": CoreLinkSpeed._10000.value, }, @@ -47,30 +44,13 @@ "description": "Core link", "tag": "CORE_LINK", "status": "active", - "product_blocks": [ - "CoreLink", - "CorePort", - ], + "root_product_block": "CoreLink", "fixed_inputs": { "speed": CoreLinkSpeed._100000.value, }, }, }, "product_blocks": { - "CoreLink": { - "product_block_id": uuid4(), - "description": "core link product block", - "tag": "CORE_LINK", - "status": "active", - "resources": { - "ports": "core ports", - "ims_id": "ID of the core link in the inventory management system", - "ipv6_prefix_ipam_id": "IPAM ID of IP prefix used to number ports of this core link", - "nrm_id": "ID of the core link in the network resource manager", - "under_maintenance": "core link under maintenance?", - }, - "depends_on_block_relations": [], - }, "CorePort": { "product_block_id": uuid4(), "description": "core port product block", @@ -81,10 +61,26 @@ "enabled": "is port enabled in inventory management system?", "ims_id": "ID of the port in the inventory management system", "nrm_id": "ID of the port in the network resource manager", - "node": "link to the Node product block the port is residing on", "ipv6_ipam_id": "ID of the port's IPv6 address in IPAM", }, - "depends_on_block_relations": [], + "depends_on_block_relations": [ + "Node", + ], + }, + "CoreLink": { + "product_block_id": uuid4(), + "description": "core link product block", + "tag": "CORE_LINK", + "status": "active", + "resources": { + "ims_id": "ID of the core link in the inventory management system", + "ipv6_prefix_ipam_id": "IPAM ID of IP prefix used to number ports of this core link", + "nrm_id": "ID of the core link in the network resource manager", + "under_maintenance": "core link under maintenance?", + }, + "depends_on_block_relations": [ + "CorePort", + ], }, }, "workflows": {}, diff --git a/migrations/versions/schema/2023-11-17_e2a0fed2a4c7_add_l2vpn.py b/migrations/versions/schema/2023-11-17_e2a0fed2a4c7_add_l2vpn.py index 3df8ae4..fa7bb33 100644 --- a/migrations/versions/schema/2023-11-17_e2a0fed2a4c7_add_l2vpn.py +++ b/migrations/versions/schema/2023-11-17_e2a0fed2a4c7_add_l2vpn.py @@ -31,39 +31,38 @@ "description": "L2VPN", "tag": "L2VPN", "status": "active", - "product_blocks": [ - "VirtualCircuit", - "SAP", - ], + "root_product_block": "VirtualCircuit", "fixed_inputs": {}, }, }, "product_blocks": { + "SAP": { + "product_block_id": uuid4(), + "description": "service access point", + "tag": "SAP", + "status": "active", + "resources": { + "vlan": "VLAN ID on port", + "ims_id": "ID of the SAP in the inventory management system", + }, + "depends_on_block_relations": [ + "Port", + ], + }, "VirtualCircuit": { "product_block_id": uuid4(), "description": "virtual circuit product block", "tag": "VC", "status": "active", "resources": { - "saps": "Virtual circuit service access points", "speed": "speed of the L2VPN im Mbit/s", "speed_policer": "speed policer active?", "ims_id": "ID of the L2VPN in the inventory management system", "nrm_id": "ID of the L2VPN in the network resource manager", }, - "depends_on_block_relations": [], - }, - "SAP": { - "product_block_id": uuid4(), - "description": "service access point", - "tag": "SAP", - "status": "active", - "resources": { - "port": "Link to Port product block", - "vlan": "VLAN ID on port", - "ims_id": "ID of the SAP in the inventory management system", - }, - "depends_on_block_relations": [], + "depends_on_block_relations": [ + "SAP", + ], }, }, "workflows": {}, diff --git a/templates/node.yaml b/templates/node.yaml index 0b27ffd..b510de8 100644 --- a/templates/node.yaml +++ b/templates/node.yaml @@ -12,7 +12,7 @@ # limitations under the License. # # -# This file describes the "Port" product +# This file describes the "Node" product # config: summary_forms: true