Skip to content
Snippets Groups Projects
Commit f567b1c9 authored by Neda Moeini's avatar Neda Moeini
Browse files

Created Opengear product block and product type.

parent 4a7cb5c7
Branches
Tags
1 merge request!202Feature/nat 458 opengear domain model
Pipeline #86578 failed
"""Product block for :class:`Opengear` products."""
import ipaddress
from orchestrator.domain.base import ProductBlockModel
from orchestrator.types import SubscriptionLifecycle
from gso.products.product_blocks.site import (
SiteBlock,
SiteBlockInactive,
SiteBlockProvisioning,
)
class OpengearBlockInactive(
ProductBlockModel,
lifecycle=[SubscriptionLifecycle.INITIAL],
product_block_name="OpengearBlock",
):
"""An Opengear that's being currently inactive. See :class:`OpengearBlock`."""
opengear_hostname: str | None = None
opengear_site: SiteBlockInactive | None = None
opengear_wan_address: ipaddress.IPv4Address | None = None
opengear_wan_netmask: ipaddress.IPv4Address | None = None
opengear_wan_gateway: ipaddress.IPv4Address | None = None
class OpengearBlockProvisioning(OpengearBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""An Opengear that's being provisioned. See :class:`OpengearBlock`."""
opengear_hostname: str
opengear_site: SiteBlockProvisioning
opengear_wan_address: ipaddress.IPv4Address | None = None
opengear_wan_netmask: ipaddress.IPv4Address | None = None
opengear_wan_gateway: ipaddress.IPv4Address | None = None
class OpengearBlock(OpengearBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""An Opengear that's currently deployed in the network."""
opengear_hostname: str
opengear_site: SiteBlock
opengear_wan_address: ipaddress.IPv4Address
opengear_wan_netmask: ipaddress.IPv4Address
opengear_wan_gateway: ipaddress.IPv4Address
"""An Opengear product type."""
from orchestrator.domain.base import SubscriptionModel
from orchestrator.types import SubscriptionLifecycle
from gso.products.product_blocks.opengear import OpengearBlock, OpengearBlockInactive, OpengearBlockProvisioning
class OpengearInactive(SubscriptionModel, is_base=True):
"""An inactive Opengear."""
opengear: OpengearBlockInactive
class OpengearProvisioning(OpengearInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""An Opengear that is being provisioned."""
opengear: OpengearBlockProvisioning
class OpenGear(OpengearProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""An Opengear that is currently active."""
opengear: OpengearBlock
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment