Skip to content

Commit 8a0a88c

Browse files
komer3zliang-akamai
authored andcommitted
Add FrontendVPCs support to NodeBalancer structs
- Add `FrontendAddressType` and `FrontendVPCSubnetID` fields to `NodeBalancer` struct - Add `FrontendVPCs` field to `NodeBalancerCreateOptions` struct - Add clarifying comment to `IPv4RangeAutoAssign` field in `NodeBalancerVPCOptions`
1 parent 59230a7 commit 8a0a88c

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

nodebalancer.go

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ type NodeBalancer struct {
2222
IPv4 *string `json:"ipv4"`
2323
// This NodeBalancer's public IPv6 address.
2424
IPv6 *string `json:"ipv6"`
25+
// Frontend address type (e.g., "vpc")
26+
FrontendAddressType *string `json:"frontend_address_type,omitempty"`
27+
// Frontend VPC subnet ID when using VPC addressing
28+
FrontendVPCSubnetID *int `json:"frontend_vpc_subnet_id,omitempty"`
2529
// Throttle connections per second (0-20). Set to 0 (zero) to disable throttling.
2630
ClientConnThrottle int `json:"client_conn_throttle"`
2731

@@ -46,16 +50,18 @@ type NodeBalancerTransfer struct {
4650
// The total transfer, in MB, used by this NodeBalancer this month.
4751
Total *float64 `json:"total"`
4852
// The total inbound transfer, in MB, used for this NodeBalancer this month.
49-
Out *float64 `json:"out"`
50-
// The total outbound transfer, in MB, used for this NodeBalancer this month.
5153
In *float64 `json:"in"`
54+
// The total outbound transfer, in MB, used for this NodeBalancer this month.
55+
Out *float64 `json:"out"`
5256
}
5357

5458
type NodeBalancerVPCOptions struct {
55-
IPv4Range string `json:"ipv4_range,omitempty"`
56-
IPv6Range string `json:"ipv6_range,omitempty"`
57-
SubnetID int `json:"subnet_id"`
58-
IPv4RangeAutoAssign bool `json:"ipv4_range_auto_assign,omitempty"`
59+
IPv4Range string `json:"ipv4_range,omitempty"`
60+
IPv6Range string `json:"ipv6_range,omitempty"`
61+
SubnetID int `json:"subnet_id"`
62+
// IPv4RangeAutoAssign is only used for backend VPC configuration.
63+
// For frontend VPCs, this field is ignored.
64+
IPv4RangeAutoAssign bool `json:"ipv4_range_auto_assign,omitempty"`
5965
}
6066

6167
// NodeBalancerCreateOptions are the options permitted for CreateNodeBalancer
@@ -67,12 +73,13 @@ type NodeBalancerCreateOptions struct {
6773
// NOTE: ClientUDPSessThrottle may not currently be available to all users.
6874
ClientUDPSessThrottle *int `json:"client_udp_sess_throttle,omitempty"`
6975

70-
Configs []*NodeBalancerConfigCreateOptions `json:"configs,omitempty"`
71-
Tags []string `json:"tags"`
72-
FirewallID int `json:"firewall_id,omitempty"`
73-
Type NodeBalancerPlanType `json:"type,omitempty"`
74-
VPCs []NodeBalancerVPCOptions `json:"vpcs,omitempty"`
75-
IPv4 *string `json:"ipv4,omitempty"`
76+
Configs []*NodeBalancerConfigCreateOptions `json:"configs,omitempty"`
77+
Tags []string `json:"tags"`
78+
FirewallID int `json:"firewall_id,omitempty"`
79+
Type NodeBalancerPlanType `json:"type,omitempty"`
80+
VPCs []NodeBalancerVPCOptions `json:"vpcs,omitempty"`
81+
FrontendVPCs []NodeBalancerVPCOptions `json:"frontend_vpcs,omitempty"`
82+
IPv4 *string `json:"ipv4,omitempty"`
7683
}
7784

7885
// NodeBalancerUpdateOptions are the options permitted for UpdateNodeBalancer

0 commit comments

Comments
 (0)