@scaleway/sdk 1.14.0 → 1.16.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.
Files changed (54) hide show
  1. package/dist/api/account/v2/api.gen.js +77 -60
  2. package/dist/api/applesilicon/v1alpha1/api.gen.js +174 -152
  3. package/dist/api/baremetal/v1/api.gen.js +434 -378
  4. package/dist/api/baremetal/v1/api.utils.js +19 -22
  5. package/dist/api/billing/v2alpha1/api.gen.js +21 -17
  6. package/dist/api/cockpit/v1beta1/api.gen.js +308 -232
  7. package/dist/api/container/v1beta1/api.gen.js +384 -337
  8. package/dist/api/domain/v2beta1/api.gen.js +754 -668
  9. package/dist/api/flexibleip/v1alpha1/api.gen.js +164 -151
  10. package/dist/api/function/v1beta1/api.gen.js +467 -407
  11. package/dist/api/iam/v1alpha1/api.gen.js +641 -557
  12. package/dist/api/instance/v1/api.gen.js +803 -677
  13. package/dist/api/instance/v1/api.utils.js +337 -325
  14. package/dist/api/instance/v1/content.gen.js +4 -1
  15. package/dist/api/instance/v1/index.js +1 -1
  16. package/dist/api/instance/v1/marshalling.gen.js +27 -4
  17. package/dist/api/iot/v1/api.gen.js +508 -452
  18. package/dist/api/ipfs/index.js +2 -0
  19. package/dist/api/ipfs/v1alpha1/api.gen.js +197 -0
  20. package/dist/api/ipfs/v1alpha1/content.gen.js +7 -0
  21. package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
  22. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +125 -0
  23. package/dist/api/k8s/v1/api.gen.js +403 -342
  24. package/dist/api/k8s/v1/api.utils.js +7 -10
  25. package/dist/api/k8s/v1/marshalling.gen.js +19 -1
  26. package/dist/api/k8s/v1/validation-rules.gen.js +10 -1
  27. package/dist/api/lb/v1/api.gen.js +1501 -1363
  28. package/dist/api/lb/v1/api.utils.js +71 -75
  29. package/dist/api/lb/v1/marshalling.gen.js +6 -0
  30. package/dist/api/marketplace/v1/api.gen.js +35 -32
  31. package/dist/api/marketplace/v2/api.gen.js +117 -102
  32. package/dist/api/mnq/v1alpha1/api.gen.js +154 -137
  33. package/dist/api/rdb/v1/api.gen.js +897 -819
  34. package/dist/api/redis/v1/api.gen.js +358 -333
  35. package/dist/api/redis/v1/marshalling.gen.js +1 -0
  36. package/dist/api/registry/v1/api.gen.js +211 -189
  37. package/dist/api/secret/v1alpha1/api.gen.js +295 -246
  38. package/dist/api/secret/v1alpha1/marshalling.gen.js +10 -1
  39. package/dist/api/tem/v1alpha1/api.gen.js +182 -147
  40. package/dist/api/tem/v1alpha1/marshalling.gen.js +32 -1
  41. package/dist/api/test/v1/api.gen.js +116 -104
  42. package/dist/api/vpc/v1/api.gen.js +74 -65
  43. package/dist/api/vpc/v2/api.gen.js +200 -178
  44. package/dist/api/vpc/v2/marshalling.gen.js +1 -0
  45. package/dist/api/vpcgw/v1/api.gen.js +575 -501
  46. package/dist/api/webhosting/v1alpha1/api.gen.js +127 -117
  47. package/dist/api/webhosting/v1alpha1/content.gen.js +1 -1
  48. package/dist/index.cjs +924 -453
  49. package/dist/index.d.ts +2152 -1558
  50. package/dist/index.js +28 -26
  51. package/dist/internal/logger/console-logger.js +4 -5
  52. package/dist/scw/constants.js +1 -1
  53. package/dist/scw/errors/scw-error.js +2 -2
  54. package/package.json +2 -2
