Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

UX2 config push #105

Closed
5 tasks done
JimOverholt opened this issue Apr 25, 2024 · 1 comment
Closed
5 tasks done

UX2 config push #105

JimOverholt opened this issue Apr 25, 2024 · 1 comment

Comments

@JimOverholt
Copy link
Contributor

Pull Request summary:

  • Successfully pushed System and Other profiles, encompassing all associated parcels. This ensures comprehensive coverage of all parcels linked to these profiles during the push process.
  • Implemented a Pusher class responsible for pushing UX2Config and creating a corresponding Rollback class, enabling seamless reversion of changes when needed.
  • Introduced a ConfigRevert class for reverting configuration changes.
  • Implemented a factory for parcel pushing strategy to provide flexibility and maintainability.
  • Created a factory for API classes to manage different API endpoints efficiently.
  • Refactored methods to use more descriptive names: "get" became "get_parcels", "delete" became "delete_parcel", "update" became "update_parcel", and "post" became "post_parcel".
  • Update the type of subelements to a Set: We've observed UUID duplication issues where a Device Template includes multiple fields populated with the same feature template. This resulted in the same UUID being added to a list multiple times, causing errors when attempting to push the same parcel, leading to HTTP errors. By changing the type of subelements to a Set, we ensure that each UUID is unique within the list, resolving the duplication problem and preventing further HTTP errors during parcel pushing.

Video - Device Templates (ux1) migrated to Configuration Groups (ux2)

Recording.mp4

Test-script:

import logging
from catalystwan.session import create_manager_session
from catalystwan.workflows.config_migration import collect_ux1_config, push_ux2_config, rollback_ux2_config, transform

logging.basicConfig(
    filename="test.log",
    level=logging.DEBUG,
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
)
logger = logging.getLogger(__name__)
with create_manager_session(
    url="host", username="admin", password="password", port=443, logger=logger
) as session:

    config = collect_ux1_config(session)
    config2 = transform(config)
    rollback = push_ux2_config(session, config2)
    input("Press enter to continue...")
    rollback_ux2_config(session, rollback)

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
@JimOverholt
Copy link
Contributor Author

This issue was migrated from an old repository: CiscoDevNet/catalystwan#527

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant