otupy.profiles.nfm.data.interface.Interface

class Interface(name: str, description: str = None, if_id: int = None, ipv4_net: ArrayOf = None, ipv6_net: ArrayOf = None, mac_addr: MACAddr = None, iface_type: IfaceType = None, active: str = None)

Bases: Record

Describes a network interface including addresses, identifiers, and status.

Methods

fromdict

Builds instance from dictionary

todict

Converts to dictionary

validate_fields

Attributes

active

Link status (True = up, False = down)

description

Human-readable description of the interface

if_id

Internal interface index

iface_type

Layer 2 interface type

ipv4_net

List of assigned IPv4 addresses (with prefix)

ipv6_net

List of assigned IPv6 addresses (with prefix)

mac_addr

MAC address of the interface

name

Internal mnemonical name of the interface

__init__(name: str, description: str = None, if_id: int = None, ipv4_net: ArrayOf = None, ipv6_net: ArrayOf = None, mac_addr: MACAddr = None, iface_type: IfaceType = None, active: str = None)
active: str = None

Link status (True = up, False = down)

description: str = None

Human-readable description of the interface

classmethod fromdict(dic, e)

Builds instance from dictionary

It is used during deserialization to create an otupy instance from the text message. It takes an Encoder instance that is used to recursively build instances of the inner objects (the Encoder provides standard methods to create instances of base objects like strings, integers, boolean).

Parameters:
  • dic – The intermediary dictionary representation from which the object is built.

  • e – The Encoder that is being used.

Returns:

An instance of this class initialized from the dictionary values.

if_id: int = None

Internal interface index

iface_type: IfaceType = None

Layer 2 interface type

ipv4_net: ArrayOf = None

List of assigned IPv4 addresses (with prefix)

ipv6_net: ArrayOf = None

List of assigned IPv6 addresses (with prefix)

mac_addr: MACAddr = None

MAC address of the interface

name: str

Internal mnemonical name of the interface

todict(e)

Converts to dictionary

It is used to convert this object to an intermediary representation during serialization. It takes an Encoder argument that is used to recursively serialize inner data and structures (the Encoder provides standard methods for converting base types to dictionaries)..

Parameters:

e – The Encoder that is being used.

Returns:

A dictionary compliants to the Language Specification’s serialization rules.