Loading cccli/command/__init__.py +1 −0 Original line number Diff line number Diff line Loading @@ -18,3 +18,4 @@ from cccli.command.vm import * # by command module from cccli.command.list import Command_list from cccli.command.expert import Command_expert from cccli.command.cache import Command_cache cccli/command/cache.py 0 → 100644 +21 −0 Original line number Diff line number Diff line #!/usr/bin/env python #coding=utf8 ''' CloudControl cache command ''' from cccli.exception import * from sjrpc.core.exceptions import * from cccli.printer import Printer, color from cccli.command.command import Command class Command_cache(Command): '''Show server cache statistics''' def __call__(self, argv): try: d = self.cli.rpc.call("dbstats") for i,v in d.items(): self.printer.out("%s: %s"%(i,v)) except RpcError as e: raise cmdError("RPCError: %s"%str(e)) Loading
cccli/command/__init__.py +1 −0 Original line number Diff line number Diff line Loading @@ -18,3 +18,4 @@ from cccli.command.vm import * # by command module from cccli.command.list import Command_list from cccli.command.expert import Command_expert from cccli.command.cache import Command_cache
cccli/command/cache.py 0 → 100644 +21 −0 Original line number Diff line number Diff line #!/usr/bin/env python #coding=utf8 ''' CloudControl cache command ''' from cccli.exception import * from sjrpc.core.exceptions import * from cccli.printer import Printer, color from cccli.command.command import Command class Command_cache(Command): '''Show server cache statistics''' def __call__(self, argv): try: d = self.cli.rpc.call("dbstats") for i,v in d.items(): self.printer.out("%s: %s"%(i,v)) except RpcError as e: raise cmdError("RPCError: %s"%str(e))