Skip to content

Bgp session

BGP session product block.

IPFamily

Bases: strEnum

Possible IP families of a BGP peering.

Source code in gso/products/product_blocks/bgp_session.py
@strawberry.enum
class IPFamily(strEnum):
    """Possible IP families of a BGP peering."""

    V4UNICAST = "ipv4"
    """Unicast IPv4"""
    V6UNICAST = "ipv6"
    """Unicast IPv6"""
    V4MULTICAST = "mcast-ipv4"
    """Multicast IPv4"""
    V6MULTICAST = "mcast-ipv6"
    """Multicast IPv6"""

V4UNICAST = 'ipv4' class-attribute instance-attribute

Unicast IPv4

V6UNICAST = 'ipv6' class-attribute instance-attribute

Unicast IPv6

V4MULTICAST = 'mcast-ipv4' class-attribute instance-attribute

Multicast IPv4

V6MULTICAST = 'mcast-ipv6' class-attribute instance-attribute

Multicast IPv6

IPTypes

Bases: strEnum

Possible IP types of a BGP peering.

Source code in gso/products/product_blocks/bgp_session.py
@strawberry.enum
class IPTypes(strEnum):
    """Possible IP types of a BGP peering."""

    IPV4 = "ipv4"
    """IPv4"""
    IPV6 = "ipv6"
    """IPv6"""

IPV4 = 'ipv4' class-attribute instance-attribute

IPv4

IPV6 = 'ipv6' class-attribute instance-attribute

IPv6

BGPSessionInactive

Bases: ProductBlockModel

A BGP session that is currently inactive. See BGPSession.

Source code in gso/products/product_blocks/bgp_session.py
class BGPSessionInactive(ProductBlockModel, lifecycle=[SubscriptionLifecycle.INITIAL], product_block_name="BGPSession"):
    """A BGP session that is currently inactive. See `BGPSession`."""

    peer_address: IPAddress | None = None
    families: list[IPFamily] = Field(default_factory=list)
    has_custom_policies: bool | None = None
    authentication_key: str | None = None
    multipath_enabled: bool | None = None
    send_default_route: bool | None = None
    is_multi_hop: bool = False
    is_passive: bool = False
    rtbh_enabled: bool = False
    bfd_enabled: bool = False
    ip_type: IPTypes | None = None
    prefix_limit: NonNegativeInt | None = None

BGPSessionProvisioning

Bases: BGPSessionInactive

A BGP session that is currently being provisioned. See BGPSession.

Source code in gso/products/product_blocks/bgp_session.py
class BGPSessionProvisioning(BGPSessionInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
    """A BGP session that is currently being provisioned. See `BGPSession`."""

    peer_address: IPAddress
    families: list[IPFamily]
    has_custom_policies: bool
    authentication_key: str | None
    multipath_enabled: bool
    send_default_route: bool
    is_multi_hop: bool
    is_passive: bool
    rtbh_enabled: bool
    bfd_enabled: bool
    ip_type: IPTypes
    prefix_limit: NonNegativeInt | None

BGPSession

Bases: BGPSessionProvisioning

A BGP session that is currently deployed in the network.

Attributes:

Name Type Description
peer_address IPAddress

The peering address of the session.

families list[IPFamily]

The list of IP families enabled for this session.

has_custom_policies bool

Whether any custom policies exist for this session.

authentication_key str | None

The authentication key of the BGP session.

multipath_enabled bool

Whether multi-path is enabled.

send_default_route bool

Whether we send a last resort route.

is_multi_hop bool

Whether this session is multi-hop or not. Defaults to no.

is_passive bool

Whether this is a passive session.

rtbh_enabled bool

Whether Remote Triggered Blackhole is enabled.

bfd_enabled bool

Settings for BFD.

ip_type IPTypes

The IP type of the session.

prefix_limit NonNegativeInt | None

A prefix limit, if required.

Source code in gso/products/product_blocks/bgp_session.py
class BGPSession(BGPSessionProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
    """A BGP session that is currently deployed in the network.

    Attributes:
        peer_address: The peering address of the session.
        families: The list of IP families enabled for this session.
        has_custom_policies: Whether any custom policies exist for this session.
        authentication_key: The authentication key of the BGP session.
        multipath_enabled: Whether multi-path is enabled.
        send_default_route: Whether we send a last resort route.
        is_multi_hop: Whether this session is multi-hop or not. Defaults to no.
        is_passive: Whether this is a passive session.
        rtbh_enabled: Whether Remote Triggered Blackhole is enabled.
        bfd_enabled: Settings for BFD.
        ip_type: The IP type of the session.
        prefix_limit: A prefix limit, if required.
    """

    peer_address: IPAddress
    families: list[IPFamily]
    has_custom_policies: bool
    authentication_key: str | None
    multipath_enabled: bool
    send_default_route: bool
    is_multi_hop: bool
    is_passive: bool
    rtbh_enabled: bool
    bfd_enabled: bool
    ip_type: IPTypes
    prefix_limit: NonNegativeInt | None