Page MenuHomeVyOS Platform

API for "show interfaces ethernet" does not include the interface description
Closed, ResolvedPublicBUG

Description

From the API, when I run the command "show interfaces ethernet", I don't see the provisioned description in the output:

root@pc:~# curl -ks --location --request POST 'https://172.31.255.6:1443/show' --form data='{"op": "show", "path": ["interfaces", "ethernet", "eth0", "brief"]}' --form key='api-key' | jq
{
  "success": true,
  "data": "Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down\nInterface        IP Address                        S/L  Description\n---------        ----------                        ---  -----------\neth0             192.168.254.90/24                 u/u  \n",
  "error": null
}

I expect the output to be the same as from the CLI:

vyos@vyos:~$ show interfaces ethernet
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface        IP Address                        S/L  Description
---------        ----------                        ---  -----------
eth0             192.168.254.90/24                 u/u  Internet Access
eth1             172.31.255.6/24                   u/u  Local Access

You can see in the API return values, the Description field is missing (although the header is there in the output). I would like to use the description field in the API results in a script, but cannot since the value is not returned via the API.

Details

Difficulty level
Easy (less than an hour)
Version
VyOS 1.4-rolling-202111090317
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

I notice my example of the API only focused on one interface (eth0), where the CLI (and the title showed all interfaces). Doesn't change the fact that in either case the API doesn't return data for the description.

jestabro changed the task status from Open to Confirmed.Thu, Nov 18, 4:12 PM

Thanks, I've confirmed the issue; I should have it resolved soon

One detail towards a resolution: if the vyos-http-api-server is started manually (without systemd) then the output is not truncated. If one wants to try this, one should configure 'set service https api' (to update Nginx config appropriately); then 'systemctl stop vyos-http-api'; then, as root:

root@vyos:/usr/libexec/vyos/services# ./vyos-http-api-server

So that narrows the investigation ...

jestabro changed the task status from Confirmed to Backport pending.Fri, Nov 19, 9:44 PM
jestabro triaged this task as Normal priority.
jestabro added a project: VyOS 1.3 Equuleus.
jestabro moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.
jestabro moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.