sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

[PoE] Add PoE CLI

Open SerhiyBoikoPLV opened this issue 1 year ago • 1 comments

What I did

  • Add show/config commands
  • Add UT
  • Update command reference

How I did it

Added ./config/plugins/poe.py that handles config commands:

  • config poe interface status <ifname> {enable|disable}
  • config poe interface priority <ifname> {low|high|crit}
  • config poe interface power-limit <ifname> <power>

Added ./show/plugins/poe.py that handles show commands:

  • show poe status
  • show poe pse status
  • show poe interface status [ifname]
  • show poe interface configuration [ifname]

Added ./tests/poe_test.py UT for the show commands.

How to verify it

Previous command output (if the output of a command-line utility has changed)

NA

New command output (if the output of a command-line utility has changed)

  • config commands example:
config poe interface status Ethernet0 enable
config poe interface priority Ethernet0 high
config poe interface power-limit Ethernet0 20.4
  • show poe status
  Id    PoE ports  Total power    Power consump    Power available    Power limit mode    HW info    Version
----  -----------  -------------  ---------------  -----------------  ------------------  ---------  ---------
   0            2  100.000 W      10.000 W         90.000 W           port                mcu1       0.1.2.3
   1            1  100.000 W      10.000 W         90.000 W           class               mcu2       0.1.2.3
  • show poe pse status
  Id  Status    Temperature    SW ver            HW ver
----  --------  -------------  ----------------  ----------------
   0  active    25.000 C       0.1.2.3           4.5.6.7
   1  active    25.000 C       0.1.2.3           4.5.6.7
   2  active    25.000 C       0.1.2.3           4.5.6.7
  • show poe interface status
Port         Status      En/Dis    Priority    Protocol          Class A    Class B  PWR Consump    PWR limit    Voltage    Current
-----------  ----------  --------  ----------  --------------  ---------  ---------  -------------  -----------  ---------  ---------
Ethernet0    delivering  enable    crit        802.3bt Type 3          2          4  10.000 W       50.000 W     50.000 V   0.200 A
Ethernet1    delivering  enable    high        802.3bt Type 3          2          4  10.000 W       50.000 W     50.000 V   0.200 A
Ethernet2    delivering  enable    low         802.3bt Type 3          2          4  10.000 W       50.000 W     50.000 V   0.200 A
  • show poe interface configuration
Port         En/Dis      Power limit  Priority
-----------  --------  -------------  ----------
Ethernet0    enable               50  crit
Ethernet1    enable               50  high
Ethernet2    enable               50  low

SerhiyBoikoPLV avatar Jul 19 '24 08:07 SerhiyBoikoPLV

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: vadym-hlushko / name: Vadym Hlushko (340ec8fefad04a59f3f71d86ea682e6ec95952fb)

@prgeor - could you help review this please?

matiAlfaro avatar Nov 26 '24 11:11 matiAlfaro

pls resolve conflicts.

FengPan-Frank avatar Dec 06 '24 08:12 FengPan-Frank

/azp run

mssonicbld avatar May 08 '25 12:05 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar May 08 '25 12:05 azure-pipelines[bot]