From efb2fc09ee389a47e006115c32f0083ccee2e6ef Mon Sep 17 00:00:00 2001 From: lulzette Date: Fri, 22 Jul 2022 17:11:25 +0300 Subject: [PATCH] At least it works --- twvdscli.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/twvdscli.py b/twvdscli.py index a03a909..865b6b3 100644 --- a/twvdscli.py +++ b/twvdscli.py @@ -496,22 +496,27 @@ def dbs_connect(db_id: Optional[int] = typer.Argument(None)): @servers_app.command("create") -def vds_create(): +def vds_create( + name: str = typer.Option(..., help="VDS Name"), + os: int = typer.Option(..., help="OS ID"), + preset: int = typer.Option(17, help="OS ID"), + comment: str = typer.Option("", help="Comment") +): data = { "server": { "configuration": { - "caption": "test from API", - "disk_size": 5, # dont give a fuck - "network_bandwidth": 100, # dont give a fuck - "os": 47, #ubuntu 18.04 - "xen_cpu": 2, # dont give a fuck - "xen_ram": 4096, # dont give a fuck + "caption": name, + # "disk_size": 5, # dont give a fuck + # "network_bandwidth": 100, # dont give a fuck + "os": os, # 47 - ubuntu 18.04 + # "xen_cpu": 2, # dont give a fuck + # "xen_ram": 4096, # dont give a fuck "ddos_guard": False }, - "comment": "comment", + "comment": comment, "group_id": 350519, # https://public-api.timeweb.com/api/v1/accounts/{user}/group - "name": "string", - "preset_id": 5, + "name": "string", # what is this for? + "preset_id": preset, # you can not create vds without this, but how to create flexible vds? (example: 20) "install_ssh_key": "", "server_id": None, "local_networks": []