@scaleway/sdk-baremetal 1.2.0 → 2.1.1
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/README.md +96 -0
- package/dist/v1/api.gen.d.ts +2 -2
- package/dist/v1/api.gen.js +39 -67
- package/dist/v1/content.gen.js +4 -1
- package/dist/v1/index.gen.d.ts +1 -1
- package/dist/v1/marshalling.gen.d.ts +2 -2
- package/dist/v1/marshalling.gen.js +18 -34
- package/dist/v1/types.gen.d.ts +26 -2
- package/dist/v3/api.gen.d.ts +1 -1
- package/dist/v3/api.gen.js +10 -21
- package/dist/v3/content.gen.js +4 -1
- package/dist/v3/index.gen.d.ts +1 -1
- package/dist/v3/marshalling.gen.js +2 -8
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -6
- package/dist/v1/api.gen.cjs +0 -600
- package/dist/v1/content.gen.cjs +0 -19
- package/dist/v1/index.gen.cjs +0 -43
- package/dist/v1/marshalling.gen.cjs +0 -725
- package/dist/v1/validation-rules.gen.cjs +0 -116
- package/dist/v3/api.gen.cjs +0 -104
- package/dist/v3/content.gen.cjs +0 -4
- package/dist/v3/index.gen.cjs +0 -12
- package/dist/v3/marshalling.gen.cjs +0 -60
package/dist/v3/index.gen.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { PrivateNetworkAPI } from './api.gen.js';
|
|
1
|
+
export { PrivateNetworkAPI, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
4
|
export type { ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ServerPrivateNetwork, ServerPrivateNetworkStatus, SetServerPrivateNetworksResponse, } from './types.gen.js';
|
|
@@ -24,10 +24,7 @@ const unmarshalListServerPrivateNetworksResponse = (data) => {
|
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
return {
|
|
27
|
-
serverPrivateNetworks: unmarshalArrayOfObject(
|
|
28
|
-
data.server_private_networks,
|
|
29
|
-
unmarshalServerPrivateNetwork
|
|
30
|
-
),
|
|
27
|
+
serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),
|
|
31
28
|
totalCount: data.total_count
|
|
32
29
|
};
|
|
33
30
|
};
|
|
@@ -38,10 +35,7 @@ const unmarshalSetServerPrivateNetworksResponse = (data) => {
|
|
|
38
35
|
);
|
|
39
36
|
}
|
|
40
37
|
return {
|
|
41
|
-
serverPrivateNetworks: unmarshalArrayOfObject(
|
|
42
|
-
data.server_private_networks,
|
|
43
|
-
unmarshalServerPrivateNetwork
|
|
44
|
-
)
|
|
38
|
+
serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork)
|
|
45
39
|
};
|
|
46
40
|
};
|
|
47
41
|
const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
|
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-baremetal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Scaleway SDK baremetal",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
7
|
+
"README.md",
|
|
7
8
|
"dist"
|
|
8
9
|
],
|
|
9
10
|
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/index.gen.d.ts",
|
|
13
|
-
"import": "./dist/index.gen.js",
|
|
14
|
-
"require": "./dist/index.gen.cjs",
|
|
15
14
|
"default": "./dist/index.gen.js"
|
|
16
15
|
},
|
|
17
16
|
"./*": {
|
|
18
17
|
"types": "./dist/*/index.gen.d.ts",
|
|
19
|
-
"import": "./dist/*/index.gen.js",
|
|
20
|
-
"require": "./dist/*/index.gen.cjs",
|
|
21
18
|
"default": "./dist/*/index.gen.js"
|
|
22
19
|
}
|
|
23
20
|
},
|
|
@@ -26,17 +23,17 @@
|
|
|
26
23
|
"directory": "packages_generated/baremetal"
|
|
27
24
|
},
|
|
28
25
|
"engines": {
|
|
29
|
-
"node": ">=20.19.
|
|
26
|
+
"node": ">=20.19.6"
|
|
30
27
|
},
|
|
31
28
|
"dependencies": {
|
|
32
29
|
"@scaleway/random-name": "5.1.2",
|
|
33
|
-
"@scaleway/sdk-std": "
|
|
30
|
+
"@scaleway/sdk-std": "2.1.0"
|
|
34
31
|
},
|
|
35
32
|
"peerDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^1.
|
|
33
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
|
-
"@scaleway/sdk-client": "^1.
|
|
36
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
40
37
|
},
|
|
41
38
|
"scripts": {
|
|
42
39
|
"package:check": "pnpm publint",
|
package/dist/index.gen.cjs
DELETED
package/dist/v1/api.gen.cjs
DELETED
|
@@ -1,600 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const sdkClient = require("@scaleway/sdk-client");
|
|
4
|
-
const content_gen = require("./content.gen.cjs");
|
|
5
|
-
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
6
|
-
const jsonContentHeaders = {
|
|
7
|
-
"Content-Type": "application/json; charset=utf-8"
|
|
8
|
-
};
|
|
9
|
-
class API extends sdkClient.API {
|
|
10
|
-
/**
|
|
11
|
-
* Locality of this API.
|
|
12
|
-
* type ∈ {'zone','region','global','unspecified'}
|
|
13
|
-
*/
|
|
14
|
-
static LOCALITY = sdkClient.toApiLocality({
|
|
15
|
-
zones: [
|
|
16
|
-
"fr-par-1",
|
|
17
|
-
"fr-par-2",
|
|
18
|
-
"nl-ams-1",
|
|
19
|
-
"nl-ams-2",
|
|
20
|
-
"pl-waw-2",
|
|
21
|
-
"pl-waw-3"
|
|
22
|
-
]
|
|
23
|
-
});
|
|
24
|
-
pageOfListServers = (request = {}) => this.client.fetch(
|
|
25
|
-
{
|
|
26
|
-
method: "GET",
|
|
27
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
|
|
28
|
-
urlParams: sdkClient.urlParams(
|
|
29
|
-
["name", request.name],
|
|
30
|
-
["option_id", request.optionId],
|
|
31
|
-
["order_by", request.orderBy],
|
|
32
|
-
["organization_id", request.organizationId],
|
|
33
|
-
["page", request.page],
|
|
34
|
-
[
|
|
35
|
-
"page_size",
|
|
36
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
37
|
-
],
|
|
38
|
-
["project_id", request.projectId],
|
|
39
|
-
["status", request.status],
|
|
40
|
-
["tags", request.tags]
|
|
41
|
-
)
|
|
42
|
-
},
|
|
43
|
-
marshalling_gen.unmarshalListServersResponse
|
|
44
|
-
);
|
|
45
|
-
/**
|
|
46
|
-
* List Elastic Metal servers for an Organization. List Elastic Metal servers for a specific Organization.
|
|
47
|
-
*
|
|
48
|
-
* @param request - The request {@link ListServersRequest}
|
|
49
|
-
* @returns A Promise of ListServersResponse
|
|
50
|
-
*/
|
|
51
|
-
listServers = (request = {}) => sdkClient.enrichForPagination("servers", this.pageOfListServers, request);
|
|
52
|
-
/**
|
|
53
|
-
* Get a specific Elastic Metal server. Get full details of an existing Elastic Metal server associated with the ID.
|
|
54
|
-
*
|
|
55
|
-
* @param request - The request {@link GetServerRequest}
|
|
56
|
-
* @returns A Promise of Server
|
|
57
|
-
*/
|
|
58
|
-
getServer = (request) => this.client.fetch(
|
|
59
|
-
{
|
|
60
|
-
method: "GET",
|
|
61
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
|
|
62
|
-
},
|
|
63
|
-
marshalling_gen.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) => sdkClient.waitForResource(
|
|
73
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
74
|
-
!content_gen.SERVER_TRANSIENT_STATUSES.includes(res.status)
|
|
75
|
-
)),
|
|
76
|
-
this.getServer,
|
|
77
|
-
request,
|
|
78
|
-
options
|
|
79
|
-
);
|
|
80
|
-
/**
|
|
81
|
-
* Create an Elastic Metal server. Create a new Elastic Metal server. Once the server is created, proceed with the [installation of an OS](#post-3e949e).
|
|
82
|
-
*
|
|
83
|
-
* @param request - The request {@link CreateServerRequest}
|
|
84
|
-
* @returns A Promise of Server
|
|
85
|
-
*/
|
|
86
|
-
createServer = (request) => this.client.fetch(
|
|
87
|
-
{
|
|
88
|
-
body: JSON.stringify(
|
|
89
|
-
marshalling_gen.marshalCreateServerRequest(request, this.client.settings)
|
|
90
|
-
),
|
|
91
|
-
headers: jsonContentHeaders,
|
|
92
|
-
method: "POST",
|
|
93
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
|
|
94
|
-
},
|
|
95
|
-
marshalling_gen.unmarshalServer
|
|
96
|
-
);
|
|
97
|
-
/**
|
|
98
|
-
* Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags, description and protection flag. Any parameters left null in the request body are not updated.
|
|
99
|
-
*
|
|
100
|
-
* @param request - The request {@link UpdateServerRequest}
|
|
101
|
-
* @returns A Promise of Server
|
|
102
|
-
*/
|
|
103
|
-
updateServer = (request) => this.client.fetch(
|
|
104
|
-
{
|
|
105
|
-
body: JSON.stringify(
|
|
106
|
-
marshalling_gen.marshalUpdateServerRequest(request, this.client.settings)
|
|
107
|
-
),
|
|
108
|
-
headers: jsonContentHeaders,
|
|
109
|
-
method: "PATCH",
|
|
110
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
|
|
111
|
-
},
|
|
112
|
-
marshalling_gen.unmarshalServer
|
|
113
|
-
);
|
|
114
|
-
/**
|
|
115
|
-
* Install an Elastic Metal server. Install an Operating System (OS) on the Elastic Metal server with a specific ID.
|
|
116
|
-
*
|
|
117
|
-
* @param request - The request {@link InstallServerRequest}
|
|
118
|
-
* @returns A Promise of Server
|
|
119
|
-
*/
|
|
120
|
-
installServer = (request) => this.client.fetch(
|
|
121
|
-
{
|
|
122
|
-
body: JSON.stringify(
|
|
123
|
-
marshalling_gen.marshalInstallServerRequest(request, this.client.settings)
|
|
124
|
-
),
|
|
125
|
-
headers: jsonContentHeaders,
|
|
126
|
-
method: "POST",
|
|
127
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/install`
|
|
128
|
-
},
|
|
129
|
-
marshalling_gen.unmarshalServer
|
|
130
|
-
);
|
|
131
|
-
/**
|
|
132
|
-
* Return server metrics. Get the ping status of the server associated with the ID.
|
|
133
|
-
*
|
|
134
|
-
* @param request - The request {@link GetServerMetricsRequest}
|
|
135
|
-
* @returns A Promise of GetServerMetricsResponse
|
|
136
|
-
*/
|
|
137
|
-
getServerMetrics = (request) => this.client.fetch(
|
|
138
|
-
{
|
|
139
|
-
method: "GET",
|
|
140
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/metrics`
|
|
141
|
-
},
|
|
142
|
-
marshalling_gen.unmarshalGetServerMetricsResponse
|
|
143
|
-
);
|
|
144
|
-
/**
|
|
145
|
-
* Delete an Elastic Metal server. Delete the server associated with the ID.
|
|
146
|
-
*
|
|
147
|
-
* @param request - The request {@link DeleteServerRequest}
|
|
148
|
-
* @returns A Promise of Server
|
|
149
|
-
*/
|
|
150
|
-
deleteServer = (request) => this.client.fetch(
|
|
151
|
-
{
|
|
152
|
-
method: "DELETE",
|
|
153
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
|
|
154
|
-
},
|
|
155
|
-
marshalling_gen.unmarshalServer
|
|
156
|
-
);
|
|
157
|
-
/**
|
|
158
|
-
* Reboot an Elastic Metal server. Reboot the Elastic Metal server associated with the ID, use the `boot_type` `rescue` to reboot the server in rescue mode.
|
|
159
|
-
*
|
|
160
|
-
* @param request - The request {@link RebootServerRequest}
|
|
161
|
-
* @returns A Promise of Server
|
|
162
|
-
*/
|
|
163
|
-
rebootServer = (request) => this.client.fetch(
|
|
164
|
-
{
|
|
165
|
-
body: JSON.stringify(
|
|
166
|
-
marshalling_gen.marshalRebootServerRequest(request, this.client.settings)
|
|
167
|
-
),
|
|
168
|
-
headers: jsonContentHeaders,
|
|
169
|
-
method: "POST",
|
|
170
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/reboot`
|
|
171
|
-
},
|
|
172
|
-
marshalling_gen.unmarshalServer
|
|
173
|
-
);
|
|
174
|
-
/**
|
|
175
|
-
* Start an Elastic Metal server. Start the server associated with the ID.
|
|
176
|
-
*
|
|
177
|
-
* @param request - The request {@link StartServerRequest}
|
|
178
|
-
* @returns A Promise of Server
|
|
179
|
-
*/
|
|
180
|
-
startServer = (request) => this.client.fetch(
|
|
181
|
-
{
|
|
182
|
-
body: JSON.stringify(
|
|
183
|
-
marshalling_gen.marshalStartServerRequest(request, this.client.settings)
|
|
184
|
-
),
|
|
185
|
-
headers: jsonContentHeaders,
|
|
186
|
-
method: "POST",
|
|
187
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/start`
|
|
188
|
-
},
|
|
189
|
-
marshalling_gen.unmarshalServer
|
|
190
|
-
);
|
|
191
|
-
/**
|
|
192
|
-
* Stop an Elastic Metal server. Stop the server associated with the ID. The server remains allocated to your account and all data remains on the local storage of the server.
|
|
193
|
-
*
|
|
194
|
-
* @param request - The request {@link StopServerRequest}
|
|
195
|
-
* @returns A Promise of Server
|
|
196
|
-
*/
|
|
197
|
-
stopServer = (request) => this.client.fetch(
|
|
198
|
-
{
|
|
199
|
-
body: "{}",
|
|
200
|
-
headers: jsonContentHeaders,
|
|
201
|
-
method: "POST",
|
|
202
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/stop`
|
|
203
|
-
},
|
|
204
|
-
marshalling_gen.unmarshalServer
|
|
205
|
-
);
|
|
206
|
-
pageOfListServerEvents = (request) => this.client.fetch(
|
|
207
|
-
{
|
|
208
|
-
method: "GET",
|
|
209
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/events`,
|
|
210
|
-
urlParams: sdkClient.urlParams(
|
|
211
|
-
["order_by", request.orderBy],
|
|
212
|
-
["page", request.page],
|
|
213
|
-
[
|
|
214
|
-
"page_size",
|
|
215
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
216
|
-
]
|
|
217
|
-
)
|
|
218
|
-
},
|
|
219
|
-
marshalling_gen.unmarshalListServerEventsResponse
|
|
220
|
-
);
|
|
221
|
-
/**
|
|
222
|
-
* List server events. List event (i.e. start/stop/reboot) associated to the server ID.
|
|
223
|
-
*
|
|
224
|
-
* @param request - The request {@link ListServerEventsRequest}
|
|
225
|
-
* @returns A Promise of ListServerEventsResponse
|
|
226
|
-
*/
|
|
227
|
-
listServerEvents = (request) => sdkClient.enrichForPagination("events", this.pageOfListServerEvents, request);
|
|
228
|
-
/**
|
|
229
|
-
* Get default partitioning schema. Get the default partitioning schema for the given offer ID and OS ID.
|
|
230
|
-
*
|
|
231
|
-
* @param request - The request {@link GetDefaultPartitioningSchemaRequest}
|
|
232
|
-
* @returns A Promise of Schema
|
|
233
|
-
*/
|
|
234
|
-
getDefaultPartitioningSchema = (request) => this.client.fetch(
|
|
235
|
-
{
|
|
236
|
-
method: "GET",
|
|
237
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/default`,
|
|
238
|
-
urlParams: sdkClient.urlParams(
|
|
239
|
-
["offer_id", request.offerId],
|
|
240
|
-
["os_id", request.osId]
|
|
241
|
-
)
|
|
242
|
-
},
|
|
243
|
-
marshalling_gen.unmarshalSchema
|
|
244
|
-
);
|
|
245
|
-
/**
|
|
246
|
-
* Validate client partitioning schema. Validate the incoming partitioning schema from a user before installing the server. Return default ErrorCode if invalid.
|
|
247
|
-
*
|
|
248
|
-
* @param request - The request {@link ValidatePartitioningSchemaRequest}
|
|
249
|
-
*/
|
|
250
|
-
validatePartitioningSchema = (request) => this.client.fetch({
|
|
251
|
-
body: JSON.stringify(
|
|
252
|
-
marshalling_gen.marshalValidatePartitioningSchemaRequest(request, this.client.settings)
|
|
253
|
-
),
|
|
254
|
-
headers: jsonContentHeaders,
|
|
255
|
-
method: "POST",
|
|
256
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
|
|
257
|
-
});
|
|
258
|
-
/**
|
|
259
|
-
* Start BMC access. Start BMC (Baseboard Management Controller) access associated with the ID.
|
|
260
|
-
The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
|
|
261
|
-
You need first to create an option Remote Access. You will find the ID and the price with a call to listOffers (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92). Then add the option https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd.
|
|
262
|
-
After adding the BMC option, you need to Get Remote Access to get the login/password https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do not forget to delete the Option after use.
|
|
263
|
-
*
|
|
264
|
-
* @param request - The request {@link StartBMCAccessRequest}
|
|
265
|
-
* @returns A Promise of BMCAccess
|
|
266
|
-
*/
|
|
267
|
-
startBMCAccess = (request) => this.client.fetch(
|
|
268
|
-
{
|
|
269
|
-
body: JSON.stringify(
|
|
270
|
-
marshalling_gen.marshalStartBMCAccessRequest(request, this.client.settings)
|
|
271
|
-
),
|
|
272
|
-
headers: jsonContentHeaders,
|
|
273
|
-
method: "POST",
|
|
274
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/bmc-access`
|
|
275
|
-
},
|
|
276
|
-
marshalling_gen.unmarshalBMCAccess
|
|
277
|
-
);
|
|
278
|
-
/**
|
|
279
|
-
* Get BMC access. Get the BMC (Baseboard Management Controller) access associated with the ID, including the URL and login information needed to connect.
|
|
280
|
-
*
|
|
281
|
-
* @param request - The request {@link GetBMCAccessRequest}
|
|
282
|
-
* @returns A Promise of BMCAccess
|
|
283
|
-
*/
|
|
284
|
-
getBMCAccess = (request) => this.client.fetch(
|
|
285
|
-
{
|
|
286
|
-
method: "GET",
|
|
287
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/bmc-access`
|
|
288
|
-
},
|
|
289
|
-
marshalling_gen.unmarshalBMCAccess
|
|
290
|
-
);
|
|
291
|
-
/**
|
|
292
|
-
* Stop BMC access. Stop BMC (Baseboard Management Controller) access associated with the ID.
|
|
293
|
-
*
|
|
294
|
-
* @param request - The request {@link StopBMCAccessRequest}
|
|
295
|
-
*/
|
|
296
|
-
stopBMCAccess = (request) => this.client.fetch({
|
|
297
|
-
method: "DELETE",
|
|
298
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/bmc-access`
|
|
299
|
-
});
|
|
300
|
-
/**
|
|
301
|
-
* Update IP. Configure the IP address associated with the server ID and IP ID. You can use this method to set a reverse DNS for an IP address.
|
|
302
|
-
*
|
|
303
|
-
* @param request - The request {@link UpdateIPRequest}
|
|
304
|
-
* @returns A Promise of IP
|
|
305
|
-
*/
|
|
306
|
-
updateIP = (request) => this.client.fetch(
|
|
307
|
-
{
|
|
308
|
-
body: JSON.stringify(
|
|
309
|
-
marshalling_gen.marshalUpdateIPRequest(request, this.client.settings)
|
|
310
|
-
),
|
|
311
|
-
headers: jsonContentHeaders,
|
|
312
|
-
method: "PATCH",
|
|
313
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
|
|
314
|
-
},
|
|
315
|
-
marshalling_gen.unmarshalIP
|
|
316
|
-
);
|
|
317
|
-
/**
|
|
318
|
-
* Add server option. Add an option, such as Private Networks, to a specific server.
|
|
319
|
-
*
|
|
320
|
-
* @param request - The request {@link AddOptionServerRequest}
|
|
321
|
-
* @returns A Promise of Server
|
|
322
|
-
*/
|
|
323
|
-
addOptionServer = (request) => this.client.fetch(
|
|
324
|
-
{
|
|
325
|
-
body: JSON.stringify(
|
|
326
|
-
marshalling_gen.marshalAddOptionServerRequest(request, this.client.settings)
|
|
327
|
-
),
|
|
328
|
-
headers: jsonContentHeaders,
|
|
329
|
-
method: "POST",
|
|
330
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/options/${sdkClient.validatePathParam("optionId", request.optionId)}`
|
|
331
|
-
},
|
|
332
|
-
marshalling_gen.unmarshalServer
|
|
333
|
-
);
|
|
334
|
-
/**
|
|
335
|
-
* Delete server option. Delete an option from a specific server.
|
|
336
|
-
*
|
|
337
|
-
* @param request - The request {@link DeleteOptionServerRequest}
|
|
338
|
-
* @returns A Promise of Server
|
|
339
|
-
*/
|
|
340
|
-
deleteOptionServer = (request) => this.client.fetch(
|
|
341
|
-
{
|
|
342
|
-
method: "DELETE",
|
|
343
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/options/${sdkClient.validatePathParam("optionId", request.optionId)}`
|
|
344
|
-
},
|
|
345
|
-
marshalling_gen.unmarshalServer
|
|
346
|
-
);
|
|
347
|
-
/**
|
|
348
|
-
* Migrate server offer. Migrate server with hourly offer to monthly offer.
|
|
349
|
-
*
|
|
350
|
-
* @param request - The request {@link MigrateServerToMonthlyOfferRequest}
|
|
351
|
-
* @returns A Promise of Server
|
|
352
|
-
*/
|
|
353
|
-
migrateServerToMonthlyOffer = (request) => this.client.fetch(
|
|
354
|
-
{
|
|
355
|
-
method: "POST",
|
|
356
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/migrate-offer-monthly`
|
|
357
|
-
},
|
|
358
|
-
marshalling_gen.unmarshalServer
|
|
359
|
-
);
|
|
360
|
-
pageOfListOffers = (request = {}) => this.client.fetch(
|
|
361
|
-
{
|
|
362
|
-
method: "GET",
|
|
363
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`,
|
|
364
|
-
urlParams: sdkClient.urlParams(
|
|
365
|
-
["name", request.name],
|
|
366
|
-
["page", request.page],
|
|
367
|
-
[
|
|
368
|
-
"page_size",
|
|
369
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
370
|
-
],
|
|
371
|
-
["subscription_period", request.subscriptionPeriod]
|
|
372
|
-
)
|
|
373
|
-
},
|
|
374
|
-
marshalling_gen.unmarshalListOffersResponse
|
|
375
|
-
);
|
|
376
|
-
/**
|
|
377
|
-
* List offers. List all available Elastic Metal server configurations.
|
|
378
|
-
*
|
|
379
|
-
* @param request - The request {@link ListOffersRequest}
|
|
380
|
-
* @returns A Promise of ListOffersResponse
|
|
381
|
-
*/
|
|
382
|
-
listOffers = (request = {}) => sdkClient.enrichForPagination("offers", this.pageOfListOffers, request);
|
|
383
|
-
/**
|
|
384
|
-
* Get offer. Get details of an offer identified by its offer ID.
|
|
385
|
-
*
|
|
386
|
-
* @param request - The request {@link GetOfferRequest}
|
|
387
|
-
* @returns A Promise of Offer
|
|
388
|
-
*/
|
|
389
|
-
getOffer = (request) => this.client.fetch(
|
|
390
|
-
{
|
|
391
|
-
method: "GET",
|
|
392
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${sdkClient.validatePathParam("offerId", request.offerId)}`
|
|
393
|
-
},
|
|
394
|
-
marshalling_gen.unmarshalOffer
|
|
395
|
-
);
|
|
396
|
-
/**
|
|
397
|
-
* Get option. Return specific option for the ID.
|
|
398
|
-
*
|
|
399
|
-
* @param request - The request {@link GetOptionRequest}
|
|
400
|
-
* @returns A Promise of Option
|
|
401
|
-
*/
|
|
402
|
-
getOption = (request) => this.client.fetch(
|
|
403
|
-
{
|
|
404
|
-
method: "GET",
|
|
405
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options/${sdkClient.validatePathParam("optionId", request.optionId)}`
|
|
406
|
-
},
|
|
407
|
-
marshalling_gen.unmarshalOption
|
|
408
|
-
);
|
|
409
|
-
pageOfListOptions = (request = {}) => this.client.fetch(
|
|
410
|
-
{
|
|
411
|
-
method: "GET",
|
|
412
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options`,
|
|
413
|
-
urlParams: sdkClient.urlParams(
|
|
414
|
-
["name", request.name],
|
|
415
|
-
["offer_id", request.offerId],
|
|
416
|
-
["page", request.page],
|
|
417
|
-
[
|
|
418
|
-
"page_size",
|
|
419
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
420
|
-
]
|
|
421
|
-
)
|
|
422
|
-
},
|
|
423
|
-
marshalling_gen.unmarshalListOptionsResponse
|
|
424
|
-
);
|
|
425
|
-
/**
|
|
426
|
-
* List options. List all options matching with filters.
|
|
427
|
-
*
|
|
428
|
-
* @param request - The request {@link ListOptionsRequest}
|
|
429
|
-
* @returns A Promise of ListOptionsResponse
|
|
430
|
-
*/
|
|
431
|
-
listOptions = (request = {}) => sdkClient.enrichForPagination("options", this.pageOfListOptions, request);
|
|
432
|
-
pageOfListSettings = (request = {}) => this.client.fetch(
|
|
433
|
-
{
|
|
434
|
-
method: "GET",
|
|
435
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings`,
|
|
436
|
-
urlParams: sdkClient.urlParams(
|
|
437
|
-
["order_by", request.orderBy],
|
|
438
|
-
["page", request.page],
|
|
439
|
-
[
|
|
440
|
-
"page_size",
|
|
441
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
442
|
-
],
|
|
443
|
-
[
|
|
444
|
-
"project_id",
|
|
445
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
446
|
-
]
|
|
447
|
-
)
|
|
448
|
-
},
|
|
449
|
-
marshalling_gen.unmarshalListSettingsResponse
|
|
450
|
-
);
|
|
451
|
-
/**
|
|
452
|
-
* List all settings. Return all settings for a Project ID.
|
|
453
|
-
*
|
|
454
|
-
* @param request - The request {@link ListSettingsRequest}
|
|
455
|
-
* @returns A Promise of ListSettingsResponse
|
|
456
|
-
*/
|
|
457
|
-
listSettings = (request = {}) => sdkClient.enrichForPagination("settings", this.pageOfListSettings, request);
|
|
458
|
-
/**
|
|
459
|
-
* Update setting. Update a setting for a Project ID (enable or disable).
|
|
460
|
-
*
|
|
461
|
-
* @param request - The request {@link UpdateSettingRequest}
|
|
462
|
-
* @returns A Promise of Setting
|
|
463
|
-
*/
|
|
464
|
-
updateSetting = (request) => this.client.fetch(
|
|
465
|
-
{
|
|
466
|
-
body: JSON.stringify(
|
|
467
|
-
marshalling_gen.marshalUpdateSettingRequest(request, this.client.settings)
|
|
468
|
-
),
|
|
469
|
-
headers: jsonContentHeaders,
|
|
470
|
-
method: "PATCH",
|
|
471
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings/${sdkClient.validatePathParam("settingId", request.settingId)}`
|
|
472
|
-
},
|
|
473
|
-
marshalling_gen.unmarshalSetting
|
|
474
|
-
);
|
|
475
|
-
pageOfListOS = (request = {}) => this.client.fetch(
|
|
476
|
-
{
|
|
477
|
-
method: "GET",
|
|
478
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
|
|
479
|
-
urlParams: sdkClient.urlParams(
|
|
480
|
-
["offer_id", request.offerId],
|
|
481
|
-
["page", request.page],
|
|
482
|
-
[
|
|
483
|
-
"page_size",
|
|
484
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
485
|
-
]
|
|
486
|
-
)
|
|
487
|
-
},
|
|
488
|
-
marshalling_gen.unmarshalListOSResponse
|
|
489
|
-
);
|
|
490
|
-
/**
|
|
491
|
-
* List available OSes. List all OSes that are available for installation on Elastic Metal servers.
|
|
492
|
-
*
|
|
493
|
-
* @param request - The request {@link ListOSRequest}
|
|
494
|
-
* @returns A Promise of ListOSResponse
|
|
495
|
-
*/
|
|
496
|
-
listOS = (request = {}) => sdkClient.enrichForPagination("os", this.pageOfListOS, request);
|
|
497
|
-
/**
|
|
498
|
-
* Get OS with an ID. Return the specific OS for the ID.
|
|
499
|
-
*
|
|
500
|
-
* @param request - The request {@link GetOSRequest}
|
|
501
|
-
* @returns A Promise of OS
|
|
502
|
-
*/
|
|
503
|
-
getOS = (request) => this.client.fetch(
|
|
504
|
-
{
|
|
505
|
-
method: "GET",
|
|
506
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${sdkClient.validatePathParam("osId", request.osId)}`
|
|
507
|
-
},
|
|
508
|
-
marshalling_gen.unmarshalOS
|
|
509
|
-
);
|
|
510
|
-
}
|
|
511
|
-
class PrivateNetworkAPI extends sdkClient.API {
|
|
512
|
-
/**
|
|
513
|
-
* Locality of this API.
|
|
514
|
-
* type ∈ {'zone','region','global','unspecified'}
|
|
515
|
-
*/
|
|
516
|
-
static LOCALITY = sdkClient.toApiLocality({
|
|
517
|
-
zones: ["fr-par-2"]
|
|
518
|
-
});
|
|
519
|
-
/**
|
|
520
|
-
* Add a server to a Private Network.
|
|
521
|
-
*
|
|
522
|
-
* @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
|
|
523
|
-
* @returns A Promise of ServerPrivateNetwork
|
|
524
|
-
*/
|
|
525
|
-
addServerPrivateNetwork = (request) => this.client.fetch(
|
|
526
|
-
{
|
|
527
|
-
body: JSON.stringify(
|
|
528
|
-
marshalling_gen.marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
|
|
529
|
-
request,
|
|
530
|
-
this.client.settings
|
|
531
|
-
)
|
|
532
|
-
),
|
|
533
|
-
headers: jsonContentHeaders,
|
|
534
|
-
method: "POST",
|
|
535
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private-networks`
|
|
536
|
-
},
|
|
537
|
-
marshalling_gen.unmarshalServerPrivateNetwork
|
|
538
|
-
);
|
|
539
|
-
/**
|
|
540
|
-
* Set multiple Private Networks on a server.
|
|
541
|
-
*
|
|
542
|
-
* @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
|
|
543
|
-
* @returns A Promise of SetServerPrivateNetworksResponse
|
|
544
|
-
*/
|
|
545
|
-
setServerPrivateNetworks = (request) => this.client.fetch(
|
|
546
|
-
{
|
|
547
|
-
body: JSON.stringify(
|
|
548
|
-
marshalling_gen.marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
|
|
549
|
-
request,
|
|
550
|
-
this.client.settings
|
|
551
|
-
)
|
|
552
|
-
),
|
|
553
|
-
headers: jsonContentHeaders,
|
|
554
|
-
method: "PUT",
|
|
555
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private-networks`
|
|
556
|
-
},
|
|
557
|
-
marshalling_gen.unmarshalSetServerPrivateNetworksResponse
|
|
558
|
-
);
|
|
559
|
-
pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch(
|
|
560
|
-
{
|
|
561
|
-
method: "GET",
|
|
562
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
|
|
563
|
-
urlParams: sdkClient.urlParams(
|
|
564
|
-
["order_by", request.orderBy],
|
|
565
|
-
["organization_id", request.organizationId],
|
|
566
|
-
["page", request.page],
|
|
567
|
-
[
|
|
568
|
-
"page_size",
|
|
569
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
570
|
-
],
|
|
571
|
-
["private_network_id", request.privateNetworkId],
|
|
572
|
-
["project_id", request.projectId],
|
|
573
|
-
["server_id", request.serverId]
|
|
574
|
-
)
|
|
575
|
-
},
|
|
576
|
-
marshalling_gen.unmarshalListServerPrivateNetworksResponse
|
|
577
|
-
);
|
|
578
|
-
/**
|
|
579
|
-
* List the Private Networks of a server.
|
|
580
|
-
*
|
|
581
|
-
* @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
|
|
582
|
-
* @returns A Promise of ListServerPrivateNetworksResponse
|
|
583
|
-
*/
|
|
584
|
-
listServerPrivateNetworks = (request = {}) => sdkClient.enrichForPagination(
|
|
585
|
-
"serverPrivateNetworks",
|
|
586
|
-
this.pageOfListServerPrivateNetworks,
|
|
587
|
-
request
|
|
588
|
-
);
|
|
589
|
-
/**
|
|
590
|
-
* Delete a Private Network.
|
|
591
|
-
*
|
|
592
|
-
* @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
|
|
593
|
-
*/
|
|
594
|
-
deleteServerPrivateNetwork = (request) => this.client.fetch({
|
|
595
|
-
method: "DELETE",
|
|
596
|
-
path: `/baremetal/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private-networks/${sdkClient.validatePathParam("privateNetworkId", request.privateNetworkId)}`
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
exports.API = API;
|
|
600
|
-
exports.PrivateNetworkAPI = PrivateNetworkAPI;
|