Page MenuHomeVyOS Platform

Return a dict when querying information about a single interface
Open, LowPublic

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

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Behavior change
Issue type
Behavior change