From 4d6603e150fd2254a8fb8f6d7d2b3369cc8afbd7 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Tue, 10 Mar 2026 18:04:31 +0000 Subject: T8371: VPP add op-mode command show runtime --- src/op_mode/vpp.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') 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__]) -- cgit v1.2.3