Example #1
0
def optionApp(option):
    "操作应用"
    aid=int(request.form.get("aid",None))
    
    #防止操作别人的应用
    sql="select count(*) from paas_app where uid = %d"%(session['user'])
    dao=db.execute(sql)
    r=objToDict(dao.first())
    dao.close()
    if r['count(*)']==0:
        return abort(403)
    
    if option == "start":
        #启动应用
        client.startApp(aid)
        return "ok"
    elif option == "stop":
        #停止应用
        client.stopApp(aid)
        return "ok"
    elif option == "reboot":
        #重启应用
        client.developApp(aid,"reboot")
        return "ok"
    elif option == "develop":
        #部署应用
        client.developApp(aid,"develop")
        return "ok"
Example #2
0
File: user.py Project: yubang/paas
def optionApp(option):
    "操作应用"
    aid = int(request.form.get("aid", None))

    #防止操作别人的应用
    sql = "select count(*) from paas_app where uid = %d" % (session['user'])
    dao = db.execute(sql)
    r = objToDict(dao.first())
    dao.close()
    if r['count(*)'] == 0:
        return abort(403)

    if option == "start":
        #启动应用
        client.startApp(aid)
        return "ok"
    elif option == "stop":
        #停止应用
        client.stopApp(aid)
        return "ok"
    elif option == "reboot":
        #重启应用
        client.developApp(aid, "reboot")
        return "ok"
    elif option == "develop":
        #部署应用
        client.developApp(aid, "develop")
        return "ok"
Example #3
0
File: api.py Project: yubang/paas
def git(apiKey, secretKey):
    "用于git调用通知有新代码"

    r = getAppFromToken(apiKey, secretKey)

    aid = r['aid']
    client.developApp(aid, 'develop')

    return "ok"
Example #4
0
def git(apiKey,secretKey):
    "用于git调用通知有新代码"
    
    r=getAppFromToken(apiKey,secretKey)
    
    aid=r['aid']
    client.developApp(aid,'develop')
    
    return "ok"
Example #5
0
def optionApp(option):
    "操作应用"
    aid=int(request.form.get("aid",None))
    if option == "start":
        #启动应用
        client.startApp(aid)
        return "ok"
    elif option == "stop":
        #停止应用
        client.stopApp(aid)
        return "ok"
    elif option == "reboot":
        #重启应用
        client.developApp(aid,"reboot")
        return "ok"
    elif option == "develop":
        #部署应用
        client.developApp(aid,"develop")
        return "ok"             
Example #6
0
def optionApp(option):
    "操作应用"
    aid = int(request.form.get("aid", None))
    if option == "start":
        #启动应用
        client.startApp(aid)
        return "ok"
    elif option == "stop":
        #停止应用
        client.stopApp(aid)
        return "ok"
    elif option == "reboot":
        #重启应用
        client.developApp(aid, "reboot")
        return "ok"
    elif option == "develop":
        #部署应用
        client.developApp(aid, "develop")
        return "ok"