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(pgw): ipam config for native vpc integration #1825

Merged
merged 1 commit into from
Sep 8, 2023
Merged
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
31 changes: 22 additions & 9 deletions api/vpcgw/v1/vpcgw_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,12 @@ type IP struct {
Zone scw.Zone `json:"zone"`
}

// IpamConfig: ipam config.
type IpamConfig struct {
// PushDefaultRoute: defines whether the default route is enabled on that Gateway Network.
PushDefaultRoute bool `json:"push_default_route"`
}

// ListDHCPEntriesResponse: list dhcp entries response.
type ListDHCPEntriesResponse struct {
// DHCPEntries: DHCP entries in this page.
Expand Down Expand Up @@ -1118,17 +1124,21 @@ type CreateGatewayNetworkRequest struct {
PrivateNetworkID string `json:"private_network_id"`
// EnableMasquerade: defines whether to enable masquerade (dynamic NAT) on this network.
EnableMasquerade bool `json:"enable_masquerade"`
// EnableDHCP: defines whether to enable DHCP on this Private Network. Defaults to `true` if either `dhcp_id` or `dhcp` are present. If set to `true`, either `dhcp_id` or `dhcp` must be present.
EnableDHCP *bool `json:"enable_dhcp"`
// DHCPID: ID of an existing DHCP configuration object to use for this GatewayNetwork.
// Precisely one of Address, DHCP, DHCPID must be set.
// Precisely one of Address, DHCP, DHCPID, IpamConfig must be set.
DHCPID *string `json:"dhcp_id,omitempty"`
// DHCP: new DHCP configuration object to use for this GatewayNetwork.
// Precisely one of Address, DHCP, DHCPID must be set.
// Precisely one of Address, DHCP, DHCPID, IpamConfig must be set.
DHCP *CreateDHCPRequest `json:"dhcp,omitempty"`
// Address: static IP address in CIDR format to to use without DHCP.
// Precisely one of Address, DHCP, DHCPID must be set.
// Precisely one of Address, DHCP, DHCPID, IpamConfig must be set.
Address *scw.IPNet `json:"address,omitempty"`
// EnableDHCP: defines whether to enable DHCP on this Private Network. Defaults to `true` if either `dhcp_id` or `dhcp` are present. If set to `true`, either `dhcp_id` or `dhcp` must be present.
EnableDHCP *bool `json:"enable_dhcp"`
// IpamConfig: auto-configure the GatewayNetwork using Scaleway's IPAM (IP address management service).
// Note: all or none of the GatewayNetworks for a single gateway can use the IPAM. DHCP and IPAM configurations cannot be mixed. Some products may require that the Public Gateway uses the IPAM, to ensure correct functionality.
// Precisely one of Address, DHCP, DHCPID, IpamConfig must be set.
IpamConfig *IpamConfig `json:"ipam_config,omitempty"`
}

// CreateGatewayNetwork: attach a Public Gateway to a Private Network.
Expand Down Expand Up @@ -1172,14 +1182,17 @@ type UpdateGatewayNetworkRequest struct {
GatewayNetworkID string `json:"-"`
// EnableMasquerade: defines whether to enable masquerade (dynamic NAT) on the GatewayNetwork.
EnableMasquerade *bool `json:"enable_masquerade"`
// DHCPID: ID of the new DHCP configuration object to use with this GatewayNetwork.
// Precisely one of Address, DHCPID must be set.
DHCPID *string `json:"dhcp_id,omitempty"`
// EnableDHCP: defines whether to enable DHCP on the connected Private Network.
EnableDHCP *bool `json:"enable_dhcp"`
// DHCPID: ID of the new DHCP configuration object to use with this GatewayNetwork.
// Precisely one of Address, DHCPID, IpamConfig must be set.
DHCPID *string `json:"dhcp_id,omitempty"`
// Address: new static IP address.
// Precisely one of Address, DHCPID must be set.
// Precisely one of Address, DHCPID, IpamConfig must be set.
Address *scw.IPNet `json:"address,omitempty"`
// IpamConfig: new IPAM configuration to use for this GatewayNetwork.
// Precisely one of Address, DHCPID, IpamConfig must be set.
IpamConfig *IpamConfig `json:"ipam_config,omitempty"`
}

// UpdateGatewayNetwork: update a Public Gateway's connection to a Private Network.
Expand Down
Loading