Skip to content
Snippets Groups Projects

Feature/update input form validation

Closed Karel van Klink requested to merge feature/update-input-form-validation into develop
All threads resolved!
Files
11
@@ -4,6 +4,7 @@ from typing import Optional
from orchestrator.domain.base import ProductBlockModel
from orchestrator.types import SubscriptionLifecycle, strEnum
from pydantic import ConstrainedInt
from gso.products.product_blocks.site import SiteBlock, SiteBlockInactive, SiteBlockProvisioning
@@ -12,20 +13,25 @@ class RouterVendor(strEnum):
"""Enumerator for the different product vendors that are supported."""
JUNIPER = "juniper"
"""Juniper routers."""
NOKIA = "nokia"
"""Nokia routers."""
class RouterRole(strEnum):
"""Enumerator for the different types of routers."""
P = "p"
"""P router."""
PE = "pe"
"""PE router."""
AMT = "amt"
"""AMT router."""
class PortNumber(ConstrainedInt):
"""Constrained integer for valid port numbers.
The range from 49152 to 65535 is marked as ephemeral, and can therefore not be selected for permanent allocation.
"""
gt = 0
le = 49151
class RouterBlockInactive(
@@ -34,7 +40,7 @@ class RouterBlockInactive(
"""A router that's being currently inactive. See {class}`RouterBlock`."""
router_fqdn: Optional[str] = None
router_ts_port: Optional[int] = None
router_ts_port: Optional[PortNumber] = None
router_access_via_ts: Optional[bool] = None
router_lo_ipv4_address: Optional[ipaddress.IPv4Address] = None
router_lo_ipv6_address: Optional[ipaddress.IPv6Address] = None
@@ -52,7 +58,7 @@ class RouterBlockProvisioning(RouterBlockInactive, lifecycle=[SubscriptionLifecy
"""A router that's being provisioned. See {class}`RouterBlock`."""
router_fqdn: str
router_ts_port: int
router_ts_port: PortNumber
router_access_via_ts: Optional[bool] = None
router_lo_ipv4_address: Optional[ipaddress.IPv4Address] = None
router_lo_ipv6_address: Optional[ipaddress.IPv6Address] = None
@@ -71,9 +77,8 @@ class RouterBlock(RouterBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTI
router_fqdn: str
"""{term}`FQDN` of a router."""
router_ts_port: int
"""The port of the terminal server that this router is connected to. Used for the same reason as mentioned
previously."""
router_ts_port: PortNumber
"""The port of the terminal server that this router is connected to. Used to offer out of band access."""
router_access_via_ts: bool
"""Whether this router should be accessed through the terminal server, or through its loopback address."""
router_lo_ipv4_address: ipaddress.IPv4Address
Loading