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

Commit

Permalink
update policy api with new policy lists
Browse files Browse the repository at this point in the history
  • Loading branch information
sbasan committed Oct 24, 2024
1 parent b0c4ffc commit 93b912c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
41 changes: 38 additions & 3 deletions catalystwan/api/policy_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
from catalystwan.endpoints.configuration.policy.list.ipv6_prefix import ConfigurationPolicyIPv6PrefixList
from catalystwan.endpoints.configuration.policy.list.local_app import ConfigurationPolicyLocalAppList, LocalAppListInfo
from catalystwan.endpoints.configuration.policy.list.local_domain import ConfigurationPolicyLocalDomainList
from catalystwan.endpoints.configuration.policy.list.media_profile import ConfigurationPolicyMediaProfileList
from catalystwan.endpoints.configuration.policy.list.mirror import ConfigurationPolicyMirrorList, MirrorListInfo
from catalystwan.endpoints.configuration.policy.list.policer import ConfigurationPolicyPolicerClassList, PolicerListInfo
from catalystwan.endpoints.configuration.policy.list.port import ConfigurationPolicyPortList, PortListInfo
Expand All @@ -84,6 +85,10 @@
from catalystwan.endpoints.configuration.policy.list.sla import ConfigurationPolicySLAClassList, SLAClassListInfo
from catalystwan.endpoints.configuration.policy.list.threat_grid_api_key import ConfigurationPolicyThreatGridApiKeyList
from catalystwan.endpoints.configuration.policy.list.tloc import ConfigurationPolicyTLOCList, TLOCListInfo
from catalystwan.endpoints.configuration.policy.list.translation_profile import (
ConfigurationPolicyTranslationProfileList,
)
from catalystwan.endpoints.configuration.policy.list.translation_rules import ConfigurationPolicyTranslationRulesList
from catalystwan.endpoints.configuration.policy.list.trunkgroup import ConfigurationPolicyTrunkGroupList
from catalystwan.endpoints.configuration.policy.list.umbrella_data import ConfigurationPolicyUmbrellaDataList
from catalystwan.endpoints.configuration.policy.list.url_allow_list import (
Expand Down Expand Up @@ -191,8 +196,11 @@
from catalystwan.models.policy.list.ips_signature import IPSSignatureListInfo
from catalystwan.models.policy.list.ipv6_prefix import IPv6PrefixListInfo
from catalystwan.models.policy.list.local_domain import LocalDomainListInfo
from catalystwan.models.policy.list.media_profile import MediaProfileList, MediaProfileListInfo
from catalystwan.models.policy.list.scalable_group_tag import ScalableGroupTagList, ScalableGroupTagListInfo
from catalystwan.models.policy.list.threat_grid_api_key import ThreatGridApiKeyList, ThreatGridApiKeyListInfo
from catalystwan.models.policy.list.translation_profile import TranslationProfileList, TranslationProfileListInfo
from catalystwan.models.policy.list.translation_rules import TranslationRulesList, TranslationRulesListInfo
from catalystwan.models.policy.list.trunkgroup import TrunkGroupList, TrunkGroupListInfo
from catalystwan.models.policy.list.umbrella_data import UmbrellaDataList, UmbrellaDataListInfo
from catalystwan.models.policy.localized import (
Expand Down Expand Up @@ -233,29 +241,32 @@
ExtendedCommunityList: ConfigurationPolicyExtendedCommunityList,
FQDNList: ConfigurationPolicyFQDNList,
GeoLocationList: ConfigurationPolicyGeoLocationList,
IdentityList: ConfigurationPolicyIdentityList,
IPSSignatureList: ConfigurationPolicyIPSSignatureList,
IPv6PrefixList: ConfigurationPolicyIPv6PrefixList,
LocalAppList: ConfigurationPolicyLocalAppList,
LocalDomainList: ConfigurationPolicyLocalDomainList,
MediaProfileList: ConfigurationPolicyMediaProfileList,
MirrorList: ConfigurationPolicyMirrorList,
PolicerList: ConfigurationPolicyPolicerClassList,
ScalableGroupTagList: ConfigurationPolicyScalableGroupTagList,
PortList: ConfigurationPolicyPortList,
PreferredColorGroupList: ConfigurationPreferredColorGroupList,
PrefixList: ConfigurationPolicyPrefixList,
ProtocolNameList: ConfigurationPolicyProtocolNameList,
RegionList: ConfigurationPolicyRegionList,
ScalableGroupTagList: ConfigurationPolicyScalableGroupTagList,
SiteList: ConfigurationPolicySiteList,
SLAClassList: ConfigurationPolicySLAClassList,
ThreatGridApiKeyList: ConfigurationPolicyThreatGridApiKeyList,
TLOCList: ConfigurationPolicyTLOCList,
TranslationProfileList: ConfigurationPolicyTranslationProfileList,
TranslationRulesList: ConfigurationPolicyTranslationRulesList,
TrunkGroupList: ConfigurationPolicyTrunkGroupList,
UmbrellaDataList: ConfigurationPolicyUmbrellaDataList,
URLBlockList: ConfigurationPolicyURLBlockList,
URLAllowList: ConfigurationPolicyURLAllowList,
URLBlockList: ConfigurationPolicyURLBlockList,
VPNList: ConfigurationPolicyVPNList,
ZoneList: ConfigurationPolicyZoneList,
IdentityList: ConfigurationPolicyIdentityList,
}

POLICY_DEFINITION_ENDPOINTS_MAP: Mapping[type, type] = {
Expand Down Expand Up @@ -485,6 +496,10 @@ def get(self, type: Type[LocalAppList]) -> DataSequence[LocalAppListInfo]:
def get(self, type: Type[LocalDomainList]) -> DataSequence[LocalDomainListInfo]:
...

@overload
def get(self, type: Type[MediaProfileList]) -> DataSequence[MediaProfileListInfo]:
...

@overload
def get(self, type: Type[MirrorList]) -> DataSequence[MirrorListInfo]:
...
Expand Down Expand Up @@ -529,6 +544,14 @@ def get(self, type: Type[ThreatGridApiKeyList]) -> DataSequence[ThreatGridApiKey
def get(self, type: Type[TLOCList]) -> DataSequence[TLOCListInfo]:
...

@overload
def get(self, type: Type[TranslationProfileList]) -> DataSequence[TranslationProfileListInfo]:
...

@overload
def get(self, type: Type[TranslationRulesList]) -> DataSequence[TranslationRulesListInfo]:
...

@overload
def get(self, type: Type[TrunkGroupList]) -> DataSequence[TrunkGroupListInfo]:
...
Expand Down Expand Up @@ -627,6 +650,10 @@ def get(self, type: Type[LocalAppList], id: UUID) -> LocalAppListInfo:
def get(self, type: Type[LocalDomainList], id: UUID) -> LocalDomainListInfo:
...

@overload
def get(self, type: Type[MediaProfileList], id: UUID) -> MediaProfileListInfo:
...

@overload
def get(self, type: Type[MirrorList], id: UUID) -> MirrorListInfo:
...
Expand Down Expand Up @@ -671,6 +698,14 @@ def get(self, type: Type[ThreatGridApiKeyList], id: UUID) -> ThreatGridApiKeyLis
def get(self, type: Type[TLOCList], id: UUID) -> TLOCListInfo:
...

@overload
def get(self, type: Type[TranslationProfileList], id: UUID) -> TranslationProfileListInfo:
...

@overload
def get(self, type: Type[TranslationRulesList], id: UUID) -> TranslationRulesListInfo:
...

@overload
def get(self, type: Type[TrunkGroupList], id: UUID) -> TrunkGroupListInfo:
...
Expand Down
8 changes: 8 additions & 0 deletions catalystwan/endpoints/endpoints_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
from catalystwan.endpoints.configuration.policy.list.ipv6_prefix import ConfigurationPolicyIPv6PrefixList
from catalystwan.endpoints.configuration.policy.list.local_app import ConfigurationPolicyLocalAppList
from catalystwan.endpoints.configuration.policy.list.local_domain import ConfigurationPolicyLocalDomainList
from catalystwan.endpoints.configuration.policy.list.media_profile import ConfigurationPolicyMediaProfileList
from catalystwan.endpoints.configuration.policy.list.mirror import ConfigurationPolicyMirrorList
from catalystwan.endpoints.configuration.policy.list.policer import ConfigurationPolicyPolicerClassList
from catalystwan.endpoints.configuration.policy.list.port import ConfigurationPolicyPortList
Expand All @@ -73,6 +74,10 @@
from catalystwan.endpoints.configuration.policy.list.site import ConfigurationPolicySiteList
from catalystwan.endpoints.configuration.policy.list.sla import ConfigurationPolicySLAClassList
from catalystwan.endpoints.configuration.policy.list.tloc import ConfigurationPolicyTLOCList
from catalystwan.endpoints.configuration.policy.list.translation_profile import (
ConfigurationPolicyTranslationProfileList,
)
from catalystwan.endpoints.configuration.policy.list.translation_rules import ConfigurationPolicyTranslationRulesList
from catalystwan.endpoints.configuration.policy.list.trunkgroup import ConfigurationPolicyTrunkGroupList
from catalystwan.endpoints.configuration.policy.list.url_allow_list import ConfigurationPolicyURLAllowList
from catalystwan.endpoints.configuration.policy.list.url_block_list import ConfigurationPolicyURLBlockList
Expand Down Expand Up @@ -129,6 +134,7 @@ def __init__(self, session: ManagerSession):
self.ipv6_prefix = ConfigurationPolicyIPv6PrefixList(session)
self.local_app = ConfigurationPolicyLocalAppList(session)
self.local_domain = ConfigurationPolicyLocalDomainList(session)
self.media_profile = ConfigurationPolicyMediaProfileList(session)
self.mirror = ConfigurationPolicyMirrorList(session)
self.policer = ConfigurationPolicyPolicerClassList(session)
self.port = ConfigurationPolicyPortList(session)
Expand All @@ -139,6 +145,8 @@ def __init__(self, session: ManagerSession):
self.site = ConfigurationPolicySiteList(session)
self.sla = ConfigurationPolicySLAClassList(session)
self.tloc = ConfigurationPolicyTLOCList(session)
self.translation_profile = ConfigurationPolicyTranslationProfileList(session)
self.translation_rules = ConfigurationPolicyTranslationRulesList(session)
self.trunkgroup = ConfigurationPolicyTrunkGroupList(session)
self.url_allow_list = ConfigurationPolicyURLAllowList(session)
self.url_block_list = ConfigurationPolicyURLBlockList(session)
Expand Down
6 changes: 6 additions & 0 deletions catalystwan/models/policy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from catalystwan.models.policy.list.ipv6_prefix import IPv6PrefixList, IPv6PrefixListInfo
from catalystwan.models.policy.list.local_app import LocalAppList, LocalAppListInfo
from catalystwan.models.policy.list.local_domain import LocalDomainList, LocalDomainListInfo
from catalystwan.models.policy.list.media_profile import MediaProfileList
from catalystwan.models.policy.list.mirror import MirrorList, MirrorListInfo
from catalystwan.models.policy.list.policer import PolicerList, PolicerListInfo
from catalystwan.models.policy.list.port import PortList, PortListInfo
Expand All @@ -41,6 +42,8 @@
from catalystwan.models.policy.list.sla import SLAClassList, SLAClassListInfo
from catalystwan.models.policy.list.threat_grid_api_key import ThreatGridApiKeyList, ThreatGridApiKeyListInfo
from catalystwan.models.policy.list.tloc import TLOCList, TLOCListInfo
from catalystwan.models.policy.list.translation_profile import TranslationProfileList
from catalystwan.models.policy.list.translation_rules import TranslationRulesList
from catalystwan.models.policy.list.trunkgroup import TrunkGroupList, TrunkGroupListInfo
from catalystwan.models.policy.list.umbrella_data import UmbrellaDataList, UmbrellaDataListInfo
from catalystwan.models.policy.list.url import URLAllowList, URLAllowListInfo, URLBlockList, URLBlockListInfo
Expand Down Expand Up @@ -136,6 +139,7 @@
IPv6PrefixList,
LocalAppList,
LocalDomainList,
MediaProfileList,
MirrorList,
PolicerList,
PortList,
Expand All @@ -148,6 +152,8 @@
SLAClassList,
ThreatGridApiKeyList,
TLOCList,
TranslationProfileList,
TranslationRulesList,
TrunkGroupList,
UmbrellaDataList,
URLAllowList,
Expand Down

0 comments on commit 93b912c

Please sign in to comment.