diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dh-cpusage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dh-cpusage.golden new file mode 100644 index 0000000000..e6247b0a73 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dh-cpusage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +DHCP configuration allows you to set parameters for assignment of IP addresses to devices on a Private Network attached to a VPC Public Gateway (subnet, lease time etc). + +USAGE: + scw vpc-gw dhcp + +AVAILABLE COMMANDS: + create Create a DHCP configuration + delete Delete a DHCP configuration + get Get a DHCP configuration + list List DHCP configurations + update Update a DHCP configuration + +FLAGS: + -h, --help help for dhcp + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw vpc-gw dhcp [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-create-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-create-usage.golden new file mode 100644 index 0000000000..99164f08fb --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-create-usage.golden @@ -0,0 +1,35 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a DHCP configuration. + +USAGE: + scw vpc-gw dhcp create [arg=value ...] + +ARGS: + [project-id] Project ID to use. If none is passed the default project ID will be used + [subnet] Subnet for the DHCP server + [address] Address of the DHCP server. This will be the gateway's address in the private network. Defaults to the first address of the subnet + [pool-low] Low IP (included) of the dynamic address pool + [pool-high] High IP (included) of the dynamic address pool + [enable-dynamic] Whether to enable dynamic pooling of IPs + [valid-lifetime.seconds] + [valid-lifetime.nanos] + [renew-timer.seconds] + [renew-timer.nanos] + [rebind-timer.seconds] + [rebind-timer.nanos] + [push-default-route] Whether the gateway should push a default route to DHCP clients or only hand out IPs. Defaults to true + [push-dns-server] Whether the gateway should push custom DNS servers to clients + [dns-servers-override.{index}] Override the DNS server list pushed to DHCP clients, instead of the gateway itself + [dns-search.{index}] Additional DNS search paths + [dns-local-name] TLD given to hosts in the Private Network + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for create + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-delete-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-delete-usage.golden new file mode 100644 index 0000000000..e566f4f968 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-delete-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete a DHCP configuration. + +USAGE: + scw vpc-gw dhcp delete [arg=value ...] + +ARGS: + dhcpid DHCP config id to delete + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for delete + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-create-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-create-usage.golden new file mode 100644 index 0000000000..5a6c68f456 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-create-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a static DHCP reservation. + +USAGE: + scw vpc-gw dhcp-entry create [arg=value ...] + +ARGS: + [gateway-network-id] GatewayNetwork on which to create a DHCP reservation + [mac-address] MAC address to give a static entry to + [ip-address] IP address to give to the machine + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for create + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-delete-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-delete-usage.golden new file mode 100644 index 0000000000..583551be22 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-delete-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete a DHCP reservation. + +USAGE: + scw vpc-gw dhcp-entry delete [arg=value ...] + +ARGS: + dhcp-entry-id DHCP entry ID to delete + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for delete + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-get-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-get-usage.golden new file mode 100644 index 0000000000..d168d61893 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Get DHCP entries. + +USAGE: + scw vpc-gw dhcp-entry get [arg=value ...] + +ARGS: + dhcp-entry-id ID of the DHCP entry to fetch + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for get + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-list-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-list-usage.golden new file mode 100644 index 0000000000..fb8309d74a --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-list-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List DHCP entries. + +USAGE: + scw vpc-gw dhcp-entry list [arg=value ...] + +ARGS: + [order-by] Order in which to return results (created_at_asc | created_at_desc | ip_address_asc | ip_address_desc | hostname_asc | hostname_desc) + [gateway-network-id] Filter entries based on the gateway network they are on + [mac-address] Filter entries on their MAC address + [ip-address] Filter entries on their IP address + [hostname] Filter entries on their hostname substring + [type] Filter entries on their type (unknown | reservation | lease) + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for list + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-set-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-set-usage.golden new file mode 100644 index 0000000000..63571acbc0 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-set-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Set the list of DHCP reservations attached to a Gateway Network. Reservations are identified by their MAC address, and will sync the current DHCP entry list to the given list, creating, updating or deleting DHCP entries. + +USAGE: + scw vpc-gw dhcp-entry set [arg=value ...] + +ARGS: + [gateway-network-id] Gateway Network on which to set DHCP reservation list + [dhcp-entries.{index}.mac-address] MAC address to give a static entry to + [dhcp-entries.{index}.ip-address] IP address to give to the machine + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for set + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-update-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-update-usage.golden new file mode 100644 index 0000000000..51dad068ea --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-update-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update a DHCP entry. + +USAGE: + scw vpc-gw dhcp-entry update [arg=value ...] + +ARGS: + dhcp-entry-id DHCP entry ID to update + [ip-address] New IP address to give to the machine + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for update + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-usage.golden new file mode 100644 index 0000000000..95345ab443 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-usage.golden @@ -0,0 +1,25 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +DHCP entries hold both dynamic DHCP leases (IP addresses dynamically assigned by the gateway to instances) and static user-created DHCP reservations. + +USAGE: + scw vpc-gw dhcp-entry + +AVAILABLE COMMANDS: + create Create a static DHCP reservation + delete Delete a DHCP reservation + get Get DHCP entries + list List DHCP entries + set Set all DHCP reservations on a Gateway Network + update Update a DHCP entry + +FLAGS: + -h, --help help for dhcp-entry + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw vpc-gw dhcp-entry [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-get-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-get-usage.golden new file mode 100644 index 0000000000..87b3e36a5d --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Get a DHCP configuration. + +USAGE: + scw vpc-gw dhcp get [arg=value ...] + +ARGS: + dhcpid ID of the DHCP config to fetch + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for get + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-list-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-list-usage.golden new file mode 100644 index 0000000000..812f7e31d7 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-list-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List DHCP configurations. + +USAGE: + scw vpc-gw dhcp list [arg=value ...] + +ARGS: + [order-by] Order in which to return results (created_at_asc | created_at_desc | subnet_asc | subnet_desc) + [project-id] Include only DHCPs in this project + [address] Filter on gateway address + [has-address] Filter on subnets containing address + [organization-id] Include only DHCPs in this organization + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for list + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-update-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-update-usage.golden new file mode 100644 index 0000000000..29c04e1183 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-update-usage.golden @@ -0,0 +1,35 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update a DHCP configuration. + +USAGE: + scw vpc-gw dhcp update [arg=value ...] + +ARGS: + dhcpid DHCP config to update + [subnet] Subnet for the DHCP server + [address] Address of the DHCP server. This will be the gateway's address in the private network + [pool-low] Low IP (included) of the dynamic address pool + [pool-high] High IP (included) of the dynamic address pool + [enable-dynamic] Whether to enable dynamic pooling of IPs + [valid-lifetime.seconds] + [valid-lifetime.nanos] + [renew-timer.seconds] + [renew-timer.nanos] + [rebind-timer.seconds] + [rebind-timer.nanos] + [push-default-route] Whether the gateway should push a default route to DHCP clients or only hand out IPs + [push-dns-server] Whether the gateway should push custom DNS servers to clients + [dns-servers-override.{index}] Override the DNS server list pushed to DHCP clients, instead of the gateway itself + [dns-search.{index}] Additional DNS search paths + [dns-local-name] TLD given to hosts in the Private Network + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for update + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-create-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-create-usage.golden new file mode 100644 index 0000000000..e3dee7ecae --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-create-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a VPC Public Gateway. + +USAGE: + scw vpc-gw gateway create [arg=value ...] + +ARGS: + [project-id] Project ID to use. If none is passed the default project ID will be used + [name=] Name of the gateway + [tags.{index}] Tags for the gateway + [type=VPC-GW-S] Gateway type + [upstream-dns-servers.{index}] Override the gateway's default recursive DNS servers, if DNS features are enabled + [ip-id] Attach an existing IP to the gateway + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for create + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-delete-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-delete-usage.golden new file mode 100644 index 0000000000..9f340b658b --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-delete-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete a VPC Public Gateway. + +USAGE: + scw vpc-gw gateway delete [arg=value ...] + +ARGS: + gateway-id ID of the gateway to delete + [cleanup-dhcp] Whether to cleanup attached DHCP configurations + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for delete + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-get-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-get-usage.golden new file mode 100644 index 0000000000..810040e6b4 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Get a VPC Public Gateway. + +USAGE: + scw vpc-gw gateway get [arg=value ...] + +ARGS: + gateway-id ID of the gateway to fetch + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for get + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-list-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-list-usage.golden new file mode 100644 index 0000000000..366680bcbe --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-list-usage.golden @@ -0,0 +1,26 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List VPC Public Gateways. + +USAGE: + scw vpc-gw gateway list [arg=value ...] + +ARGS: + [order-by] Order in which to return results (created_at_asc | created_at_desc | name_asc | name_desc | type_asc | type_desc | status_asc | status_desc) + [project-id] Include only gateways in this project + [name] Filter gateways including this name + [tags.{index}] Filter gateways with these tags + [type] Filter gateways of this type + [status] Filter gateways in this status (unknown for any) (unknown | stopped | allocating | configuring | running | stopping | failed | deleting | deleted) + [private-network-id] Filter gateways attached to this private network + [organization-id] Include only gateways in this organization + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for list + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-create-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-create-usage.golden new file mode 100644 index 0000000000..11fd7f5772 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-create-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Attach a gateway to a Private Network. + +USAGE: + scw vpc-gw gateway-network create [arg=value ...] + +ARGS: + [gateway-id] Gateway to connect + [private-network-id] Private Network to connect + [enable-masquerade] Whether to enable masquerade on this network + [dhcpid] Existing configuration + [address] Static IP address in CIDR format to to use without DHCP + [enable-dhcp] Whether to enable DHCP on this Private Network + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for create + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-delete-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-delete-usage.golden new file mode 100644 index 0000000000..1bb0442be2 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-delete-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Detach a gateway from a Private Network. + +USAGE: + scw vpc-gw gateway-network delete [arg=value ...] + +ARGS: + gateway-network-id GatewayNetwork to delete + [cleanup-dhcp] Whether to cleanup the attached DHCP configuration + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for delete + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-get-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-get-usage.golden new file mode 100644 index 0000000000..08d07ac03c --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Get a gateway connection to a Private Network. + +USAGE: + scw vpc-gw gateway-network get [arg=value ...] + +ARGS: + gateway-network-id ID of the GatewayNetwork to fetch + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for get + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-list-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-list-usage.golden new file mode 100644 index 0000000000..f3d4fa3beb --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-list-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List gateway connections to Private Networks. + +USAGE: + scw vpc-gw gateway-network list [arg=value ...] + +ARGS: + [order-by] Order in which to return results (created_at_asc | created_at_desc | status_asc | status_desc) + [gateway-id] Filter by gateway + [private-network-id] Filter by private network + [enable-masquerade] Filter by masquerade enablement + [dhcpid] Filter by DHCP configuration + [status] Filter GatewayNetworks by this status (unknown for any) (unknown | created | attaching | configuring | ready | detaching | deleted) + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for list + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-update-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-update-usage.golden new file mode 100644 index 0000000000..132bd0e64e --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-update-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update a gateway connection to a Private Network. + +USAGE: + scw vpc-gw gateway-network update [arg=value ...] + +ARGS: + gateway-network-id ID of the GatewayNetwork to update + [enable-masquerade] New masquerade enablement + [dhcpid] New DHCP configuration + [enable-dhcp] Whether to enable DHCP on the connected Private Network + [address] New static IP address + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for update + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-usage.golden new file mode 100644 index 0000000000..310ede6ae6 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-network-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +A Gateway Network represents the connection of a Private Network to a VPC Public Gateway. It holds configuration options relative to this specific connection, such as the DHCP configuration. + +USAGE: + scw vpc-gw gateway-network + +AVAILABLE COMMANDS: + create Attach a gateway to a Private Network + delete Detach a gateway from a Private Network + get Get a gateway connection to a Private Network + list List gateway connections to Private Networks + update Update a gateway connection to a Private Network + +FLAGS: + -h, --help help for gateway-network + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw vpc-gw gateway-network [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-type-list-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-type-list-usage.golden new file mode 100644 index 0000000000..cf83427c95 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-type-list-usage.golden @@ -0,0 +1,18 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List VPC Public Gateway types. + +USAGE: + scw vpc-gw gateway-type list [arg=value ...] + +ARGS: + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for list + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-type-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-type-usage.golden new file mode 100644 index 0000000000..393b71088f --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-type-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Gateways come in multiple shapes and size, which are described by the various gateway types. + +USAGE: + scw vpc-gw gateway-type + +AVAILABLE COMMANDS: + list List VPC Public Gateway types + +FLAGS: + -h, --help help for gateway-type + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw vpc-gw gateway-type [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-update-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-update-usage.golden new file mode 100644 index 0000000000..f36808b3ff --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-update-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update a VPC Public Gateway. + +USAGE: + scw vpc-gw gateway update [arg=value ...] + +ARGS: + gateway-id ID of the gateway to update + [name] Name fo the gateway + [tags.{index}] Tags for the gateway + [upstream-dns-servers.{index}] Override the gateway's default recursive DNS servers, if DNS features are enabled + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for update + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-upgrade-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-upgrade-usage.golden new file mode 100644 index 0000000000..eabce94800 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-upgrade-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Upgrade a VPC Public Gateway to the latest version. + +USAGE: + scw vpc-gw gateway upgrade [arg=value ...] + +ARGS: + gateway-id ID of the gateway to upgrade + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for upgrade + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-usage.golden new file mode 100644 index 0000000000..d051fb33f2 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-gateway-usage.golden @@ -0,0 +1,25 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +The VPC Public Gateway is a building block for your infrastructure on Scaleway's shared public cloud. It provides a set of managed network services and features for Scaleway's Private Networks such as DHCP, NAT and routing. + +USAGE: + scw vpc-gw gateway + +AVAILABLE COMMANDS: + create Create a VPC Public Gateway + delete Delete a VPC Public Gateway + get Get a VPC Public Gateway + list List VPC Public Gateways + update Update a VPC Public Gateway + upgrade Upgrade a VPC Public Gateway to the latest version + +FLAGS: + -h, --help help for gateway + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw vpc-gw gateway [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-ip-create-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-create-usage.golden new file mode 100644 index 0000000000..2783ae790d --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-create-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Reserve an IP. + +USAGE: + scw vpc-gw ip create [arg=value ...] + +ARGS: + [project-id] Project ID to use. If none is passed the default project ID will be used + [tags.{index}] Tags to give to the IP + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for create + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-ip-delete-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-delete-usage.golden new file mode 100644 index 0000000000..55cd1420bf --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-delete-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete an IP. + +USAGE: + scw vpc-gw ip delete [arg=value ...] + +ARGS: + ip-id ID of the IP to delete + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for delete + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-ip-get-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-get-usage.golden new file mode 100644 index 0000000000..31054fabcf --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Get an IP. + +USAGE: + scw vpc-gw ip get [arg=value ...] + +ARGS: + ip-id ID of the IP to get + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for get + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-ip-list-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-list-usage.golden new file mode 100644 index 0000000000..5a6ec73d90 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-list-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List IPs. + +USAGE: + scw vpc-gw ip list [arg=value ...] + +ARGS: + [order-by] Order in which to return results (created_at_asc | created_at_desc | ip_asc | ip_desc | reverse_asc | reverse_desc) + [project-id] Include only IPs in this project + [tags.{index}] Filter IPs with these tags + [reverse] Filter by reverse containing this string + [is-free] Filter whether the IP is attached to a gateway or not + [organization-id] Include only IPs in this organization + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for list + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-ip-update-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-update-usage.golden new file mode 100644 index 0000000000..b94d7934ff --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-update-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update an IP. + +USAGE: + scw vpc-gw ip update [arg=value ...] + +ARGS: + ip-id ID of the IP to update + [tags.{index}] Tags to give to the IP + [reverse] Reverse to set on the IP. Empty string to unset + [gateway-id] Gateway to attach the IP to. Empty string to detach + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for update + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-ip-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-usage.golden new file mode 100644 index 0000000000..97e2d81ab8 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-ip-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +A VPC Public Gateway has a public IP address, allowing it to reach the public internet, as well as forward (masquerade) traffic from member instances of attached Private Networks. + +USAGE: + scw vpc-gw ip + +AVAILABLE COMMANDS: + create Reserve an IP + delete Delete an IP + get Get an IP + list List IPs + update Update an IP + +FLAGS: + -h, --help help for ip + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw vpc-gw ip [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-create-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-create-usage.golden new file mode 100644 index 0000000000..38c383014f --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-create-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a PAT rule. + +USAGE: + scw vpc-gw pat-rule create [arg=value ...] + +ARGS: + [gateway-id] Gateway on which to attach the rule to + [public-port] Public port to listen on + [private-ip] Private IP to forward data to + [private-port] Private port to translate to + [protocol] Protocol the rule should apply to (unknown | both | tcp | udp) + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for create + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-delete-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-delete-usage.golden new file mode 100644 index 0000000000..814d928121 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-delete-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete a PAT rule. + +USAGE: + scw vpc-gw pat-rule delete [arg=value ...] + +ARGS: + pat-rule-id PAT rule to delete + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for delete + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-get-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-get-usage.golden new file mode 100644 index 0000000000..fbbd5477b8 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Get a PAT rule. + +USAGE: + scw vpc-gw pat-rule get [arg=value ...] + +ARGS: + pat-rule-id PAT rule to get + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for get + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-list-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-list-usage.golden new file mode 100644 index 0000000000..02e5d7aedc --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-list-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List PAT rules. + +USAGE: + scw vpc-gw pat-rule list [arg=value ...] + +ARGS: + [order-by] Order in which to return results (created_at_asc | created_at_desc | public_port_asc | public_port_desc) + [gateway-id] Fetch rules for this gateway + [private-ip] Fetch rules targeting this private ip + [protocol] Fetch rules for this protocol (unknown | both | tcp | udp) + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for list + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-set-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-set-usage.golden new file mode 100644 index 0000000000..663f8235cf --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-set-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Set the list of PAT rules attached to a Gateway. Rules are identified by their public port and protocol. This will sync the current PAT rule list with the givent list, creating, updating or deleting PAT rules. + +USAGE: + scw vpc-gw pat-rule set [arg=value ...] + +ARGS: + [gateway-id] Gateway on which to set the PAT rules + [pat-rules.{index}.public-port] Public port to listen on + [pat-rules.{index}.private-ip] Private IP to forward data to + [pat-rules.{index}.private-port] Private port to translate to + [pat-rules.{index}.protocol] Protocol the rule should apply to (unknown | both | tcp | udp) + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for set + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-update-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-update-usage.golden new file mode 100644 index 0000000000..b4e60244f8 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-update-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update a PAT rule. + +USAGE: + scw vpc-gw pat-rule update [arg=value ...] + +ARGS: + pat-rule-id PAT rule to update + [public-port] Public port to listen on + [private-ip] Private IP to forward data to + [private-port] Private port to translate to + [protocol] Protocol the rule should apply to (unknown | both | tcp | udp) + [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | pl-waw-1) + +FLAGS: + -h, --help help for update + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-usage.golden new file mode 100644 index 0000000000..5a482d645f --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-pat-rule-usage.golden @@ -0,0 +1,25 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +PAT (Port Address Translation) rules are global to a gateway. They define the forwarding of a public port to a specific instance on a Private Network. + +USAGE: + scw vpc-gw pat-rule + +AVAILABLE COMMANDS: + create Create a PAT rule + delete Delete a PAT rule + get Get a PAT rule + list List PAT rules + set Set all PAT rules on a Gateway + update Update a PAT rule + +FLAGS: + -h, --help help for pat-rule + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw vpc-gw pat-rule [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-vpc-gw-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-gw-usage.golden new file mode 100644 index 0000000000..68dcb91314 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-vpc-gw-usage.golden @@ -0,0 +1,26 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +VPC Public Gateway API + +USAGE: + scw vpc-gw + +AVAILABLE COMMANDS: + dhcp DHCP configuration management + dhcp-entry DHCP entries management + gateway VPC Public Gateway management + gateway-network Gateway Networks management + gateway-type + ip IP address management + pat-rule PAT rules management + +FLAGS: + -h, --help help for vpc-gw + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw vpc-gw [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-main-usage-usage.golden b/cmd/scw/testdata/test-main-usage-usage.golden index 07b54de54a..c557432d89 100644 --- a/cmd/scw/testdata/test-main-usage-usage.golden +++ b/cmd/scw/testdata/test-main-usage-usage.golden @@ -27,6 +27,7 @@ AVAILABLE COMMANDS: registry Container registry API version Display cli version vpc VPC API + vpc-gw VPC Public Gateway API help Help about any command FLAGS: diff --git a/docs/commands/vpc-gw.md b/docs/commands/vpc-gw.md new file mode 100644 index 0000000000..bb3d9e54b9 --- /dev/null +++ b/docs/commands/vpc-gw.md @@ -0,0 +1,871 @@ + +# Documentation for `scw vpc-gw` +VPC Public Gateway API + +- [DHCP configuration management](#dhcp-configuration-management) + - [Create a DHCP configuration](#create-a-dhcp-configuration) + - [Delete a DHCP configuration](#delete-a-dhcp-configuration) + - [Get a DHCP configuration](#get-a-dhcp-configuration) + - [List DHCP configurations](#list-dhcp-configurations) + - [Update a DHCP configuration](#update-a-dhcp-configuration) +- [DHCP entries management](#dhcp-entries-management) + - [Create a static DHCP reservation](#create-a-static-dhcp-reservation) + - [Delete a DHCP reservation](#delete-a-dhcp-reservation) + - [Get DHCP entries](#get-dhcp-entries) + - [List DHCP entries](#list-dhcp-entries) + - [Set all DHCP reservations on a Gateway Network](#set-all-dhcp-reservations-on-a-gateway-network) + - [Update a DHCP entry](#update-a-dhcp-entry) +- [VPC Public Gateway management](#vpc-public-gateway-management) + - [Create a VPC Public Gateway](#create-a-vpc-public-gateway) + - [Delete a VPC Public Gateway](#delete-a-vpc-public-gateway) + - [Get a VPC Public Gateway](#get-a-vpc-public-gateway) + - [List VPC Public Gateways](#list-vpc-public-gateways) + - [Update a VPC Public Gateway](#update-a-vpc-public-gateway) + - [Upgrade a VPC Public Gateway to the latest version](#upgrade-a-vpc-public-gateway-to-the-latest-version) +- [Gateway Networks management](#gateway-networks-management) + - [Attach a gateway to a Private Network](#attach-a-gateway-to-a-private-network) + - [Detach a gateway from a Private Network](#detach-a-gateway-from-a-private-network) + - [Get a gateway connection to a Private Network](#get-a-gateway-connection-to-a-private-network) + - [List gateway connections to Private Networks](#list-gateway-connections-to-private-networks) + - [Update a gateway connection to a Private Network](#update-a-gateway-connection-to-a-private-network) +- [](#) + - [List VPC Public Gateway types](#list-vpc-public-gateway-types) +- [IP address management](#ip-address-management) + - [Reserve an IP](#reserve-an-ip) + - [Delete an IP](#delete-an-ip) + - [Get an IP](#get-an-ip) + - [List IPs](#list-ips) + - [Update an IP](#update-an-ip) +- [PAT rules management](#pat-rules-management) + - [Create a PAT rule](#create-a-pat-rule) + - [Delete a PAT rule](#delete-a-pat-rule) + - [Get a PAT rule](#get-a-pat-rule) + - [List PAT rules](#list-pat-rules) + - [Set all PAT rules on a Gateway](#set-all-pat-rules-on-a-gateway) + - [Update a PAT rule](#update-a-pat-rule) + + +## DHCP configuration management + +DHCP configuration allows you to set parameters for assignment of IP addresses to devices on a Private Network attached to a VPC Public Gateway (subnet, lease time etc). + + + +### Create a DHCP configuration + +Create a DHCP configuration. + +**Usage:** + +``` +scw vpc-gw dhcp create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| subnet | | Subnet for the DHCP server | +| address | | Address of the DHCP server. This will be the gateway's address in the private network. Defaults to the first address of the subnet | +| pool-low | | Low IP (included) of the dynamic address pool | +| pool-high | | High IP (included) of the dynamic address pool | +| enable-dynamic | | Whether to enable dynamic pooling of IPs | +| valid-lifetime.seconds | | | +| valid-lifetime.nanos | | | +| renew-timer.seconds | | | +| renew-timer.nanos | | | +| rebind-timer.seconds | | | +| rebind-timer.nanos | | | +| push-default-route | | Whether the gateway should push a default route to DHCP clients or only hand out IPs. Defaults to true | +| push-dns-server | | Whether the gateway should push custom DNS servers to clients | +| dns-servers-override.{index} | | Override the DNS server list pushed to DHCP clients, instead of the gateway itself | +| dns-search.{index} | | Additional DNS search paths | +| dns-local-name | | TLD given to hosts in the Private Network | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Delete a DHCP configuration + +Delete a DHCP configuration. + +**Usage:** + +``` +scw vpc-gw dhcp delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dhcpid | Required | DHCP config id to delete | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Get a DHCP configuration + +Get a DHCP configuration. + +**Usage:** + +``` +scw vpc-gw dhcp get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dhcpid | Required | ID of the DHCP config to fetch | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### List DHCP configurations + +List DHCP configurations. + +**Usage:** + +``` +scw vpc-gw dhcp list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| order-by | One of: `created_at_asc`, `created_at_desc`, `subnet_asc`, `subnet_desc` | Order in which to return results | +| project-id | | Include only DHCPs in this project | +| address | | Filter on gateway address | +| has-address | | Filter on subnets containing address | +| organization-id | | Include only DHCPs in this organization | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Update a DHCP configuration + +Update a DHCP configuration. + +**Usage:** + +``` +scw vpc-gw dhcp update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dhcpid | Required | DHCP config to update | +| subnet | | Subnet for the DHCP server | +| address | | Address of the DHCP server. This will be the gateway's address in the private network | +| pool-low | | Low IP (included) of the dynamic address pool | +| pool-high | | High IP (included) of the dynamic address pool | +| enable-dynamic | | Whether to enable dynamic pooling of IPs | +| valid-lifetime.seconds | | | +| valid-lifetime.nanos | | | +| renew-timer.seconds | | | +| renew-timer.nanos | | | +| rebind-timer.seconds | | | +| rebind-timer.nanos | | | +| push-default-route | | Whether the gateway should push a default route to DHCP clients or only hand out IPs | +| push-dns-server | | Whether the gateway should push custom DNS servers to clients | +| dns-servers-override.{index} | | Override the DNS server list pushed to DHCP clients, instead of the gateway itself | +| dns-search.{index} | | Additional DNS search paths | +| dns-local-name | | TLD given to hosts in the Private Network | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +## DHCP entries management + +DHCP entries hold both dynamic DHCP leases (IP addresses dynamically assigned by the gateway to instances) and static user-created DHCP reservations. + + + +### Create a static DHCP reservation + +Create a static DHCP reservation. + +**Usage:** + +``` +scw vpc-gw dhcp-entry create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-network-id | | GatewayNetwork on which to create a DHCP reservation | +| mac-address | | MAC address to give a static entry to | +| ip-address | | IP address to give to the machine | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Delete a DHCP reservation + +Delete a DHCP reservation. + +**Usage:** + +``` +scw vpc-gw dhcp-entry delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dhcp-entry-id | Required | DHCP entry ID to delete | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Get DHCP entries + +Get DHCP entries. + +**Usage:** + +``` +scw vpc-gw dhcp-entry get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dhcp-entry-id | Required | ID of the DHCP entry to fetch | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### List DHCP entries + +List DHCP entries. + +**Usage:** + +``` +scw vpc-gw dhcp-entry list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| order-by | One of: `created_at_asc`, `created_at_desc`, `ip_address_asc`, `ip_address_desc`, `hostname_asc`, `hostname_desc` | Order in which to return results | +| gateway-network-id | | Filter entries based on the gateway network they are on | +| mac-address | | Filter entries on their MAC address | +| ip-address | | Filter entries on their IP address | +| hostname | | Filter entries on their hostname substring | +| type | One of: `unknown`, `reservation`, `lease` | Filter entries on their type | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Set all DHCP reservations on a Gateway Network + +Set the list of DHCP reservations attached to a Gateway Network. Reservations are identified by their MAC address, and will sync the current DHCP entry list to the given list, creating, updating or deleting DHCP entries. + + +**Usage:** + +``` +scw vpc-gw dhcp-entry set [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-network-id | | Gateway Network on which to set DHCP reservation list | +| dhcp-entries.{index}.mac-address | | MAC address to give a static entry to | +| dhcp-entries.{index}.ip-address | | IP address to give to the machine | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Update a DHCP entry + +Update a DHCP entry. + +**Usage:** + +``` +scw vpc-gw dhcp-entry update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dhcp-entry-id | Required | DHCP entry ID to update | +| ip-address | | New IP address to give to the machine | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +## VPC Public Gateway management + +The VPC Public Gateway is a building block for your infrastructure on Scaleway's shared public cloud. It provides a set of managed network services and features for Scaleway's Private Networks such as DHCP, NAT and routing. + + + +### Create a VPC Public Gateway + +Create a VPC Public Gateway. + +**Usage:** + +``` +scw vpc-gw gateway create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| name | Default: `` | Name of the gateway | +| tags.{index} | | Tags for the gateway | +| type | Default: `VPC-GW-S` | Gateway type | +| upstream-dns-servers.{index} | | Override the gateway's default recursive DNS servers, if DNS features are enabled | +| ip-id | | Attach an existing IP to the gateway | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Delete a VPC Public Gateway + +Delete a VPC Public Gateway. + +**Usage:** + +``` +scw vpc-gw gateway delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-id | Required | ID of the gateway to delete | +| cleanup-dhcp | | Whether to cleanup attached DHCP configurations | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Get a VPC Public Gateway + +Get a VPC Public Gateway. + +**Usage:** + +``` +scw vpc-gw gateway get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-id | Required | ID of the gateway to fetch | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### List VPC Public Gateways + +List VPC Public Gateways. + +**Usage:** + +``` +scw vpc-gw gateway list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc`, `type_asc`, `type_desc`, `status_asc`, `status_desc` | Order in which to return results | +| project-id | | Include only gateways in this project | +| name | | Filter gateways including this name | +| tags.{index} | | Filter gateways with these tags | +| type | | Filter gateways of this type | +| status | One of: `unknown`, `stopped`, `allocating`, `configuring`, `running`, `stopping`, `failed`, `deleting`, `deleted` | Filter gateways in this status (unknown for any) | +| private-network-id | | Filter gateways attached to this private network | +| organization-id | | Include only gateways in this organization | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Update a VPC Public Gateway + +Update a VPC Public Gateway. + +**Usage:** + +``` +scw vpc-gw gateway update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-id | Required | ID of the gateway to update | +| name | | Name fo the gateway | +| tags.{index} | | Tags for the gateway | +| upstream-dns-servers.{index} | | Override the gateway's default recursive DNS servers, if DNS features are enabled | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Upgrade a VPC Public Gateway to the latest version + +Upgrade a VPC Public Gateway to the latest version. + +**Usage:** + +``` +scw vpc-gw gateway upgrade [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-id | Required | ID of the gateway to upgrade | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +## Gateway Networks management + +A Gateway Network represents the connection of a Private Network to a VPC Public Gateway. It holds configuration options relative to this specific connection, such as the DHCP configuration. + + + +### Attach a gateway to a Private Network + +Attach a gateway to a Private Network. + +**Usage:** + +``` +scw vpc-gw gateway-network create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-id | | Gateway to connect | +| private-network-id | | Private Network to connect | +| enable-masquerade | | Whether to enable masquerade on this network | +| dhcpid | | Existing configuration | +| address | | Static IP address in CIDR format to to use without DHCP | +| enable-dhcp | | Whether to enable DHCP on this Private Network | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Detach a gateway from a Private Network + +Detach a gateway from a Private Network. + +**Usage:** + +``` +scw vpc-gw gateway-network delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-network-id | Required | GatewayNetwork to delete | +| cleanup-dhcp | | Whether to cleanup the attached DHCP configuration | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Get a gateway connection to a Private Network + +Get a gateway connection to a Private Network. + +**Usage:** + +``` +scw vpc-gw gateway-network get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-network-id | Required | ID of the GatewayNetwork to fetch | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### List gateway connections to Private Networks + +List gateway connections to Private Networks. + +**Usage:** + +``` +scw vpc-gw gateway-network list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| order-by | One of: `created_at_asc`, `created_at_desc`, `status_asc`, `status_desc` | Order in which to return results | +| gateway-id | | Filter by gateway | +| private-network-id | | Filter by private network | +| enable-masquerade | | Filter by masquerade enablement | +| dhcpid | | Filter by DHCP configuration | +| status | One of: `unknown`, `created`, `attaching`, `configuring`, `ready`, `detaching`, `deleted` | Filter GatewayNetworks by this status (unknown for any) | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Update a gateway connection to a Private Network + +Update a gateway connection to a Private Network. + +**Usage:** + +``` +scw vpc-gw gateway-network update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-network-id | Required | ID of the GatewayNetwork to update | +| enable-masquerade | | New masquerade enablement | +| dhcpid | | New DHCP configuration | +| enable-dhcp | | Whether to enable DHCP on the connected Private Network | +| address | | New static IP address | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +## + +Gateways come in multiple shapes and size, which are described by the various gateway types. + + + +### List VPC Public Gateway types + +List VPC Public Gateway types. + +**Usage:** + +``` +scw vpc-gw gateway-type list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +## IP address management + +A VPC Public Gateway has a public IP address, allowing it to reach the public internet, as well as forward (masquerade) traffic from member instances of attached Private Networks. + + + +### Reserve an IP + +Reserve an IP. + +**Usage:** + +``` +scw vpc-gw ip create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| tags.{index} | | Tags to give to the IP | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Delete an IP + +Delete an IP. + +**Usage:** + +``` +scw vpc-gw ip delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| ip-id | Required | ID of the IP to delete | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Get an IP + +Get an IP. + +**Usage:** + +``` +scw vpc-gw ip get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| ip-id | Required | ID of the IP to get | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### List IPs + +List IPs. + +**Usage:** + +``` +scw vpc-gw ip list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| order-by | One of: `created_at_asc`, `created_at_desc`, `ip_asc`, `ip_desc`, `reverse_asc`, `reverse_desc` | Order in which to return results | +| project-id | | Include only IPs in this project | +| tags.{index} | | Filter IPs with these tags | +| reverse | | Filter by reverse containing this string | +| is-free | | Filter whether the IP is attached to a gateway or not | +| organization-id | | Include only IPs in this organization | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Update an IP + +Update an IP. + +**Usage:** + +``` +scw vpc-gw ip update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| ip-id | Required | ID of the IP to update | +| tags.{index} | | Tags to give to the IP | +| reverse | | Reverse to set on the IP. Empty string to unset | +| gateway-id | | Gateway to attach the IP to. Empty string to detach | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +## PAT rules management + +PAT (Port Address Translation) rules are global to a gateway. They define the forwarding of a public port to a specific instance on a Private Network. + + + +### Create a PAT rule + +Create a PAT rule. + +**Usage:** + +``` +scw vpc-gw pat-rule create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-id | | Gateway on which to attach the rule to | +| public-port | | Public port to listen on | +| private-ip | | Private IP to forward data to | +| private-port | | Private port to translate to | +| protocol | One of: `unknown`, `both`, `tcp`, `udp` | Protocol the rule should apply to | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Delete a PAT rule + +Delete a PAT rule. + +**Usage:** + +``` +scw vpc-gw pat-rule delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| pat-rule-id | Required | PAT rule to delete | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Get a PAT rule + +Get a PAT rule. + +**Usage:** + +``` +scw vpc-gw pat-rule get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| pat-rule-id | Required | PAT rule to get | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### List PAT rules + +List PAT rules. + +**Usage:** + +``` +scw vpc-gw pat-rule list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| order-by | One of: `created_at_asc`, `created_at_desc`, `public_port_asc`, `public_port_desc` | Order in which to return results | +| gateway-id | | Fetch rules for this gateway | +| private-ip | | Fetch rules targeting this private ip | +| protocol | One of: `unknown`, `both`, `tcp`, `udp` | Fetch rules for this protocol | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Set all PAT rules on a Gateway + +Set the list of PAT rules attached to a Gateway. Rules are identified by their public port and protocol. This will sync the current PAT rule list with the givent list, creating, updating or deleting PAT rules. + + +**Usage:** + +``` +scw vpc-gw pat-rule set [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| gateway-id | | Gateway on which to set the PAT rules | +| pat-rules.{index}.public-port | | Public port to listen on | +| pat-rules.{index}.private-ip | | Private IP to forward data to | +| pat-rules.{index}.private-port | | Private port to translate to | +| pat-rules.{index}.protocol | One of: `unknown`, `both`, `tcp`, `udp` | Protocol the rule should apply to | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + +### Update a PAT rule + +Update a PAT rule. + +**Usage:** + +``` +scw vpc-gw pat-rule update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| pat-rule-id | Required | PAT rule to update | +| public-port | | Public port to listen on | +| private-ip | | Private IP to forward data to | +| private-port | | Private port to translate to | +| protocol | One of: `unknown`, `both`, `tcp`, `udp` | Protocol the rule should apply to | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | + + + diff --git a/internal/namespaces/get_commands.go b/internal/namespaces/get_commands.go index 69b09eb2a8..eb07dcfe2c 100644 --- a/internal/namespaces/get_commands.go +++ b/internal/namespaces/get_commands.go @@ -25,6 +25,7 @@ import ( "github.com/scaleway/scaleway-cli/internal/namespaces/registry/v1" versionNamespace "github.com/scaleway/scaleway-cli/internal/namespaces/version" "github.com/scaleway/scaleway-cli/internal/namespaces/vpc/v1" + "github.com/scaleway/scaleway-cli/internal/namespaces/vpcgw/v1" ) // GetCommands returns a list of all commands in the CLI. @@ -57,5 +58,6 @@ func GetCommands() *core.Commands { commands.Merge(flexibleip.GetCommands()) commands.Merge(container.GetCommands()) commands.Merge(function.GetCommands()) + commands.Merge(vpcgw.GetCommands()) return commands } diff --git a/internal/namespaces/vpcgw/v1/custom.go b/internal/namespaces/vpcgw/v1/custom.go new file mode 100644 index 0000000000..b754b87055 --- /dev/null +++ b/internal/namespaces/vpcgw/v1/custom.go @@ -0,0 +1,16 @@ +package vpcgw + +import ( + "github.com/scaleway/scaleway-cli/internal/core" + "github.com/scaleway/scaleway-cli/internal/human" + "github.com/scaleway/scaleway-sdk-go/api/vpcgw/v1" +) + +func GetCommands() *core.Commands { + cmds := GetGeneratedCommands() + + human.RegisterMarshalerFunc(vpcgw.GatewayNetworkStatus(""), human.EnumMarshalFunc(gatewayNetworkStatusMarshalSpecs)) + human.RegisterMarshalerFunc(vpcgw.GatewayStatus(""), human.EnumMarshalFunc(gatewayStatusMarshalSpecs)) + + return cmds +} diff --git a/internal/namespaces/vpcgw/v1/custom_gateway.go b/internal/namespaces/vpcgw/v1/custom_gateway.go new file mode 100644 index 0000000000..2a161175a8 --- /dev/null +++ b/internal/namespaces/vpcgw/v1/custom_gateway.go @@ -0,0 +1,21 @@ +package vpcgw + +import ( + "github.com/fatih/color" + "github.com/scaleway/scaleway-cli/internal/human" + "github.com/scaleway/scaleway-sdk-go/api/vpcgw/v1" +) + +var ( + gatewayStatusMarshalSpecs = human.EnumMarshalSpecs{ + vpcgw.GatewayStatusAllocating: &human.EnumMarshalSpec{Attribute: color.FgBlue}, + vpcgw.GatewayStatusConfiguring: &human.EnumMarshalSpec{Attribute: color.FgBlue}, + vpcgw.GatewayStatusDeleted: &human.EnumMarshalSpec{Attribute: color.FgRed}, + vpcgw.GatewayStatusDeleting: &human.EnumMarshalSpec{Attribute: color.FgBlue}, + vpcgw.GatewayStatusFailed: &human.EnumMarshalSpec{Attribute: color.FgRed}, + vpcgw.GatewayStatusRunning: &human.EnumMarshalSpec{Attribute: color.FgGreen}, + vpcgw.GatewayStatusStopped: &human.EnumMarshalSpec{Attribute: color.FgRed}, + vpcgw.GatewayStatusStopping: &human.EnumMarshalSpec{Attribute: color.FgBlue}, + vpcgw.GatewayStatusUnknown: &human.EnumMarshalSpec{Attribute: color.Faint}, + } +) diff --git a/internal/namespaces/vpcgw/v1/custom_gateway_network.go b/internal/namespaces/vpcgw/v1/custom_gateway_network.go new file mode 100644 index 0000000000..de7ebba60e --- /dev/null +++ b/internal/namespaces/vpcgw/v1/custom_gateway_network.go @@ -0,0 +1,19 @@ +package vpcgw + +import ( + "github.com/fatih/color" + "github.com/scaleway/scaleway-cli/internal/human" + "github.com/scaleway/scaleway-sdk-go/api/vpcgw/v1" +) + +var ( + gatewayNetworkStatusMarshalSpecs = human.EnumMarshalSpecs{ + vpcgw.GatewayNetworkStatusAttaching: &human.EnumMarshalSpec{Attribute: color.FgBlue}, + vpcgw.GatewayNetworkStatusConfiguring: &human.EnumMarshalSpec{Attribute: color.FgBlue}, + vpcgw.GatewayNetworkStatusCreated: &human.EnumMarshalSpec{Attribute: color.FgGreen}, + vpcgw.GatewayNetworkStatusDeleted: &human.EnumMarshalSpec{Attribute: color.FgRed}, + vpcgw.GatewayNetworkStatusDetaching: &human.EnumMarshalSpec{Attribute: color.FgBlue}, + vpcgw.GatewayNetworkStatusReady: &human.EnumMarshalSpec{Attribute: color.FgGreen}, + vpcgw.GatewayNetworkStatusUnknown: &human.EnumMarshalSpec{Attribute: color.Faint}, + } +) diff --git a/internal/namespaces/vpcgw/v1/vpcgw_cli.go b/internal/namespaces/vpcgw/v1/vpcgw_cli.go new file mode 100644 index 0000000000..caadffc45e --- /dev/null +++ b/internal/namespaces/vpcgw/v1/vpcgw_cli.go @@ -0,0 +1,2125 @@ +// This file was automatically generated. DO NOT EDIT. +// If you have any remark or suggestion do not hesitate to open an issue. + +package vpcgw + +import ( + "context" + "reflect" + + "github.com/scaleway/scaleway-cli/internal/core" + "github.com/scaleway/scaleway-sdk-go/api/vpcgw/v1" + "github.com/scaleway/scaleway-sdk-go/scw" +) + +// always import dependencies +var ( + _ = scw.RegionFrPar +) + +func GetGeneratedCommands() *core.Commands { + return core.NewCommands( + vpcGwRoot(), + vpcGwGateway(), + vpcGwGatewayNetwork(), + vpcGwDHCP(), + vpcGwDHCPEntry(), + vpcGwPatRule(), + vpcGwIP(), + vpcGwGatewayType(), + vpcGwGatewayList(), + vpcGwGatewayGet(), + vpcGwGatewayCreate(), + vpcGwGatewayUpdate(), + vpcGwGatewayDelete(), + vpcGwGatewayUpgrade(), + vpcGwGatewayNetworkList(), + vpcGwGatewayNetworkGet(), + vpcGwGatewayNetworkCreate(), + vpcGwGatewayNetworkUpdate(), + vpcGwGatewayNetworkDelete(), + vpcGwDHCPList(), + vpcGwDHCPGet(), + vpcGwDHCPCreate(), + vpcGwDHCPUpdate(), + vpcGwDHCPDelete(), + vpcGwDHCPEntryList(), + vpcGwDHCPEntryGet(), + vpcGwDHCPEntryCreate(), + vpcGwDHCPEntryUpdate(), + vpcGwDHCPEntrySet(), + vpcGwDHCPEntryDelete(), + vpcGwPatRuleList(), + vpcGwPatRuleGet(), + vpcGwPatRuleCreate(), + vpcGwPatRuleUpdate(), + vpcGwPatRuleSet(), + vpcGwPatRuleDelete(), + vpcGwGatewayTypeList(), + vpcGwIPList(), + vpcGwIPGet(), + vpcGwIPCreate(), + vpcGwIPUpdate(), + vpcGwIPDelete(), + ) +} +func vpcGwRoot() *core.Command { + return &core.Command{ + Short: `VPC Public Gateway API`, + Long: ``, + Namespace: "vpc-gw", + } +} + +func vpcGwGateway() *core.Command { + return &core.Command{ + Short: `VPC Public Gateway management`, + Long: `The VPC Public Gateway is a building block for your infrastructure on Scaleway's shared public cloud. It provides a set of managed network services and features for Scaleway's Private Networks such as DHCP, NAT and routing. +`, + Namespace: "vpc-gw", + Resource: "gateway", + } +} + +func vpcGwGatewayNetwork() *core.Command { + return &core.Command{ + Short: `Gateway Networks management`, + Long: `A Gateway Network represents the connection of a Private Network to a VPC Public Gateway. It holds configuration options relative to this specific connection, such as the DHCP configuration. +`, + Namespace: "vpc-gw", + Resource: "gateway-network", + } +} + +func vpcGwDHCP() *core.Command { + return &core.Command{ + Short: `DHCP configuration management`, + Long: `DHCP configuration allows you to set parameters for assignment of IP addresses to devices on a Private Network attached to a VPC Public Gateway (subnet, lease time etc). +`, + Namespace: "vpc-gw", + Resource: "dhcp", + } +} + +func vpcGwDHCPEntry() *core.Command { + return &core.Command{ + Short: `DHCP entries management`, + Long: `DHCP entries hold both dynamic DHCP leases (IP addresses dynamically assigned by the gateway to instances) and static user-created DHCP reservations. +`, + Namespace: "vpc-gw", + Resource: "dhcp-entry", + } +} + +func vpcGwPatRule() *core.Command { + return &core.Command{ + Short: `PAT rules management`, + Long: `PAT (Port Address Translation) rules are global to a gateway. They define the forwarding of a public port to a specific instance on a Private Network. +`, + Namespace: "vpc-gw", + Resource: "pat-rule", + } +} + +func vpcGwIP() *core.Command { + return &core.Command{ + Short: `IP address management`, + Long: `A VPC Public Gateway has a public IP address, allowing it to reach the public internet, as well as forward (masquerade) traffic from member instances of attached Private Networks. +`, + Namespace: "vpc-gw", + Resource: "ip", + } +} + +func vpcGwGatewayType() *core.Command { + return &core.Command{ + Short: ``, + Long: `Gateways come in multiple shapes and size, which are described by the various gateway types. +`, + Namespace: "vpc-gw", + Resource: "gateway-type", + } +} + +func vpcGwGatewayList() *core.Command { + return &core.Command{ + Short: `List VPC Public Gateways`, + Long: `List VPC Public Gateways.`, + Namespace: "vpc-gw", + Resource: "gateway", + Verb: "list", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.ListGatewaysRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "order-by", + Short: `Order in which to return results`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"created_at_asc", "created_at_desc", "name_asc", "name_desc", "type_asc", "type_desc", "status_asc", "status_desc"}, + }, + { + Name: "project-id", + Short: `Include only gateways in this project`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "name", + Short: `Filter gateways including this name`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "tags.{index}", + Short: `Filter gateways with these tags`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "type", + Short: `Filter gateways of this type`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "status", + Short: `Filter gateways in this status (unknown for any)`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"unknown", "stopped", "allocating", "configuring", "running", "stopping", "failed", "deleting", "deleted"}, + }, + { + Name: "private-network-id", + Short: `Filter gateways attached to this private network`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "organization-id", + Short: `Include only gateways in this organization`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.ListGatewaysRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + resp, err := api.ListGateways(request, scw.WithAllPages()) + if err != nil { + return nil, err + } + return resp.Gateways, nil + + }, + View: &core.View{Fields: []*core.ViewField{ + { + FieldName: "ID", + }, + { + FieldName: "Name", + }, + { + FieldName: "Status", + }, + { + FieldName: "Tags", + }, + { + FieldName: "GatewayNetworks", + }, + { + FieldName: "UpstreamDNSServers", + }, + { + FieldName: "UpdatedAt", + }, + { + FieldName: "CreatedAt", + }, + { + FieldName: "Zone", + }, + { + FieldName: "ProjectID", + }, + { + FieldName: "OrganizationID", + }, + }}, + } +} + +func vpcGwGatewayGet() *core.Command { + return &core.Command{ + Short: `Get a VPC Public Gateway`, + Long: `Get a VPC Public Gateway.`, + Namespace: "vpc-gw", + Resource: "gateway", + Verb: "get", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.GetGatewayRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-id", + Short: `ID of the gateway to fetch`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.GetGatewayRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.GetGateway(request) + + }, + } +} + +func vpcGwGatewayCreate() *core.Command { + return &core.Command{ + Short: `Create a VPC Public Gateway`, + Long: `Create a VPC Public Gateway.`, + Namespace: "vpc-gw", + Resource: "gateway", + Verb: "create", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.CreateGatewayRequest{}), + ArgSpecs: core.ArgSpecs{ + core.ProjectIDArgSpec(), + { + Name: "name", + Short: `Name of the gateway`, + Required: false, + Deprecated: false, + Positional: false, + Default: core.RandomValueGenerator("gw"), + }, + { + Name: "tags.{index}", + Short: `Tags for the gateway`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "type", + Short: `Gateway type`, + Required: false, + Deprecated: false, + Positional: false, + Default: core.DefaultValueSetter("VPC-GW-S"), + }, + { + Name: "upstream-dns-servers.{index}", + Short: `Override the gateway's default recursive DNS servers, if DNS features are enabled`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "ip-id", + Short: `Attach an existing IP to the gateway`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.CreateGatewayRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.CreateGateway(request) + + }, + } +} + +func vpcGwGatewayUpdate() *core.Command { + return &core.Command{ + Short: `Update a VPC Public Gateway`, + Long: `Update a VPC Public Gateway.`, + Namespace: "vpc-gw", + Resource: "gateway", + Verb: "update", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.UpdateGatewayRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-id", + Short: `ID of the gateway to update`, + Required: true, + Deprecated: false, + Positional: true, + }, + { + Name: "name", + Short: `Name fo the gateway`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "tags.{index}", + Short: `Tags for the gateway`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "upstream-dns-servers.{index}", + Short: `Override the gateway's default recursive DNS servers, if DNS features are enabled`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.UpdateGatewayRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.UpdateGateway(request) + + }, + } +} + +func vpcGwGatewayDelete() *core.Command { + return &core.Command{ + Short: `Delete a VPC Public Gateway`, + Long: `Delete a VPC Public Gateway.`, + Namespace: "vpc-gw", + Resource: "gateway", + Verb: "delete", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.DeleteGatewayRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-id", + Short: `ID of the gateway to delete`, + Required: true, + Deprecated: false, + Positional: true, + }, + { + Name: "cleanup-dhcp", + Short: `Whether to cleanup attached DHCP configurations`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.DeleteGatewayRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + e = api.DeleteGateway(request) + if e != nil { + return nil, e + } + return &core.SuccessResult{ + Resource: "gateway", + Verb: "delete", + }, nil + }, + } +} + +func vpcGwGatewayUpgrade() *core.Command { + return &core.Command{ + Short: `Upgrade a VPC Public Gateway to the latest version`, + Long: `Upgrade a VPC Public Gateway to the latest version.`, + Namespace: "vpc-gw", + Resource: "gateway", + Verb: "upgrade", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.UpgradeGatewayRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-id", + Short: `ID of the gateway to upgrade`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.UpgradeGatewayRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.UpgradeGateway(request) + + }, + } +} + +func vpcGwGatewayNetworkList() *core.Command { + return &core.Command{ + Short: `List gateway connections to Private Networks`, + Long: `List gateway connections to Private Networks.`, + Namespace: "vpc-gw", + Resource: "gateway-network", + Verb: "list", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.ListGatewayNetworksRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "order-by", + Short: `Order in which to return results`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"created_at_asc", "created_at_desc", "status_asc", "status_desc"}, + }, + { + Name: "gateway-id", + Short: `Filter by gateway`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "private-network-id", + Short: `Filter by private network`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "enable-masquerade", + Short: `Filter by masquerade enablement`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dhcpid", + Short: `Filter by DHCP configuration`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "status", + Short: `Filter GatewayNetworks by this status (unknown for any)`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"unknown", "created", "attaching", "configuring", "ready", "detaching", "deleted"}, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.ListGatewayNetworksRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + resp, err := api.ListGatewayNetworks(request, scw.WithAllPages()) + if err != nil { + return nil, err + } + return resp.GatewayNetworks, nil + + }, + View: &core.View{Fields: []*core.ViewField{ + { + FieldName: "ID", + }, + { + FieldName: "GatewayID", + }, + { + FieldName: "PrivateNetworkID", + }, + { + FieldName: "Status", + }, + { + FieldName: "Address", + }, + { + FieldName: "MacAddress", + }, + { + FieldName: "EnableDHCP", + }, + { + FieldName: "EnableMasquerade", + }, + { + FieldName: "CreatedAt", + }, + { + FieldName: "UpdatedAt", + }, + { + FieldName: "Zone", + }, + }}, + } +} + +func vpcGwGatewayNetworkGet() *core.Command { + return &core.Command{ + Short: `Get a gateway connection to a Private Network`, + Long: `Get a gateway connection to a Private Network.`, + Namespace: "vpc-gw", + Resource: "gateway-network", + Verb: "get", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.GetGatewayNetworkRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-network-id", + Short: `ID of the GatewayNetwork to fetch`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.GetGatewayNetworkRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.GetGatewayNetwork(request) + + }, + } +} + +func vpcGwGatewayNetworkCreate() *core.Command { + return &core.Command{ + Short: `Attach a gateway to a Private Network`, + Long: `Attach a gateway to a Private Network.`, + Namespace: "vpc-gw", + Resource: "gateway-network", + Verb: "create", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.CreateGatewayNetworkRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-id", + Short: `Gateway to connect`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "private-network-id", + Short: `Private Network to connect`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "enable-masquerade", + Short: `Whether to enable masquerade on this network`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dhcpid", + Short: `Existing configuration`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "address", + Short: `Static IP address in CIDR format to to use without DHCP`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "enable-dhcp", + Short: `Whether to enable DHCP on this Private Network`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.CreateGatewayNetworkRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.CreateGatewayNetwork(request) + + }, + } +} + +func vpcGwGatewayNetworkUpdate() *core.Command { + return &core.Command{ + Short: `Update a gateway connection to a Private Network`, + Long: `Update a gateway connection to a Private Network.`, + Namespace: "vpc-gw", + Resource: "gateway-network", + Verb: "update", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.UpdateGatewayNetworkRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-network-id", + Short: `ID of the GatewayNetwork to update`, + Required: true, + Deprecated: false, + Positional: true, + }, + { + Name: "enable-masquerade", + Short: `New masquerade enablement`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dhcpid", + Short: `New DHCP configuration`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "enable-dhcp", + Short: `Whether to enable DHCP on the connected Private Network`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "address", + Short: `New static IP address`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.UpdateGatewayNetworkRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.UpdateGatewayNetwork(request) + + }, + } +} + +func vpcGwGatewayNetworkDelete() *core.Command { + return &core.Command{ + Short: `Detach a gateway from a Private Network`, + Long: `Detach a gateway from a Private Network.`, + Namespace: "vpc-gw", + Resource: "gateway-network", + Verb: "delete", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.DeleteGatewayNetworkRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-network-id", + Short: `GatewayNetwork to delete`, + Required: true, + Deprecated: false, + Positional: true, + }, + { + Name: "cleanup-dhcp", + Short: `Whether to cleanup the attached DHCP configuration`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.DeleteGatewayNetworkRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + e = api.DeleteGatewayNetwork(request) + if e != nil { + return nil, e + } + return &core.SuccessResult{ + Resource: "gateway-network", + Verb: "delete", + }, nil + }, + } +} + +func vpcGwDHCPList() *core.Command { + return &core.Command{ + Short: `List DHCP configurations`, + Long: `List DHCP configurations.`, + Namespace: "vpc-gw", + Resource: "dhcp", + Verb: "list", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.ListDHCPsRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "order-by", + Short: `Order in which to return results`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"created_at_asc", "created_at_desc", "subnet_asc", "subnet_desc"}, + }, + { + Name: "project-id", + Short: `Include only DHCPs in this project`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "address", + Short: `Filter on gateway address`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "has-address", + Short: `Filter on subnets containing address`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "organization-id", + Short: `Include only DHCPs in this organization`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.ListDHCPsRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + resp, err := api.ListDHCPs(request, scw.WithAllPages()) + if err != nil { + return nil, err + } + return resp.Dhcps, nil + + }, + View: &core.View{Fields: []*core.ViewField{ + { + FieldName: "ID", + }, + { + FieldName: "Subnet", + }, + { + FieldName: "Address", + }, + { + FieldName: "EnableDynamic", + }, + { + FieldName: "PoolLow", + }, + { + FieldName: "PoolHigh", + }, + { + FieldName: "PushDefaultRoute", + }, + { + FieldName: "PushDNSServer", + }, + { + FieldName: "DNSLocalName", + }, + { + FieldName: "DNSServersOverride", + }, + { + FieldName: "DNSSearch", + }, + { + FieldName: "ValidLifetime", + }, + { + FieldName: "RenewTimer", + }, + { + FieldName: "RebindTimer", + }, + { + FieldName: "UpdatedAt", + }, + { + FieldName: "CreatedAt", + }, + { + FieldName: "Zone", + }, + { + FieldName: "ProjectID", + }, + { + FieldName: "OrganizationID", + }, + }}, + } +} + +func vpcGwDHCPGet() *core.Command { + return &core.Command{ + Short: `Get a DHCP configuration`, + Long: `Get a DHCP configuration.`, + Namespace: "vpc-gw", + Resource: "dhcp", + Verb: "get", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.GetDHCPRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "dhcpid", + Short: `ID of the DHCP config to fetch`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.GetDHCPRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.GetDHCP(request) + + }, + } +} + +func vpcGwDHCPCreate() *core.Command { + return &core.Command{ + Short: `Create a DHCP configuration`, + Long: `Create a DHCP configuration.`, + Namespace: "vpc-gw", + Resource: "dhcp", + Verb: "create", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.CreateDHCPRequest{}), + ArgSpecs: core.ArgSpecs{ + core.ProjectIDArgSpec(), + { + Name: "subnet", + Short: `Subnet for the DHCP server`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "address", + Short: `Address of the DHCP server. This will be the gateway's address in the private network. Defaults to the first address of the subnet`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "pool-low", + Short: `Low IP (included) of the dynamic address pool`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "pool-high", + Short: `High IP (included) of the dynamic address pool`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "enable-dynamic", + Short: `Whether to enable dynamic pooling of IPs`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "valid-lifetime.seconds", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "valid-lifetime.nanos", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "renew-timer.seconds", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "renew-timer.nanos", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "rebind-timer.seconds", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "rebind-timer.nanos", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "push-default-route", + Short: `Whether the gateway should push a default route to DHCP clients or only hand out IPs. Defaults to true`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "push-dns-server", + Short: `Whether the gateway should push custom DNS servers to clients`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dns-servers-override.{index}", + Short: `Override the DNS server list pushed to DHCP clients, instead of the gateway itself`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dns-search.{index}", + Short: `Additional DNS search paths`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dns-local-name", + Short: `TLD given to hosts in the Private Network`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.CreateDHCPRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.CreateDHCP(request) + + }, + } +} + +func vpcGwDHCPUpdate() *core.Command { + return &core.Command{ + Short: `Update a DHCP configuration`, + Long: `Update a DHCP configuration.`, + Namespace: "vpc-gw", + Resource: "dhcp", + Verb: "update", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.UpdateDHCPRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "dhcpid", + Short: `DHCP config to update`, + Required: true, + Deprecated: false, + Positional: true, + }, + { + Name: "subnet", + Short: `Subnet for the DHCP server`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "address", + Short: `Address of the DHCP server. This will be the gateway's address in the private network`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "pool-low", + Short: `Low IP (included) of the dynamic address pool`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "pool-high", + Short: `High IP (included) of the dynamic address pool`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "enable-dynamic", + Short: `Whether to enable dynamic pooling of IPs`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "valid-lifetime.seconds", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "valid-lifetime.nanos", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "renew-timer.seconds", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "renew-timer.nanos", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "rebind-timer.seconds", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "rebind-timer.nanos", + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "push-default-route", + Short: `Whether the gateway should push a default route to DHCP clients or only hand out IPs`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "push-dns-server", + Short: `Whether the gateway should push custom DNS servers to clients`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dns-servers-override.{index}", + Short: `Override the DNS server list pushed to DHCP clients, instead of the gateway itself`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dns-search.{index}", + Short: `Additional DNS search paths`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dns-local-name", + Short: `TLD given to hosts in the Private Network`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.UpdateDHCPRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.UpdateDHCP(request) + + }, + } +} + +func vpcGwDHCPDelete() *core.Command { + return &core.Command{ + Short: `Delete a DHCP configuration`, + Long: `Delete a DHCP configuration.`, + Namespace: "vpc-gw", + Resource: "dhcp", + Verb: "delete", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.DeleteDHCPRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "dhcpid", + Short: `DHCP config id to delete`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.DeleteDHCPRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + e = api.DeleteDHCP(request) + if e != nil { + return nil, e + } + return &core.SuccessResult{ + Resource: "dhcp", + Verb: "delete", + }, nil + }, + } +} + +func vpcGwDHCPEntryList() *core.Command { + return &core.Command{ + Short: `List DHCP entries`, + Long: `List DHCP entries.`, + Namespace: "vpc-gw", + Resource: "dhcp-entry", + Verb: "list", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.ListDHCPEntriesRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "order-by", + Short: `Order in which to return results`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"created_at_asc", "created_at_desc", "ip_address_asc", "ip_address_desc", "hostname_asc", "hostname_desc"}, + }, + { + Name: "gateway-network-id", + Short: `Filter entries based on the gateway network they are on`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "mac-address", + Short: `Filter entries on their MAC address`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "ip-address", + Short: `Filter entries on their IP address`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "hostname", + Short: `Filter entries on their hostname substring`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "type", + Short: `Filter entries on their type`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"unknown", "reservation", "lease"}, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.ListDHCPEntriesRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + resp, err := api.ListDHCPEntries(request, scw.WithAllPages()) + if err != nil { + return nil, err + } + return resp.DHCPEntries, nil + + }, + View: &core.View{Fields: []*core.ViewField{ + { + FieldName: "ID", + }, + { + FieldName: "GatewayNetworkID", + }, + { + FieldName: "IPAddress", + }, + { + FieldName: "MacAddress", + }, + { + FieldName: "Hostname", + }, + { + FieldName: "Type", + }, + { + FieldName: "UpdatedAt", + }, + { + FieldName: "CreatedAt", + }, + { + FieldName: "Zone", + }, + }}, + } +} + +func vpcGwDHCPEntryGet() *core.Command { + return &core.Command{ + Short: `Get DHCP entries`, + Long: `Get DHCP entries.`, + Namespace: "vpc-gw", + Resource: "dhcp-entry", + Verb: "get", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.GetDHCPEntryRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "dhcp-entry-id", + Short: `ID of the DHCP entry to fetch`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.GetDHCPEntryRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.GetDHCPEntry(request) + + }, + } +} + +func vpcGwDHCPEntryCreate() *core.Command { + return &core.Command{ + Short: `Create a static DHCP reservation`, + Long: `Create a static DHCP reservation.`, + Namespace: "vpc-gw", + Resource: "dhcp-entry", + Verb: "create", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.CreateDHCPEntryRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-network-id", + Short: `GatewayNetwork on which to create a DHCP reservation`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "mac-address", + Short: `MAC address to give a static entry to`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "ip-address", + Short: `IP address to give to the machine`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.CreateDHCPEntryRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.CreateDHCPEntry(request) + + }, + } +} + +func vpcGwDHCPEntryUpdate() *core.Command { + return &core.Command{ + Short: `Update a DHCP entry`, + Long: `Update a DHCP entry.`, + Namespace: "vpc-gw", + Resource: "dhcp-entry", + Verb: "update", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.UpdateDHCPEntryRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "dhcp-entry-id", + Short: `DHCP entry ID to update`, + Required: true, + Deprecated: false, + Positional: true, + }, + { + Name: "ip-address", + Short: `New IP address to give to the machine`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.UpdateDHCPEntryRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.UpdateDHCPEntry(request) + + }, + } +} + +func vpcGwDHCPEntrySet() *core.Command { + return &core.Command{ + Short: `Set all DHCP reservations on a Gateway Network`, + Long: `Set the list of DHCP reservations attached to a Gateway Network. Reservations are identified by their MAC address, and will sync the current DHCP entry list to the given list, creating, updating or deleting DHCP entries. +`, + Namespace: "vpc-gw", + Resource: "dhcp-entry", + Verb: "set", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.SetDHCPEntriesRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-network-id", + Short: `Gateway Network on which to set DHCP reservation list`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dhcp-entries.{index}.mac-address", + Short: `MAC address to give a static entry to`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "dhcp-entries.{index}.ip-address", + Short: `IP address to give to the machine`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.SetDHCPEntriesRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.SetDHCPEntries(request) + + }, + } +} + +func vpcGwDHCPEntryDelete() *core.Command { + return &core.Command{ + Short: `Delete a DHCP reservation`, + Long: `Delete a DHCP reservation.`, + Namespace: "vpc-gw", + Resource: "dhcp-entry", + Verb: "delete", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.DeleteDHCPEntryRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "dhcp-entry-id", + Short: `DHCP entry ID to delete`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.DeleteDHCPEntryRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + e = api.DeleteDHCPEntry(request) + if e != nil { + return nil, e + } + return &core.SuccessResult{ + Resource: "dhcp-entry", + Verb: "delete", + }, nil + }, + } +} + +func vpcGwPatRuleList() *core.Command { + return &core.Command{ + Short: `List PAT rules`, + Long: `List PAT rules.`, + Namespace: "vpc-gw", + Resource: "pat-rule", + Verb: "list", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.ListPATRulesRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "order-by", + Short: `Order in which to return results`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"created_at_asc", "created_at_desc", "public_port_asc", "public_port_desc"}, + }, + { + Name: "gateway-id", + Short: `Fetch rules for this gateway`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "private-ip", + Short: `Fetch rules targeting this private ip`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "protocol", + Short: `Fetch rules for this protocol`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"unknown", "both", "tcp", "udp"}, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.ListPATRulesRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + resp, err := api.ListPATRules(request, scw.WithAllPages()) + if err != nil { + return nil, err + } + return resp.PatRules, nil + + }, + View: &core.View{Fields: []*core.ViewField{ + { + FieldName: "ID", + }, + { + FieldName: "GatewayID", + }, + { + FieldName: "PublicPort", + }, + { + FieldName: "PrivateIP", + }, + { + FieldName: "PrivatePort", + }, + { + FieldName: "Protocol", + }, + { + FieldName: "UpdatedAt", + }, + { + FieldName: "CreatedAt", + }, + { + FieldName: "Zone", + }, + }}, + } +} + +func vpcGwPatRuleGet() *core.Command { + return &core.Command{ + Short: `Get a PAT rule`, + Long: `Get a PAT rule.`, + Namespace: "vpc-gw", + Resource: "pat-rule", + Verb: "get", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.GetPATRuleRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "pat-rule-id", + Short: `PAT rule to get`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.GetPATRuleRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.GetPATRule(request) + + }, + } +} + +func vpcGwPatRuleCreate() *core.Command { + return &core.Command{ + Short: `Create a PAT rule`, + Long: `Create a PAT rule.`, + Namespace: "vpc-gw", + Resource: "pat-rule", + Verb: "create", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.CreatePATRuleRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-id", + Short: `Gateway on which to attach the rule to`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "public-port", + Short: `Public port to listen on`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "private-ip", + Short: `Private IP to forward data to`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "private-port", + Short: `Private port to translate to`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "protocol", + Short: `Protocol the rule should apply to`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"unknown", "both", "tcp", "udp"}, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.CreatePATRuleRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.CreatePATRule(request) + + }, + } +} + +func vpcGwPatRuleUpdate() *core.Command { + return &core.Command{ + Short: `Update a PAT rule`, + Long: `Update a PAT rule.`, + Namespace: "vpc-gw", + Resource: "pat-rule", + Verb: "update", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.UpdatePATRuleRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "pat-rule-id", + Short: `PAT rule to update`, + Required: true, + Deprecated: false, + Positional: true, + }, + { + Name: "public-port", + Short: `Public port to listen on`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "private-ip", + Short: `Private IP to forward data to`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "private-port", + Short: `Private port to translate to`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "protocol", + Short: `Protocol the rule should apply to`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"unknown", "both", "tcp", "udp"}, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.UpdatePATRuleRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.UpdatePATRule(request) + + }, + } +} + +func vpcGwPatRuleSet() *core.Command { + return &core.Command{ + Short: `Set all PAT rules on a Gateway`, + Long: `Set the list of PAT rules attached to a Gateway. Rules are identified by their public port and protocol. This will sync the current PAT rule list with the givent list, creating, updating or deleting PAT rules. +`, + Namespace: "vpc-gw", + Resource: "pat-rule", + Verb: "set", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.SetPATRulesRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "gateway-id", + Short: `Gateway on which to set the PAT rules`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "pat-rules.{index}.public-port", + Short: `Public port to listen on`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "pat-rules.{index}.private-ip", + Short: `Private IP to forward data to`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "pat-rules.{index}.private-port", + Short: `Private port to translate to`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "pat-rules.{index}.protocol", + Short: `Protocol the rule should apply to`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"unknown", "both", "tcp", "udp"}, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.SetPATRulesRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.SetPATRules(request) + + }, + } +} + +func vpcGwPatRuleDelete() *core.Command { + return &core.Command{ + Short: `Delete a PAT rule`, + Long: `Delete a PAT rule.`, + Namespace: "vpc-gw", + Resource: "pat-rule", + Verb: "delete", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.DeletePATRuleRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "pat-rule-id", + Short: `PAT rule to delete`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.DeletePATRuleRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + e = api.DeletePATRule(request) + if e != nil { + return nil, e + } + return &core.SuccessResult{ + Resource: "pat-rule", + Verb: "delete", + }, nil + }, + } +} + +func vpcGwGatewayTypeList() *core.Command { + return &core.Command{ + Short: `List VPC Public Gateway types`, + Long: `List VPC Public Gateway types.`, + Namespace: "vpc-gw", + Resource: "gateway-type", + Verb: "list", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.ListGatewayTypesRequest{}), + ArgSpecs: core.ArgSpecs{ + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.ListGatewayTypesRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.ListGatewayTypes(request) + + }, + } +} + +func vpcGwIPList() *core.Command { + return &core.Command{ + Short: `List IPs`, + Long: `List IPs.`, + Namespace: "vpc-gw", + Resource: "ip", + Verb: "list", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.ListIPsRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "order-by", + Short: `Order in which to return results`, + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"created_at_asc", "created_at_desc", "ip_asc", "ip_desc", "reverse_asc", "reverse_desc"}, + }, + { + Name: "project-id", + Short: `Include only IPs in this project`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "tags.{index}", + Short: `Filter IPs with these tags`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "reverse", + Short: `Filter by reverse containing this string`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "is-free", + Short: `Filter whether the IP is attached to a gateway or not`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "organization-id", + Short: `Include only IPs in this organization`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.ListIPsRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + resp, err := api.ListIPs(request, scw.WithAllPages()) + if err != nil { + return nil, err + } + return resp.IPs, nil + + }, + View: &core.View{Fields: []*core.ViewField{ + { + FieldName: "ID", + }, + { + FieldName: "Address", + }, + { + FieldName: "Reverse", + }, + { + FieldName: "Tags", + }, + { + FieldName: "UpdatedAt", + }, + { + FieldName: "CreatedAt", + }, + { + FieldName: "Zone", + }, + { + FieldName: "ProjectID", + }, + { + FieldName: "OrganizationID", + }, + }}, + } +} + +func vpcGwIPGet() *core.Command { + return &core.Command{ + Short: `Get an IP`, + Long: `Get an IP.`, + Namespace: "vpc-gw", + Resource: "ip", + Verb: "get", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.GetIPRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "ip-id", + Short: `ID of the IP to get`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.GetIPRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.GetIP(request) + + }, + } +} + +func vpcGwIPCreate() *core.Command { + return &core.Command{ + Short: `Reserve an IP`, + Long: `Reserve an IP.`, + Namespace: "vpc-gw", + Resource: "ip", + Verb: "create", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.CreateIPRequest{}), + ArgSpecs: core.ArgSpecs{ + core.ProjectIDArgSpec(), + { + Name: "tags.{index}", + Short: `Tags to give to the IP`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.CreateIPRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.CreateIP(request) + + }, + } +} + +func vpcGwIPUpdate() *core.Command { + return &core.Command{ + Short: `Update an IP`, + Long: `Update an IP.`, + Namespace: "vpc-gw", + Resource: "ip", + Verb: "update", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.UpdateIPRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "ip-id", + Short: `ID of the IP to update`, + Required: true, + Deprecated: false, + Positional: true, + }, + { + Name: "tags.{index}", + Short: `Tags to give to the IP`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "reverse", + Short: `Reverse to set on the IP. Empty string to unset`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "gateway-id", + Short: `Gateway to attach the IP to. Empty string to detach`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.UpdateIPRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + return api.UpdateIP(request) + + }, + } +} + +func vpcGwIPDelete() *core.Command { + return &core.Command{ + Short: `Delete an IP`, + Long: `Delete an IP.`, + Namespace: "vpc-gw", + Resource: "ip", + Verb: "delete", + // Deprecated: false, + ArgsType: reflect.TypeOf(vpcgw.DeleteIPRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "ip-id", + Short: `ID of the IP to delete`, + Required: true, + Deprecated: false, + Positional: true, + }, + core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZonePlWaw1), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*vpcgw.DeleteIPRequest) + + client := core.ExtractClient(ctx) + api := vpcgw.NewAPI(client) + e = api.DeleteIP(request) + if e != nil { + return nil, e + } + return &core.SuccessResult{ + Resource: "ip", + Verb: "delete", + }, nil + }, + } +}