From 9435a46fbd4d9894a69492284b8a28ff7afd08ab Mon Sep 17 00:00:00 2001 From: lulzette Date: Sun, 10 Jul 2022 03:57:59 +0300 Subject: [PATCH] Added '--raw' option to dbs creation --- twvdscli.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/twvdscli.py b/twvdscli.py index e2908a1..a2ef53d 100644 --- a/twvdscli.py +++ b/twvdscli.py @@ -403,13 +403,19 @@ def get_balance(): @dbs_app.command("create") -def dbs_create(passwd: str = typer.Option(..., help="DB password"), name: str = typer.Option(..., help="DB Name"), db_type: str = typer.Option(..., help="mysql5/mysql/postgres")): +def dbs_create(passwd: str = typer.Option(..., help="DB password"), + name: str = typer.Option(..., help="DB Name"), + db_type: str = typer.Option(..., help="mysql5/mysql/postgres"), + raw: bool = typer.Option(False, help="Get result as raw json")): """ Create database """ # service_type == 341 - mysql # service_type == 357 - pgsql result = Dbaas.create(passwd=passwd, name=name, db_type=db_type) + if raw: + print(result) + return # We need to get id from result['db']['id'] db_id = result['db']['id'] for frame in cycle(r'-\|/'):