Process feedback; make it possible to install monitoring
This commit is contained in:
parent
6529636b3d
commit
4c57f92c8a
4 changed files with 84 additions and 59 deletions
|
|
@ -13,7 +13,7 @@ from flask.cli import AppGroup
|
|||
from ory_kratos_client.api import v0alpha2_api as kratos_api
|
||||
from sqlalchemy import func
|
||||
|
||||
from config import HYDRA_ADMIN_URL,KRATOS_ADMIN_URL,KRATOS_PUBLIC_URL
|
||||
from config import HYDRA_ADMIN_URL, KRATOS_ADMIN_URL, KRATOS_PUBLIC_URL
|
||||
from helpers import KratosUser
|
||||
from cliapp import cli
|
||||
from areas.roles import Role
|
||||
|
|
@ -88,7 +88,7 @@ def list_app():
|
|||
)
|
||||
@click.argument("slug")
|
||||
def delete_app(slug):
|
||||
"""Removes app from database as well as uninstalls it from the cluster
|
||||
"""Removes app from database
|
||||
:param slug: str Slug of app to remove
|
||||
"""
|
||||
current_app.logger.info(f"Trying to delete app: {slug}")
|
||||
|
|
@ -102,6 +102,25 @@ def delete_app(slug):
|
|||
current_app.logger.info(f"Success: {deleted}")
|
||||
return
|
||||
|
||||
@app_cli.command(
|
||||
"uninstall",
|
||||
)
|
||||
@click.argument("slug")
|
||||
def uninstall_app(slug):
|
||||
"""Uninstalls the app from the cluster
|
||||
:param slug: str Slug of app to remove
|
||||
"""
|
||||
current_app.logger.info(f"Trying to delete app: {slug}")
|
||||
app_obj = App.query.filter_by(slug=slug).first()
|
||||
|
||||
if not app_obj:
|
||||
current_app.logger.info("Not found")
|
||||
return
|
||||
|
||||
uninstalled = app_obj.uninstall()
|
||||
current_app.logger.info(f"Success: {uninstalled}")
|
||||
return
|
||||
|
||||
@app_cli.command("status")
|
||||
@click.argument("slug")
|
||||
def status_app(slug):
|
||||
|
|
@ -116,7 +135,7 @@ def status_app(slug):
|
|||
current_app.logger.error(f"App {slug} does not exist")
|
||||
return
|
||||
|
||||
current_app.logger.info("Status: " + str(app.get_status()))
|
||||
current_app.logger.info(f"Status: {app.get_status()}")
|
||||
|
||||
@app_cli.command("install")
|
||||
@click.argument("slug")
|
||||
|
|
|
|||
Reference in a new issue