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

Commit

Permalink
creating new radius and tacacs data classes (#815)
Browse files Browse the repository at this point in the history
* updating radius and tacacs data classes for new changes

* fix static

* fix static

* make vpn vpn id optional

* sub class

* match with parent class

* match with parent class

* match with parent class

* snake case

* description

* src checks

* src checks

* src checks
  • Loading branch information
nikhilkp93 authored Sep 6, 2024
1 parent 356ebf6 commit 13e8aa2
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions catalystwan/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,22 @@ class RadiusServer(DataclassBase):
address: str = field(metadata={FIELD_NAME: "address"})
auth_port: int = field(metadata={FIELD_NAME: "authPort"})
acct_port: int = field(metadata={FIELD_NAME: "acctPort"})
vpn: int = field(metadata={FIELD_NAME: "vpn"})
vpn_ip_subnet: str = field(metadata={FIELD_NAME: "vpnIpSubnet"})
vpn: Optional[int] = field(metadata={FIELD_NAME: "vpn", "description": "required field < 20.16"})
vpn_ip_subnet: Optional[str] = field(metadata={FIELD_NAME: "vpnIpSubnet", "description": "required field < 20.16"})
key: str = field(metadata={FIELD_NAME: "key"})
secret_key: str = field(metadata={FIELD_NAME: "secretKey"})
priority: int = field(metadata={FIELD_NAME: "priority"})


@define(frozen=True)
class ExtendedRadiusServer(RadiusServer):
"""
Extended RADIUS server with additional fields.
"""

source_vpn: Optional[int] = field(default=None, metadata={FIELD_NAME: "sourceVpn"})


@define(frozen=True)
class TenantRadiusServer(DataclassBase):
"""
Expand All @@ -479,13 +488,22 @@ class TacacsServer(DataclassBase):

address: str = field(metadata={FIELD_NAME: "address"})
auth_port: int = field(metadata={FIELD_NAME: "authPort"})
vpn: int = field(metadata={FIELD_NAME: "vpn"})
vpn_ip_subnet: str = field(metadata={FIELD_NAME: "vpnIpSubnet"})
vpn: Optional[int] = field(metadata={FIELD_NAME: "vpn", "description": "required field < 20.16"})
vpn_ip_subnet: Optional[str] = field(metadata={FIELD_NAME: "vpnIpSubnet", "description": "required field < 20.16"})
key: str = field(metadata={FIELD_NAME: "key"})
secret_key: str = field(metadata={FIELD_NAME: "secretKey"})
priority: int = field(metadata={FIELD_NAME: "priority"})


@define(frozen=True)
class ExtendedTacacsServer(TacacsServer):
"""
Extended TACACS server with additional fields.
"""

source_vpn: Optional[int] = field(default=None, metadata={FIELD_NAME: "sourceVpn"})


@define(frozen=True)
class TenantTacacsServer(DataclassBase):
"""
Expand Down

0 comments on commit 13e8aa2

Please sign in to comment.