@scaleway/sdk 3.0.0-alpha.0 → 3.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/dist/index.gen.d.ts +362 -0
- package/dist/index.gen.js +323 -0
- package/package.json +71 -25
- package/README.md +0 -46
- package/dist/api/account/index.js +0 -4
- package/dist/api/account/v2/api.gen.js +0 -147
- package/dist/api/account/v2/index.gen.js +0 -4
- package/dist/api/account/v2/marshalling.gen.js +0 -39
- package/dist/api/account/v3/api.gen.js +0 -129
- package/dist/api/account/v3/index.gen.js +0 -6
- package/dist/api/account/v3/marshalling.gen.js +0 -39
- package/dist/api/account/v3/validation-rules.gen.js +0 -39
- package/dist/api/applesilicon/index.js +0 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
- package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
- package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
- package/dist/api/baremetal/index.js +0 -2
- package/dist/api/baremetal/v1/api.gen.js +0 -523
- package/dist/api/baremetal/v1/api.utils.js +0 -27
- package/dist/api/baremetal/v1/content.gen.js +0 -13
- package/dist/api/baremetal/v1/index.js +0 -5
- package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
- package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
- package/dist/api/billing/index.js +0 -2
- package/dist/api/billing/v2alpha1/api.gen.js +0 -80
- package/dist/api/billing/v2alpha1/index.gen.js +0 -4
- package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
- package/dist/api/block/index.js +0 -2
- package/dist/api/block/v1alpha1/api.gen.js +0 -245
- package/dist/api/block/v1alpha1/content.gen.js +0 -13
- package/dist/api/block/v1alpha1/index.gen.js +0 -7
- package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
- package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
- package/dist/api/cockpit/index.js +0 -2
- package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
- package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
- package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
- package/dist/api/container/index.js +0 -2
- package/dist/api/container/v1beta1/api.gen.js +0 -549
- package/dist/api/container/v1beta1/content.gen.js +0 -22
- package/dist/api/container/v1beta1/index.gen.js +0 -5
- package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
- package/dist/api/document_db/index.js +0 -2
- package/dist/api/document_db/v1beta1/api.gen.js +0 -830
- package/dist/api/document_db/v1beta1/content.gen.js +0 -19
- package/dist/api/document_db/v1beta1/index.gen.js +0 -7
- package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
- package/dist/api/domain/index.js +0 -2
- package/dist/api/domain/v2beta1/api.gen.js +0 -875
- package/dist/api/domain/v2beta1/content.gen.js +0 -28
- package/dist/api/domain/v2beta1/index.gen.js +0 -7
- package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
- package/dist/api/flexibleip/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
- package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
- package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
- package/dist/api/function/index.js +0 -2
- package/dist/api/function/v1beta1/api.gen.js +0 -560
- package/dist/api/function/v1beta1/content.gen.js +0 -22
- package/dist/api/function/v1beta1/index.gen.js +0 -5
- package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
- package/dist/api/iam/index.js +0 -2
- package/dist/api/iam/v1alpha1/api.gen.js +0 -799
- package/dist/api/iam/v1alpha1/index.gen.js +0 -6
- package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
- package/dist/api/instance/index.js +0 -2
- package/dist/api/instance/v1/api.gen.js +0 -1003
- package/dist/api/instance/v1/api.utils.js +0 -369
- package/dist/api/instance/v1/content.gen.js +0 -31
- package/dist/api/instance/v1/index.js +0 -2
- package/dist/api/instance/v1/marshalling.gen.js +0 -1206
- package/dist/api/instance/v1/marshalling.utils.js +0 -63
- package/dist/api/iot/index.js +0 -2
- package/dist/api/iot/v1/api.gen.js +0 -581
- package/dist/api/iot/v1/content.gen.js +0 -7
- package/dist/api/iot/v1/index.gen.js +0 -5
- package/dist/api/iot/v1/marshalling.gen.js +0 -388
- package/dist/api/ipfs/index.js +0 -2
- package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
- package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
- package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/k8s/index.js +0 -2
- package/dist/api/k8s/v1/api.gen.js +0 -454
- package/dist/api/k8s/v1/api.utils.js +0 -13
- package/dist/api/k8s/v1/content.gen.js +0 -13
- package/dist/api/k8s/v1/index.js +0 -4
- package/dist/api/k8s/v1/marshalling.gen.js +0 -333
- package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
- package/dist/api/lb/index.js +0 -2
- package/dist/api/lb/v1/api.gen.js +0 -1669
- package/dist/api/lb/v1/api.utils.js +0 -81
- package/dist/api/lb/v1/content.gen.js +0 -16
- package/dist/api/lb/v1/index.js +0 -2
- package/dist/api/lb/v1/marshalling.gen.js +0 -923
- package/dist/api/marketplace/index.js +0 -4
- package/dist/api/marketplace/v1/api.gen.js +0 -60
- package/dist/api/marketplace/v1/index.gen.js +0 -4
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
- package/dist/api/marketplace/v2/api.gen.js +0 -162
- package/dist/api/marketplace/v2/index.gen.js +0 -4
- package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
- package/dist/api/mnq/index.js +0 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
- package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/rdb/index.js +0 -2
- package/dist/api/rdb/v1/api.gen.js +0 -972
- package/dist/api/rdb/v1/content.gen.js +0 -22
- package/dist/api/rdb/v1/index.gen.js +0 -7
- package/dist/api/rdb/v1/marshalling.gen.js +0 -636
- package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
- package/dist/api/redis/index.js +0 -2
- package/dist/api/redis/v1/api.gen.js +0 -389
- package/dist/api/redis/v1/content.gen.js +0 -7
- package/dist/api/redis/v1/index.gen.js +0 -5
- package/dist/api/redis/v1/marshalling.gen.js +0 -259
- package/dist/api/registry/index.js +0 -2
- package/dist/api/registry/v1/api.gen.js +0 -252
- package/dist/api/registry/v1/content.gen.js +0 -13
- package/dist/api/registry/v1/index.gen.js +0 -5
- package/dist/api/registry/v1/marshalling.gen.js +0 -106
- package/dist/api/secret/index.js +0 -2
- package/dist/api/secret/v1alpha1/api.gen.js +0 -415
- package/dist/api/secret/v1alpha1/index.gen.js +0 -4
- package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
- package/dist/api/tem/index.js +0 -2
- package/dist/api/tem/v1alpha1/api.gen.js +0 -229
- package/dist/api/tem/v1alpha1/content.gen.js +0 -10
- package/dist/api/tem/v1alpha1/index.gen.js +0 -5
- package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
- package/dist/api/test/index.js +0 -2
- package/dist/api/test/v1/api.gen.js +0 -152
- package/dist/api/test/v1/content.gen.js +0 -7
- package/dist/api/test/v1/index.gen.js +0 -5
- package/dist/api/test/v1/marshalling.gen.js +0 -79
- package/dist/api/vpc/index.js +0 -4
- package/dist/api/vpc/v1/api.gen.js +0 -110
- package/dist/api/vpc/v1/index.gen.js +0 -4
- package/dist/api/vpc/v1/marshalling.gen.js +0 -44
- package/dist/api/vpc/v2/api.gen.js +0 -276
- package/dist/api/vpc/v2/index.gen.js +0 -4
- package/dist/api/vpc/v2/marshalling.gen.js +0 -135
- package/dist/api/vpcgw/index.js +0 -2
- package/dist/api/vpcgw/v1/api.gen.js +0 -669
- package/dist/api/vpcgw/v1/content.gen.js +0 -10
- package/dist/api/vpcgw/v1/index.gen.js +0 -5
- package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
- package/dist/api/webhosting/index.js +0 -2
- package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
- package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
- package/dist/helpers/is-browser.js +0 -5
- package/dist/helpers/is-response.js +0 -10
- package/dist/helpers/json.js +0 -11
- package/dist/helpers/marshalling.js +0 -130
- package/dist/index.cjs +0 -24364
- package/dist/index.d.ts +0 -27584
- package/dist/index.js +0 -69
- package/dist/internal/async/interval-retrier.js +0 -105
- package/dist/internal/async/sleep.js +0 -13
- package/dist/internal/interceptors/composer.js +0 -46
- package/dist/internal/interceptors/helpers.js +0 -32
- package/dist/internal/logger/console-logger.js +0 -38
- package/dist/internal/logger/index.js +0 -41
- package/dist/internal/logger/level-resolver.js +0 -13
- package/dist/internal/validations/string-validation.js +0 -38
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/dist/scw/api.js +0 -12
- package/dist/scw/auth.js +0 -68
- package/dist/scw/client-ini-factory.js +0 -174
- package/dist/scw/client-ini-profile.js +0 -54
- package/dist/scw/client-settings.js +0 -78
- package/dist/scw/client.js +0 -98
- package/dist/scw/constants.js +0 -4
- package/dist/scw/custom-marshalling.js +0 -131
- package/dist/scw/errors/error-parser.js +0 -107
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
- package/dist/scw/errors/scw-error.js +0 -66
- package/dist/scw/errors/standard/already-exists-error.js +0 -26
- package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
- package/dist/scw/errors/standard/index.js +0 -13
- package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
- package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
- package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
- package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
- package/dist/scw/errors/standard/resource-expired-error.js +0 -26
- package/dist/scw/errors/standard/resource-locked-error.js +0 -25
- package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
- package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
- package/dist/scw/errors/standard/transient-state-error.js +0 -26
- package/dist/scw/errors/types.js +0 -23
- package/dist/scw/fetch/build-fetcher.js +0 -72
- package/dist/scw/fetch/http-dumper.js +0 -54
- package/dist/scw/fetch/http-interceptors.js +0 -99
- package/dist/scw/fetch/resource-paginator.js +0 -84
- package/dist/scw/fetch/response-parser.js +0 -72
- package/node_modules/@scaleway/random-name/.npmignore +0 -4
- package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
- package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
- package/node_modules/@scaleway/random-name/README.md +0 -26
- package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
- package/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/node_modules/@scaleway/random-name/package.json +0 -23
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import { API as API$1 } from '../../../scw/api.js';
|
|
3
|
-
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
|
-
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
|
-
import { SERVER_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { unmarshalListServerTypesResponse, unmarshalServerType, marshalCreateServerRequest, unmarshalServer, unmarshalListServersResponse, unmarshalListOSResponse, unmarshalOS, marshalUpdateServerRequest } from './marshalling.gen.js';
|
|
7
|
-
|
|
8
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
9
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
10
|
-
const jsonContentHeaders = {
|
|
11
|
-
'Content-Type': 'application/json; charset=utf-8'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** Apple silicon API. */
|
|
15
|
-
class API extends API$1 {
|
|
16
|
-
/** Lists the available zones of the API. */
|
|
17
|
-
static LOCALITIES = ['fr-par-3'];
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* List server types. List all technical details about Apple silicon server
|
|
21
|
-
* types available in the specified zone. Since there is only one Availability
|
|
22
|
-
* Zone for Apple silicon servers, the targeted value is `fr-par-3`.
|
|
23
|
-
*
|
|
24
|
-
* @param request - The request {@link ListServerTypesRequest}
|
|
25
|
-
* @returns A Promise of ListServerTypesResponse
|
|
26
|
-
*/
|
|
27
|
-
listServerTypes = (() => {
|
|
28
|
-
var _this = this;
|
|
29
|
-
return function (request) {
|
|
30
|
-
if (request === void 0) {
|
|
31
|
-
request = {};
|
|
32
|
-
}
|
|
33
|
-
return _this.client.fetch({
|
|
34
|
-
method: 'GET',
|
|
35
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/server-types`
|
|
36
|
-
}, unmarshalListServerTypesResponse);
|
|
37
|
-
};
|
|
38
|
-
})();
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Get a server type. Get technical details (CPU, disk size etc.) of a server
|
|
42
|
-
* type.
|
|
43
|
-
*
|
|
44
|
-
* @param request - The request {@link GetServerTypeRequest}
|
|
45
|
-
* @returns A Promise of ServerType
|
|
46
|
-
*/
|
|
47
|
-
getServerType = request => this.client.fetch({
|
|
48
|
-
method: 'GET',
|
|
49
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam('serverType', request.serverType)}`
|
|
50
|
-
}, unmarshalServerType);
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Create a server. Create a new server in the targeted zone, specifying its
|
|
54
|
-
* configuration including name and type.
|
|
55
|
-
*
|
|
56
|
-
* @param request - The request {@link CreateServerRequest}
|
|
57
|
-
* @returns A Promise of Server
|
|
58
|
-
*/
|
|
59
|
-
createServer = request => this.client.fetch({
|
|
60
|
-
body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
|
|
61
|
-
headers: jsonContentHeaders,
|
|
62
|
-
method: 'POST',
|
|
63
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
|
|
64
|
-
}, unmarshalServer);
|
|
65
|
-
pageOfListServers = (() => {
|
|
66
|
-
var _this2 = this;
|
|
67
|
-
return function (request) {
|
|
68
|
-
if (request === void 0) {
|
|
69
|
-
request = {};
|
|
70
|
-
}
|
|
71
|
-
return _this2.client.fetch({
|
|
72
|
-
method: 'GET',
|
|
73
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/servers`,
|
|
74
|
-
urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
75
|
-
}, unmarshalListServersResponse);
|
|
76
|
-
};
|
|
77
|
-
})();
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* List all servers. List all servers in the specified zone. By default,
|
|
81
|
-
* returned servers in the list are ordered by creation date in ascending
|
|
82
|
-
* order, though this can be modified via the `order_by` field.
|
|
83
|
-
*
|
|
84
|
-
* @param request - The request {@link ListServersRequest}
|
|
85
|
-
* @returns A Promise of ListServersResponse
|
|
86
|
-
*/
|
|
87
|
-
listServers = (() => {
|
|
88
|
-
var _this3 = this;
|
|
89
|
-
return function (request) {
|
|
90
|
-
if (request === void 0) {
|
|
91
|
-
request = {};
|
|
92
|
-
}
|
|
93
|
-
return enrichForPagination('servers', _this3.pageOfListServers, request);
|
|
94
|
-
};
|
|
95
|
-
})();
|
|
96
|
-
pageOfListOS = (() => {
|
|
97
|
-
var _this4 = this;
|
|
98
|
-
return function (request) {
|
|
99
|
-
if (request === void 0) {
|
|
100
|
-
request = {};
|
|
101
|
-
}
|
|
102
|
-
return _this4.client.fetch({
|
|
103
|
-
method: 'GET',
|
|
104
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this4.client.settings.defaultZone)}/os`,
|
|
105
|
-
urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? _this4.client.settings.defaultPageSize], ['server_type', request.serverType])
|
|
106
|
-
}, unmarshalListOSResponse);
|
|
107
|
-
};
|
|
108
|
-
})();
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* List all Operating Systems (OS). List all Operating Systems (OS). The
|
|
112
|
-
* response will include the total number of OS as well as their associated
|
|
113
|
-
* IDs, names and labels.
|
|
114
|
-
*
|
|
115
|
-
* @param request - The request {@link ListOSRequest}
|
|
116
|
-
* @returns A Promise of ListOSResponse
|
|
117
|
-
*/
|
|
118
|
-
listOS = (() => {
|
|
119
|
-
var _this5 = this;
|
|
120
|
-
return function (request) {
|
|
121
|
-
if (request === void 0) {
|
|
122
|
-
request = {};
|
|
123
|
-
}
|
|
124
|
-
return enrichForPagination('os', _this5.pageOfListOS, request);
|
|
125
|
-
};
|
|
126
|
-
})();
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Get an Operating System (OS). Get an Operating System (OS). The response
|
|
130
|
-
* will include the OS's unique ID as well as its name and label.
|
|
131
|
-
*
|
|
132
|
-
* @param request - The request {@link GetOSRequest}
|
|
133
|
-
* @returns A Promise of OS
|
|
134
|
-
*/
|
|
135
|
-
getOS = request => this.client.fetch({
|
|
136
|
-
method: 'GET',
|
|
137
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
|
|
138
|
-
}, unmarshalOS);
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Get a server. Retrieve information about an existing Apple silicon server,
|
|
142
|
-
* specified by its server ID. Its full details, including name, status and IP
|
|
143
|
-
* address, are returned in the response object.
|
|
144
|
-
*
|
|
145
|
-
* @param request - The request {@link GetServerRequest}
|
|
146
|
-
* @returns A Promise of Server
|
|
147
|
-
*/
|
|
148
|
-
getServer = request => this.client.fetch({
|
|
149
|
-
method: 'GET',
|
|
150
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
151
|
-
}, unmarshalServer);
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Waits for {@link Server} to be in a final state.
|
|
155
|
-
*
|
|
156
|
-
* @param request - The request {@link GetServerRequest}
|
|
157
|
-
* @param options - The waiting options
|
|
158
|
-
* @returns A Promise of Server
|
|
159
|
-
*/
|
|
160
|
-
waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Update a server. Update the parameters of an existing Apple silicon server,
|
|
164
|
-
* specified by its server ID.
|
|
165
|
-
*
|
|
166
|
-
* @param request - The request {@link UpdateServerRequest}
|
|
167
|
-
* @returns A Promise of Server
|
|
168
|
-
*/
|
|
169
|
-
updateServer = request => this.client.fetch({
|
|
170
|
-
body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
|
|
171
|
-
headers: jsonContentHeaders,
|
|
172
|
-
method: 'PATCH',
|
|
173
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
174
|
-
}, unmarshalServer);
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Delete a server. Delete an existing Apple silicon server, specified by its
|
|
178
|
-
* server ID. Deleting a server is permanent, and cannot be undone. Note that
|
|
179
|
-
* the minimum allocation period for Apple silicon-as-a-service is 24 hours,
|
|
180
|
-
* meaning you cannot delete your server prior to that.
|
|
181
|
-
*
|
|
182
|
-
* @param request - The request {@link DeleteServerRequest}
|
|
183
|
-
*/
|
|
184
|
-
deleteServer = request => this.client.fetch({
|
|
185
|
-
method: 'DELETE',
|
|
186
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Reboot a server. Reboot an existing Apple silicon server, specified by its
|
|
191
|
-
* server ID.
|
|
192
|
-
*
|
|
193
|
-
* @param request - The request {@link RebootServerRequest}
|
|
194
|
-
* @returns A Promise of Server
|
|
195
|
-
*/
|
|
196
|
-
rebootServer = request => this.client.fetch({
|
|
197
|
-
body: '{}',
|
|
198
|
-
headers: jsonContentHeaders,
|
|
199
|
-
method: 'POST',
|
|
200
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
|
|
201
|
-
}, unmarshalServer);
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Reinstall a server. Reinstall an existing Apple silicon server (specified
|
|
205
|
-
* by its server ID) from a new image (OS). All the data on the disk is
|
|
206
|
-
* deleted and all configuration is reset to the defailt configuration values
|
|
207
|
-
* of the image (OS).
|
|
208
|
-
*
|
|
209
|
-
* @param request - The request {@link ReinstallServerRequest}
|
|
210
|
-
* @returns A Promise of Server
|
|
211
|
-
*/
|
|
212
|
-
reinstallServer = request => this.client.fetch({
|
|
213
|
-
body: '{}',
|
|
214
|
-
headers: jsonContentHeaders,
|
|
215
|
-
method: 'POST',
|
|
216
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reinstall`
|
|
217
|
-
}, unmarshalServer);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export { API };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
-
|
|
4
|
-
/** Lists transient statutes of the enum {@link ServerStatus}. */
|
|
5
|
-
const SERVER_TRANSIENT_STATUSES = ['starting', 'rebooting', 'updating', 'locking', 'unlocking', 'reinstalling'];
|
|
6
|
-
|
|
7
|
-
export { SERVER_TRANSIENT_STATUSES };
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
|
-
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
|
-
import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
|
|
4
|
-
|
|
5
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
6
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
7
|
-
const unmarshalOS = data => {
|
|
8
|
-
if (!isJSONObject(data)) {
|
|
9
|
-
throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
compatibleServerTypes: data.compatible_server_types,
|
|
13
|
-
id: data.id,
|
|
14
|
-
imageUrl: data.image_url,
|
|
15
|
-
label: data.label,
|
|
16
|
-
name: data.name
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
const unmarshalServerTypeMemory = data => {
|
|
20
|
-
if (!isJSONObject(data)) {
|
|
21
|
-
throw new TypeError(`Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.`);
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
capacity: data.capacity,
|
|
25
|
-
type: data.type
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
const unmarshalServerTypeDisk = data => {
|
|
29
|
-
if (!isJSONObject(data)) {
|
|
30
|
-
throw new TypeError(`Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary.`);
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
capacity: data.capacity,
|
|
34
|
-
type: data.type
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
const unmarshalServerTypeCPU = data => {
|
|
38
|
-
if (!isJSONObject(data)) {
|
|
39
|
-
throw new TypeError(`Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.`);
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
coreCount: data.core_count,
|
|
43
|
-
name: data.name
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
const unmarshalServerType = data => {
|
|
47
|
-
if (!isJSONObject(data)) {
|
|
48
|
-
throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
cpu: unmarshalServerTypeCPU(data.cpu),
|
|
52
|
-
disk: unmarshalServerTypeDisk(data.disk),
|
|
53
|
-
memory: unmarshalServerTypeMemory(data.memory),
|
|
54
|
-
minimumLeaseDuration: data.minimum_lease_duration ? data.minimum_lease_duration : undefined,
|
|
55
|
-
name: data.name,
|
|
56
|
-
stock: data.stock
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
const unmarshalServer = data => {
|
|
60
|
-
if (!isJSONObject(data)) {
|
|
61
|
-
throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
createdAt: unmarshalDate(data.created_at),
|
|
65
|
-
deletableAt: unmarshalDate(data.deletable_at),
|
|
66
|
-
id: data.id,
|
|
67
|
-
ip: data.ip,
|
|
68
|
-
name: data.name,
|
|
69
|
-
organizationId: data.organization_id,
|
|
70
|
-
projectId: data.project_id,
|
|
71
|
-
status: data.status,
|
|
72
|
-
type: data.type,
|
|
73
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
74
|
-
vncUrl: data.vnc_url,
|
|
75
|
-
zone: data.zone
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
const unmarshalListOSResponse = data => {
|
|
79
|
-
if (!isJSONObject(data)) {
|
|
80
|
-
throw new TypeError(`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`);
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
os: unmarshalArrayOfObject(data.os, unmarshalOS),
|
|
84
|
-
totalCount: data.total_count
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
const unmarshalListServerTypesResponse = data => {
|
|
88
|
-
if (!isJSONObject(data)) {
|
|
89
|
-
throw new TypeError(`Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.`);
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
serverTypes: unmarshalArrayOfObject(data.server_types, unmarshalServerType)
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
const unmarshalListServersResponse = data => {
|
|
96
|
-
if (!isJSONObject(data)) {
|
|
97
|
-
throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
|
|
101
|
-
totalCount: data.total_count
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
const marshalCreateServerRequest = (request, defaults) => ({
|
|
105
|
-
name: request.name || randomName('as'),
|
|
106
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
107
|
-
type: request.type
|
|
108
|
-
});
|
|
109
|
-
const marshalUpdateServerRequest = (request, defaults) => ({
|
|
110
|
-
name: request.name
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
export { marshalCreateServerRequest, marshalUpdateServerRequest, unmarshalListOSResponse, unmarshalListServerTypesResponse, unmarshalListServersResponse, unmarshalOS, unmarshalServer, unmarshalServerType };
|