From 7ab5ce331fe4d579a11f2ddf6954644acd76f308 Mon Sep 17 00:00:00 2001 From: Szymon Basan <116343782+sbasan@users.noreply.github.com> Date: Mon, 11 Nov 2024 14:47:44 +0100 Subject: [PATCH] ensure parcel entries are hashable so duplicates can be removed easily (#854) --- ENDPOINTS.md | 26 +++++++++---------- .../api/configuration_groups/parcel.py | 12 ++++++++- .../sdwan/policy_object/policy/app_probe.py | 4 +-- .../policy_object/policy/application_list.py | 8 +++--- .../sdwan/policy_object/policy/as_path.py | 6 ++--- .../sdwan/policy_object/policy/color_list.py | 6 ++--- .../sdwan/policy_object/policy/data_prefix.py | 6 ++--- .../policy/extended_community.py | 6 ++--- .../policy_object/policy/fowarding_class.py | 6 ++--- .../policy_object/policy/ipv6_data_prefix.py | 6 ++--- .../policy_object/policy/ipv6_prefix_list.py | 6 ++--- .../sdwan/policy_object/policy/mirror.py | 6 ++--- .../sdwan/policy_object/policy/policer.py | 10 +++---- .../policy/prefered_group_color.py | 4 +-- .../sdwan/policy_object/policy/prefix_list.py | 6 ++--- .../sdwan/policy_object/policy/sla_class.py | 4 +-- .../policy/standard_community.py | 6 ++--- .../sdwan/policy_object/policy/tloc_list.py | 6 ++--- .../security/application_list.py | 8 +++--- .../policy_object/security/data_prefix.py | 6 ++--- .../sdwan/policy_object/security/fqdn.py | 6 ++--- .../security/geolocation_list.py | 6 ++--- .../sdwan/policy_object/security/identity.py | 6 ++--- .../policy_object/security/ips_signature.py | 6 ++--- .../policy_object/security/local_domain.py | 6 ++--- .../policy_object/security/protocol_list.py | 6 ++--- .../security/scalable_group_tag.py | 6 ++--- .../policy_object/security/security_port.py | 6 ++--- .../sdwan/policy_object/security/url.py | 6 ++--- .../sdwan/policy_object/security/zone.py | 6 ++--- pyproject.toml | 2 +- 31 files changed, 110 insertions(+), 100 deletions(-) diff --git a/ENDPOINTS.md b/ENDPOINTS.md index 5ce762d7..bda8997c 100644 --- a/ENDPOINTS.md +++ b/ENDPOINTS.md @@ -1,6 +1,6 @@ **THIS FILE WAS AUTO-GENERATED DO NOT EDIT** -Generated for: catalystwan-0.36.0.dev3 +Generated for: catalystwan-0.36.0.dev5 All URIs are relative to */dataservice* HTTP request | Supported Versions | Method | Payload Type | Return Type | Tenancy Mode @@ -92,8 +92,8 @@ GET /v1/feature-profile/sdwan/system/{parcel_type}/schema|>=20.9|[**SystemFeatur GET /v1/feature-profile/sdwan/system|>=20.9|[**SystemFeatureProfile.get_sdwan_system_feature_profiles**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L38)|Optional[[**GetFeatureProfilesParams**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L128)]|DataSequence[[**FeatureProfileInfo**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L59)]| POST /v1/feature-profile/sdwan/system|>=20.9|[**SystemFeatureProfile.create_sdwan_system_feature_profile**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L45)|[**FeatureProfileCreationPayload**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L100)|[**FeatureProfileCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L113)| DELETE /v1/feature-profile/sdwan/system/{profile_id}|>=20.9|[**SystemFeatureProfile.delete_sdwan_system_feature_profile**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L52)||None| -POST /v1/feature-profile/sdwan/system/{profile_id}/aaa|>=20.9|[**SystemFeatureProfile.create_aaa_profile_parcel_for_system**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L57)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| -PUT /v1/feature-profile/sdwan/system/{profile_id}/aaa/{parcel_id}|>=20.9|[**SystemFeatureProfile.edit_aaa_profile_parcel_for_system**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L62)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| +POST /v1/feature-profile/sdwan/system/{profile_id}/aaa|>=20.9|[**SystemFeatureProfile.create_aaa_profile_parcel_for_system**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L57)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| +PUT /v1/feature-profile/sdwan/system/{profile_id}/aaa/{parcel_id}|>=20.9|[**SystemFeatureProfile.edit_aaa_profile_parcel_for_system**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L62)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| GET /v1/feature-profile/sdwan/system/{profile_id}/{parcel_type}|>=20.9|[**SystemFeatureProfile.get_all**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L67)||DataSequence[[**Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L152)]| GET /v1/feature-profile/sdwan/system/{profile_id}/{parcel_type}/{parcel_id}|>=20.9|[**SystemFeatureProfile.get_by_id**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L72)||[**Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L152)| GET /v1/feature-profile/sdwan/system/{profile_id}/aaa|>=20.9|[**SystemFeatureProfile.get_all_aaa**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L77)||DataSequence[[**Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L152)]| @@ -120,7 +120,7 @@ GET /v1/feature-profile/sdwan/system/{profile_id}/snmp|>=20.9|[**SystemFeaturePr GET /v1/feature-profile/sdwan/system/{profile_id}/snmp/{parcel_id}|>=20.9|[**SystemFeatureProfile.get_by_id_snmp**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L182)||[**Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L152)| PUT /v1/feature-profile/sdwan/system/{profile_id}/{parcel_type}/{parcel_id}|>=20.9|[**SystemFeatureProfile.update**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L187)|[**AAAParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/aaa.py#L264), [**BFDParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/bfd.py#L22), [**LoggingParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/logging_parcel.py#L74), [**BannerParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/banner.py#L12), [**BasicParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/basic.py#L116), [**DeviceAccessIPv4Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/device_access.py#L127), [**DeviceAccessIPv6Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/device_access_ipv6.py#L127), [**GlobalParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/global_parcel.py#L140), [**NtpParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/ntp.py#L90), [**MRFParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/mrf.py#L38), [**OMPParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/omp.py#L34), [**SecurityParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/security.py#L144), [**SNMPParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/snmp.py#L137)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| DELETE /v1/feature-profile/sdwan/system/{profile_id}/{parcel_type}/{parcel_id}|>=20.9|[**SystemFeatureProfile.delete**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L192)||None| -POST /v1/feature-profile/sdwan/system/{system_id}/bfd|>=20.9|[**SystemFeatureProfile.create_bfd_profile_parcel_for_system**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L197)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| +POST /v1/feature-profile/sdwan/system/{system_id}/bfd|>=20.9|[**SystemFeatureProfile.create_bfd_profile_parcel_for_system**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L197)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| POST /v1/feature-profile/sdwan/system/{profile_id}/{parcel_type}|>=20.9|[**SystemFeatureProfile.create**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/system.py#L202)|[**AAAParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/aaa.py#L264), [**BFDParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/bfd.py#L22), [**LoggingParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/logging_parcel.py#L74), [**BannerParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/banner.py#L12), [**BasicParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/basic.py#L116), [**DeviceAccessIPv4Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/device_access.py#L127), [**DeviceAccessIPv6Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/device_access_ipv6.py#L127), [**GlobalParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/global_parcel.py#L140), [**NtpParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/ntp.py#L90), [**MRFParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/mrf.py#L38), [**OMPParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/omp.py#L34), [**SecurityParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/security.py#L144), [**SNMPParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/system/snmp.py#L137)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| POST /v1/feature-profile/sdwan/topology|>=20.12|[**TopologyFeatureProfile.create_topology_feature_profile**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/topology.py#L23)|[**FeatureProfileCreationPayload**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L100)|[**FeatureProfileCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L113)| GET /v1/feature-profile/sdwan/topology|>=20.12|[**TopologyFeatureProfile.get_topology_feature_profiles**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/topology.py#L28)||DataSequence[[**FeatureProfileInfo**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L59)]| @@ -138,17 +138,17 @@ GET /v1/feature-profile/sdwan/transport|>=20.12|[**TransportFeatureProfile.get_t GET /v1/feature-profile/sdwan/transport/{profile_id}|>=20.12|[**TransportFeatureProfile.get_transport_feature_profile**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L46)||[**FeatureProfileDetail**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L74)| PUT /v1/feature-profile/sdwan/transport/{profile_id}|>=20.12|[**TransportFeatureProfile.edit_transport_feature_profile**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L51)|[**FeatureProfileEditPayload**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L108)|[**FeatureProfileCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L113)| DELETE /v1/feature-profile/sdwan/transport/{profile_id}|>=20.12|[**TransportFeatureProfile.delete_transport_feature_profile**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L58)||None| -POST /v1/feature-profile/sdwan/transport/{profile_id}/{parcel_type}|>=20.12|[**TransportFeatureProfile.create_transport_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L63)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| -POST /v1/feature-profile/sdwan/transport/{profile_id}/wan/vpn/{vpn_id}/{parcel_type}|>=20.12|[**TransportFeatureProfile.create_transport_vpn_sub_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L70)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| -POST /v1/feature-profile/sdwan/transport/{profile_id}/management/vpn/{vpn_id}/{parcel_type}|>=20.12|[**TransportFeatureProfile.create_management_vpn_sub_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L77)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| +POST /v1/feature-profile/sdwan/transport/{profile_id}/{parcel_type}|>=20.12|[**TransportFeatureProfile.create_transport_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L63)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| +POST /v1/feature-profile/sdwan/transport/{profile_id}/wan/vpn/{vpn_id}/{parcel_type}|>=20.12|[**TransportFeatureProfile.create_transport_vpn_sub_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L70)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| +POST /v1/feature-profile/sdwan/transport/{profile_id}/management/vpn/{vpn_id}/{parcel_type}|>=20.12|[**TransportFeatureProfile.create_management_vpn_sub_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L77)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| GET /v1/feature-profile/sdwan/transport/{profile_id}/{parcel_type}|>=20.12|[**TransportFeatureProfile.get_transport_parcels**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L84)||DataSequence[[**Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L152)]| GET /v1/feature-profile/sdwan/transport/{profile_id}/{parcel_type}/{parcel_id}|>=20.12|[**TransportFeatureProfile.get_transport_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L91)||[**Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L152)| -PUT /v1/feature-profile/sdwan/transport/{profile_id}/{parcel_type}/{parcel_id}|>=20.12|[**TransportFeatureProfile.update_transport_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L98)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| +PUT /v1/feature-profile/sdwan/transport/{profile_id}/{parcel_type}/{parcel_id}|>=20.12|[**TransportFeatureProfile.update_transport_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L98)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| GET /v1/feature-profile/sdwan/transport/{profile_id}/wan/vpn/{vpn_id}/{parcel_type}/{parcel_id}|>=20.12|[**TransportFeatureProfile.get_transport_vpn_sub_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L105)||[**Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L152)| GET /v1/feature-profile/sdwan/transport/{profile_id}/management/vpn/{vpn_id}/{parcel_type}/{parcel_id}|>=20.12|[**TransportFeatureProfile.get_management_vpn_sub_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L112)||[**Parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L152)| -PUT /v1/feature-profile/sdwan/transport/{profile_id}/wan/vpn/{vpn_id}/{parcel_type}/{parcel_id}|>=20.12|[**TransportFeatureProfile.update_transport_vpn_sub_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L119)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| -PUT /v1/feature-profile/sdwan/transport/{profile_id}/management/vpn/{vpn_id}/{parcel_type}/{parcel_id}|>=20.12|[**TransportFeatureProfile.update_management_vpn_sub_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L126)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| -POST /v1/feature-profile/sdwan/transport/{profile_id}/management/vpn|>=20.12|[**TransportFeatureProfile.create_management_vpn_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L136)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| +PUT /v1/feature-profile/sdwan/transport/{profile_id}/wan/vpn/{vpn_id}/{parcel_type}/{parcel_id}|>=20.12|[**TransportFeatureProfile.update_transport_vpn_sub_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L119)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| +PUT /v1/feature-profile/sdwan/transport/{profile_id}/management/vpn/{vpn_id}/{parcel_type}/{parcel_id}|>=20.12|[**TransportFeatureProfile.update_management_vpn_sub_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L126)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| +POST /v1/feature-profile/sdwan/transport/{profile_id}/management/vpn|>=20.12|[**TransportFeatureProfile.create_management_vpn_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L136)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| PUT /v1/feature-profile/sdwan/transport/{profile_id}/management/vpn/{parcel_id}|>=20.12|[**TransportFeatureProfile.edit_management_vpn_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L151)|[**ManagementVpnParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/sdwan/transport/vpn.py#L166)|[**ParcelCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L199)| DELETE /v1/feature-profile/sdwan/transport/{profile_id}/management/vpn/{parcel_id}|>=20.12|[**TransportFeatureProfile.delete_management_vpn_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L158)||None| GET /v1/feature-profile/sdwan/transport|>=20.9|[**TransportFeatureProfile.get_sdwan_transport_feature_profiles**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration/feature_profile/sdwan/transport.py#L163)|Optional[[**GetFeatureProfilesParams**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L128)]|DataSequence[[**FeatureProfileInfo**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L59)]| @@ -724,8 +724,8 @@ DELETE /v1/feature-profile/sdwan/transport/{transport_id}|>=20.9|[**Configuratio GET /v1/feature-profile/sdwan/system|>=20.9|[**ConfigurationFeatureProfile.get_sdwan_system_feature_profiles**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L67)|Optional[[**GetFeatureProfilesPayload**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L32)]|DataSequence[[**FeatureProfileInfo**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L59)]| POST /v1/feature-profile/sdwan/system|>=20.9|[**ConfigurationFeatureProfile.create_sdwan_system_feature_profile**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L74)|[**FeatureProfileCreationPayload**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L100)|[**FeatureProfileCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L113)| DELETE /v1/feature-profile/sdwan/system/{system_id}|>=20.9|[**ConfigurationFeatureProfile.delete_sdwan_system_feature_profile**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L81)||None| -POST /v1/feature-profile/sdwan/system/{system_id}/aaa|>=20.9|[**ConfigurationFeatureProfile.create_aaa_profile_parcel_for_system**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L86)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| -POST /v1/feature-profile/sdwan/transport/{transport_id}/cellular-controller|>=20.9|[**ConfigurationFeatureProfile.create_cellular_controller_profile_parcel_for_transport**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L91)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L24)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| +POST /v1/feature-profile/sdwan/system/{system_id}/aaa|>=20.9|[**ConfigurationFeatureProfile.create_aaa_profile_parcel_for_system**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L86)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| +POST /v1/feature-profile/sdwan/transport/{transport_id}/cellular-controller|>=20.9|[**ConfigurationFeatureProfile.create_cellular_controller_profile_parcel_for_transport**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L91)|[**_ParcelBase**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/configuration_groups/parcel.py#L29)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| GET /v1/feature-profile/sdwan|>=20.9|[**ConfigurationFeatureProfile.get_sdwan_feature_profiles**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L98)||DataSequence[[**FeatureProfileInfo**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L59)]| POST /v1/feature-profile/sd-routing/cli|>=20.12|[**SDRoutingConfigurationFeatureProfile.create_cli_feature_profile**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L105)|[**FeatureProfileCreationPayload**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L100)|[**FeatureProfileCreationResponse**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/common.py#L113)| POST /v1/feature-profile/sd-routing/cli/{cli_fp_id}/full-config|>=20.12|[**SDRoutingConfigurationFeatureProfile.create_cli_full_config_parcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/endpoints/configuration_feature_profile.py#L110)|[**FullConfigParcel**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/feature_profile_parcel.py#L12)|[**ParcelId**](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/models/configuration/feature_profile/parcel.py#L210)| diff --git a/catalystwan/api/configuration_groups/parcel.py b/catalystwan/api/configuration_groups/parcel.py index 4be1822d..ea0e05d3 100644 --- a/catalystwan/api/configuration_groups/parcel.py +++ b/catalystwan/api/configuration_groups/parcel.py @@ -1,6 +1,6 @@ # Copyright 2024 Cisco Systems, Inc. and its affiliates -from typing import Any, Dict, Generic, List, Literal, Optional, Tuple, TypeVar +from typing import Any, Dict, Generic, List, Literal, Optional, Sequence, Tuple, TypeVar from pydantic import ( AliasPath, @@ -21,6 +21,11 @@ T = TypeVar("T") +class _ParcelEntry(BaseModel): + def __hash__(self) -> int: + return hash(self.model_dump_json()) + + class _ParcelBase(BaseModel): model_config = ConfigDict( extra="allow", arbitrary_types_allowed=True, populate_by_name=True, json_schema_mode_override="validation" @@ -39,6 +44,7 @@ class _ParcelBase(BaseModel): description="Set the parcel description", ) data: Optional[Any] = None + entries: Optional[Sequence[_ParcelEntry]] = Field(default=None, validation_alias=AliasPath("data", "entries")) _parcel_data_key: str = PrivateAttr(default="data") @model_serializer(mode="wrap") @@ -80,6 +86,10 @@ def _get_parcel_type(cls) -> str: return str(field_info.default) raise CatalystwanException(f"{cls.__name__} field parcel type is not set.") + def remove_duplicated_entries(self) -> None: + if self.entries: + self.entries = list(set(self.entries)) + # https://github.com/pydantic/pydantic/discussions/6090 # Usage: Global[str](value="test") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/app_probe.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/app_probe.py index 04566ebe..1393c16f 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/app_probe.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/app_probe.py @@ -5,7 +5,7 @@ from pydantic import AliasPath, BaseModel, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global, as_optional_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global, as_optional_global from catalystwan.models.common import TLOCColor from catalystwan.models.configuration.feature_profile.common import RefIdItem @@ -15,7 +15,7 @@ class AppProbeMapItem(BaseModel): dscp: Optional[Global[int]] = Field(default=None) -class AppProbeEntry(BaseModel): +class AppProbeEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) map: List[AppProbeMapItem] = Field(default_factory=list) forwarding_class: Union[Global[str], RefIdItem] = Field( diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/application_list.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/application_list.py index 41c246d9..814ba174 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/application_list.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/application_list.py @@ -2,17 +2,17 @@ from typing import List, Literal, Union -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class ApplicationListEntry(BaseModel): +class ApplicationListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) app_list: Global[str] = Field(serialization_alias="app", validation_alias="app") -class ApplicationFamilyListEntry(BaseModel): +class ApplicationFamilyListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) app_list_family: Global[str] = Field(serialization_alias="appFamily", validation_alias="appFamily") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/as_path.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/as_path.py index 155e82e2..1bff470d 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/as_path.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/as_path.py @@ -2,12 +2,12 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class AsPathEntry(BaseModel): +class AsPathEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) as_path: Global[str] = Field(validation_alias="asPath", serialization_alias="asPath") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/color_list.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/color_list.py index cbae3939..2e5ea5ae 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/color_list.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/color_list.py @@ -2,13 +2,13 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global from catalystwan.models.common import TLOCColor -class ColorEntry(BaseModel): +class ColorEntry(_ParcelEntry): color: Global[TLOCColor] diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/data_prefix.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/data_prefix.py index 2965850f..9da7ae68 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/data_prefix.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/data_prefix.py @@ -3,12 +3,12 @@ from ipaddress import IPv4Address, IPv4Network from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class DataPrefixEntry(BaseModel): +class DataPrefixEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) ipv4_address: Global[IPv4Address] = Field(serialization_alias="ipv4Address", validation_alias="ipv4Address") ipv4_prefix_length: Global[int] = Field(serialization_alias="ipv4PrefixLength", validation_alias="ipv4PrefixLength") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/extended_community.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/extended_community.py index 127a026f..62b3ed75 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/extended_community.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/extended_community.py @@ -3,12 +3,12 @@ from ipaddress import IPv4Address from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class ExtendedCommunityEntry(BaseModel): +class ExtendedCommunityEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) extended_community: Global[str] = Field(serialization_alias="extCommunity", validation_alias="extCommunity") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/fowarding_class.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/fowarding_class.py index 787317ec..097558d7 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/fowarding_class.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/fowarding_class.py @@ -2,12 +2,12 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field, field_validator +from pydantic import AliasPath, ConfigDict, Field, field_validator -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class FowardingClassQueueEntry(BaseModel): +class FowardingClassQueueEntry(_ParcelEntry): queue: Global[str] @field_validator("queue") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/ipv6_data_prefix.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/ipv6_data_prefix.py index 9e15671e..ed91d265 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/ipv6_data_prefix.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/ipv6_data_prefix.py @@ -3,12 +3,12 @@ from ipaddress import IPv6Address, IPv6Interface from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class IPv6DataPrefixEntry(BaseModel): +class IPv6DataPrefixEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) ipv6_address: Global[IPv6Address] = Field(serialization_alias="ipv6Address", validation_alias="ipv6Address") ipv6_prefix_length: Global[int] = Field(serialization_alias="ipv6PrefixLength", validation_alias="ipv6PrefixLength") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/ipv6_prefix_list.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/ipv6_prefix_list.py index ee335313..8999c067 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/ipv6_prefix_list.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/ipv6_prefix_list.py @@ -3,12 +3,12 @@ from ipaddress import IPv6Address, IPv6Interface from typing import List, Literal, Optional -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class IPv6PrefixListEntry(BaseModel): +class IPv6PrefixListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) ipv6_address: Global[IPv6Address] = Field(serialization_alias="ipv6Address", validation_alias="ipv6Address") ipv6_prefix_length: Global[int] = Field( diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/mirror.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/mirror.py index daef268b..84636554 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/mirror.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/mirror.py @@ -2,13 +2,13 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field from pydantic.networks import IPvAnyAddress -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class MirrorEntry(BaseModel): +class MirrorEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) remote_dest_ip: Global[str] = Field(validation_alias="remoteDestIp", serialization_alias="remoteDestIp") source_ip: Global[str] = Field(validation_alias="sourceIp", serialization_alias="sourceIp") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/policer.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/policer.py index d9ce714f..024cb7d3 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/policer.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/policer.py @@ -2,13 +2,13 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field, field_validator +from pydantic import AliasPath, ConfigDict, Field, field_validator -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global from catalystwan.models.policy.list.policer import PolicerExceedAction -class PolicerEntry(BaseModel): +class PolicerEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) burst: Global[int] exceed: Global[PolicerExceedAction] @@ -16,13 +16,13 @@ class PolicerEntry(BaseModel): @field_validator("burst") @classmethod - def check_burst(cls, burst_str: Global): + def check_burst(cls, burst_str: Global[int]): assert 15000 <= burst_str.value <= 10_000_000 return burst_str @field_validator("rate") @classmethod - def check_rate(cls, rate_str: Global): + def check_rate(cls, rate_str: Global[int]): assert 8 <= rate_str.value <= 100_000_000_000 return rate_str diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/prefered_group_color.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/prefered_group_color.py index 9fd7ba65..25c3490d 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/prefered_group_color.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/prefered_group_color.py @@ -4,7 +4,7 @@ from pydantic import AliasPath, BaseModel, ConfigDict, Field, field_validator, model_validator -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global from catalystwan.models.common import TLOCColor PathPreference = Literal[ @@ -24,7 +24,7 @@ class Preference(BaseModel): ) -class PreferredColorGroupEntry(BaseModel): +class PreferredColorGroupEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) primary_preference: Preference = Field( serialization_alias="primaryPreference", validation_alias="primaryPreference" diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/prefix_list.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/prefix_list.py index a0c32de4..a7f38b42 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/prefix_list.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/prefix_list.py @@ -3,12 +3,12 @@ from ipaddress import IPv4Address, IPv4Network from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class PrefixListEntry(BaseModel): +class PrefixListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) ipv4_address: Global[IPv4Address] = Field(serialization_alias="ipv4Address", validation_alias="ipv4Address") ipv4_prefix_length: Global[int] = Field(serialization_alias="ipv4PrefixLength", validation_alias="ipv4PrefixLength") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/sla_class.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/sla_class.py index 1e9a79c6..ca3b00a6 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/sla_class.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/sla_class.py @@ -5,7 +5,7 @@ from pydantic import AliasPath, BaseModel, ConfigDict, Field, field_validator -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global from catalystwan.models.common import SLAClassCriteria from catalystwan.models.configuration.feature_profile.common import RefIdItem @@ -73,7 +73,7 @@ def add_criteria( raise ValueError(f"Criteria {e} is not in configured criteria {self.criteria.value}") -class SLAClassListEntry(BaseModel): +class SLAClassListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) latency: Optional[Global[int]] = None diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/standard_community.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/standard_community.py index 0b84d4c1..d670063c 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/standard_community.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/standard_community.py @@ -2,13 +2,13 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global from catalystwan.models.common import WellKnownBGPCommunities -class StandardCommunityEntry(BaseModel): +class StandardCommunityEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) standard_community: Global[str] = Field( serialization_alias="standardCommunity", validation_alias="standardCommunity" diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/tloc_list.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/tloc_list.py index 8d6c5333..a086f78e 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/tloc_list.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/tloc_list.py @@ -3,13 +3,13 @@ from ipaddress import IPv4Address from typing import List, Literal, Optional -from pydantic import AliasPath, BaseModel, ConfigDict, Field, field_validator +from pydantic import AliasPath, ConfigDict, Field, field_validator -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global from catalystwan.models.common import EncapType, TLOCColor -class TlocEntry(BaseModel): +class TlocEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) tloc: Global[IPv4Address] color: Global[TLOCColor] diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/application_list.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/application_list.py index f7ae1eba..2ea2eefd 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/application_list.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/application_list.py @@ -2,17 +2,17 @@ from typing import List, Literal, Union -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class SecurityApplicationListEntry(BaseModel): +class SecurityApplicationListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) app_list: Global[str] = Field(serialization_alias="app", validation_alias="app") -class SecurityApplicationFamilyListEntry(BaseModel): +class SecurityApplicationFamilyListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) app_list_family: Global[str] = Field(serialization_alias="appFamily", validation_alias="appFamily") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/data_prefix.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/data_prefix.py index 17ffe44d..c98cd3b7 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/data_prefix.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/data_prefix.py @@ -3,12 +3,12 @@ from ipaddress import IPv4Network from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class SecurityDataPrefixEntry(BaseModel): +class SecurityDataPrefixEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) ip_prefix: Global[IPv4Network] = Field(serialization_alias="ipPrefix", validation_alias="ipPrefix") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/fqdn.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/fqdn.py index bce46b3f..3c81ac25 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/fqdn.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/fqdn.py @@ -2,12 +2,12 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class FQDNListEntry(BaseModel): +class FQDNListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) pattern: Global[str] = Field( description="Ex: cisco.com, .*cisco.com, .*.cisco.com. Should not start with '*' or '+'" diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/geolocation_list.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/geolocation_list.py index ccf3153c..7a3a0f33 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/geolocation_list.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/geolocation_list.py @@ -2,13 +2,13 @@ from typing import List, Literal, Optional -from pydantic import AliasPath, BaseModel, ConfigDict, Field, model_validator +from pydantic import AliasPath, ConfigDict, Field, model_validator -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global from catalystwan.models.common import check_fields_exclusive -class GeoLocationListEntry(BaseModel): +class GeoLocationListEntry(_ParcelEntry): country: Optional[Global[str]] = Field(default=None, description="ISO-3166 alpha-3 country code eg: FRA") continent: Optional[Global[str]] = Field( default=None, description="One of 2-letter continent codes: AF, NA, OC, AN, AS, EU, SA" diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/identity.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/identity.py index 6afe702a..8f6e9538 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/identity.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/identity.py @@ -1,11 +1,11 @@ from typing import List, Literal, Optional -from pydantic import AliasPath, BaseModel, Field +from pydantic import AliasPath, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_optional_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_optional_global -class IdentityEntry(BaseModel): +class IdentityEntry(_ParcelEntry): user: Optional[Global[str]] = Field(default=None) user_group: Optional[Global[str]] = Field( default=None, validation_alias="userGroup", serialization_alias="userGroup" diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/ips_signature.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/ips_signature.py index 82d5e2e9..dab79c13 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/ips_signature.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/ips_signature.py @@ -2,12 +2,12 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field, field_validator +from pydantic import AliasPath, ConfigDict, Field, field_validator -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class IPSSignatureListEntry(BaseModel): +class IPSSignatureListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) generator_id: Global[str] = Field( serialization_alias="generatorId", validation_alias="generatorId", description="Range 0 to 4294967295" diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/local_domain.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/local_domain.py index b686edc3..6df2ab33 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/local_domain.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/local_domain.py @@ -2,12 +2,12 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class LocalDomainListEntry(BaseModel): +class LocalDomainListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) name_server: Global[str] = Field( serialization_alias="nameServer", validation_alias="nameServer", description="Ex: cisco.com, *.cisco.com" diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/protocol_list.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/protocol_list.py index 28ad06a9..e8611f12 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/protocol_list.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/protocol_list.py @@ -2,12 +2,12 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class ProtocolListEntry(BaseModel): +class ProtocolListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) protocol: Global[str] = Field(serialization_alias="protocolName", validation_alias="protocolName") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/scalable_group_tag.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/scalable_group_tag.py index d440c691..1ed61211 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/scalable_group_tag.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/scalable_group_tag.py @@ -1,11 +1,11 @@ from typing import List, Literal, Optional -from pydantic import AliasPath, BaseModel, Field +from pydantic import AliasPath, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_optional_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_optional_global -class ScalableGroupTagEntry(BaseModel): +class ScalableGroupTagEntry(_ParcelEntry): sgt_name: Optional[Global[str]] = Field(default=None, validation_alias="sgtName", serialization_alias="sgtName") tag: Optional[Global[str]] = Field(default=None) diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/security_port.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/security_port.py index 970bdfb4..bf1570a3 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/security_port.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/security_port.py @@ -2,12 +2,12 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field, field_validator +from pydantic import AliasPath, ConfigDict, Field, field_validator -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class SecurityPortListEntry(BaseModel): +class SecurityPortListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) port: Global[str] = Field(description="Ex: 1 or 1-10 by range. Range 0 to 65530") diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/url.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/url.py index 5704738d..ae097c08 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/url.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/url.py @@ -2,12 +2,12 @@ from typing import List, Literal -from pydantic import AliasPath, BaseModel, ConfigDict, Field +from pydantic import AliasPath, ConfigDict, Field -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global -class BaseURLListEntry(BaseModel): +class BaseURLListEntry(_ParcelEntry): model_config = ConfigDict(populate_by_name=True) pattern: Global[str] diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/zone.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/zone.py index b7427035..348c7a3b 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/zone.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/security/zone.py @@ -2,13 +2,13 @@ from typing import List, Literal, Optional -from pydantic import AliasPath, BaseModel, ConfigDict, Field, field_validator, model_validator +from pydantic import AliasPath, ConfigDict, Field, field_validator, model_validator -from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, as_global +from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase, _ParcelEntry, as_global from catalystwan.models.common import InterfaceStr, check_fields_exclusive -class SecurityZoneListEntry(BaseModel): +class SecurityZoneListEntry(_ParcelEntry): vpn: Optional[Global[str]] = Field(default=None, description="0-65530 single number") interface: Optional[Global[InterfaceStr]] = None diff --git a/pyproject.toml b/pyproject.toml index 94dd7f1a..86eaa069 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "catalystwan" -version = "0.36.0dev4" +version = "0.36.0dev5" description = "Cisco Catalyst WAN SDK for Python" authors = ["kagorski "] readme = "README.md"