Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PoE] Add PoE CLI #3436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

SerhiyBoikoPLV
Copy link

@SerhiyBoikoPLV SerhiyBoikoPLV commented Jul 19, 2024

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.

yang model:

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

Copy link

linux-foundation-easycla bot commented Jul 19, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: vadym-hlushko / name: Vadym Hlushko (753119b)


# 'power-limit' subcommand ("config poe interface power-limit ...")
@poe_interface.command(
name="power-limit"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clarify if this CLIs will be available only in supported platforms

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CLI will be available on all platforms. If the platform does not support PoE the user will get an error message when trying to configure anything on an interface.

@matiAlfaro
Copy link
Contributor

@prgeor - could you help review this please?

@FengPan-Frank
Copy link
Contributor

pls resolve conflicts.

Add show/config commands
Add UT
Update command reference

Signed-off-by: vadym-hlushko <[email protected]>
Signed-off-by: Serhiy Boiko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants