diff --git "a/gso/migrations/versions/2024-10-08_bf05800fe9fc_add_edge_port_and_g\303\251ant_ip_workflows.py" b/gso/migrations/versions/2024-10-08_bf05800fe9fc_add_edge_port_and_nren_l3_workflows.py similarity index 68% rename from "gso/migrations/versions/2024-10-08_bf05800fe9fc_add_edge_port_and_g\303\251ant_ip_workflows.py" rename to gso/migrations/versions/2024-10-08_bf05800fe9fc_add_edge_port_and_nren_l3_workflows.py index c4cf724be531946f26f475a9d58e484b37e5e1fc..770e6c31f71a5e6704f600c6a948c0b8bc4e8997 100644 --- "a/gso/migrations/versions/2024-10-08_bf05800fe9fc_add_edge_port_and_g\303\251ant_ip_workflows.py" +++ b/gso/migrations/versions/2024-10-08_bf05800fe9fc_add_edge_port_and_nren_l3_workflows.py @@ -1,4 +1,4 @@ -"""Add Edge Port and GÉANT IP workflows. +"""Add Edge Port and NREN L3 Core Service workflows. Revision ID: bf05800fe9fc Revises: a08bf228f112 @@ -10,7 +10,7 @@ from alembic import op # revision identifiers, used by Alembic. revision = 'bf05800fe9fc' -down_revision = 'a08bf228f112' +down_revision = '2d224884c80b' branch_labels = None depends_on = None @@ -55,34 +55,34 @@ new_workflows = [ "product_type": "ImportedEdgePort" }, { - "name": "create_geant_ip", + "name": "create_nren_l3_core_service", "target": "CREATE", - "description": "Create G\u00c9ANT IP", - "product_type": "GeantIP" + "description": "Create NREN L3 Core Service", + "product_type": "NRENL3CoreService" }, { - "name": "modify_geant_ip", + "name": "modify_nren_l3_core_service", "target": "MODIFY", - "description": "Modify G\u00c9ANT IP", - "product_type": "GeantIP" + "description": "Modify NREN L3 Core Service", + "product_type": "NRENL3CoreService" }, { - "name": "migrate_geant_ip", + "name": "migrate_nren_l3_core_service", "target": "MODIFY", - "description": "Migrate G\u00c9ANT IP", - "product_type": "GeantIP" + "description": "Migrate NREN L3 Core Service", + "product_type": "NRENL3CoreService" }, { - "name": "create_imported_geant_ip", + "name": "create_imported_nren_l3_core_service", "target": "CREATE", - "description": "Import G\u00c9ANT IP", - "product_type": "ImportedGeantIP" + "description": "Import NREN L3 Core Service", + "product_type": "ImportedNRENL3CoreService" }, { - "name": "import_geant_ip", + "name": "import_nren_l3_core_service", "target": "MODIFY", - "description": "Import G\u00c9ANT IP", - "product_type": "ImportedGeantIP" + "description": "Import NREN L3 Core Service", + "product_type": "ImportedNRENL3CoreService" } ] diff --git a/gso/migrations/versions/2024-10-10_df108295d917_add_ipv4_ipv6_netmask_to_service_.py b/gso/migrations/versions/2024-10-10_df108295d917_add_ipv4_ipv6_netmask_to_service_.py deleted file mode 100644 index 98a1bb47618d51e73b557b0156d71dcd1173df5e..0000000000000000000000000000000000000000 --- a/gso/migrations/versions/2024-10-10_df108295d917_add_ipv4_ipv6_netmask_to_service_.py +++ /dev/null @@ -1,99 +0,0 @@ -"""Add IPV4/IPV6 netmask to Service Binding Port model . - -Revision ID: df108295d917 -Revises: bf05800fe9fc -Create Date: 2024-10-10 11:39:43.051211 - -""" -import sqlalchemy as sa -from alembic import op - -# revision identifiers, used by Alembic. -revision = 'df108295d917' -down_revision = 'bf05800fe9fc' -branch_labels = None -depends_on = None - - -def upgrade() -> None: - conn = op.get_bind() - conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('ipv4_mask', 'IPV4 subnet mask') RETURNING resource_types.resource_type_id - """)) - conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('ipv6_mask', 'IPV6 subnet mask') RETURNING resource_types.resource_type_id - """)) - conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_mask'))) - """)) - conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv6_mask'))) - """)) - conn.execute(sa.text(""" - - WITH subscription_instance_ids AS ( - SELECT subscription_instances.subscription_instance_id - FROM subscription_instances - WHERE subscription_instances.product_block_id IN ( - SELECT product_blocks.product_block_id - FROM product_blocks - WHERE product_blocks.name = 'ServiceBindingPort' - ) - ) - - INSERT INTO - subscription_instance_values (subscription_instance_id, resource_type_id, value) - SELECT - subscription_instance_ids.subscription_instance_id, - resource_types.resource_type_id, - 'None' - FROM resource_types - CROSS JOIN subscription_instance_ids - WHERE resource_types.resource_type = 'ipv4_mask' - - """)) - conn.execute(sa.text(""" - - WITH subscription_instance_ids AS ( - SELECT subscription_instances.subscription_instance_id - FROM subscription_instances - WHERE subscription_instances.product_block_id IN ( - SELECT product_blocks.product_block_id - FROM product_blocks - WHERE product_blocks.name = 'ServiceBindingPort' - ) - ) - - INSERT INTO - subscription_instance_values (subscription_instance_id, resource_type_id, value) - SELECT - subscription_instance_ids.subscription_instance_id, - resource_types.resource_type_id, - 'None' - FROM resource_types - CROSS JOIN subscription_instance_ids - WHERE resource_types.resource_type = 'ipv6_mask' - - """)) - - -def downgrade() -> None: - conn = op.get_bind() - conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_mask')) - """)) - conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_mask')) - """)) - conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv6_mask')) - """)) - conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv6_mask')) - """)) - conn.execute(sa.text(""" -DELETE FROM subscription_instance_values WHERE subscription_instance_values.resource_type_id IN (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_mask', 'ipv6_mask')) - """)) - conn.execute(sa.text(""" -DELETE FROM resource_types WHERE resource_types.resource_type IN ('ipv4_mask', 'ipv6_mask') - """)) diff --git "a/gso/migrations/versions/2024-10-08_a08bf228f112_add_edge_port_and_g\303\251ant_ip_products.py" b/gso/migrations/versions/2024-10-16_2d224884c80b_add_edge_port_and_nren_l3_core_service_.py similarity index 80% rename from "gso/migrations/versions/2024-10-08_a08bf228f112_add_edge_port_and_g\303\251ant_ip_products.py" rename to gso/migrations/versions/2024-10-16_2d224884c80b_add_edge_port_and_nren_l3_core_service_.py index 869e4fe037728f6d73204704d7d004641291825d..bc1c6df50eb9fb4310b76a456b0213422040c2fd 100644 --- "a/gso/migrations/versions/2024-10-08_a08bf228f112_add_edge_port_and_g\303\251ant_ip_products.py" +++ b/gso/migrations/versions/2024-10-16_2d224884c80b_add_edge_port_and_nren_l3_core_service_.py @@ -1,15 +1,15 @@ -"""Add Edge Port and GÉANT IP products. +"""Add Edge Port and NREN L3 Core Service products. -Revision ID: a08bf228f112 +Revision ID: 2d224884c80b Revises: 51c819b28101 -Create Date: 2024-10-08 11:16:31.834340 +Create Date: 2024-10-16 14:39:40.236160 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. -revision = 'a08bf228f112' +revision = '2d224884c80b' down_revision = '51c819b28101' branch_labels = None depends_on = None @@ -18,127 +18,139 @@ depends_on = None def upgrade() -> None: conn = op.get_bind() conn.execute(sa.text(""" -INSERT INTO products (name, description, product_type, tag, status) VALUES ('Edge Port', 'Edge Port', 'EdgePort', 'EDGE_PORT', 'active') RETURNING products.product_id +INSERT INTO products (name, description, product_type, tag, status) VALUES ('Edge Port', 'Edge Port where a partner service terminates', 'EdgePort', 'EP', 'active') RETURNING products.product_id """)) conn.execute(sa.text(""" -INSERT INTO products (name, description, product_type, tag, status) VALUES ('Imported Edge Port', 'Imported Edge Port', 'ImportedEdgePort', 'IMPORTED_EDGE_PORT', 'active') RETURNING products.product_id +INSERT INTO products (name, description, product_type, tag, status) VALUES ('Imported Edge Port', 'A pre-existing Edge Port that is imported into the service database', 'ImportedEdgePort', 'IMP_EP', 'active') RETURNING products.product_id """)) conn.execute(sa.text(""" -INSERT INTO products (name, description, product_type, tag, status) VALUES ('GÉANT IP', 'GÉANT IP', 'GeantIP', 'GEANT_IP', 'active') RETURNING products.product_id +INSERT INTO products (name, description, product_type, tag, status) VALUES ('GÉANT IP', 'A GÉANT IP subscription for R&E access', 'NRENL3CoreService', 'G_IP', 'active') RETURNING products.product_id """)) conn.execute(sa.text(""" -INSERT INTO products (name, description, product_type, tag, status) VALUES ('Imported GÉANT IP', 'Imported GÉANT IP', 'ImportedGeantIP', 'IMPORTED_GEANT_IP', 'active') RETURNING products.product_id +INSERT INTO products (name, description, product_type, tag, status) VALUES ('Imported GÉANT IP', 'A Gpre-existing GÉANT IP subscription that is imported into the service database', 'ImportedNRENL3CoreService', 'IMP_G_IP', 'active') RETURNING products.product_id """)) conn.execute(sa.text(""" -INSERT INTO product_blocks (name, description, tag, status) VALUES ('EdgePortBlock', 'Edge Port block', 'EDGE_PORT_BLOCK', 'active') RETURNING product_blocks.product_block_id +INSERT INTO products (name, description, product_type, tag, status) VALUES ('IAS', 'An Internet Access Service for general internet access', 'NRENL3CoreService', 'IAS', 'active') RETURNING products.product_id """)) conn.execute(sa.text(""" -INSERT INTO product_blocks (name, description, tag, status) VALUES ('EdgePortAEMemberBlock', 'Edge Port AE Member block', 'EP_AE_MEMBER_BLOCK', 'active') RETURNING product_blocks.product_block_id +INSERT INTO products (name, description, product_type, tag, status) VALUES ('Imported IAS', 'A pre-existing Internet Access Service that is imported into the service database', 'ImportedNRENL3CoreService', 'IMP_IAS', 'active') RETURNING products.product_id """)) conn.execute(sa.text(""" -INSERT INTO product_blocks (name, description, tag, status) VALUES ('GeantIPBlock', 'GÉANT IP block', 'GEANT_IP_BLOCK', 'active') RETURNING product_blocks.product_block_id +INSERT INTO fixed_inputs (name, value, product_id) VALUES ('nren_l3_core_service_type', 'IMPORTED_IAS', (SELECT products.product_id FROM products WHERE products.name IN ('Imported IAS'))), ('nren_l3_core_service_type', 'IMPORTED_GEANT_IP', (SELECT products.product_id FROM products WHERE products.name IN ('Imported GÉANT IP'))), ('nren_l3_core_service_type', 'IAS', (SELECT products.product_id FROM products WHERE products.name IN ('IAS'))), ('nren_l3_core_service_type', 'GGEANT_IP', (SELECT products.product_id FROM products WHERE products.name IN ('GÉANT IP'))) """)) conn.execute(sa.text(""" -INSERT INTO product_blocks (name, description, tag, status) VALUES ('NRENAccessPort', 'NREN Access Port', 'NREN_AP', 'active') RETURNING product_blocks.product_block_id +INSERT INTO product_blocks (name, description, tag, status) VALUES ('EdgePortBlock', 'The product block with all attributes of an Edge Port', 'EP_BLOCK', 'active') RETURNING product_blocks.product_block_id """)) conn.execute(sa.text(""" -INSERT INTO product_blocks (name, description, tag, status) VALUES ('ServiceBindingPort', 'Service Binding Port', 'SBP', 'active') RETURNING product_blocks.product_block_id +INSERT INTO product_blocks (name, description, tag, status) VALUES ('EdgePortAEMemberBlock', 'A physical interface member of an Edge Port', 'EP_AE_BLOCK', 'active') RETURNING product_blocks.product_block_id """)) conn.execute(sa.text(""" -INSERT INTO product_blocks (name, description, tag, status) VALUES ('BGPSession', 'BGP Session', 'BGP_SESSION', 'active') RETURNING product_blocks.product_block_id +INSERT INTO product_blocks (name, description, tag, status) VALUES ('NRENL3CoreServiceBlock', 'The product block with all attributes of an NREN L3 Core Service', 'NREN_L3_CORE_BLOCK', 'active') RETURNING product_blocks.product_block_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('peer_address', 'BGP peer address') RETURNING resource_types.resource_type_id +INSERT INTO product_blocks (name, description, tag, status) VALUES ('NRENAccessPort', 'An NREN Access Port', 'NREN_AP_BLOCK', 'active') RETURNING product_blocks.product_block_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('authentication_key', 'BGP session authentication key') RETURNING resource_types.resource_type_id +INSERT INTO product_blocks (name, description, tag, status) VALUES ('ServiceBindingPort', 'A Service Binding Port', 'SBP_BLOCK', 'active') RETURNING product_blocks.product_block_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('multipath_enabled', 'Multipath enabled') RETURNING resource_types.resource_type_id +INSERT INTO product_blocks (name, description, tag, status) VALUES ('BGPSession', 'A BGP session', 'BGP_BLOCK', 'active') RETURNING product_blocks.product_block_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_description', 'Edge Port description') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('ignore_if_down', 'Ignore if this interface goes down') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('ipv6_address', 'IPv6 Address') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('multipath_enabled', 'Does this have multipath enabled') RETURNING resource_types.resource_type_id + """)) + conn.execute(sa.text(""" +INSERT INTO resource_types (resource_type, description) VALUES ('geant_ga_id', 'GÉANT GA service ID') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('geant_sid', 'GÉANT S-ID') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('has_custom_policies', 'This has custom policies enabled') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('nren_ap_type', 'NREN AP type, PRIMARY, BACKUP or LOAD BALANCED') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('families', 'IP families, can be v4 v6 and UNICAST or MULTICAST') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('is_passive', 'Is passive') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('name', 'Name') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('rtbh_enabled', 'Remote Triggered Blackhole enabled') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_type', 'Type of Edge Port') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_minimum_links', 'Edge Port minimum amount of links') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('custom_firewall_filters', 'This product has custom firewall filters enabled') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('is_tagged', 'Is tagged') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('peer_address', 'A Peer address') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_mac_address', 'Edge Port MAC address') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('ipv6_address', 'IPv6 Address') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('is_multi_hop', 'Is multi hop') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_description', 'Description of an Edge Port') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_ignore_if_down', 'Ignore if Edge Port is in a down state') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('authentication_key', 'Authentication key') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" INSERT INTO resource_types (resource_type, description) VALUES ('bfd_multiplier', 'BFD multiplier') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('sbp_type', 'Service Binding Port type') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('is_tagged', 'This product is tagged') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('send_default_route', 'Send default route') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('rtbh_enabled', 'This product has RTBH enabled') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_encapsulation', 'Edge Port encapsulation') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('mac_address', 'A MAC address') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('has_custom_policies', 'Has custom routing policies') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('bfd_interval', 'BFD interval') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('bfd_enabled', 'Bidirectional Forwarding Detection enabled') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('is_multi_hop', 'This product is multi-hop') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('families', 'IP families') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('member_speed', 'The capacity of a member interface') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('ipv4_address', 'IPv4 address') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('ipv4_mask', 'IPv4 netmask') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_enable_lacp', 'Enable Link Aggregation Control Protocol on this Edge Port') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('geant_sid', 'G´ÉANT service ID') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('custom_firewall_filters', 'Custom firewall filters') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('encapsulation', 'Encapsulation method') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_type', 'Edge Port type') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('ipv4_address', 'IPv4 Address') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('bfd_interval', 'BFD interval') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('ipv6_mask', 'IPv6 netmask') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_name', 'Edge Port name') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('bfd_enabled', 'This product has BFD enabled') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_geant_ga_id', 'GÉANT ID') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('ap_type', 'Access Port type') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO resource_types (resource_type, description) VALUES ('edge_port_member_speed', 'Edge Port member speed') RETURNING resource_types.resource_type_id +INSERT INTO resource_types (resource_type, description) VALUES ('send_default_route', 'This product sends a default route') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO product_product_blocks (product_id, product_block_id) VALUES ((SELECT products.product_id FROM products WHERE products.name IN ('Edge Port')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))), ((SELECT products.product_id FROM products WHERE products.name IN ('Imported Edge Port')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) +INSERT INTO resource_types (resource_type, description) VALUES ('is_passive', 'This product is passive') RETURNING resource_types.resource_type_id """)) conn.execute(sa.text(""" -INSERT INTO product_product_blocks (product_id, product_block_id) VALUES ((SELECT products.product_id FROM products WHERE products.name IN ('GÉANT IP')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('GeantIPBlock'))), ((SELECT products.product_id FROM products WHERE products.name IN ('Imported GÉANT IP')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('GeantIPBlock'))) +INSERT INTO resource_types (resource_type, description) VALUES ('sbp_type', 'Type of Service Binding Port') RETURNING resource_types.resource_type_id + """)) + conn.execute(sa.text(""" +INSERT INTO resource_types (resource_type, description) VALUES ('enable_lacp', 'This product has LACP enabled') RETURNING resource_types.resource_type_id + """)) + conn.execute(sa.text(""" +INSERT INTO product_product_blocks (product_id, product_block_id) VALUES ((SELECT products.product_id FROM products WHERE products.name IN ('Imported Edge Port')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))), ((SELECT products.product_id FROM products WHERE products.name IN ('Edge Port')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) + """)) + conn.execute(sa.text(""" +INSERT INTO product_product_blocks (product_id, product_block_id) VALUES ((SELECT products.product_id FROM products WHERE products.name IN ('Imported IAS')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENL3CoreServiceBlock'))), ((SELECT products.product_id FROM products WHERE products.name IN ('Imported GÉANT IP')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENL3CoreServiceBlock'))), ((SELECT products.product_id FROM products WHERE products.name IN ('IAS')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENL3CoreServiceBlock'))), ((SELECT products.product_id FROM products WHERE products.name IN ('GÉANT IP')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENL3CoreServiceBlock'))) """)) conn.execute(sa.text(""" INSERT INTO product_block_relations (in_use_by_id, depends_on_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('RouterBlock'))) @@ -147,7 +159,7 @@ INSERT INTO product_block_relations (in_use_by_id, depends_on_id) VALUES ((SELEC INSERT INTO product_block_relations (in_use_by_id, depends_on_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortAEMemberBlock'))) """)) conn.execute(sa.text(""" -INSERT INTO product_block_relations (in_use_by_id, depends_on_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('GeantIPBlock')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort'))) +INSERT INTO product_block_relations (in_use_by_id, depends_on_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENL3CoreServiceBlock')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort'))) """)) conn.execute(sa.text(""" INSERT INTO product_block_relations (in_use_by_id, depends_on_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort'))) @@ -159,34 +171,34 @@ INSERT INTO product_block_relations (in_use_by_id, depends_on_id) VALUES ((SELEC INSERT INTO product_block_relations (in_use_by_id, depends_on_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) """)) conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_name'))) +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('name'))) """)) conn.execute(sa.text(""" INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_description'))) """)) conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_enable_lacp'))) +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('enable_lacp'))) """)) conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_encapsulation'))) +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('encapsulation'))) """)) conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_mac_address'))) +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('mac_address'))) """)) conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_member_speed'))) +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('member_speed'))) """)) conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_minimum_links'))) +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('minimum_links'))) """)) conn.execute(sa.text(""" INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_type'))) """)) conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_ignore_if_down'))) +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ignore_if_down'))) """)) conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_geant_ga_id'))) +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('geant_ga_id'))) """)) conn.execute(sa.text(""" INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortAEMemberBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('interface_name'))) @@ -195,7 +207,7 @@ INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VA INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortAEMemberBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('interface_description'))) """)) conn.execute(sa.text(""" -INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('nren_ap_type'))) +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ap_type'))) """)) conn.execute(sa.text(""" INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('is_tagged'))) @@ -210,9 +222,15 @@ INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VA INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_address'))) """)) conn.execute(sa.text(""" +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_mask'))) + """)) + conn.execute(sa.text(""" INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv6_address'))) """)) conn.execute(sa.text(""" +INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv6_mask'))) + """)) + conn.execute(sa.text(""" INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('custom_firewall_filters'))) """)) conn.execute(sa.text(""" @@ -259,10 +277,10 @@ INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VA def downgrade() -> None: conn = op.get_bind() conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_name')) +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('name')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_name')) +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('name')) """)) conn.execute(sa.text(""" DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_description')) @@ -271,34 +289,34 @@ DELETE FROM product_block_resource_types WHERE product_block_resource_types.prod DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_description')) """)) conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_enable_lacp')) +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('enable_lacp')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_enable_lacp')) +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('enable_lacp')) """)) conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_encapsulation')) +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('encapsulation')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_encapsulation')) +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('encapsulation')) """)) conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_mac_address')) +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('mac_address')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_mac_address')) +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('mac_address')) """)) conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_member_speed')) +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('member_speed')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_member_speed')) +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('member_speed')) """)) conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_minimum_links')) +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('minimum_links')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_minimum_links')) +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('minimum_links')) """)) conn.execute(sa.text(""" DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_type')) @@ -307,16 +325,16 @@ DELETE FROM product_block_resource_types WHERE product_block_resource_types.prod DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_type')) """)) conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_ignore_if_down')) +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ignore_if_down')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_ignore_if_down')) +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ignore_if_down')) """)) conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_geant_ga_id')) +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('geant_ga_id')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('edge_port_geant_ga_id')) +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('geant_ga_id')) """)) conn.execute(sa.text(""" DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortAEMemberBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('interface_name')) @@ -331,10 +349,10 @@ DELETE FROM product_block_resource_types WHERE product_block_resource_types.prod DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortAEMemberBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('interface_description')) """)) conn.execute(sa.text(""" -DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('nren_ap_type')) +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ap_type')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('nren_ap_type')) +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ap_type')) """)) conn.execute(sa.text(""" DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('is_tagged')) @@ -361,12 +379,24 @@ DELETE FROM product_block_resource_types WHERE product_block_resource_types.prod DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_address')) """)) conn.execute(sa.text(""" +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_mask')) + """)) + conn.execute(sa.text(""" +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_mask')) + """)) + conn.execute(sa.text(""" DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv6_address')) """)) conn.execute(sa.text(""" DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv6_address')) """)) conn.execute(sa.text(""" +DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv6_mask')) + """)) + conn.execute(sa.text(""" +DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv6_mask')) + """)) + conn.execute(sa.text(""" DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('custom_firewall_filters')) """)) conn.execute(sa.text(""" @@ -451,16 +481,16 @@ DELETE FROM product_block_resource_types WHERE product_block_resource_types.prod DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('BGPSession'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('rtbh_enabled')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instance_values WHERE subscription_instance_values.resource_type_id IN (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('peer_address', 'authentication_key', 'multipath_enabled', 'edge_port_description', 'ipv6_address', 'geant_sid', 'nren_ap_type', 'is_passive', 'rtbh_enabled', 'edge_port_minimum_links', 'is_tagged', 'edge_port_mac_address', 'is_multi_hop', 'edge_port_ignore_if_down', 'bfd_multiplier', 'sbp_type', 'send_default_route', 'edge_port_encapsulation', 'has_custom_policies', 'bfd_enabled', 'families', 'ipv4_address', 'edge_port_enable_lacp', 'custom_firewall_filters', 'edge_port_type', 'bfd_interval', 'edge_port_name', 'edge_port_geant_ga_id', 'edge_port_member_speed')) +DELETE FROM subscription_instance_values WHERE subscription_instance_values.resource_type_id IN (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ignore_if_down', 'multipath_enabled', 'geant_ga_id', 'has_custom_policies', 'families', 'name', 'edge_port_type', 'custom_firewall_filters', 'peer_address', 'ipv6_address', 'edge_port_description', 'authentication_key', 'bfd_multiplier', 'is_tagged', 'rtbh_enabled', 'mac_address', 'bfd_interval', 'is_multi_hop', 'member_speed', 'ipv4_mask', 'geant_sid', 'encapsulation', 'ipv4_address', 'ipv6_mask', 'bfd_enabled', 'ap_type', 'send_default_route', 'is_passive', 'sbp_type', 'enable_lacp')) """)) conn.execute(sa.text(""" -DELETE FROM resource_types WHERE resource_types.resource_type IN ('peer_address', 'authentication_key', 'multipath_enabled', 'edge_port_description', 'ipv6_address', 'geant_sid', 'nren_ap_type', 'is_passive', 'rtbh_enabled', 'edge_port_minimum_links', 'is_tagged', 'edge_port_mac_address', 'is_multi_hop', 'edge_port_ignore_if_down', 'bfd_multiplier', 'sbp_type', 'send_default_route', 'edge_port_encapsulation', 'has_custom_policies', 'bfd_enabled', 'families', 'ipv4_address', 'edge_port_enable_lacp', 'custom_firewall_filters', 'edge_port_type', 'bfd_interval', 'edge_port_name', 'edge_port_geant_ga_id', 'edge_port_member_speed') +DELETE FROM resource_types WHERE resource_types.resource_type IN ('ignore_if_down', 'multipath_enabled', 'geant_ga_id', 'has_custom_policies', 'families', 'name', 'edge_port_type', 'custom_firewall_filters', 'peer_address', 'ipv6_address', 'edge_port_description', 'authentication_key', 'bfd_multiplier', 'is_tagged', 'rtbh_enabled', 'mac_address', 'bfd_interval', 'is_multi_hop', 'member_speed', 'ipv4_mask', 'geant_sid', 'encapsulation', 'ipv4_address', 'ipv6_mask', 'bfd_enabled', 'ap_type', 'send_default_route', 'is_passive', 'sbp_type', 'enable_lacp') """)) conn.execute(sa.text(""" -DELETE FROM product_product_blocks WHERE product_product_blocks.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Edge Port', 'Imported Edge Port')) AND product_product_blocks.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) +DELETE FROM product_product_blocks WHERE product_product_blocks.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported Edge Port', 'Edge Port')) AND product_product_blocks.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) """)) conn.execute(sa.text(""" -DELETE FROM product_product_blocks WHERE product_product_blocks.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('GÉANT IP', 'Imported GÉANT IP')) AND product_product_blocks.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('GeantIPBlock')) +DELETE FROM product_product_blocks WHERE product_product_blocks.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported IAS', 'Imported GÉANT IP', 'IAS', 'GÉANT IP')) AND product_product_blocks.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENL3CoreServiceBlock')) """)) conn.execute(sa.text(""" DELETE FROM product_block_relations WHERE product_block_relations.in_use_by_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_relations.depends_on_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('RouterBlock')) @@ -469,7 +499,7 @@ DELETE FROM product_block_relations WHERE product_block_relations.in_use_by_id I DELETE FROM product_block_relations WHERE product_block_relations.in_use_by_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) AND product_block_relations.depends_on_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortAEMemberBlock')) """)) conn.execute(sa.text(""" -DELETE FROM product_block_relations WHERE product_block_relations.in_use_by_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('GeantIPBlock')) AND product_block_relations.depends_on_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort')) +DELETE FROM product_block_relations WHERE product_block_relations.in_use_by_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENL3CoreServiceBlock')) AND product_block_relations.depends_on_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort')) """)) conn.execute(sa.text(""" DELETE FROM product_block_relations WHERE product_block_relations.in_use_by_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort')) AND product_block_relations.depends_on_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')) @@ -481,23 +511,26 @@ DELETE FROM product_block_relations WHERE product_block_relations.in_use_by_id I DELETE FROM product_block_relations WHERE product_block_relations.in_use_by_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('ServiceBindingPort')) AND product_block_relations.depends_on_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortBlock')) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instances WHERE subscription_instances.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('EdgePortAEMemberBlock', 'BGPSession', 'ServiceBindingPort', 'EdgePortBlock', 'NRENAccessPort', 'GeantIPBlock')) +DELETE FROM fixed_inputs WHERE fixed_inputs.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported IAS', 'Imported GÉANT IP', 'IAS', 'GÉANT IP')) AND fixed_inputs.name = 'nren_l3_core_service_type' + """)) + conn.execute(sa.text(""" +DELETE FROM subscription_instances WHERE subscription_instances.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('BGPSession', 'ServiceBindingPort', 'NRENAccessPort', 'EdgePortAEMemberBlock', 'NRENL3CoreServiceBlock', 'EdgePortBlock')) """)) conn.execute(sa.text(""" -DELETE FROM product_blocks WHERE product_blocks.name IN ('EdgePortAEMemberBlock', 'BGPSession', 'ServiceBindingPort', 'EdgePortBlock', 'NRENAccessPort', 'GeantIPBlock') +DELETE FROM product_blocks WHERE product_blocks.name IN ('BGPSession', 'ServiceBindingPort', 'NRENAccessPort', 'EdgePortAEMemberBlock', 'NRENL3CoreServiceBlock', 'EdgePortBlock') """)) conn.execute(sa.text(""" -DELETE FROM processes WHERE processes.pid IN (SELECT processes_subscriptions.pid FROM processes_subscriptions WHERE processes_subscriptions.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Edge Port', 'GÉANT IP', 'Imported Edge Port', 'Imported GÉANT IP')))) +DELETE FROM processes WHERE processes.pid IN (SELECT processes_subscriptions.pid FROM processes_subscriptions WHERE processes_subscriptions.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported IAS', 'Imported GÉANT IP', 'Imported Edge Port', 'Edge Port', 'IAS', 'GÉANT IP')))) """)) conn.execute(sa.text(""" -DELETE FROM processes_subscriptions WHERE processes_subscriptions.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Edge Port', 'GÉANT IP', 'Imported Edge Port', 'Imported GÉANT IP'))) +DELETE FROM processes_subscriptions WHERE processes_subscriptions.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported IAS', 'Imported GÉANT IP', 'Imported Edge Port', 'Edge Port', 'IAS', 'GÉANT IP'))) """)) conn.execute(sa.text(""" -DELETE FROM subscription_instances WHERE subscription_instances.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Edge Port', 'GÉANT IP', 'Imported Edge Port', 'Imported GÉANT IP'))) +DELETE FROM subscription_instances WHERE subscription_instances.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported IAS', 'Imported GÉANT IP', 'Imported Edge Port', 'Edge Port', 'IAS', 'GÉANT IP'))) """)) conn.execute(sa.text(""" -DELETE FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Edge Port', 'GÉANT IP', 'Imported Edge Port', 'Imported GÉANT IP')) +DELETE FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported IAS', 'Imported GÉANT IP', 'Imported Edge Port', 'Edge Port', 'IAS', 'GÉANT IP')) """)) conn.execute(sa.text(""" -DELETE FROM products WHERE products.name IN ('Edge Port', 'GÉANT IP', 'Imported Edge Port', 'Imported GÉANT IP') +DELETE FROM products WHERE products.name IN ('Imported IAS', 'Imported GÉANT IP', 'Imported Edge Port', 'Edge Port', 'IAS', 'GÉANT IP') """)) diff --git a/gso/products/product_blocks/edge_port.py b/gso/products/product_blocks/edge_port.py index c78719e23b830d33e28172b16e64dde5e3d185e0..7a7baf78f61451a95f59ac0d7cdf4c9f49a1df10 100644 --- a/gso/products/product_blocks/edge_port.py +++ b/gso/products/product_blocks/edge_port.py @@ -62,34 +62,34 @@ class EdgePortBlockInactive( ): """An edge port that's currently inactive. See :class:`EdgePortBlock`.""" - edge_port_node: RouterBlockInactive | None = None - edge_port_name: str | None = None + node: RouterBlockInactive | None = None + name: str | None = None edge_port_description: str | None = None - edge_port_enable_lacp: bool | None = None - edge_port_encapsulation: EncapsulationType = EncapsulationType.DOT1Q - edge_port_mac_address: str | None = None - edge_port_member_speed: PhysicalPortCapacity | None = None - edge_port_minimum_links: int | None = None + enable_lacp: bool | None = None + encapsulation: EncapsulationType = EncapsulationType.DOT1Q + mac_address: str | None = None + member_speed: PhysicalPortCapacity | None = None + minimum_links: int | None = None edge_port_type: EdgePortType | None = None - edge_port_ignore_if_down: bool = False - edge_port_geant_ga_id: str | None = None + ignore_if_down: bool = False + geant_ga_id: str | None = None edge_port_ae_members: LAGMemberList[EdgePortAEMemberBlockInactive] class EdgePortBlockProvisioning(EdgePortBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]): """An edge port that's being provisioned. See :class:`EdgePortBlock`.""" - edge_port_node: RouterBlockProvisioning - edge_port_name: str + node: RouterBlockProvisioning + name: str edge_port_description: str | None = None - edge_port_enable_lacp: bool - edge_port_encapsulation: EncapsulationType = EncapsulationType.DOT1Q - edge_port_mac_address: str | None = None - edge_port_member_speed: PhysicalPortCapacity - edge_port_minimum_links: int | None = None + enable_lacp: bool + encapsulation: EncapsulationType = EncapsulationType.DOT1Q + mac_address: str | None = None + member_speed: PhysicalPortCapacity + minimum_links: int | None = None edge_port_type: EdgePortType - edge_port_ignore_if_down: bool = False - edge_port_geant_ga_id: str | None = None + ignore_if_down: bool = False + geant_ga_id: str | None = None edge_port_ae_members: LAGMemberList[EdgePortAEMemberBlockProvisioning] # type: ignore[assignment] @@ -97,26 +97,26 @@ class EdgePortBlock(EdgePortBlockProvisioning, lifecycle=[SubscriptionLifecycle. """An edge port that's currently deployed in the network.""" #: The router that this edge port is connected to. - edge_port_node: RouterBlock + node: RouterBlock #: The name of the edge port, in our case, corresponds to the name of the :term:`LAG` interface. - edge_port_name: str + name: str #: A description of the edge port. edge_port_description: str | None = None #: Indicates whether :term:`LACP` is enabled for this edge port. - edge_port_enable_lacp: bool + enable_lacp: bool #: The type of encapsulation used on this edge port, by default DOT1Q. - edge_port_encapsulation: EncapsulationType = EncapsulationType.DOT1Q + encapsulation: EncapsulationType = EncapsulationType.DOT1Q #: The MAC address assigned to this edge port, if applicable. - edge_port_mac_address: str | None = None + mac_address: str | None = None #: The speed capacity of each member in the physical port. - edge_port_member_speed: PhysicalPortCapacity + member_speed: PhysicalPortCapacity #: The minimum number of links required for this edge port. - edge_port_minimum_links: int | None = None + minimum_links: int | None = None #: The type of edge port (e.g., customer, private, public). edge_port_type: EdgePortType #: If set to True, the edge port will be ignored if it is down. - edge_port_ignore_if_down: bool = False + ignore_if_down: bool = False #: The GEANT GA ID associated with this edge port, if any. - edge_port_geant_ga_id: str | None = None + geant_ga_id: str | None = None #: A list of :term:`LAG` members associated with this edge port. edge_port_ae_members: LAGMemberList[EdgePortAEMemberBlock] # type: ignore[assignment] diff --git a/gso/products/product_blocks/service_binding_port.py b/gso/products/product_blocks/service_binding_port.py index f88a2e2ccfb07260b84f59b4d641cbafdde884a9..540983821f64b86e5e3c11a9118ea8b867bff61d 100644 --- a/gso/products/product_blocks/service_binding_port.py +++ b/gso/products/product_blocks/service_binding_port.py @@ -31,7 +31,7 @@ class ServiceBindingPortInactive( ipv6_mask: IPV6Netmask | None = None custom_firewall_filters: bool | None = None geant_sid: str | None = None - sbp_bgp_session_list: list[BGPSessionInactive] = Field(default_factory=list) + bgp_session_list: list[BGPSessionInactive] = Field(default_factory=list) edge_port: EdgePortBlockInactive | None = None @@ -47,7 +47,7 @@ class ServiceBindingPortProvisioning(ServiceBindingPortInactive, lifecycle=[Subs ipv6_mask: IPV6Netmask | None = None custom_firewall_filters: bool geant_sid: str - sbp_bgp_session_list: list[BGPSessionProvisioning] # type: ignore[assignment] + bgp_session_list: list[BGPSessionProvisioning] # type: ignore[assignment] edge_port: EdgePortBlockProvisioning @@ -73,6 +73,6 @@ class ServiceBindingPort(ServiceBindingPortProvisioning, lifecycle=[Subscription #: The GÉANT service ID of this binding port. geant_sid: str #: The :term:`BGP` sessions associated with this service binding port. - sbp_bgp_session_list: list[BGPSession] # type: ignore[assignment] + bgp_session_list: list[BGPSession] # type: ignore[assignment] #: The Edge Port on which this :term:`SBP` resides. edge_port: EdgePortBlock