From e1f0857f520e6627299c83c9bff5591b173bb5c9 Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Thu, 27 Jun 2024 09:05:19 -0400 Subject: [PATCH] updated docstring --- fabrictestbed_extensions/fablib/interface.py | 48 ++++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/fabrictestbed_extensions/fablib/interface.py b/fabrictestbed_extensions/fablib/interface.py index ebb02a5b..12a051b2 100644 --- a/fabrictestbed_extensions/fablib/interface.py +++ b/fabrictestbed_extensions/fablib/interface.py @@ -346,7 +346,8 @@ def get_peer_port_vlan(self) -> str: Returns the VLAN associated with the interface. For shared NICs extracts it from label_allocations. - :return VLAN to be used for Port Mirroring + :return: VLAN to be used for Port Mirroring + :rtype: String """ vlan = self.get_vlan() if not vlan: @@ -572,8 +573,8 @@ def set_vlan(self, vlan: Any = None): """ Set the VLAN on the FABRIC request. - :param addr: vlan - :type addr: String or int + :param vlan: vlan + :type vlan: String or int """ if vlan: vlan = str(vlan) @@ -997,6 +998,17 @@ def config(self): pass def add_mirror(self, port_name: str, name: str = "mirror", vlan: str = None): + """ + Add Port Mirror Service + + :param port_name: Mirror Port Name + :type port_name: String + :param vlan: Mirror Port vlan + :type vlan: String + :param name: Name of the Port Mirror service + :type name: String + + """ self.get_slice().get_fim_topology().add_port_mirror_service( name=name, from_interface_name=port_name, @@ -1042,6 +1054,12 @@ def set_subnet(self, ipv4_subnet: str = None, ipv6_subnet: str = None): raise e def get_subnet(self): + """ + Get Subnet associated with the interface + + :return: ipv4/ipv6 subnet associated with the interface + :rtype: String + """ if self.get_fim() and self.get_fim().labels: if self.get_fim().labels.ipv4_subnet: return self.get_fim().labels.ipv4_subnet @@ -1049,6 +1067,12 @@ def get_subnet(self): return self.get_fim().labels.ipv6_subnet def get_peer_subnet(self): + """ + Get Peer Subnet associated with the interface + + :return: peer ipv4/ipv6 subnet associated with the interface + :rtype: String + """ if self.get_fim() and self.get_fim().peer_labels: if self.get_fim().peer_labels.ipv4_subnet: return self.get_fim().peer_labels.ipv4_subnet @@ -1056,13 +1080,31 @@ def get_peer_subnet(self): return self.get_fim().peer_labels.ipv6_subnet def get_peer_asn(self): + """ + Get Peer ASN; Set only for Peered Interface using L3Peering via AL2S + + :return: peer asn + :rtype: String + """ if self.get_fim() and self.get_fim().peer_labels: return self.get_fim().peer_labels.asn def get_peer_bgp_key(self): + """ + Get Peer BGP Key; Set only for Peered Interface using L3Peering via AL2S + + :return: peer BGP Key + :rtype: String + """ if self.get_fim() and self.get_fim().peer_labels: return self.get_fim().peer_labels.bgp_key def get_peer_account_id(self): + """ + Get Peer Account Id associated with the interface + + :return: peer account id associated with the interface (Used when interface is peered to AWS via AL2S) + :rtype: String + """ if self.get_fim() and self.get_fim().peer_labels: return self.get_fim().peer_labels.account_id