瀏覽代碼

added srv commands

- implemented subcommands:
  - aliases - list server domain aliases
  - sockets - list server listen sockets
  - rpclist - list server rpc commands
Daniel-Constantin Mierla 8 年之前
父節點
當前提交
bc284aead8
共有 1 個文件被更改,包括 49 次插入0 次删除
  1. 49 0
      kamcli/commands/cmd_srv.py

+ 49 - 0
kamcli/commands/cmd_srv.py

@@ -0,0 +1,49 @@
+import click
+from kamcli.cli import pass_context
+from kamcli.iorpc import command_ctl
+
+
+##
+#
+#
[email protected]('srv', help='Common server interaction commands')
+@pass_context
+def cli(ctx):
+    pass
+
+##
+#
+#
[email protected]('sockets', short_help='Show the list of listen sockets')
+@pass_context
+def srv_sockets(ctx):
+    """Show the list of listen sockets
+
+    \b
+    """
+    command_ctl(ctx, 'corex.list_sockets')
+
+##
+#
+#
[email protected]('aliases', short_help='Show the list of server domain aliases')
+@pass_context
+def srv_aliases(ctx):
+    """Show the list of server domain aliases
+
+    \b
+    """
+    command_ctl(ctx, 'corex.list_aliases')
+
+##
+#
+#
[email protected]('rpclist', short_help='Show the list of server rpc commands')
+@pass_context
+def srv_rpclist(ctx):
+    """Show the list of server rpc commands
+
+    \b
+    """
+    command_ctl(ctx, 'system.listMethods')
+