Skip to content

Commit d457d43

Browse files
committed
show: add system services command
Add the command show system services. Signed-off-by: Richard Alpe <[email protected]>
1 parent c119436 commit d457d43

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/show/show.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,18 @@ def software(args: List[str]) -> None:
142142
else:
143143
print("Too many arguments provided. Only one name is expected.")
144144

145+
def services(args: List[str]) -> None:
146+
data = run_sysrepocfg("/ietf-system:system-state/infix-system:services")
147+
if not data:
148+
print("No service data retrieved.")
149+
return
150+
151+
if RAW_OUTPUT:
152+
print(json.dumps(data, indent=2))
153+
return
154+
155+
cli_pretty(data, f"show-services")
156+
145157
def routes(args: List[str]):
146158
ip_version = args[0] if args and args[0] in ["ipv4", "ipv6"] else "ipv4"
147159

@@ -186,6 +198,7 @@ def execute_command(command: str, args: List[str]):
186198
'ntp': ntp,
187199
'routes': routes,
188200
'lldp': lldp,
201+
'services' : services,
189202
'software' : software,
190203
'stp': stp,
191204
'wifi': wifi

0 commit comments

Comments
 (0)