Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vpcgw): add initial support for v1 #2003

Merged
merged 2 commits into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-gw-dh-cpusage.golden
Original file line number Diff line number Diff line change
@@ -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 <command>

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.
35 changes: 35 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-create-usage.golden
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-delete-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete a DHCP configuration.

USAGE:
scw vpc-gw dhcp delete <dhcpid ...> [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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete a DHCP reservation.

USAGE:
scw vpc-gw dhcp-entry delete <dhcp-entry-id ...> [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
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get DHCP entries.

USAGE:
scw vpc-gw dhcp-entry get <dhcp-entry-id ...> [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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update a DHCP entry.

USAGE:
scw vpc-gw dhcp-entry update <dhcp-entry-id ...> [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
25 changes: 25 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-entry-usage.golden
Original file line number Diff line number Diff line change
@@ -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 <command>

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.
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-get-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get a DHCP configuration.

USAGE:
scw vpc-gw dhcp get <dhcpid ...> [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
23 changes: 23 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-list-usage.golden
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-update-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update a DHCP configuration.

USAGE:
scw vpc-gw dhcp update <dhcpid ...> [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
Original file line number Diff line number Diff line change
@@ -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=<generated>] 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete a VPC Public Gateway.

USAGE:
scw vpc-gw gateway delete <gateway-id ...> [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
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-gw-gateway-get-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get a VPC Public Gateway.

USAGE:
scw vpc-gw gateway get <gateway-id ...> [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
Loading