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

Commit

Permalink
Merge pull request #494 from CiscoDevNet/dev/featureprofile-system-en…
Browse files Browse the repository at this point in the history
…dpoints

Dev/featureprofile system endpoints
  • Loading branch information
jpkrajewski authored Feb 26, 2024
2 parents 1ecfc0d + 9c596d0 commit 7e821d3
Show file tree
Hide file tree
Showing 13 changed files with 547 additions and 27 deletions.
3 changes: 2 additions & 1 deletion catalystwan/api/api_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from catalystwan.api.config_device_inventory_api import ConfigurationDeviceInventoryAPI
from catalystwan.api.config_group_api import ConfigGroupAPI
from catalystwan.api.dashboard_api import DashboardAPI
from catalystwan.api.feature_profile_api import SDRoutingFeatureProfilesAPI
from catalystwan.api.feature_profile_api import SDRoutingFeatureProfilesAPI, SDWANFeatureProfilesAPI
from catalystwan.api.logs_api import LogsAPI
from catalystwan.api.omp_api import OmpAPI
from catalystwan.api.packet_capture_api import PacketCaptureAPI
Expand Down Expand Up @@ -64,3 +64,4 @@ def __init__(self, session: ManagerSession):
self.sessions = SessionsAPI(session)
self.policy = PolicyAPI(session)
self.sd_routing_feature_profiles = SDRoutingFeatureProfilesAPI(session)
self.sdwan_feature_profiles = SDWANFeatureProfilesAPI(session)
14 changes: 7 additions & 7 deletions catalystwan/api/configuration_groups/parcel.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ class _ParcelBase(BaseModel):
)
_parcel_data_key: str = PrivateAttr(default="data")

@classmethod
def _get_parcel_type(cls) -> str:
field_info = cls.model_fields.get("type_")
if field_info is not None:
return str(field_info.default)
raise CatalystwanException("Cannot obtain parcel type string")

@model_serializer(mode="wrap")
def envelope_parcel_data(self, handler: SerializerFunctionWrapHandler) -> Dict[str, Any]:
"""
Expand All @@ -67,6 +60,13 @@ def envelope_parcel_data(self, handler: SerializerFunctionWrapHandler) -> Dict[s
del model_dict[key]
return model_dict

@classmethod
def _get_parcel_type(cls) -> str:
field_info = cls.model_fields.get("type_")
if field_info is not None:
return str(field_info.default)
raise CatalystwanException("Field parcel type is not set.")


class OptionType(str, Enum):
GLOBAL = "global"
Expand Down
Loading

0 comments on commit 7e821d3

Please sign in to comment.