s/ucloud/uncloud/g
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
267828e85a
commit
280043659d
10 changed files with 10 additions and 10 deletions
31
uncloud_cli/commands/network.py
Normal file
31
uncloud_cli/commands/network.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
from uncloud_cli.commands.helper import load_dump_pretty, OTPCredentials
|
||||
from uncloud_cli.config import env_vars
|
||||
from os.path import join as join_path
|
||||
|
||||
import click
|
||||
import requests
|
||||
|
||||
|
||||
@click.group()
|
||||
def network():
|
||||
pass
|
||||
|
||||
|
||||
@network.command("create")
|
||||
@click.option("--name", required=True, default=env_vars.get("OTP_NAME"))
|
||||
@click.option("--realm", required=True, default=env_vars.get("OTP_REALM"))
|
||||
@click.option("--seed", required=True, default=env_vars.get("OTP_SEED"))
|
||||
@click.option("--network-name", required=True)
|
||||
@click.option("--network-type", required=True)
|
||||
@click.option("--user", required=True, type=bool, default=False)
|
||||
def create(name, realm, seed, network_name, network_type, user):
|
||||
data = {
|
||||
**OTPCredentials(name, realm, seed).get_json(),
|
||||
"network_name": network_name,
|
||||
"type": network_type,
|
||||
"user": user,
|
||||
}
|
||||
r = requests.post(
|
||||
join_path(env_vars.get("UCLOUD_API_SERVER"), "network", "create"), json=data
|
||||
)
|
||||
print(load_dump_pretty(r.content))
|
||||
Loading…
Add table
Add a link
Reference in a new issue