예제 #1
0
def get_app_or_404(app_id):
    heroku = get_heroku_client_for_session()
    try:
        app = heroku.apps()[app_id]
    except KeyError:
        abort(404, message="App {} doesn't exist".format(app_id))

    return app
예제 #2
0
파일: views.py 프로젝트: sibson/dynoup
    def get_app(self, app_id):
        heroku = utils.get_heroku_client_for_session()
        try:
            app = heroku.apps()[app_id]
        except KeyError:
            raise NotFoundError('app', app_id)

        return app
예제 #3
0
파일: apps.py 프로젝트: sibson/dynoup
def get_app_or_404(app_id):
    heroku = get_heroku_client_for_session()
    try:
        app = heroku.apps()[app_id]
    except KeyError:
        abort(404, message="App {} doesn't exist".format(app_id))

    return app
예제 #4
0
파일: views.py 프로젝트: sibson/dynoup
    def get_app(self, app_id):
        heroku = utils.get_heroku_client_for_session()
        try:
            app = heroku.apps()[app_id]
        except KeyError:
            raise NotFoundError('app', app_id)

        return app
예제 #5
0
파일: views.py 프로젝트: sibson/dynoup
def app(app_id):
    heroku = utils.get_heroku_client_for_session()
    apps = heroku.apps()  # getto permissions check

    if app_id not in apps:
        raise NotFoundError('app', app_id)

    app = models.App.query.filter_by(id=app_id).first()
    if not app:
        app = apps[app_id]

    return AppSchema().jsonify(app)
예제 #6
0
파일: views.py 프로젝트: sibson/dynoup
def app(app_id):
    heroku = utils.get_heroku_client_for_session()
    apps = heroku.apps()  # getto permissions check

    if app_id not in apps:
        raise NotFoundError('app', app_id)

    app = models.App.query.filter_by(id=app_id).first()
    if not app:
        app = apps[app_id]

    return AppSchema().jsonify(app)
예제 #7
0
    def get(self, app_id):

        heroku = get_heroku_client_for_session()
        apps = heroku.apps()  # getto permissions check
        if app_id not in apps:
            abort(404, message="App {} doesn't exist".format(app_id))

        app = models.App.query.filter_by(id=app_id).first()
        if app:
            checks = {c.dynotype: str(c.id) for c in app.checks}
        else:
            app = apps[app_id]
            checks = {}

        return {
            'name': app.name,
            'id': app_id,
            'checks': checks,
        }
예제 #8
0
파일: apps.py 프로젝트: sibson/dynoup
    def get(self, app_id):

        heroku = get_heroku_client_for_session()
        apps = heroku.apps()  # getto permissions check
        if app_id not in apps:
            abort(404, message="App {} doesn't exist".format(app_id))

        app = models.App.query.filter_by(id=app_id).first()
        if app:
            checks = {c.dynotype: str(c.id) for c in app.checks}
        else:
            app = apps[app_id]
            checks = {}

        return {
            'name': app.name,
            'id': app_id,
            'checks': checks,
        }
예제 #9
0
 def get(self):
     heroku = get_heroku_client_for_session()
     return {a.name: a.id for a in heroku.apps()}
예제 #10
0
파일: apps.py 프로젝트: sibson/dynoup
 def get(self):
     heroku = get_heroku_client_for_session()
     return {a.name: a.id for a in heroku.apps()}
예제 #11
0
파일: views.py 프로젝트: sibson/dynoup
def apps():
    heroku = utils.get_heroku_client_for_session()
    apps = heroku.apps()
    return jsonify({'apps': AppSchema(many=True).dump(apps).data})
예제 #12
0
파일: views.py 프로젝트: sibson/dynoup
def apps():
    heroku = utils.get_heroku_client_for_session()
    apps = heroku.apps()
    return jsonify({'apps': AppSchema(many=True).dump(apps).data})