@@ -5,12 +5,23 @@ import "time"
5
5
// GatewayConfiguredStatus represents a desired status of the service
6
6
type GatewayConfiguredStatus string
7
7
8
- // GatewayConfiguredStatus represents a current actual status of the service
8
+ // GatewayConfiguredStatus represents current, actual status of the service
9
9
type GatewayOperationalState string
10
10
11
11
// GatewayFeature represents a feature of the service
12
12
type GatewayFeature string
13
13
14
+ // GatewayTunnelOperationalState represents current, actual status of the tunnel
15
+ type GatewayTunnelOperationalState string
16
+
17
+ type (
18
+ GatewayConnectionType string
19
+ GatewayRouteType string
20
+ GatewayIPSecAuthType string
21
+ GatewayIPSecAlgorithm string
22
+ GatewayIPSecIntegrityAlgorithm string
23
+ )
24
+
14
25
const (
15
26
GatewayConfiguredStatusStarted GatewayConfiguredStatus = "started"
16
27
GatewayConfiguredStatusStopped GatewayConfiguredStatus = "stopped"
@@ -30,14 +41,55 @@ const (
30
41
GatewayOperationalStateDeleteLinkNetwork GatewayOperationalState = "delete-link-network"
31
42
GatewayOperationalStateDeleteService GatewayOperationalState = "delete-service"
32
43
33
- // GatewayFeatureNAT is the network address translation (NAT) feature of the network gateway
44
+ GatewayTunnelOperationalStateUninitialized GatewayTunnelOperationalState = "uninitialized"
45
+ GatewayTunnelOperationalStateCreated GatewayTunnelOperationalState = "created"
46
+ GatewayTunnelOperationalStateConnecting GatewayTunnelOperationalState = "connecting"
47
+ GatewayTunnelOperationalStateEstabilished GatewayTunnelOperationalState = "established"
48
+ GatewayTunnelOperationalStateRekeying GatewayTunnelOperationalState = "rekeying"
49
+ GatewayTunnelOperationalStateRekeyed GatewayTunnelOperationalState = "rekeyed"
50
+ GatewayTunnelOperationalStateDeleting GatewayTunnelOperationalState = "deleting"
51
+ GatewayTunnelOperationalStateDestroying GatewayTunnelOperationalState = "destroying"
52
+ GatewayTunnelOperationalStateUnknown GatewayTunnelOperationalState = "unknown"
53
+
54
+ // GatewayFeatureNAT is a Network Address Translation (NAT) service that offers a way for cloud servers in SDN private networks to connect to the Internet through the public IP assigned to the network gateway service
34
55
GatewayFeatureNAT GatewayFeature = "nat"
56
+
57
+ // GatewayFeatureVPN is a Virtual Private Network (VPN) service used to establish an encrypted network connection when using public networks
58
+ // Please note that VPN feature is currently in beta. You can learn more about it on its [product page]
59
+ // Also note that VPN is available only in some of the gateway plans. To check which plans support VPN, you can use the GetGatewayPlans method.
60
+ //
61
+ // [product page]: https://upcloud.com/resources/docs/networking#nat-and-vpn-gateways
62
+ GatewayFeatureVPN GatewayFeature = "vpn"
63
+
64
+ GatewayConnectionTypeIPSec GatewayConnectionType = "ipsec"
65
+
66
+ GatewayRouteTypeStatic GatewayRouteType = "static"
67
+
68
+ GatewayTunnelIPSecAuthTypePSK GatewayIPSecAuthType = "psk"
69
+
70
+ GatewayIPSecAlgorithm_aes128gcm16 GatewayIPSecAlgorithm = "aes128gcm16"
71
+ GatewayIPSecAlgorithm_aes128gcm128 GatewayIPSecAlgorithm = "aes128gcm128"
72
+ GatewayIPSecAlgorithm_aes192gcm16 GatewayIPSecAlgorithm = "aes192gcm16"
73
+ GatewayIPSecAlgorithm_aes192gcm128 GatewayIPSecAlgorithm = "aes192gcm128"
74
+ GatewayIPSecAlgorithm_aes256gcm16 GatewayIPSecAlgorithm = "aes256gcm16"
75
+ GatewayIPSecAlgorithm_aes256gcm128 GatewayIPSecAlgorithm = "aes256gcm128"
76
+ GatewayIPSecAlgorithm_aes128 GatewayIPSecAlgorithm = "aes128"
77
+ GatewayIPSecAlgorithm_aes192 GatewayIPSecAlgorithm = "aes192"
78
+ GatewayIPSecAlgorithm_aes256 GatewayIPSecAlgorithm = "aes256"
79
+
80
+ GatewayIPSecIntegrityAlgorithm_aes128gmac GatewayIPSecIntegrityAlgorithm = "aes128gmac"
81
+ GatewayIPSecIntegrityAlgorithm_aes256gmac GatewayIPSecIntegrityAlgorithm = "aes256gmac"
82
+ GatewayIPSecIntegrityAlgorithm_sha1 GatewayIPSecIntegrityAlgorithm = "sha1"
83
+ GatewayIPSecIntegrityAlgorithm_sha256 GatewayIPSecIntegrityAlgorithm = "sha256"
84
+ GatewayIPSecIntegrityAlgorithm_sha384 GatewayIPSecIntegrityAlgorithm = "sha384"
85
+ GatewayIPSecIntegrityAlgorithm_sha512 GatewayIPSecIntegrityAlgorithm = "sha512"
35
86
)
36
87
37
88
type Gateway struct {
38
89
UUID string `json:"uuid,omitempty"`
39
90
Name string `json:"name,omitempty"`
40
91
Zone string `json:"zone,omitempty"`
92
+ Plan string `json:"plan,omitempty"`
41
93
Labels []Label `json:"labels,omitempty"`
42
94
ConfiguredStatus GatewayConfiguredStatus `json:"configured_status,omitempty"`
43
95
OperationalState GatewayOperationalState `json:"operational_state,omitempty"`
@@ -46,6 +98,7 @@ type Gateway struct {
46
98
CreatedAt time.Time `json:"created_at,omitempty"`
47
99
UpdatedAt time.Time `json:"updated_at,omitempty"`
48
100
Addresses []GatewayAddress `json:"addresses,omitempty"`
101
+ Connections []GatewayConnection `json:"connections,omitempty"`
49
102
}
50
103
51
104
type GatewayAddress struct {
@@ -57,3 +110,82 @@ type GatewayRouter struct {
57
110
CreatedAt time.Time `json:"created_at,omitempty"`
58
111
UUID string `json:"uuid,omitempty"`
59
112
}
113
+
114
+ type GatewayConnection struct {
115
+ Name string `json:"name,omitempty"`
116
+ Type GatewayConnectionType `json:"type,omitempty"`
117
+ LocalRoutes []GatewayRoute `json:"local_routes,omitempty"`
118
+ RemoteRoutes []GatewayRoute `json:"remote_routes,omitempty"`
119
+ Tunnels []GatewayTunnel `json:"tunnels,omitempty"`
120
+ CreatedAt time.Time `json:"created_at,omitempty"`
121
+ UpdatedAt time.Time `json:"updated_at,omitempty"`
122
+ }
123
+
124
+ type GatewayRoute struct {
125
+ Name string `json:"name,omitempty"`
126
+ StaticNetwork string `json:"static_network,omitempty"`
127
+ Type GatewayRouteType `json:"type,omitempty"`
128
+ }
129
+
130
+ type GatewayTunnel struct {
131
+ Name string `json:"name,omitempty"`
132
+ LocalAddress GatewayTunnelLocalAddress `json:"local_address,omitempty"`
133
+ RemoteAddress GatewayTunnelRemoteAddress `json:"remote_address,omitempty"`
134
+ IPSec GatewayTunnelIPSec `json:"ipsec,omitempty"`
135
+ OperationalState GatewayTunnelOperationalState `json:"operational_state,omitempty"`
136
+ CreatedAt time.Time `json:"created_at,omitempty"`
137
+ UpdatedAt time.Time `json:"updated_at,omitempty"`
138
+ }
139
+
140
+ type GatewayTunnelLocalAddress struct {
141
+ // Name of the UpCloud gateway address; should correspond to the name of one of the gateway address structs
142
+ Name string `json:"name,omitempty"`
143
+ }
144
+
145
+ type GatewayTunnelRemoteAddress struct {
146
+ // Address is a remote peer address VPN will connect to; must be global non-private unicast IP address.
147
+ Address string `json:"address,omitempty"`
148
+ }
149
+
150
+ type GatewayTunnelIPSec struct {
151
+ // Tunnel IPSec authentication object
152
+ Authentication GatewayTunnelIPSecAuth `json:"authentication,omitempty"`
153
+ // IKE SA rekey time in seconds
154
+ RekeyTime int `json:"rekey_time,omitempty"`
155
+ // IKE child SA rekey time in seconds
156
+ ChildRekeyTime int `json:"child_rekey_time,omitempty"`
157
+ // Delay before sending Dead Peer Detection packets if no traffic is detected, in seconds
158
+ DPDDelay int `json:"dpd_delay,omitempty"`
159
+ // Timeout period for DPD reply before considering the peer to be dead, in seconds
160
+ DPDTimeout int `json:"dpd_timeout,omitempty"`
161
+ // Maximum IKE SA lifetime in seconds
162
+ IKELifetime int `json:"ike_lifetime,omitempty"`
163
+ // List of Phase 1: Proposal algorithms
164
+ Phase1Algorithms []GatewayIPSecAlgorithm `json:"phase1_algorithms,omitempty"`
165
+ // List of Phase 1 integrity algorithms
166
+ Phase1IntegrityAlgorithms []GatewayIPSecIntegrityAlgorithm `json:"phase1_integrity_algorithms,omitempty"`
167
+ // List of Phase 1 Diffie-Hellman group numbers
168
+ Phase1DHGroupNumbers []int `json:"phase1_dh_group_numbers,omitempty"`
169
+ // List of Phase 2: Security Association algorithms
170
+ Phase2Algorithms []GatewayIPSecAlgorithm `json:"phase2_algorithms,omitempty"`
171
+ // List of Phase 2 integrity algorithms
172
+ Phase2IntegrityAlgorithms []GatewayIPSecIntegrityAlgorithm `json:"phase2_integrity_algorithms,omitempty"`
173
+ // List of Phase 2 Diffie-Hellman group numbers
174
+ Phase2DHGroupNumbers []int `json:"phase2_dh_group_numbers,omitempty"`
175
+ }
176
+
177
+ type GatewayTunnelIPSecAuth struct {
178
+ Authentication GatewayIPSecAuthType `json:"authentication,omitempty"`
179
+ // PSK is a user-provided pre-shared key.
180
+ // Note that this field is only meant to be used when providing API with your pre-shared key; it will always be empty in API responses
181
+ PSK string `json:"psk,omitempty"`
182
+ }
183
+
184
+ type GatewayPlan struct {
185
+ Name string `json:"name,omitempty"`
186
+ PerGatewayBandwidthMbps int `json:"per_gateway_bandwidth_mbps,omitempty"`
187
+ PerGatewayMaxConnections int `json:"per_gateway_max_connections,omitempty"`
188
+ ServerNumber int `json:"server_number,omitempty"`
189
+ SupportedFeatures []GatewayFeature `json:"supported_features,omitempty"`
190
+ VPNTunnelAmount int `json:"vpn_tunnel_amount,omitempty"`
191
+ }
0 commit comments