예제 #1
0
파일: rest.py 프로젝트: willll/masternodes
    def cli_mn_action(request, mnidx, actidx=0):
        actions = {
            'mnstat': 'masternode status',
            'gi': 'getinfo',
            'mnss': 'mnsync status',
            'mnsr': 'mnsync reset'
        }

        coin = Polis(config["Polis"])
        vps = VPS(config["masternodes"][mnidx], coin)

        result = vps.async_cli(actions[actidx], coin)
        return result
예제 #2
0
def action(mnidx, actidx=0):
    coin = Polis(config["Polis"])
    vps = VPS(config["masternodes"][mnidx], coin)
    res = vps.async_cli(actions[actidx], coin)
    memcached.client.set('{}{}'.format(actidx, mnidx), res)