515 lines
14 KiB
Plaintext
515 lines
14 KiB
Plaintext
CLI to interact with Ubicloud
|
|
|
|
Usage:
|
|
ubi [options] [command [command-options] ...]
|
|
|
|
Examples:
|
|
ubi vm list # List virtual machines
|
|
ubi help vm # Get help for vm subcommand
|
|
|
|
Commands:
|
|
fw Manage firewalls
|
|
help Get command help
|
|
lb Manage load balancers
|
|
pg Manage PostgreSQL databases
|
|
ps Manage private subnets
|
|
vm Manage virtual machines
|
|
|
|
Options:
|
|
--version show program version
|
|
--help show program help
|
|
--confirm=confirmation confirmation value (not for direct use)
|
|
|
|
|
|
Manage firewalls
|
|
|
|
Usage:
|
|
ubi fw command [...]
|
|
ubi fw (location/fw-name | fw-id) post-command [...]
|
|
|
|
Commands:
|
|
list List firewalls
|
|
|
|
Post Commands:
|
|
add-rule Add a firewall rule
|
|
attach-subnet Attach a private subnet to a firewall
|
|
create Create a firewall
|
|
delete-rule Remove a firewall rule
|
|
destroy Destroy a firewall
|
|
detach-subnet Detch a private subnet from a firewall
|
|
show Show details for a firewall
|
|
|
|
|
|
List firewalls
|
|
|
|
Usage:
|
|
ubi fw list [options]
|
|
|
|
Options:
|
|
-f, --fields=fields show specific fields (comma separated)
|
|
-l, --location=location only show firewalls in given location
|
|
-N, --no-headers do not show headers
|
|
Fields: location name id
|
|
|
|
|
|
Add a firewall rule
|
|
|
|
Usage:
|
|
ubi fw (location/fw-name | fw-id) add-rule cidr
|
|
|
|
Options:
|
|
-s, --start-port=port starting (or only) port to allow (default: 0)
|
|
-e, --end-port=port ending port to allow (default: 65535)
|
|
|
|
|
|
Attach a private subnet to a firewall
|
|
|
|
Usage:
|
|
ubi fw (location/fw-name | fw-id) attach-subnet ps-id
|
|
|
|
|
|
Create a firewall
|
|
|
|
Usage:
|
|
ubi fw location/fw-name create [options]
|
|
|
|
Options:
|
|
-d, --description=desc description for firewall
|
|
|
|
|
|
Remove a firewall rule
|
|
|
|
Usage:
|
|
ubi fw (location/fw-name | fw-id) delete-rule rule-id
|
|
|
|
|
|
Destroy a firewall
|
|
|
|
Usage:
|
|
ubi fw (location/fw-name | fw-id) destroy [options]
|
|
|
|
Options:
|
|
-f, --force do not require confirmation
|
|
|
|
|
|
Detch a private subnet from a firewall
|
|
|
|
Usage:
|
|
ubi fw (location/fw-name | fw-id) detach-subnet ps-id
|
|
|
|
|
|
Show details for a firewall
|
|
|
|
Usage:
|
|
ubi fw (location/fw-name | fw-id) show [options]
|
|
|
|
Options:
|
|
-f, --fields=fields show specific fields (comma separated)
|
|
-n, --nic-fields=fields show specific nic fields (comma separated)
|
|
-p, --priv-subnet-fields=fields show specific private subnet fields (comma separated)
|
|
-r, --rule-fields=fields show specific firewall rule fields (comma separated)
|
|
Fields: id name location description firewall-rules private-subnets
|
|
Nic Fields: id name private-ipv4 private-ipv6 vm-name
|
|
Private Subnet Fields: id name state location net4 net6 nics
|
|
Firewall Rule Fields: id cidr port-range
|
|
|
|
|
|
Get command help
|
|
|
|
Usage:
|
|
ubi help [options] [command [subcommand]]
|
|
|
|
Options:
|
|
-r, --recursive also show documentation for all subcommands of command
|
|
-u, --usage only show usage
|
|
|
|
|
|
Manage load balancers
|
|
|
|
Usage:
|
|
ubi lb command [...]
|
|
ubi lb (location/lb-name | lb-id) post-command [...]
|
|
|
|
Commands:
|
|
list List load balancers
|
|
|
|
Post Commands:
|
|
attach-vm Attach a virtual machine to a load balancer
|
|
create Create a load balancer
|
|
destroy Destroy a load balancer
|
|
detach-vm Detach a virtual machine from a load balancer
|
|
show Show details for a load balancer
|
|
update Update a load balancer
|
|
|
|
|
|
List load balancers
|
|
|
|
Usage:
|
|
ubi lb list [options]
|
|
|
|
Options:
|
|
-f, --fields=fields show specific fields (comma separated)
|
|
-l, --location=location only show load balancers in given location
|
|
-N, --no-headers do not show headers
|
|
Fields: location name id src-port dst-port hostname
|
|
|
|
|
|
Attach a virtual machine to a load balancer
|
|
|
|
Usage:
|
|
ubi lb (location/lb-name | lb-id) attach-vm vm-id
|
|
|
|
|
|
Create a load balancer
|
|
|
|
Usage:
|
|
ubi lb location/lb-name create [options] ps-id src-port dst-port
|
|
|
|
Options:
|
|
-a, --algorithm=alg set the algorithm to use (round_robin(default), hash_based)
|
|
-e, --check-endpoint=path set the health check endpoint (default: /up)
|
|
-p, --check-protocol=proto set the health check protocol (http(default), https, tcp)
|
|
-s, --stack=stack set the stack (dual(default), ipv4, ipv6)
|
|
|
|
|
|
Destroy a load balancer
|
|
|
|
Usage:
|
|
ubi lb (location/lb-name | lb-id) destroy [options]
|
|
|
|
Options:
|
|
-f, --force do not require confirmation
|
|
|
|
|
|
Detach a virtual machine from a load balancer
|
|
|
|
Usage:
|
|
ubi lb (location/lb-name | lb-id) detach-vm vm-id
|
|
|
|
|
|
Show details for a load balancer
|
|
|
|
Usage:
|
|
ubi lb (location/lb-name | lb-id) show [options]
|
|
|
|
Options:
|
|
-f, --fields=fields show specific fields (comma separated)
|
|
Fields: id name state location hostname algorithm stack health-check-endpoint
|
|
health-check-protocol src-port dst-port subnet vms
|
|
|
|
|
|
Update a load balancer
|
|
|
|
Usage:
|
|
ubi lb (location/lb-name | lb-id) update algorithm src-port dst-port health-check-endpoint [vm-id [...]]
|
|
|
|
|
|
Manage PostgreSQL databases
|
|
|
|
Usage:
|
|
ubi pg command [...]
|
|
ubi pg (location/pg-name | pg-id) [post-options] post-command [...]
|
|
|
|
Commands:
|
|
list List PostgreSQL databases
|
|
|
|
Post Commands:
|
|
add-firewall-rule Add a PostgreSQL firewall rule
|
|
add-metric-destination Add a PostgreSQL metric destination
|
|
create Create a PostgreSQL database
|
|
delete-firewall-rule Delete a PostgreSQL firewall rule
|
|
delete-metric-destination Delete a PostgreSQL metric destination
|
|
destroy Destroy a PostgreSQL database
|
|
pg_dump Dump a single PostgreSQL database using `pg_dump`
|
|
pg_dumpall Dump a entire PostgreSQL database cluster using `pg_dumpall`
|
|
psql Connect to a PostgreSQL database using `psql`
|
|
reset-superuser-password Reset the superuser password for a PostgreSQL database
|
|
restart Restart a PostgreSQL database cluster
|
|
restore Restore a PostgreSQL database backup to a new database
|
|
show Show details for a PostgreSQL database
|
|
|
|
Post Options:
|
|
-d, --dbname=name override database name
|
|
-U, --username=name override username
|
|
|
|
|
|
List PostgreSQL databases
|
|
|
|
Usage:
|
|
ubi pg list [options]
|
|
|
|
Options:
|
|
-f, --fields=fields show specific fields (comma separated)
|
|
-l, --location=location only show PostgreSQL databases in given location
|
|
-N, --no-headers do not show headers
|
|
Fields: location name id version flavor
|
|
|
|
|
|
Add a PostgreSQL firewall rule
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) add-firewall-rule cidr
|
|
|
|
|
|
Add a PostgreSQL metric destination
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) add-metric-destination username password url
|
|
|
|
|
|
Create a PostgreSQL database
|
|
|
|
Usage:
|
|
ubi pg location/pg-name create [options]
|
|
|
|
Options:
|
|
-f, --flavor=type flavor (standard, paradedb, lantern)
|
|
-h, --ha-type=type replication type (none, async, sync)
|
|
-s, --size=size server size (standard-{2,4,8,16,30,60})
|
|
-S, --storage-size=size storage size GB (64, 128, 256)
|
|
-v, --version=version PostgreSQL version (16, 17)
|
|
|
|
|
|
Delete a PostgreSQL firewall rule
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) delete-firewall-rule rule-id
|
|
|
|
|
|
Delete a PostgreSQL metric destination
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) delete-metric-destination md-id
|
|
|
|
|
|
Destroy a PostgreSQL database
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) destroy [options]
|
|
|
|
Options:
|
|
-f, --force do not require confirmation
|
|
|
|
|
|
Dump a single PostgreSQL database using `pg_dump`
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) [options] pg_dump [pg_dump-options]
|
|
|
|
|
|
Dump a entire PostgreSQL database cluster using `pg_dumpall`
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) [options] pg_dumpall [pg_dumpall-options]
|
|
|
|
|
|
Connect to a PostgreSQL database using `psql`
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) [options] psql [psql-options]
|
|
|
|
|
|
Reset the superuser password for a PostgreSQL database
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) reset-superuser-password new-password
|
|
|
|
|
|
Restart a PostgreSQL database cluster
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) restart
|
|
|
|
|
|
Restore a PostgreSQL database backup to a new database
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) restore new-db-name restore-time
|
|
|
|
|
|
Show details for a PostgreSQL database
|
|
|
|
Usage:
|
|
ubi pg (location/pg-name | pg-id) show [options]
|
|
|
|
Options:
|
|
-f, --fields=fields show specific fields (comma separated)
|
|
Fields: id name state location vm-size storage-size-gib version ha-type flavor
|
|
connection-string primary earliest-restore-time firewall-rules
|
|
metric-destinations ca-certificates
|
|
|
|
|
|
Manage private subnets
|
|
|
|
Usage:
|
|
ubi ps command [...]
|
|
ubi ps (location/ps-name | ps-id) post-command [...]
|
|
|
|
Commands:
|
|
list List private subnets
|
|
|
|
Post Commands:
|
|
connect Connect a private subnet to another private subnet
|
|
create Create a private subnet
|
|
destroy Destroy a private subnet
|
|
disconnect Disconnect a private subnet from another private subnet
|
|
show Show details for a private subnet
|
|
|
|
|
|
List private subnets
|
|
|
|
Usage:
|
|
ubi ps list [options]
|
|
|
|
Options:
|
|
-f, --fields=fields show specific fields (comma separated)
|
|
-l, --location=location only show private subnets in given location
|
|
-N, --no-headers do not show headers
|
|
Fields: location name id net4 net6
|
|
|
|
|
|
Connect a private subnet to another private subnet
|
|
|
|
Usage:
|
|
ubi ps (location/ps-name | ps-id) connect ps-id
|
|
|
|
|
|
Create a private subnet
|
|
|
|
Usage:
|
|
ubi ps location/ps-name create [options]
|
|
|
|
Options:
|
|
-f, --firewall-id=id add to given firewall
|
|
|
|
|
|
Destroy a private subnet
|
|
|
|
Usage:
|
|
ubi ps (location/ps-name | ps-id) destroy [options]
|
|
|
|
Options:
|
|
-f, --force do not require confirmation
|
|
|
|
|
|
Disconnect a private subnet from another private subnet
|
|
|
|
Usage:
|
|
ubi ps (location/ps-name | ps-id) disconnect ps-id
|
|
|
|
|
|
Show details for a private subnet
|
|
|
|
Usage:
|
|
ubi ps (location/ps-name | ps-id) show [options]
|
|
|
|
Options:
|
|
-f, --fields=fields show specific fields (comma separated)
|
|
-n, --nic-fields=fields show specific nic fields (comma separated)
|
|
-r, --rule-fields=fields show specific firewall rule fields (comma separated)
|
|
-w, --firewall-fields=fields show specific firewall fields (comma separated)
|
|
Fields: id name state location net4 net6 firewalls nics
|
|
Nic Fields: id name private-ipv4 private-ipv6 vm-name
|
|
Firewall Rule Fields: id cidr port-range
|
|
Firewall Fields: id name description location path firewall-rules
|
|
|
|
|
|
Manage virtual machines
|
|
|
|
Usage:
|
|
ubi vm command [...]
|
|
ubi vm (location/vm-name | vm-id) [post-options] post-command [...]
|
|
|
|
Commands:
|
|
list List virtual machines
|
|
|
|
Post Commands:
|
|
create Create a virtual machine
|
|
destroy Destroy a virtual machine
|
|
restart Restart a virtual machine
|
|
scp Copy files to or from virtual machine using `scp`
|
|
sftp Copy files to or from virtual machine using `sftp`
|
|
show Show details for a virtual machine
|
|
ssh Connect to a virtual machine using `ssh`
|
|
|
|
Post Options:
|
|
-4, --ip4 use IPv4 address
|
|
-6, --ip6 use IPv6 address
|
|
-u, --user user override username
|
|
|
|
|
|
List virtual machines
|
|
|
|
Usage:
|
|
ubi vm list [options]
|
|
|
|
Options:
|
|
-f, --fields=fields show specific fields (comma separated)
|
|
-l, --location=location only show virtual machines in given location
|
|
-N, --no-headers do not show headers
|
|
Fields: location name id ip4 ip6
|
|
|
|
|
|
Create a virtual machine
|
|
|
|
Usage:
|
|
ubi vm location/vm-name create [options] public_key
|
|
|
|
Options:
|
|
-6, --ipv6-only do not enable IPv4
|
|
-b, --boot-image=image_name boot image (ubuntu-noble,ubuntu-jammy,debian-12,almalinux-9)
|
|
-p, --private-subnet-id=id place VM into specific private subnet
|
|
-s, --size=size server size (standard-{2,4,8,16,30,60})
|
|
-S, --storage-size=size storage size (40, 80)
|
|
-u, --unix-user=username username (default: ubi)
|
|
|
|
|
|
Destroy a virtual machine
|
|
|
|
Usage:
|
|
ubi vm (location/vm-name | vm-id) destroy [options]
|
|
|
|
Options:
|
|
-f, --force do not require confirmation
|
|
|
|
|
|
Restart a virtual machine
|
|
|
|
Usage:
|
|
ubi vm (location/vm-name | vm-id) restart
|
|
|
|
|
|
Copy files to or from virtual machine using `scp`
|
|
|
|
Usage:
|
|
ubi vm (location/vm-name | vm-id) [options] scp [scp-options] (local-path :remote-path | :remote-path local-path)
|
|
|
|
|
|
Copy files to or from virtual machine using `sftp`
|
|
|
|
Usage:
|
|
ubi vm (location/vm-name | vm-id) [options] sftp [sftp-options]
|
|
|
|
|
|
Show details for a virtual machine
|
|
|
|
Usage:
|
|
ubi vm (location/vm-name | vm-id) show [options]
|
|
|
|
Options:
|
|
-f, --fields=fields show specific fields (comma separated)
|
|
-r, --rule-fields=fields show specific firewall rule fields (comma separated)
|
|
-w, --firewall-fields=fields show specific firewall fields (comma separated)
|
|
Fields: id name state location size unix-user storage-size-gib ip6 ip4-enabled
|
|
ip4 private-ipv4 private-ipv6 subnet firewalls
|
|
Firewall Rule Fields: id cidr port-range
|
|
Firewall Fields: id name description location path firewall-rules
|
|
|
|
|
|
Connect to a virtual machine using `ssh`
|
|
|
|
Usage:
|
|
ubi vm (location/vm-name | vm-id) [options] ssh [ssh-options --] [remote-cmd [remote-cmd-arg ...]]
|
|
|
|
|