diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-03-10 18:04:31 +0000 |
|---|---|---|
| committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-03-11 15:14:06 +0000 |
| commit | 4d6603e150fd2254a8fb8f6d7d2b3369cc8afbd7 (patch) | |
| tree | f30f8c8dfe83d08afcec0528d974f5fc48708d39 /src | |
| parent | 44e5e9f0b26ce496b04f603bb68c82ecf01dc54a (diff) | |
| download | vyos-1x-4d6603e150fd2254a8fb8f6d7d2b3369cc8afbd7.tar.gz vyos-1x-4d6603e150fd2254a8fb8f6d7d2b3369cc8afbd7.zip | |
T8371: VPP add op-mode command show runtime
Diffstat (limited to 'src')
| -rwxr-xr-x | src/op_mode/vpp.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/op_mode/vpp.py b/src/op_mode/vpp.py index f108392fb..6ce7eed6e 100755 --- a/src/op_mode/vpp.py +++ b/src/op_mode/vpp.py @@ -344,6 +344,22 @@ class VPPShow: return data.reply + # ----------------------------- + # Runtime table + # ----------------------------- + def _get_runtime_raw(self): + # VPP does not have API call to get this data + data = self.vpp.cli_cmd('show runtime') + return [data.reply] + + def _show_runtime_formatted(self) -> str: + data = self.vpp.cli_cmd('show runtime') + return data.reply + + def runtime(self, raw: bool): + data = self._get_runtime_raw() + return data if raw else self._show_runtime_formatted() + # ----------------------------- # VyOS IPFIX op-mode entries @@ -382,6 +398,14 @@ def show_bridge(raw: bool, ifname: typing.Optional[str] = None): def show_bridge_details(raw: bool, ifname: typing.Optional[str] = None): return VPPShow().bridge_domain_details(raw, ifname) +# ----------------------------- +# show runtime +# ----------------------------- +@vyos.opmode.verify_cli_exists(['vpp']) +def show_runtime(raw: bool): + return VPPShow().runtime(raw) + + if __name__ == '__main__': try: res = vyos.opmode.run(sys.modules[__name__]) |