@@ -17,11 +17,11 @@ const jsonContentHeaders = {
17
17
  * This API allows to manage your Elastic Metal server. Elastic Metal API.
18
18
  */
19
19
  class API extends API$1 {
20
- constructor() {
21
- var _this;
22
- super(...arguments);
23
- _this = this;
24
- this.pageOfListServers = function (request) {
20
+ /** Lists the available zones of the API. */
21
+ static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1'];
22
+ pageOfListServers = (() => {
23
+ var _this = this;
24
+ return function (request) {
25
25
  if (request === void 0) {
26
26
  request = {};
27
27
  }
@@ -31,437 +31,493 @@ class API extends API$1 {
31
31
  urlParams: urlParams(['name', request.name], ['option_id', request.optionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status], ['tags', request.tags])
32
32
  }, unmarshalListServersResponse);
33
33
  };
34
- /**
35
- * List Elastic Metal servers for an Organization. List Elastic Metal servers
36
- * for a specific Organization.
37
- *
38
- * @param request - The request {@link ListServersRequest}
39
- * @returns A Promise of ListServersResponse
40
- */
41
- this.listServers = function (request) {
34
+ })();
35
+
36
+ /**
37
+ * List Elastic Metal servers for an Organization. List Elastic Metal servers
38
+ * for a specific Organization.
39
+ *
40
+ * @param request - The request {@link ListServersRequest}
41
+ * @returns A Promise of ListServersResponse
42
+ */
43
+ listServers = (() => {
44
+ var _this2 = this;
45
+ return function (request) {
42
46
  if (request === void 0) {
43
47
  request = {};
44
48
  }
45
- return enrichForPagination('servers', _this.pageOfListServers, request);
49
+ return enrichForPagination('servers', _this2.pageOfListServers, request);
46
50
  };
47
- /**
48
- * Get a specific Elastic Metal server. Get full details of an existing
49
- * Elastic Metal server associated with the ID.
50
- *
51
- * @param request - The request {@link GetServerRequest}
52
- * @returns A Promise of Server
53
- */
54
- this.getServer = request => this.client.fetch({
55
- method: 'GET',
56
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
57
- }, unmarshalServer);
58
- /**
59
- * Waits for {@link Server} to be in a final state.
60
- *
61
- * @param request - The request {@link GetServerRequest}
62
- * @param options - The waiting options
63
- * @returns A Promise of Server
64
- */
65
- this.waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
66
- /**
67
- * Create an Elastic Metal server. Create a new Elastic Metal server. Once the
68
- * server is created, proceed with the [installation of an OS](#post-3e949e).
69
- *
70
- * @param request - The request {@link CreateServerRequest}
71
- * @returns A Promise of Server
72
- */
73
- this.createServer = request => this.client.fetch({
74
- body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
75
- headers: jsonContentHeaders,
76
- method: 'POST',
77
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
78
- }, unmarshalServer);
79
- /**
80
- * Update an Elastic Metal server. Update the server associated with the ID.
81
- * You can update parameters such as the server's name, tags and description.
82
- * Any parameters left null in the request body are not updated.
83
- *
84
- * @param request - The request {@link UpdateServerRequest}
85
- * @returns A Promise of Server
86
- */
87
- this.updateServer = request => this.client.fetch({
88
- body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
89
- headers: jsonContentHeaders,
90
- method: 'PATCH',
91
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
92
- }, unmarshalServer);
93
- /**
94
- * Install an Elastic Metal server. Install an Operating System (OS) on the
95
- * Elastic Metal server with a specific ID.
96
- *
97
- * @param request - The request {@link InstallServerRequest}
98
- * @returns A Promise of Server
99
- */
100
- this.installServer = request => this.client.fetch({
101
- body: JSON.stringify(marshalInstallServerRequest(request, this.client.settings)),
102
- headers: jsonContentHeaders,
103
- method: 'POST',
104
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install`
105
- }, unmarshalServer);
106
- /**
107
- * Return server metrics. Get the ping status of the server associated with
108
- * the ID.
109
- *
110
- * @param request - The request {@link GetServerMetricsRequest}
111
- * @returns A Promise of GetServerMetricsResponse
112
- */
113
- this.getServerMetrics = request => this.client.fetch({
114
- method: 'GET',
115
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/metrics`
116
- }, unmarshalGetServerMetricsResponse);
117
- /**
118
- * Delete an Elastic Metal server. Delete the server associated with the ID.
119
- *
120
- * @param request - The request {@link DeleteServerRequest}
121
- * @returns A Promise of Server
122
- */
123
- this.deleteServer = request => this.client.fetch({
124
- method: 'DELETE',
125
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
126
- }, unmarshalServer);
127
- /**
128
- * Reboot an Elastic Metal server. Reboot the Elastic Metal server associated
129
- * with the ID, use the `boot_type` `rescue` to reboot the server in rescue
130
- * mode.
131
- *
132
- * @param request - The request {@link RebootServerRequest}
133
- * @returns A Promise of Server
134
- */
135
- this.rebootServer = request => this.client.fetch({
136
- body: JSON.stringify(marshalRebootServerRequest(request, this.client.settings)),
137
- headers: jsonContentHeaders,
138
- method: 'POST',
139
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
140
- }, unmarshalServer);
141
- /**
142
- * Start an Elastic Metal server. Start the server associated with the ID.
143
- *
144
- * @param request - The request {@link StartServerRequest}
145
- * @returns A Promise of Server
146
- */
147
- this.startServer = request => this.client.fetch({
148
- body: JSON.stringify(marshalStartServerRequest(request, this.client.settings)),
149
- headers: jsonContentHeaders,
150
- method: 'POST',
151
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`
152
- }, unmarshalServer);
153
- /**
154
- * Stop an Elastic Metal server. Stop the server associated with the ID. The
155
- * server remains allocated to your account and all data remains on the local
156
- * storage of the server.
157
- *
158
- * @param request - The request {@link StopServerRequest}
159
- * @returns A Promise of Server
160
- */
161
- this.stopServer = request => this.client.fetch({
162
- body: '{}',
163
- headers: jsonContentHeaders,
164
- method: 'POST',
165
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/stop`
166
- }, unmarshalServer);
167
- this.pageOfListServerEvents = request => this.client.fetch({
168
- method: 'GET',
169
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/events`,
170
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
171
- }, unmarshalListServerEventsResponse);
172
- /**
173
- * List server events. List event (i.e. start/stop/reboot) associated to the
174
- * server ID.
175
- *
176
- * @param request - The request {@link ListServerEventsRequest}
177
- * @returns A Promise of ListServerEventsResponse
178
- */
179
- this.listServerEvents = request => enrichForPagination('events', this.pageOfListServerEvents, request);
180
- /**
181
- * Start BMC access. Start BMC (Baseboard Management Controller) access
182
- * associated with the ID. The BMC (Baseboard Management Controller) access is
183
- * available one hour after the installation of the server. You need first to
184
- * create an option Remote Access. You will find the ID and the price with a
185
- * call to listOffers
186
- * (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92).
187
- * Then add the option
188
- * https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd.
189
- * After adding the BMC option, you need to Get Remote Access to get the
190
- * login/password
191
- * https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do
192
- * not forget to delete the Option after use.
193
- *
194
- * @param request - The request {@link StartBMCAccessRequest}
195
- * @returns A Promise of BMCAccess
196
- */
197
- this.startBMCAccess = request => this.client.fetch({
198
- body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
199
- headers: jsonContentHeaders,
200
- method: 'POST',
201
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
202
- }, unmarshalBMCAccess);
203
- /**
204
- * Get BMC access. Get the BMC (Baseboard Management Controller) access
205
- * associated with the ID, including the URL and login information needed to
206
- * connect.
207
- *
208
- * @param request - The request {@link GetBMCAccessRequest}
209
- * @returns A Promise of BMCAccess
210
- */
211
- this.getBMCAccess = request => this.client.fetch({
212
- method: 'GET',
213
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
214
- }, unmarshalBMCAccess);
215
- /**
216
- * Stop BMC access. Stop BMC (Baseboard Management Controller) access
217
- * associated with the ID.
218
- *
219
- * @param request - The request {@link StopBMCAccessRequest}
220
- */
221
- this.stopBMCAccess = request => this.client.fetch({
222
- method: 'DELETE',
223
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
224
- });
225
- /**
226
- * Update IP. Configure the IP address associated with the server ID and IP
227
- * ID. You can use this method to set a reverse DNS for an IP address.
228
- *
229
- * @param request - The request {@link UpdateIPRequest}
230
- * @returns A Promise of IP
231
- */
232
- this.updateIP = request => this.client.fetch({
233
- body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
234
- headers: jsonContentHeaders,
235
- method: 'PATCH',
236
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/ips/${validatePathParam('ipId', request.ipId)}`
237
- }, unmarshalIP);
238
- /**
239
- * Add server option. Add an option, such as Private Networks, to a specific
240
- * server.
241
- *
242
- * @param request - The request {@link AddOptionServerRequest}
243
- * @returns A Promise of Server
244
- */
245
- this.addOptionServer = request => this.client.fetch({
246
- body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)),
247
- headers: jsonContentHeaders,
248
- method: 'POST',
249
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
250
- }, unmarshalServer);
251
- /**
252
- * Delete server option. Delete an option from a specific server.
253
- *
254
- * @param request - The request {@link DeleteOptionServerRequest}
255
- * @returns A Promise of Server
256
- */
257
- this.deleteOptionServer = request => this.client.fetch({
258
- method: 'DELETE',
259
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
260
- }, unmarshalServer);
261
- this.pageOfListOffers = function (request) {
51
+ })();
52
+
53
+ /**
54
+ * Get a specific Elastic Metal server. Get full details of an existing
55
+ * Elastic Metal server associated with the ID.
56
+ *
57
+ * @param request - The request {@link GetServerRequest}
58
+ * @returns A Promise of Server
59
+ */
60
+ getServer = request => this.client.fetch({
61
+ method: 'GET',
62
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
63
+ }, unmarshalServer);
64
+
65
+ /**
66
+ * Waits for {@link Server} to be in a final state.
67
+ *
68
+ * @param request - The request {@link GetServerRequest}
69
+ * @param options - The waiting options
70
+ * @returns A Promise of Server
71
+ */
72
+ waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
73
+
74
+ /**
75
+ * Create an Elastic Metal server. Create a new Elastic Metal server. Once the
76
+ * server is created, proceed with the [installation of an OS](#post-3e949e).
77
+ *
78
+ * @param request - The request {@link CreateServerRequest}
79
+ * @returns A Promise of Server
80
+ */
81
+ createServer = request => this.client.fetch({
82
+ body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
83
+ headers: jsonContentHeaders,
84
+ method: 'POST',
85
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
86
+ }, unmarshalServer);
87
+
88
+ /**
89
+ * Update an Elastic Metal server. Update the server associated with the ID.
90
+ * You can update parameters such as the server's name, tags and description.
91
+ * Any parameters left null in the request body are not updated.
92
+ *
93
+ * @param request - The request {@link UpdateServerRequest}
94
+ * @returns A Promise of Server
95
+ */
96
+ updateServer = request => this.client.fetch({
97
+ body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
98
+ headers: jsonContentHeaders,
99
+ method: 'PATCH',
100
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
101
+ }, unmarshalServer);
102
+
103
+ /**
104
+ * Install an Elastic Metal server. Install an Operating System (OS) on the
105
+ * Elastic Metal server with a specific ID.
106
+ *
107
+ * @param request - The request {@link InstallServerRequest}
108
+ * @returns A Promise of Server
109
+ */
110
+ installServer = request => this.client.fetch({
111
+ body: JSON.stringify(marshalInstallServerRequest(request, this.client.settings)),
112
+ headers: jsonContentHeaders,
113
+ method: 'POST',
114
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install`
115
+ }, unmarshalServer);
116
+
117
+ /**
118
+ * Return server metrics. Get the ping status of the server associated with
119
+ * the ID.
120
+ *
121
+ * @param request - The request {@link GetServerMetricsRequest}
122
+ * @returns A Promise of GetServerMetricsResponse
123
+ */
124
+ getServerMetrics = request => this.client.fetch({
125
+ method: 'GET',
126
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/metrics`
127
+ }, unmarshalGetServerMetricsResponse);
128
+
129
+ /**
130
+ * Delete an Elastic Metal server. Delete the server associated with the ID.
131
+ *
132
+ * @param request - The request {@link DeleteServerRequest}
133
+ * @returns A Promise of Server
134
+ */
135
+ deleteServer = request => this.client.fetch({
136
+ method: 'DELETE',
137
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
138
+ }, unmarshalServer);
139
+
140
+ /**
141
+ * Reboot an Elastic Metal server. Reboot the Elastic Metal server associated
142
+ * with the ID, use the `boot_type` `rescue` to reboot the server in rescue
143
+ * mode.
144
+ *
145
+ * @param request - The request {@link RebootServerRequest}
146
+ * @returns A Promise of Server
147
+ */
148
+ rebootServer = request => this.client.fetch({
149
+ body: JSON.stringify(marshalRebootServerRequest(request, this.client.settings)),
150
+ headers: jsonContentHeaders,
151
+ method: 'POST',
152
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
153
+ }, unmarshalServer);
154
+
155
+ /**
156
+ * Start an Elastic Metal server. Start the server associated with the ID.
157
+ *
158
+ * @param request - The request {@link StartServerRequest}
159
+ * @returns A Promise of Server
160
+ */
161
+ startServer = request => this.client.fetch({
162
+ body: JSON.stringify(marshalStartServerRequest(request, this.client.settings)),
163
+ headers: jsonContentHeaders,
164
+ method: 'POST',
165
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`
166
+ }, unmarshalServer);
167
+
168
+ /**
169
+ * Stop an Elastic Metal server. Stop the server associated with the ID. The
170
+ * server remains allocated to your account and all data remains on the local
171
+ * storage of the server.
172
+ *
173
+ * @param request - The request {@link StopServerRequest}
174
+ * @returns A Promise of Server
175
+ */
176
+ stopServer = request => this.client.fetch({
177
+ body: '{}',
178
+ headers: jsonContentHeaders,
179
+ method: 'POST',
180
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/stop`
181
+ }, unmarshalServer);
182
+ pageOfListServerEvents = request => this.client.fetch({
183
+ method: 'GET',
184
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/events`,
185
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
186
+ }, unmarshalListServerEventsResponse);
187
+
188
+ /**
189
+ * List server events. List event (i.e. start/stop/reboot) associated to the
190
+ * server ID.
191
+ *
192
+ * @param request - The request {@link ListServerEventsRequest}
193
+ * @returns A Promise of ListServerEventsResponse
194
+ */
195
+ listServerEvents = request => enrichForPagination('events', this.pageOfListServerEvents, request);
196
+
197
+ /**
198
+ * Start BMC access. Start BMC (Baseboard Management Controller) access
199
+ * associated with the ID. The BMC (Baseboard Management Controller) access is
200
+ * available one hour after the installation of the server. You need first to
201
+ * create an option Remote Access. You will find the ID and the price with a
202
+ * call to listOffers
203
+ * (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92).
204
+ * Then add the option
205
+ * https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd.
206
+ * After adding the BMC option, you need to Get Remote Access to get the
207
+ * login/password
208
+ * https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do
209
+ * not forget to delete the Option after use.
210
+ *
211
+ * @param request - The request {@link StartBMCAccessRequest}
212
+ * @returns A Promise of BMCAccess
213
+ */
214
+ startBMCAccess = request => this.client.fetch({
215
+ body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
216
+ headers: jsonContentHeaders,
217
+ method: 'POST',
218
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
219
+ }, unmarshalBMCAccess);
220
+
221
+ /**
222
+ * Get BMC access. Get the BMC (Baseboard Management Controller) access
223
+ * associated with the ID, including the URL and login information needed to
224
+ * connect.
225
+ *
226
+ * @param request - The request {@link GetBMCAccessRequest}
227
+ * @returns A Promise of BMCAccess
228
+ */
229
+ getBMCAccess = request => this.client.fetch({
230
+ method: 'GET',
231
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
232
+ }, unmarshalBMCAccess);
233
+
234
+ /**
235
+ * Stop BMC access. Stop BMC (Baseboard Management Controller) access
236
+ * associated with the ID.
237
+ *
238
+ * @param request - The request {@link StopBMCAccessRequest}
239
+ */
240
+ stopBMCAccess = request => this.client.fetch({
241
+ method: 'DELETE',
242
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
243
+ });
244
+
245
+ /**
246
+ * Update IP. Configure the IP address associated with the server ID and IP
247
+ * ID. You can use this method to set a reverse DNS for an IP address.
248
+ *
249
+ * @param request - The request {@link UpdateIPRequest}
250
+ * @returns A Promise of IP
251
+ */
252
+ updateIP = request => this.client.fetch({
253
+ body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
254
+ headers: jsonContentHeaders,
255
+ method: 'PATCH',
256
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/ips/${validatePathParam('ipId', request.ipId)}`
257
+ }, unmarshalIP);
258
+
259
+ /**
260
+ * Add server option. Add an option, such as Private Networks, to a specific
261
+ * server.
262
+ *
263
+ * @param request - The request {@link AddOptionServerRequest}
264
+ * @returns A Promise of Server
265
+ */
266
+ addOptionServer = request => this.client.fetch({
267
+ body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)),
268
+ headers: jsonContentHeaders,
269
+ method: 'POST',
270
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
271
+ }, unmarshalServer);
272
+
273
+ /**
274
+ * Delete server option. Delete an option from a specific server.
275
+ *
276
+ * @param request - The request {@link DeleteOptionServerRequest}
277
+ * @returns A Promise of Server
278
+ */
279
+ deleteOptionServer = request => this.client.fetch({
280
+ method: 'DELETE',
281
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
282
+ }, unmarshalServer);
283
+ pageOfListOffers = (() => {
284
+ var _this3 = this;
285
+ return function (request) {
262
286
  if (request === void 0) {
263
287
  request = {};
264
288
  }
265
- return _this.client.fetch({
289
+ return _this3.client.fetch({
266
290
  method: 'GET',
267
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/offers`,
268
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['subscription_period', request.subscriptionPeriod ?? 'unknown_subscription_period'])
291
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this3.client.settings.defaultZone)}/offers`,
292
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['subscription_period', request.subscriptionPeriod ?? 'unknown_subscription_period'])
269
293
  }, unmarshalListOffersResponse);
270
294
  };
271
- /**
272
- * List offers. List all available Elastic Metal server configurations.
273
- *
274
- * @param request - The request {@link ListOffersRequest}
275
- * @returns A Promise of ListOffersResponse
276
- */
277
- this.listOffers = function (request) {
295
+ })();
296
+
297
+ /**
298
+ * List offers. List all available Elastic Metal server configurations.
299
+ *
300
+ * @param request - The request {@link ListOffersRequest}
301
+ * @returns A Promise of ListOffersResponse
302
+ */
303
+ listOffers = (() => {
304
+ var _this4 = this;
305
+ return function (request) {
278
306
  if (request === void 0) {
279
307
  request = {};
280
308
  }
281
- return enrichForPagination('offers', _this.pageOfListOffers, request);
309
+ return enrichForPagination('offers', _this4.pageOfListOffers, request);
282
310
  };
283
- /**
284
- * Get offer. Get details of an offer identified by its offer ID.
285
- *
286
- * @param request - The request {@link GetOfferRequest}
287
- * @returns A Promise of Offer
288
- */
289
- this.getOffer = request => this.client.fetch({
290
- method: 'GET',
291
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam('offerId', request.offerId)}`
292
- }, unmarshalOffer);
293
- /**
294
- * Get option. Return specific option for the ID.
295
- *
296
- * @param request - The request {@link GetOptionRequest}
297
- * @returns A Promise of Option
298
- */
299
- this.getOption = request => this.client.fetch({
300
- method: 'GET',
301
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam('optionId', request.optionId)}`
302
- }, unmarshalOption);
303
- this.pageOfListOptions = function (request) {
311
+ })();
312
+
313
+ /**
314
+ * Get offer. Get details of an offer identified by its offer ID.
315
+ *
316
+ * @param request - The request {@link GetOfferRequest}
317
+ * @returns A Promise of Offer
318
+ */
319
+ getOffer = request => this.client.fetch({
320
+ method: 'GET',
321
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam('offerId', request.offerId)}`
322
+ }, unmarshalOffer);
323
+
324
+ /**
325
+ * Get option. Return specific option for the ID.
326
+ *
327
+ * @param request - The request {@link GetOptionRequest}
328
+ * @returns A Promise of Option
329
+ */
330
+ getOption = request => this.client.fetch({
331
+ method: 'GET',
332
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam('optionId', request.optionId)}`
333
+ }, unmarshalOption);
334
+ pageOfListOptions = (() => {
335
+ var _this5 = this;
336
+ return function (request) {
304
337
  if (request === void 0) {
305
338
  request = {};
306
339
  }
307
- return _this.client.fetch({
340
+ return _this5.client.fetch({
308
341
  method: 'GET',
309
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/options`,
310
- urlParams: urlParams(['name', request.name], ['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
342
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this5.client.settings.defaultZone)}/options`,
343
+ urlParams: urlParams(['name', request.name], ['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize])
311
344
  }, unmarshalListOptionsResponse);
312
345
  };
313
- /**
314
- * List options. List all options matching with filters.
315
- *
316
- * @param request - The request {@link ListOptionsRequest}
317
- * @returns A Promise of ListOptionsResponse
318
- */
319
- this.listOptions = function (request) {
346
+ })();
347
+
348
+ /**
349
+ * List options. List all options matching with filters.
350
+ *
351
+ * @param request - The request {@link ListOptionsRequest}
352
+ * @returns A Promise of ListOptionsResponse
353
+ */
354
+ listOptions = (() => {
355
+ var _this6 = this;
356
+ return function (request) {
320
357
  if (request === void 0) {
321
358
  request = {};
322
359
  }
323
- return enrichForPagination('options', _this.pageOfListOptions, request);
360
+ return enrichForPagination('options', _this6.pageOfListOptions, request);
324
361
  };
325
- this.pageOfListSettings = function (request) {
362
+ })();
363
+ pageOfListSettings = (() => {
364
+ var _this7 = this;
365
+ return function (request) {
326
366
  if (request === void 0) {
327
367
  request = {};
328
368
  }
329
- return _this.client.fetch({
369
+ return _this7.client.fetch({
330
370
  method: 'GET',
331
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/settings`,
332
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
371
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this7.client.settings.defaultZone)}/settings`,
372
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this7.client.settings.defaultProjectId])
333
373
  }, unmarshalListSettingsResponse);
334
374
  };
335
- /**
336
- * List all settings. Return all settings for a Project ID.
337
- *
338
- * @param request - The request {@link ListSettingsRequest}
339
- * @returns A Promise of ListSettingsResponse
340
- */
341
- this.listSettings = function (request) {
375
+ })();
376
+
377
+ /**
378
+ * List all settings. Return all settings for a Project ID.
379
+ *
380
+ * @param request - The request {@link ListSettingsRequest}
381
+ * @returns A Promise of ListSettingsResponse
382
+ */
383
+ listSettings = (() => {
384
+ var _this8 = this;
385
+ return function (request) {
342
386
  if (request === void 0) {
343
387
  request = {};
344
388
  }
345
- return enrichForPagination('settings', _this.pageOfListSettings, request);
389
+ return enrichForPagination('settings', _this8.pageOfListSettings, request);
346
390
  };
347
- /**
348
- * Update setting. Update a setting for a Project ID (enable or disable).
349
- *
350
- * @param request - The request {@link UpdateSettingRequest}
351
- * @returns A Promise of Setting
352
- */
353
- this.updateSetting = request => this.client.fetch({
354
- body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)),
355
- headers: jsonContentHeaders,
356
- method: 'PATCH',
357
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam('settingId', request.settingId)}`
358
- }, unmarshalSetting);
359
- this.pageOfListOS = function (request) {
391
+ })();
392
+
393
+ /**
394
+ * Update setting. Update a setting for a Project ID (enable or disable).
395
+ *
396
+ * @param request - The request {@link UpdateSettingRequest}
397
+ * @returns A Promise of Setting
398
+ */
399
+ updateSetting = request => this.client.fetch({
400
+ body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)),
401
+ headers: jsonContentHeaders,
402
+ method: 'PATCH',
403
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam('settingId', request.settingId)}`
404
+ }, unmarshalSetting);
405
+ pageOfListOS = (() => {
406
+ var _this9 = this;
407
+ return function (request) {
360
408
  if (request === void 0) {
361
409
  request = {};
362
410
  }
363
- return _this.client.fetch({
411
+ return _this9.client.fetch({
364
412
  method: 'GET',
365
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/os`,
366
- urlParams: urlParams(['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
413
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this9.client.settings.defaultZone)}/os`,
414
+ urlParams: urlParams(['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? _this9.client.settings.defaultPageSize])
367
415
  }, unmarshalListOSResponse);
368
416
  };
369
- /**
370
- * List available OSes. List all OSes that are available for installation on
371
- * Elastic Metal servers.
372
- *
373
- * @param request - The request {@link ListOSRequest}
374
- * @returns A Promise of ListOSResponse
375
- */
376
- this.listOS = function (request) {
417
+ })();
418
+
419
+ /**
420
+ * List available OSes. List all OSes that are available for installation on
421
+ * Elastic Metal servers.
422
+ *
423
+ * @param request - The request {@link ListOSRequest}
424
+ * @returns A Promise of ListOSResponse
425
+ */
426
+ listOS = (() => {
427
+ var _this10 = this;
428
+ return function (request) {
377
429
  if (request === void 0) {
378
430
  request = {};
379
431
  }
380
- return enrichForPagination('os', _this.pageOfListOS, request);
432
+ return enrichForPagination('os', _this10.pageOfListOS, request);
381
433
  };
382
- /**
383
- * Get OS with an ID. Return the specific OS for the ID.
384
- *
385
- * @param request - The request {@link GetOSRequest}
386
- * @returns A Promise of OS
387
- */
388
- this.getOS = request => this.client.fetch({
389
- method: 'GET',
390
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
391
- }, unmarshalOS);
392
- }
434
+ })();
435
+
436
+ /**
437
+ * Get OS with an ID. Return the specific OS for the ID.
438
+ *
439
+ * @param request - The request {@link GetOSRequest}
440
+ * @returns A Promise of OS
441
+ */
442
+ getOS = request => this.client.fetch({
443
+ method: 'GET',
444
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
445
+ }, unmarshalOS);
393
446
  }
394
447
 
395
448
  /** Elastic Metal Private Network API. */
396
- /** Lists the available zones of the API. */
397
- API.LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1'];
398
449
  class PrivateNetworkAPI extends API$1 {
399
- constructor() {
400
- var _this2;
401
- super(...arguments);
402
- _this2 = this;
403
- /**
404
- * Add a server to a Private Network.
405
- *
406
- * @param request - The request
407
- * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
408
- * @returns A Promise of ServerPrivateNetwork
409
- */
410
- this.addServerPrivateNetwork = request => this.client.fetch({
411
- body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
412
- headers: jsonContentHeaders,
413
- method: 'POST',
414
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
415
- }, unmarshalServerPrivateNetwork);
416
- /**
417
- * Set multiple Private Networks on a server.
418
- *
419
- * @param request - The request
420
- * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
421
- * @returns A Promise of SetServerPrivateNetworksResponse
422
- */
423
- this.setServerPrivateNetworks = request => this.client.fetch({
424
- body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
425
- headers: jsonContentHeaders,
426
- method: 'PUT',
427
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
428
- }, unmarshalSetServerPrivateNetworksResponse);
429
- this.pageOfListServerPrivateNetworks = function (request) {
450
+ /** Lists the available zones of the API. */
451
+ static LOCALITIES = ['fr-par-2'];
452
+
453
+ /**
454
+ * Add a server to a Private Network.
455
+ *
456
+ * @param request - The request
457
+ * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
458
+ * @returns A Promise of ServerPrivateNetwork
459
+ */
460
+ addServerPrivateNetwork = request => this.client.fetch({
461
+ body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
462
+ headers: jsonContentHeaders,
463
+ method: 'POST',
464
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
465
+ }, unmarshalServerPrivateNetwork);
466
+
467
+ /**
468
+ * Set multiple Private Networks on a server.
469
+ *
470
+ * @param request - The request
471
+ * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
472
+ * @returns A Promise of SetServerPrivateNetworksResponse
473
+ */
474
+ setServerPrivateNetworks = request => this.client.fetch({
475
+ body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
476
+ headers: jsonContentHeaders,
477
+ method: 'PUT',
478
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
479
+ }, unmarshalSetServerPrivateNetworksResponse);
480
+ pageOfListServerPrivateNetworks = (() => {
481
+ var _this11 = this;
482
+ return function (request) {
430
483
  if (request === void 0) {
431
484
  request = {};
432
485
  }
433
- return _this2.client.fetch({
486
+ return _this11.client.fetch({
434
487
  method: 'GET',
435
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/server-private-networks`,
436
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId])
488
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this11.client.settings.defaultZone)}/server-private-networks`,
489
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this11.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId])
437
490
  }, unmarshalListServerPrivateNetworksResponse);
438
491
  };
439
- /**
440
- * List the Private Networks of a server.
441
- *
442
- * @param request - The request
443
- * {@link PrivateNetworkApiListServerPrivateNetworksRequest}
444
- * @returns A Promise of ListServerPrivateNetworksResponse
445
- */
446
- this.listServerPrivateNetworks = function (request) {
492
+ })();
493
+
494
+ /**
495
+ * List the Private Networks of a server.
496
+ *
497
+ * @param request - The request
498
+ * {@link PrivateNetworkApiListServerPrivateNetworksRequest}
499
+ * @returns A Promise of ListServerPrivateNetworksResponse
500
+ */
501
+ listServerPrivateNetworks = (() => {
502
+ var _this12 = this;
503
+ return function (request) {
447
504
  if (request === void 0) {
448
505
  request = {};
449
506
  }
450
- return enrichForPagination('serverPrivateNetworks', _this2.pageOfListServerPrivateNetworks, request);
507
+ return enrichForPagination('serverPrivateNetworks', _this12.pageOfListServerPrivateNetworks, request);
451
508
  };
452
- /**
453
- * Delete a Private Network.
454
- *
455
- * @param request - The request
456
- * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
457
- */
458
- this.deleteServerPrivateNetwork = request => this.client.fetch({
459
- method: 'DELETE',
460
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
461
- });
462
- }
509
+ })();
510
+
511
+ /**
512
+ * Delete a Private Network.
513
+ *
514
+ * @param request - The request
515
+ * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
516
+ */
517
+ deleteServerPrivateNetwork = request => this.client.fetch({
518
+ method: 'DELETE',
519
+ path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
520
+ });
463
521
  }
464
- /** Lists the available zones of the API. */
465
- PrivateNetworkAPI.LOCALITIES = ['fr-par-2'];
466
522
 
467
523
  export { API, PrivateNetworkAPI };