Skip to content

[action] [PR:3906] Added json support intfutil#4023

Merged
mssonicbld merged 1 commit intosonic-net:202505from
mssonicbld:cherry/202505/3906
Aug 8, 2025
Merged

[action] [PR:3906] Added json support intfutil#4023
mssonicbld merged 1 commit intosonic-net:202505from
mssonicbld:cherry/202505/3906

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

What I did

Added json output supoort for

intfutil -c autoneg -j
intfutil -c fec -j
intfutil -c status -j
intfutil -c description -j
intfutil -c tpid -j
intfutil -c link_training -j

How I did it

How to verify it

admin@str-7060x6-64pe-stress-01:~$ intfutil -c status -i Ethernet0 -j
{
    "Ethernet0": {
        "Admin": "up",
        "Alias": "Ethernet1/1",
        "Asym PFC": "off",
        "FEC": "rs",
        "Lanes": "17",
        "MTU": "9100",
        "Oper": "up",
        "Speed": "100G",
        "Type": "OSFP 8X Pluggable Transceiver",
        "Vlan": "trunk"
    }
}
admin@str-7060x6-64pe-stress-01:~$ intfutil -c description -i Ethernet0 -j
{
    "Ethernet0": {
        "Admin": "up",
        "Alias": "Ethernet1/1",
        "Description": "Servers0:eth0",
        "Oper": "up"
    }
}
admin@str-7060x6-64pe-stress-01:~$ intfutil -c autoneg -i Ethernet0 -j
{
    "Ethernet0": {
        "Admin": "up",
        "Adv Speeds": "N/A",
        "Adv Types": "N/A",
        "Auto-Neg Mode": "N/A",
        "Oper": "up",
        "Rmt Adv Speeds": "N/A",
        "Speed": "100G",
        "Type": "N/A"
    }
}
admin@str-7060x6-64pe-stress-01:~$ intfutil -c tpid -i Ethernet0 -j
{
    "Ethernet0": {
        "Admin": "up",
        "Alias": "Ethernet1/1",
        "Oper": "up",
        "TPID": "0x8100"
    }
}
admin@str-7060x6-64pe-stress-01:~$ intfutil -c link_training -i Ethernet0 -j
{
    "Ethernet0": {
        "Admin": "up",
        "LT Admin": "N/A",
        "LT Oper": "N/A",
        "Oper": "up"
    }
}
admin@str-7060x6-64pe-stress-01:~$ intfutil -c fec -i Ethernet0 -j
{
    "Ethernet0": {
        "FEC Admin": "rs",
        "FEC Oper": "N/A"
    }
}

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

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

<!--
    Please make sure you've read and understood our contributing guidelines:
    https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

    ** Make sure all your commits include a signature generated with `git commit -s` **

    If this is a bug fix, make sure your description includes "closes #xxxx",
    "fixes #xxxx" or "resolves #xxxx" so that GitHub automatically closes the related
    issue when the PR is merged.

    If you are adding/modifying/removing any command or utility script, please also
    make sure to add/modify/remove any unit tests from the tests
    directory as appropriate.

    If you are modifying or removing an existing 'show', 'config' or 'sonic-clear'
    subcommand, or you are adding a new subcommand, please make sure you also
    update the Command Line Reference Guide (doc/Command-Reference.md) to reflect
    your changes.

    Please provide the following information:
-->

#### What I did
Added json output supoort for
```
intfutil -c autoneg -j
intfutil -c fec -j
intfutil -c status -j
intfutil -c description -j
intfutil -c tpid -j
intfutil -c link_training -j
```
#### How I did it

#### How to verify it
```
admin@str-7060x6-64pe-stress-01:~$ intfutil -c status -i Ethernet0 -j
{
    "Ethernet0": {
        "Admin": "up",
        "Alias": "Ethernet1/1",
        "Asym PFC": "off",
        "FEC": "rs",
        "Lanes": "17",
        "MTU": "9100",
        "Oper": "up",
        "Speed": "100G",
        "Type": "OSFP 8X Pluggable Transceiver",
        "Vlan": "trunk"
    }
}
admin@str-7060x6-64pe-stress-01:~$ intfutil -c description -i Ethernet0 -j
{
    "Ethernet0": {
        "Admin": "up",
        "Alias": "Ethernet1/1",
        "Description": "Servers0:eth0",
        "Oper": "up"
    }
}
admin@str-7060x6-64pe-stress-01:~$ intfutil -c autoneg -i Ethernet0 -j
{
    "Ethernet0": {
        "Admin": "up",
        "Adv Speeds": "N/A",
        "Adv Types": "N/A",
        "Auto-Neg Mode": "N/A",
        "Oper": "up",
        "Rmt Adv Speeds": "N/A",
        "Speed": "100G",
        "Type": "N/A"
    }
}
admin@str-7060x6-64pe-stress-01:~$ intfutil -c tpid -i Ethernet0 -j
{
    "Ethernet0": {
        "Admin": "up",
        "Alias": "Ethernet1/1",
        "Oper": "up",
        "TPID": "0x8100"
    }
}
admin@str-7060x6-64pe-stress-01:~$ intfutil -c link_training -i Ethernet0 -j
{
    "Ethernet0": {
        "Admin": "up",
        "LT Admin": "N/A",
        "LT Oper": "N/A",
        "Oper": "up"
    }
}
admin@str-7060x6-64pe-stress-01:~$ intfutil -c fec -i Ethernet0 -j
{
    "Ethernet0": {
        "FEC Admin": "rs",
        "FEC Oper": "N/A"
    }
}

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

#### New command output (if the output of a command-line utility has changed)
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: #3906

@mssonicbld
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 3a849b6 into sonic-net:202505 Aug 8, 2025
7 checks passed
kktheballer pushed a commit to kktheballer/sonic-utilities that referenced this pull request Jan 14, 2026
```<br>* d784b5e - (HEAD -> 202506) Merge branch '202505' of https://github.com/sonic-net/sonic-utilities into 202506 (2025-08-08) [Sonic Automation]
* 3a849b6 - (origin/202505) Added json support intfutil (sonic-net#4023) (2025-08-08) [mssonicbld]<br>```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant