Exemplo n.º 1
0
def add_app(request):
    json_app = yield from request.text()
    app = json.loads(json_app)
    result = models.add_row(models.App, app)
    if(result):
        return web.Response(status=200,body=encode_msg("success"))
    else:
        return web.Response(status=200,body=encode_msg("fail"))
Exemplo n.º 2
0
def add_cron(request):
    json_cron = yield from request.text()
    cron = json.loads(json_cron)
    result = models.add_row(models.Cron, cron)
    if(result):
        return web.Response(status=200,body=encode_msg("success"))
    else:
        return web.Response(status=200,body=encode_msg("fail"))
Exemplo n.º 3
0
def add_policy(request):
    json_policy = yield from request.text()
    policy = json.loads(json_policy)
    result = models.add_row(models.Policy, policy)
    if(result):
        return web.Response(status=200,body=encode_msg("success"))
    else:
        return web.Response(status=200,body=encode_msg("fail"))
Exemplo n.º 4
0
def add_cron(request):
    json_cron = yield from request.text()
    cron = json.loads(json_cron)
    result = models.add_row(models.Cron, cron)
    if (result):
        return web.Response(status=200, body=encode_msg("success"))
    else:
        return web.Response(status=200, body=encode_msg("fail"))
Exemplo n.º 5
0
def add_policy(request):
    json_policy = yield from request.text()
    policy = json.loads(json_policy)
    result = models.add_row(models.Policy, policy)
    if (result):
        return web.Response(status=200, body=encode_msg("success"))
    else:
        return web.Response(status=200, body=encode_msg("fail"))
Exemplo n.º 6
0
def add_app(request):
    json_app = yield from request.text()
    app = json.loads(json_app)
    result = models.add_row(models.App, app)
    if (result):
        return web.Response(status=200, body=encode_msg("success"))
    else:
        return web.Response(status=200, body=encode_msg("fail"))