Page MenuHomeVyOS Platform

Return a dict when querying information about a single interface
Closed, ResolvedPublic

Description

Right now, the raw op mode API for show interfaces always returns a list, even when the request is about a single interface.

vyos@vyos# sudo /usr/libexec/vyos/op_mode/interfaces.py show_summary --raw --intf-name eth0
[
    {
        "ifname": "eth0",
        "oper_state": "up",
        "admin_state": "up",
        "addr": [
            "192.168.56.107/24"
        ],
        "description": "",
        "mtu": 1500,
        "mac": "08:00:27:64:ce:12",
        "vrf": null
    }
]

That's an annoyance from the client perspective since clients need to unwrap a single-item list.

Details

Version
-
Is it a breaking change?
Behavior change
Issue type
Feature (new functionality)

Event Timeline

vyosbot added a subscriber: HollyGurza.
dmbaturin changed Issue type from behavior-change to Feature (new functionality).Nov 27 2024, 6:48 PM
Viacheslav assigned this task to HollyGurza.
Viacheslav moved this task from Backport Candidates to Completed on the VyOS Rolling board.