@scaleway/sdk-vpcgw 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/license.md +3 -0
- package/dist/metadata.gen.d.ts +12 -0
- package/dist/metadata.gen.js +13 -0
- package/dist/v1/api.gen.d.ts +2 -2
- package/dist/v1/api.gen.js +216 -480
- package/dist/v1/content.gen.js +2 -2
- package/dist/v1/marshalling.gen.js +36 -36
- package/dist/v1/metadata.gen.js +1 -1
- package/dist/v2/api.gen.d.ts +2 -2
- package/dist/v2/api.gen.js +161 -333
- package/dist/v2/content.gen.js +2 -2
- package/dist/v2/marshalling.gen.js +26 -26
- package/dist/v2/metadata.gen.js +1 -1
- package/package.json +16 -6
- package/LICENSE +0 -191
package/dist/v2/api.gen.js
CHANGED
|
@@ -2,345 +2,173 @@ import { GATEWAY_NETWORK_TRANSIENT_STATUSES, GATEWAY_TRANSIENT_STATUSES } from "
|
|
|
2
2
|
import { marshalAddBastionAllowedIPsRequest, marshalCreateGatewayNetworkRequest, marshalCreateGatewayRequest, marshalCreateIPRequest, marshalCreatePatRuleRequest, marshalSetBastionAllowedIPsRequest, marshalSetPatRulesRequest, marshalUpdateGatewayNetworkRequest, marshalUpdateGatewayRequest, marshalUpdateIPRequest, marshalUpdatePatRuleRequest, marshalUpgradeGatewayRequest, unmarshalAddBastionAllowedIPsResponse, unmarshalGateway, unmarshalGatewayNetwork, unmarshalIP, unmarshalListGatewayNetworksResponse, unmarshalListGatewayTypesResponse, unmarshalListGatewaysResponse, unmarshalListIPsResponse, unmarshalListPatRulesResponse, unmarshalPatRule, unmarshalSetBastionAllowedIPsResponse, unmarshalSetPatRulesResponse } from "./marshalling.gen.js";
|
|
3
3
|
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
4
|
//#region src/v2/api.gen.ts
|
|
5
|
-
|
|
5
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
6
6
|
/**
|
|
7
7
|
* Public Gateways API.
|
|
8
8
|
|
|
9
9
|
This API allows you to manage your Public Gateways.
|
|
10
10
|
*/
|
|
11
11
|
var API = class extends API$1 {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* List PAT rules. List PAT rules. You can filter by gateway ID to list all PAT rules for a particular gateway, or filter for PAT rules targeting a specific IP address or using a specific protocol.
|
|
174
|
-
*
|
|
175
|
-
* @param request - The request {@link ListPatRulesRequest}
|
|
176
|
-
* @returns A Promise of ListPatRulesResponse
|
|
177
|
-
*/
|
|
178
|
-
listPatRules = (request = {}) => enrichForPagination("patRules", this.pageOfListPatRules, request);
|
|
179
|
-
/**
|
|
180
|
-
* Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response object gives full details of the PAT rule, including the Public Gateway it belongs to and the configuration settings in terms of public / private ports, private IP and protocol.
|
|
181
|
-
*
|
|
182
|
-
* @param request - The request {@link GetPatRuleRequest}
|
|
183
|
-
* @returns A Promise of PatRule
|
|
184
|
-
*/
|
|
185
|
-
getPatRule = (request) => this.client.fetch({
|
|
186
|
-
method: "GET",
|
|
187
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
|
|
188
|
-
}, unmarshalPatRule);
|
|
189
|
-
/**
|
|
190
|
-
* Create a PAT rule. Create a new PAT rule on a specified Public Gateway, defining the protocol to use, public port to listen on, and private port / IP address to map to.
|
|
191
|
-
*
|
|
192
|
-
* @param request - The request {@link CreatePatRuleRequest}
|
|
193
|
-
* @returns A Promise of PatRule
|
|
194
|
-
*/
|
|
195
|
-
createPatRule = (request) => this.client.fetch({
|
|
196
|
-
body: JSON.stringify(marshalCreatePatRuleRequest(request, this.client.settings)),
|
|
197
|
-
headers: jsonContentHeaders,
|
|
198
|
-
method: "POST",
|
|
199
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
|
|
200
|
-
}, unmarshalPatRule);
|
|
201
|
-
/**
|
|
202
|
-
* Update a PAT rule. Update a PAT rule, specified by its PAT rule ID. Configuration settings including private/public port, private IP address and protocol can all be updated.
|
|
203
|
-
*
|
|
204
|
-
* @param request - The request {@link UpdatePatRuleRequest}
|
|
205
|
-
* @returns A Promise of PatRule
|
|
206
|
-
*/
|
|
207
|
-
updatePatRule = (request) => this.client.fetch({
|
|
208
|
-
body: JSON.stringify(marshalUpdatePatRuleRequest(request, this.client.settings)),
|
|
209
|
-
headers: jsonContentHeaders,
|
|
210
|
-
method: "PATCH",
|
|
211
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
|
|
212
|
-
}, unmarshalPatRule);
|
|
213
|
-
/**
|
|
214
|
-
* Set all PAT rules. Set a definitive list of PAT rules attached to a Public Gateway. Each rule is identified by its public port and protocol. This will sync the current PAT rule list on the gateway with the new list, creating, updating or deleting PAT rules accordingly.
|
|
215
|
-
*
|
|
216
|
-
* @param request - The request {@link SetPatRulesRequest}
|
|
217
|
-
* @returns A Promise of SetPatRulesResponse
|
|
218
|
-
*/
|
|
219
|
-
setPatRules = (request) => this.client.fetch({
|
|
220
|
-
body: JSON.stringify(marshalSetPatRulesRequest(request, this.client.settings)),
|
|
221
|
-
headers: jsonContentHeaders,
|
|
222
|
-
method: "PUT",
|
|
223
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
|
|
224
|
-
}, unmarshalSetPatRulesResponse);
|
|
225
|
-
/**
|
|
226
|
-
* Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This action is irreversible.
|
|
227
|
-
*
|
|
228
|
-
* @param request - The request {@link DeletePatRuleRequest}
|
|
229
|
-
*/
|
|
230
|
-
deletePatRule = (request) => this.client.fetch({
|
|
231
|
-
method: "DELETE",
|
|
232
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
|
|
233
|
-
});
|
|
234
|
-
/**
|
|
235
|
-
* List Public Gateway types. List the different Public Gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available gateway type.
|
|
236
|
-
*
|
|
237
|
-
* @param request - The request {@link ListGatewayTypesRequest}
|
|
238
|
-
* @returns A Promise of ListGatewayTypesResponse
|
|
239
|
-
*/
|
|
240
|
-
listGatewayTypes = (request = {}) => this.client.fetch({
|
|
241
|
-
method: "GET",
|
|
242
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-types`
|
|
243
|
-
}, unmarshalListGatewayTypesResponse);
|
|
244
|
-
pageOfListIPs = (request = {}) => this.client.fetch({
|
|
245
|
-
method: "GET",
|
|
246
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`,
|
|
247
|
-
urlParams: urlParams(["is_free", request.isFree], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["reverse", request.reverse], ["tags", request.tags])
|
|
248
|
-
}, unmarshalListIPsResponse);
|
|
249
|
-
/**
|
|
250
|
-
* List IPs. List Public Gateway flexible IP addresses. A number of filter options are available for limiting results in the response.
|
|
251
|
-
*
|
|
252
|
-
* @param request - The request {@link ListIPsRequest}
|
|
253
|
-
* @returns A Promise of ListIPsResponse
|
|
254
|
-
*/
|
|
255
|
-
listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
|
|
256
|
-
/**
|
|
257
|
-
* Get an IP. Get details of a Public Gateway flexible IP address, identified by its IP ID. The response object contains information including which (if any) Public Gateway using this IP address, the reverse and various other metadata.
|
|
258
|
-
*
|
|
259
|
-
* @param request - The request {@link GetIPRequest}
|
|
260
|
-
* @returns A Promise of IP
|
|
261
|
-
*/
|
|
262
|
-
getIP = (request) => this.client.fetch({
|
|
263
|
-
method: "GET",
|
|
264
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
265
|
-
}, unmarshalIP);
|
|
266
|
-
/**
|
|
267
|
-
* Reserve an IP. Create (reserve) a new flexible IP address that can be used for a Public Gateway in a specified Scaleway Project.
|
|
268
|
-
*
|
|
269
|
-
* @param request - The request {@link CreateIPRequest}
|
|
270
|
-
* @returns A Promise of IP
|
|
271
|
-
*/
|
|
272
|
-
createIP = (request = {}) => this.client.fetch({
|
|
273
|
-
body: JSON.stringify(marshalCreateIPRequest(request, this.client.settings)),
|
|
274
|
-
headers: jsonContentHeaders,
|
|
275
|
-
method: "POST",
|
|
276
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`
|
|
277
|
-
}, unmarshalIP);
|
|
278
|
-
/**
|
|
279
|
-
* Update an IP. Update details of an existing flexible IP address, including its tags, reverse and the Public Gateway it is assigned to.
|
|
280
|
-
*
|
|
281
|
-
* @param request - The request {@link UpdateIPRequest}
|
|
282
|
-
* @returns A Promise of IP
|
|
283
|
-
*/
|
|
284
|
-
updateIP = (request) => this.client.fetch({
|
|
285
|
-
body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
|
|
286
|
-
headers: jsonContentHeaders,
|
|
287
|
-
method: "PATCH",
|
|
288
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
289
|
-
}, unmarshalIP);
|
|
290
|
-
/**
|
|
291
|
-
* Delete an IP. Delete a flexible IP address from your account. This action is irreversible.
|
|
292
|
-
*
|
|
293
|
-
* @param request - The request {@link DeleteIPRequest}
|
|
294
|
-
*/
|
|
295
|
-
deleteIP = (request) => this.client.fetch({
|
|
296
|
-
method: "DELETE",
|
|
297
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
298
|
-
});
|
|
299
|
-
/**
|
|
300
|
-
* Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself.
|
|
301
|
-
*
|
|
302
|
-
* @param request - The request {@link RefreshSSHKeysRequest}
|
|
303
|
-
* @returns A Promise of Gateway
|
|
304
|
-
*/
|
|
305
|
-
refreshSSHKeys = (request) => this.client.fetch({
|
|
306
|
-
body: "{}",
|
|
307
|
-
headers: jsonContentHeaders,
|
|
308
|
-
method: "POST",
|
|
309
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/refresh-ssh-keys`
|
|
310
|
-
}, unmarshalGateway);
|
|
311
|
-
/**
|
|
312
|
-
* Add allowed IP range to SSH bastion. Add an IP range (in CIDR notation) to be allowed to connect to the SSH bastion.
|
|
313
|
-
*
|
|
314
|
-
* @param request - The request {@link AddBastionAllowedIPsRequest}
|
|
315
|
-
* @returns A Promise of AddBastionAllowedIPsResponse
|
|
316
|
-
*/
|
|
317
|
-
addBastionAllowedIPs = (request) => this.client.fetch({
|
|
318
|
-
body: JSON.stringify(marshalAddBastionAllowedIPsRequest(request, this.client.settings)),
|
|
319
|
-
headers: jsonContentHeaders,
|
|
320
|
-
method: "POST",
|
|
321
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/bastion-allowed-ips`
|
|
322
|
-
}, unmarshalAddBastionAllowedIPsResponse);
|
|
323
|
-
/**
|
|
324
|
-
* Set all IP ranges allowed for SSH bastion. Set a definitive list of IP ranges (in CIDR notation) allowed to connect to the SSH bastion.
|
|
325
|
-
*
|
|
326
|
-
* @param request - The request {@link SetBastionAllowedIPsRequest}
|
|
327
|
-
* @returns A Promise of SetBastionAllowedIPsResponse
|
|
328
|
-
*/
|
|
329
|
-
setBastionAllowedIPs = (request) => this.client.fetch({
|
|
330
|
-
body: JSON.stringify(marshalSetBastionAllowedIPsRequest(request, this.client.settings)),
|
|
331
|
-
headers: jsonContentHeaders,
|
|
332
|
-
method: "PUT",
|
|
333
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/bastion-allowed-ips`
|
|
334
|
-
}, unmarshalSetBastionAllowedIPsResponse);
|
|
335
|
-
/**
|
|
336
|
-
* Delete allowed IP range from SSH bastion. Delete an IP range (defined in CIDR notation) from SSH bastion, so that it is no longer allowed to connect.
|
|
337
|
-
*
|
|
338
|
-
* @param request - The request {@link DeleteBastionAllowedIPsRequest}
|
|
339
|
-
*/
|
|
340
|
-
deleteBastionAllowedIPs = (request) => this.client.fetch({
|
|
341
|
-
method: "DELETE",
|
|
342
|
-
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/bastion-allowed-ips/${validatePathParam("ipRange", request.ipRange)}`
|
|
343
|
-
});
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.pageOfListGateways = (request = {}) => this.client.fetch({
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`,
|
|
17
|
+
urlParams: urlParams(["include_legacy", request.includeLegacy], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_ids", request.privateNetworkIds], ["project_id", request.projectId], ["status", request.status], ["tags", request.tags], ["types", request.types])
|
|
18
|
+
}, unmarshalListGatewaysResponse);
|
|
19
|
+
this.listGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListGateways, request);
|
|
20
|
+
this.getGateway = (request) => this.client.fetch({
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
|
|
23
|
+
}, unmarshalGateway);
|
|
24
|
+
this.waitForGateway = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))), this.getGateway, request, options);
|
|
25
|
+
this.createGateway = (request) => this.client.fetch({
|
|
26
|
+
body: JSON.stringify(marshalCreateGatewayRequest(request, this.client.settings)),
|
|
27
|
+
headers: jsonContentHeaders,
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`
|
|
30
|
+
}, unmarshalGateway);
|
|
31
|
+
this.updateGateway = (request) => this.client.fetch({
|
|
32
|
+
body: JSON.stringify(marshalUpdateGatewayRequest(request, this.client.settings)),
|
|
33
|
+
headers: jsonContentHeaders,
|
|
34
|
+
method: "PATCH",
|
|
35
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
|
|
36
|
+
}, unmarshalGateway);
|
|
37
|
+
this.deleteGateway = (request) => this.client.fetch({
|
|
38
|
+
method: "DELETE",
|
|
39
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`,
|
|
40
|
+
urlParams: urlParams(["delete_ip", request.deleteIp])
|
|
41
|
+
}, unmarshalGateway);
|
|
42
|
+
this.upgradeGateway = (request) => this.client.fetch({
|
|
43
|
+
body: JSON.stringify(marshalUpgradeGatewayRequest(request, this.client.settings)),
|
|
44
|
+
headers: jsonContentHeaders,
|
|
45
|
+
method: "POST",
|
|
46
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/upgrade`
|
|
47
|
+
}, unmarshalGateway);
|
|
48
|
+
this.pageOfListGatewayNetworks = (request = {}) => this.client.fetch({
|
|
49
|
+
method: "GET",
|
|
50
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`,
|
|
51
|
+
urlParams: urlParams(["gateway_ids", request.gatewayIds], ["masquerade_enabled", request.masqueradeEnabled], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_ids", request.privateNetworkIds], ["status", request.status])
|
|
52
|
+
}, unmarshalListGatewayNetworksResponse);
|
|
53
|
+
this.listGatewayNetworks = (request = {}) => enrichForPagination("gatewayNetworks", this.pageOfListGatewayNetworks, request);
|
|
54
|
+
this.getGatewayNetwork = (request) => this.client.fetch({
|
|
55
|
+
method: "GET",
|
|
56
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
|
|
57
|
+
}, unmarshalGatewayNetwork);
|
|
58
|
+
this.waitForGatewayNetwork = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status))), this.getGatewayNetwork, request, options);
|
|
59
|
+
this.createGatewayNetwork = (request) => this.client.fetch({
|
|
60
|
+
body: JSON.stringify(marshalCreateGatewayNetworkRequest(request, this.client.settings)),
|
|
61
|
+
headers: jsonContentHeaders,
|
|
62
|
+
method: "POST",
|
|
63
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`
|
|
64
|
+
}, unmarshalGatewayNetwork);
|
|
65
|
+
this.updateGatewayNetwork = (request) => this.client.fetch({
|
|
66
|
+
body: JSON.stringify(marshalUpdateGatewayNetworkRequest(request, this.client.settings)),
|
|
67
|
+
headers: jsonContentHeaders,
|
|
68
|
+
method: "PATCH",
|
|
69
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
|
|
70
|
+
}, unmarshalGatewayNetwork);
|
|
71
|
+
this.deleteGatewayNetwork = (request) => this.client.fetch({
|
|
72
|
+
method: "DELETE",
|
|
73
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
|
|
74
|
+
}, unmarshalGatewayNetwork);
|
|
75
|
+
this.pageOfListPatRules = (request = {}) => this.client.fetch({
|
|
76
|
+
method: "GET",
|
|
77
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`,
|
|
78
|
+
urlParams: urlParams(["gateway_ids", request.gatewayIds], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_ips", request.privateIps], ["protocol", request.protocol])
|
|
79
|
+
}, unmarshalListPatRulesResponse);
|
|
80
|
+
this.listPatRules = (request = {}) => enrichForPagination("patRules", this.pageOfListPatRules, request);
|
|
81
|
+
this.getPatRule = (request) => this.client.fetch({
|
|
82
|
+
method: "GET",
|
|
83
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
|
|
84
|
+
}, unmarshalPatRule);
|
|
85
|
+
this.createPatRule = (request) => this.client.fetch({
|
|
86
|
+
body: JSON.stringify(marshalCreatePatRuleRequest(request, this.client.settings)),
|
|
87
|
+
headers: jsonContentHeaders,
|
|
88
|
+
method: "POST",
|
|
89
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
|
|
90
|
+
}, unmarshalPatRule);
|
|
91
|
+
this.updatePatRule = (request) => this.client.fetch({
|
|
92
|
+
body: JSON.stringify(marshalUpdatePatRuleRequest(request, this.client.settings)),
|
|
93
|
+
headers: jsonContentHeaders,
|
|
94
|
+
method: "PATCH",
|
|
95
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
|
|
96
|
+
}, unmarshalPatRule);
|
|
97
|
+
this.setPatRules = (request) => this.client.fetch({
|
|
98
|
+
body: JSON.stringify(marshalSetPatRulesRequest(request, this.client.settings)),
|
|
99
|
+
headers: jsonContentHeaders,
|
|
100
|
+
method: "PUT",
|
|
101
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
|
|
102
|
+
}, unmarshalSetPatRulesResponse);
|
|
103
|
+
this.deletePatRule = (request) => this.client.fetch({
|
|
104
|
+
method: "DELETE",
|
|
105
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
|
|
106
|
+
});
|
|
107
|
+
this.listGatewayTypes = (request = {}) => this.client.fetch({
|
|
108
|
+
method: "GET",
|
|
109
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-types`
|
|
110
|
+
}, unmarshalListGatewayTypesResponse);
|
|
111
|
+
this.pageOfListIPs = (request = {}) => this.client.fetch({
|
|
112
|
+
method: "GET",
|
|
113
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`,
|
|
114
|
+
urlParams: urlParams(["is_free", request.isFree], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["reverse", request.reverse], ["tags", request.tags])
|
|
115
|
+
}, unmarshalListIPsResponse);
|
|
116
|
+
this.listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
|
|
117
|
+
this.getIP = (request) => this.client.fetch({
|
|
118
|
+
method: "GET",
|
|
119
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
120
|
+
}, unmarshalIP);
|
|
121
|
+
this.createIP = (request = {}) => this.client.fetch({
|
|
122
|
+
body: JSON.stringify(marshalCreateIPRequest(request, this.client.settings)),
|
|
123
|
+
headers: jsonContentHeaders,
|
|
124
|
+
method: "POST",
|
|
125
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`
|
|
126
|
+
}, unmarshalIP);
|
|
127
|
+
this.updateIP = (request) => this.client.fetch({
|
|
128
|
+
body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
|
|
129
|
+
headers: jsonContentHeaders,
|
|
130
|
+
method: "PATCH",
|
|
131
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
132
|
+
}, unmarshalIP);
|
|
133
|
+
this.deleteIP = (request) => this.client.fetch({
|
|
134
|
+
method: "DELETE",
|
|
135
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
136
|
+
});
|
|
137
|
+
this.refreshSSHKeys = (request) => this.client.fetch({
|
|
138
|
+
body: "{}",
|
|
139
|
+
headers: jsonContentHeaders,
|
|
140
|
+
method: "POST",
|
|
141
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/refresh-ssh-keys`
|
|
142
|
+
}, unmarshalGateway);
|
|
143
|
+
this.addBastionAllowedIPs = (request) => this.client.fetch({
|
|
144
|
+
body: JSON.stringify(marshalAddBastionAllowedIPsRequest(request, this.client.settings)),
|
|
145
|
+
headers: jsonContentHeaders,
|
|
146
|
+
method: "POST",
|
|
147
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/bastion-allowed-ips`
|
|
148
|
+
}, unmarshalAddBastionAllowedIPsResponse);
|
|
149
|
+
this.setBastionAllowedIPs = (request) => this.client.fetch({
|
|
150
|
+
body: JSON.stringify(marshalSetBastionAllowedIPsRequest(request, this.client.settings)),
|
|
151
|
+
headers: jsonContentHeaders,
|
|
152
|
+
method: "PUT",
|
|
153
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/bastion-allowed-ips`
|
|
154
|
+
}, unmarshalSetBastionAllowedIPsResponse);
|
|
155
|
+
this.deleteBastionAllowedIPs = (request) => this.client.fetch({
|
|
156
|
+
method: "DELETE",
|
|
157
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/bastion-allowed-ips/${validatePathParam("ipRange", request.ipRange)}`
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
static {
|
|
161
|
+
this.LOCALITY = toApiLocality({ zones: [
|
|
162
|
+
"fr-par-1",
|
|
163
|
+
"fr-par-2",
|
|
164
|
+
"nl-ams-1",
|
|
165
|
+
"nl-ams-2",
|
|
166
|
+
"nl-ams-3",
|
|
167
|
+
"pl-waw-1",
|
|
168
|
+
"pl-waw-2",
|
|
169
|
+
"pl-waw-3"
|
|
170
|
+
] });
|
|
171
|
+
}
|
|
344
172
|
};
|
|
345
173
|
//#endregion
|
|
346
174
|
export { API };
|
package/dist/v2/content.gen.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
//#region src/v2/content.gen.ts
|
|
2
2
|
/** Lists transient statutes of the enum {@link GatewayNetworkStatus}. */
|
|
3
|
-
|
|
3
|
+
const GATEWAY_NETWORK_TRANSIENT_STATUSES = [
|
|
4
4
|
"attaching",
|
|
5
5
|
"configuring",
|
|
6
6
|
"detaching"
|
|
7
7
|
];
|
|
8
8
|
/** Lists transient statutes of the enum {@link GatewayStatus}. */
|
|
9
|
-
|
|
9
|
+
const GATEWAY_TRANSIENT_STATUSES = [
|
|
10
10
|
"allocating",
|
|
11
11
|
"configuring",
|
|
12
12
|
"stopping",
|