At least it works
This commit is contained in:
parent
79dbcbd943
commit
efb2fc09ee
25
twvdscli.py
25
twvdscli.py
@ -496,22 +496,27 @@ def dbs_connect(db_id: Optional[int] = typer.Argument(None)):
|
|||||||
|
|
||||||
|
|
||||||
@servers_app.command("create")
|
@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 = {
|
data = {
|
||||||
"server": {
|
"server": {
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"caption": "test from API",
|
"caption": name,
|
||||||
"disk_size": 5, # dont give a fuck
|
# "disk_size": 5, # dont give a fuck
|
||||||
"network_bandwidth": 100, # dont give a fuck
|
# "network_bandwidth": 100, # dont give a fuck
|
||||||
"os": 47, #ubuntu 18.04
|
"os": os, # 47 - ubuntu 18.04
|
||||||
"xen_cpu": 2, # dont give a fuck
|
# "xen_cpu": 2, # dont give a fuck
|
||||||
"xen_ram": 4096, # dont give a fuck
|
# "xen_ram": 4096, # dont give a fuck
|
||||||
"ddos_guard": False
|
"ddos_guard": False
|
||||||
},
|
},
|
||||||
"comment": "comment",
|
"comment": comment,
|
||||||
"group_id": 350519, # https://public-api.timeweb.com/api/v1/accounts/{user}/group
|
"group_id": 350519, # https://public-api.timeweb.com/api/v1/accounts/{user}/group
|
||||||
"name": "string",
|
"name": "string", # what is this for?
|
||||||
"preset_id": 5,
|
"preset_id": preset, # you can not create vds without this, but how to create flexible vds? (example: 20)
|
||||||
"install_ssh_key": "",
|
"install_ssh_key": "",
|
||||||
"server_id": None,
|
"server_id": None,
|
||||||
"local_networks": []
|
"local_networks": []
|
||||||
|
Loading…
Reference in New Issue
Block a user