Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Cover system parcels. Feature templates ux1 to System Parcels ux2#511

Merged
11 commits merged intodev-ux-migrationfrom
dev/templates-ux1-to-ux2
Mar 7, 2024
Merged

Cover system parcels. Feature templates ux1 to System Parcels ux2#511
11 commits merged intodev-ux-migrationfrom
dev/templates-ux1-to-ux2

Conversation

@ghost
Copy link

@ghost ghost commented Mar 6, 2024

Pull Request summary:

Port the Feature Templates to System models (UX2) in the codebase. This task is dependent on the template serialization mechanism implemented in pull request #505 (This fixes serialization problems for AAA and other templates). Therefore, it needs to be merged with pull request #505 to ensure compatibility and functionality coherence within the codebase.

Description of changes:

  • Add Template Converters
  • Refactor converters factory methods to be more clear
  • Delete recast module. Converters should take care of all data transformation
  • Add annotations for models fields that were missing in model API JSON schema

This PR is crucial for 3-step migration proccess.

  1. Collect UX1
  2. Transform (Transforms listed templates to UX2)
  3. Push UX2

Covered listed templates:

  • cisco_aaa
  • cedge_aaa
  • aaa
  • cisco_banner
  • cisco_security
  • security
  • security-vsmart
  • security-vedge
  • cisco_system
  • system-vsmart
  • system-vedge
  • cisco_bfd
  • bfd-vedge
  • cedge_global
  • cisco_logging
  • logging
  • cisco_omp
  • omp-vedge
  • omp-vsmart
  • cisco_ntp
  • ntp

Features Templates that are left but were not in System Models scope:

  • cisco_sig_credentials
  • virtual-application-utd
  • cedgeVoiceSIP
  • cisco_bgp
  • uc-voice-endpoint-map
  • dhcp-server
  • cisco_wireless_lan
  • vpn-vedge
  • cedgeVoiceSrst
  • vpn-vedge-interface
  • cisco_vpn
  • cisco_vpn_interface
  • cisco_secure_internet_gateway
  • cellular-cedge-controller
  • cedgeVoiceCard
  • vpn-vsmart
  • cisco_dhcp_server
  • appqoe
  • vpn-vedge-interface-cellular
  • vpn-cedge-interface-cellular
  • cellular-cedge-gps-controller
  • vpn-interface-svi
  • cisco_trustsec
  • switchport
  • bgp
  • cisco_thousandeyes
  • vpn-vsmart-interface
  • cli-template

Testing

Run this script to check create_parcel_from_template method.

import os
from catalystwan.utils.config_migration.converters.feature_template.factory_method import create_parcel_from_template
out_of_scope = [
    "cisco_sig_credentials",
    "virtual-application-utd",
    "cedgeVoiceSIP",
    "cisco_bgp",
    "uc-voice-endpoint-map",
    "dhcp-server",
    "cisco_wireless_lan",
    "vpn-vedge",
    "cedgeVoiceSrst",
    "vpn-vedge-interface",
    "cisco_vpn",
    "cisco_vpn_interface",
    "cisco_secure_internet_gateway",
    "cellular-cedge-controller",
    "cedgeVoiceCard",
    "vpn-vsmart",
    "cisco_dhcp_server",
    "appqoe",
    "vpn-vedge-interface-cellular",
    "vpn-cedge-interface-cellular",
    "cellular-cedge-gps-controller",
    "vpn-interface-svi",
    "cisco_trustsec",
    "switchport",
    "bgp",
    "cisco_thousandeyes",
    "vpn-vsmart-interface",
    "cli-template"
]
session = create_manager_session(
    url=os.environ.get("TEST_VMANAGE_URL"),
    port=os.environ.get("TEST_VMANAGE_PORT"),
    username=os.environ.get("TEST_VMANAGE_USERNAME"),
    password=os.environ.get("TEST_VMANAGE_PASSWORD"),
)
fts = session.api.templates.get_feature_templates()
for ft in fts:
    if ft.template_type in out_of_scope:
        continue
    create_parcel_from_template(ft)

Checklist:

  • Make sure to run pre-commit before committing changes
  • Make sure all checks have passed
  • PR description is clear and comprehensive
  • Mentioned the issue that this PR solves (if applicable)
  • Make sure you test the changes

@ghost ghost marked this pull request as ready for review March 6, 2024 17:42
@ghost ghost requested review from JimOverholt, bboot2, igosoft, kagrski and sbasan as code owners March 6, 2024 17:42
@ghost ghost changed the title Cover system models. Feature templates ux1 to System Parcels ux2 Cover system parcels. Feature templates ux1 to System Parcels ux2 Mar 7, 2024
@ghost ghost merged commit f8c524d into dev-ux-migration Mar 7, 2024
@ghost ghost deleted the dev/templates-ux1-to-ux2 branch March 7, 2024 11:59
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants