Compare commits

..

No commits in common. "a08e62e6193c9391a0f37c8983d8ecc622f65876" and "50f2dd02b6bcbbe010b1c66cc8ced4192d5660b7" have entirely different histories.

View File

@ -29,7 +29,6 @@ servers_app.add_typer(backups_app, name='backup', help='Create/Delete backup')
snapshot_app = typer.Typer()
servers_app.add_typer(snapshot_app, name='snap', help='Create/Rollback/Delete snapshot')
class Dbaas:
"""
DataBases As A Service
@ -44,15 +43,6 @@ class Dbaas:
return None
return result.json()
def get(db_id):
url = 'https://public-api.timeweb.com/api/v1/dbs/{db_id}'
result = requests.get(
url=url.format(db_id=db_id),
headers=reqHeader
)
if not result.ok:
return None
return result.json()
class Server:
@ -385,8 +375,8 @@ def get_balance():
@dbs_app.command("list")
def list_dbs():
"""
Show list of DBs
ID, State, Name, IP, local IP, Password, Type
Show list of VDSes
ID, State, Name, IP, CPUs, Ram, Disk
"""
list_of_dbaas = Dbaas.list()
x = PrettyTable()
@ -421,21 +411,6 @@ def list_dbs():
print(x)
@servers_app.command("goto")
def vds_goto(vds_id: Optional[int] = typer.Argument(None),
port: int = typer.Option(22, help="Specify non standart SSH port.")):
"""
Connect via SSH to VDS
"""
if vds_id is None:
vds_list()
vds_id = input("Enter VDS ID: ")
vds = Server.get_vds(vds_id)
ip = vds['server']['ip']
os.system('ssh -p {port} root@{ip}'.format(port=port, ip=ip))
@servers_app.command("start")
def vds_start(vds_id: Optional[int] = typer.Argument(None)):