Skip to content
Snippets Groups Projects
cache.py 542 B
#!/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))