Retrieves status and counter values from DUT.
def test_fun(duthosts, rand_one_dut_hostname):
duthost = duthosts[rand_one_dut_hostname]
interf_status = duthost.show_interface(command="status")
interf_counters = duthost.show_interface(command="counter")
command
- Whether interface statuses or counters are desired- Required:
True
- Type:
String
- Choices:
status
counter
- Required:
interfaces
- List of interface for facts to be gathered. If not defined facts are gathered for all interfaces- Required:
False
- Type:
List
- Element-Type:
String
- Element-Type:
- Default:
None
- Required:
namespace
- shows external interfaces for a specific ASIC's namespace- Required:
False
- Type:
String
- Default:
None
- Required:
include_internal_intfs
- Whether or not to include internal interfaces- Required:
False
- Type:
Boolean
- Default:
False
- Required:
Will return a dictionary describing either status or counters depending on argument provided.
The dictionary hierarchy is described below, with each indentation describing a sub-dictionary:
ansible_facts
- Dictionary that describes statusesint_status
- Dictionary that maps interface name to status info{INTERFACE_NAME}
- Dictionary containing status info on specified interfacename
- Name of interface, same as providedspeed
- Network speed of interfacealias
- Interface's local aliasvlan
- VLAN config typeoper_state
- oper statusadmin_state
- admin status
The dictionary hierarchy is described below, with each indentation describing a sub-dictionary:
ansible_facts
- Dictionary that describes countersint_counter
- Dictionary that maps interface name to counter info{INTERFACE_NAME}
- Dictionary containing counter info on specified interfaceIFACE
- name of interface, same as providedSTATE
- state of interfaceU
orD
RX_OK
- packets received okRX_DRP
- Packets received droppedRX_OVR
- Packets interface was unable to recieveTX_OK
- Packets correctly transmittedTX_ERR
- Packets incorrectly transmittedTX_DRP
- Dropped Packets transmittedTX_OVR
- Packets unable to be transmitted