@scaleway/sdk 2.0.0-alpha.13 → 2.0.0-alpha.15
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/api/account/index.js +4 -0
- package/dist/api/account/v2/api.gen.js +147 -0
- package/dist/api/account/v2/index.gen.js +4 -0
- package/dist/api/account/v2/marshalling.gen.js +39 -0
- package/dist/api/account/v3/api.gen.js +129 -0
- package/dist/api/account/v3/index.gen.js +6 -0
- package/dist/api/account/v3/marshalling.gen.js +39 -0
- package/dist/api/account/v3/validation-rules.gen.js +39 -0
- package/dist/api/applesilicon/index.js +2 -0
- package/dist/api/applesilicon/v1alpha1/api.gen.js +220 -0
- package/dist/api/applesilicon/v1alpha1/content.gen.js +7 -0
- package/dist/api/applesilicon/v1alpha1/index.gen.js +5 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +113 -0
- package/dist/api/baremetal/index.js +2 -0
- package/dist/api/baremetal/v1/api.gen.js +523 -0
- package/dist/api/baremetal/v1/api.utils.js +27 -0
- package/dist/api/baremetal/v1/content.gen.js +13 -0
- package/dist/api/baremetal/v1/index.js +5 -0
- package/dist/api/baremetal/v1/marshalling.gen.js +406 -0
- package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
- package/dist/api/billing/index.js +2 -0
- package/dist/api/billing/v2alpha1/api.gen.js +80 -0
- package/dist/api/billing/v2alpha1/index.gen.js +4 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.js +53 -0
- package/dist/api/block/index.js +2 -0
- package/dist/api/block/v1alpha1/api.gen.js +249 -0
- package/dist/api/block/v1alpha1/content.gen.js +13 -0
- package/dist/api/block/v1alpha1/index.gen.js +7 -0
- package/dist/api/block/v1alpha1/marshalling.gen.js +182 -0
- package/dist/api/block/v1alpha1/validation-rules.gen.js +52 -0
- package/dist/api/cockpit/index.js +2 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +543 -0
- package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
- package/dist/api/cockpit/v1beta1/index.gen.js +5 -0
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +271 -0
- package/dist/api/container/index.js +2 -0
- package/dist/api/container/v1beta1/api.gen.js +549 -0
- package/dist/api/container/v1beta1/content.gen.js +22 -0
- package/dist/api/container/v1beta1/index.gen.js +7 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +358 -0
- package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/document_db/index.js +2 -0
- package/dist/api/document_db/v1beta1/api.gen.js +830 -0
- package/dist/api/document_db/v1beta1/content.gen.js +19 -0
- package/dist/api/document_db/v1beta1/index.gen.js +7 -0
- package/dist/api/document_db/v1beta1/marshalling.gen.js +636 -0
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +10 -0
- package/dist/api/domain/index.js +2 -0
- package/dist/api/domain/v2beta1/api.gen.js +867 -0
- package/dist/api/domain/v2beta1/content.gen.js +28 -0
- package/dist/api/domain/v2beta1/index.gen.js +5 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +1172 -0
- package/dist/api/flexibleip/index.js +2 -0
- package/dist/api/flexibleip/v1alpha1/api.gen.js +195 -0
- package/dist/api/flexibleip/v1alpha1/content.gen.js +10 -0
- package/dist/api/flexibleip/v1alpha1/index.gen.js +7 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +97 -0
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/function/index.js +2 -0
- package/dist/api/function/v1beta1/api.gen.js +560 -0
- package/dist/api/function/v1beta1/content.gen.js +22 -0
- package/dist/api/function/v1beta1/index.gen.js +7 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +396 -0
- package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/iam/index.js +2 -0
- package/dist/api/iam/v1alpha1/api.gen.js +783 -0
- package/dist/api/iam/v1alpha1/index.gen.js +6 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +384 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +207 -0
- package/dist/api/instance/index.js +2 -0
- package/dist/api/instance/v1/api.gen.js +1003 -0
- package/dist/api/instance/v1/api.utils.js +369 -0
- package/dist/api/instance/v1/content.gen.js +31 -0
- package/dist/api/instance/v1/index.js +2 -0
- package/dist/api/instance/v1/marshalling.gen.js +1415 -0
- package/dist/api/instance/v1/marshalling.utils.js +63 -0
- package/dist/api/iot/index.js +2 -0
- package/dist/api/iot/v1/api.gen.js +573 -0
- package/dist/api/iot/v1/content.gen.js +7 -0
- package/dist/api/iot/v1/index.gen.js +5 -0
- package/dist/api/iot/v1/marshalling.gen.js +439 -0
- package/dist/api/ipam/index.js +2 -0
- package/dist/api/ipam/v1/api.gen.js +113 -0
- package/dist/api/ipam/v1/index.gen.js +6 -0
- package/dist/api/ipam/v1/marshalling.gen.js +77 -0
- package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
- package/dist/api/ipfs/index.js +2 -0
- package/dist/api/ipfs/v1alpha1/api.gen.js +314 -0
- package/dist/api/ipfs/v1alpha1/content.gen.js +10 -0
- package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +180 -0
- package/dist/api/k8s/index.js +2 -0
- package/dist/api/k8s/v1/api.gen.js +454 -0
- package/dist/api/k8s/v1/api.utils.js +13 -0
- package/dist/api/k8s/v1/content.gen.js +13 -0
- package/dist/api/k8s/v1/index.js +4 -0
- package/dist/api/k8s/v1/marshalling.gen.js +421 -0
- package/dist/api/k8s/v1/validation-rules.gen.js +101 -0
- package/dist/api/lb/index.js +2 -0
- package/dist/api/lb/v1/api.gen.js +1669 -0
- package/dist/api/lb/v1/api.utils.js +81 -0
- package/dist/api/lb/v1/content.gen.js +16 -0
- package/dist/api/lb/v1/index.js +2 -0
- package/dist/api/lb/v1/marshalling.gen.js +1039 -0
- package/dist/api/marketplace/index.js +4 -0
- package/dist/api/marketplace/v1/api.gen.js +60 -0
- package/dist/api/marketplace/v1/index.gen.js +4 -0
- package/dist/api/marketplace/v1/marshalling.gen.js +92 -0
- package/dist/api/marketplace/v2/api.gen.js +162 -0
- package/dist/api/marketplace/v2/index.gen.js +4 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +94 -0
- package/dist/api/mnq/index.js +4 -0
- package/dist/api/mnq/v1alpha1/api.gen.js +197 -0
- package/dist/api/mnq/v1alpha1/index.gen.js +4 -0
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +126 -0
- package/dist/api/mnq/v1beta1/api.gen.js +529 -0
- package/dist/api/mnq/v1beta1/index.gen.js +6 -0
- package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
- package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
- package/dist/api/rdb/index.js +2 -0
- package/dist/api/rdb/v1/api.gen.js +972 -0
- package/dist/api/rdb/v1/content.gen.js +22 -0
- package/dist/api/rdb/v1/index.gen.js +7 -0
- package/dist/api/rdb/v1/marshalling.gen.js +694 -0
- package/dist/api/rdb/v1/validation-rules.gen.js +10 -0
- package/dist/api/redis/index.js +2 -0
- package/dist/api/redis/v1/api.gen.js +389 -0
- package/dist/api/redis/v1/content.gen.js +7 -0
- package/dist/api/redis/v1/index.gen.js +5 -0
- package/dist/api/redis/v1/marshalling.gen.js +283 -0
- package/dist/api/registry/index.js +2 -0
- package/dist/api/registry/v1/api.gen.js +252 -0
- package/dist/api/registry/v1/content.gen.js +13 -0
- package/dist/api/registry/v1/index.gen.js +5 -0
- package/dist/api/registry/v1/marshalling.gen.js +108 -0
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1alpha1/api.gen.js +415 -0
- package/dist/api/secret/v1alpha1/index.gen.js +4 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +150 -0
- package/dist/api/tem/index.js +2 -0
- package/dist/api/tem/v1alpha1/api.gen.js +229 -0
- package/dist/api/tem/v1alpha1/content.gen.js +10 -0
- package/dist/api/tem/v1alpha1/index.gen.js +5 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +168 -0
- package/dist/api/test/index.js +2 -0
- package/dist/api/test/v1/api.gen.js +152 -0
- package/dist/api/test/v1/content.gen.js +7 -0
- package/dist/api/test/v1/index.gen.js +5 -0
- package/dist/api/test/v1/marshalling.gen.js +81 -0
- package/dist/api/vpc/index.js +4 -0
- package/dist/api/vpc/v1/api.gen.js +110 -0
- package/dist/api/vpc/v1/index.gen.js +4 -0
- package/dist/api/vpc/v1/marshalling.gen.js +44 -0
- package/dist/api/vpc/v2/api.gen.js +276 -0
- package/dist/api/vpc/v2/index.gen.js +4 -0
- package/dist/api/vpc/v2/marshalling.gen.js +137 -0
- package/dist/api/vpcgw/index.js +2 -0
- package/dist/api/vpcgw/v1/api.gen.js +669 -0
- package/dist/api/vpcgw/v1/content.gen.js +10 -0
- package/dist/api/vpcgw/v1/index.gen.js +5 -0
- package/dist/api/vpcgw/v1/marshalling.gen.js +359 -0
- package/dist/api/webhosting/index.js +2 -0
- package/dist/api/webhosting/v1alpha1/api.gen.js +158 -0
- package/dist/api/webhosting/v1alpha1/content.gen.js +7 -0
- package/dist/api/webhosting/v1alpha1/index.gen.js +7 -0
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +146 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/helpers/is-browser.js +5 -0
- package/dist/helpers/is-response.js +10 -0
- package/dist/helpers/json.js +11 -0
- package/dist/helpers/marshalling.js +130 -0
- package/dist/index.cjs +26484 -0
- package/dist/index.d.ts +31184 -0
- package/dist/index.js +71 -0
- package/dist/internal/async/interval-retrier.js +105 -0
- package/dist/internal/async/sleep.js +13 -0
- package/dist/internal/interceptors/composer.js +46 -0
- package/dist/internal/interceptors/helpers.js +32 -0
- package/dist/internal/logger/console-logger.js +38 -0
- package/dist/internal/logger/index.js +41 -0
- package/dist/internal/logger/level-resolver.js +13 -0
- package/dist/internal/validations/string-validation.js +38 -0
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +13 -0
- package/dist/scw/api.js +12 -0
- package/dist/scw/auth.js +68 -0
- package/dist/scw/client-ini-factory.js +174 -0
- package/dist/scw/client-ini-profile.js +54 -0
- package/dist/scw/client-settings.js +78 -0
- package/dist/scw/client.js +98 -0
- package/dist/scw/constants.js +4 -0
- package/dist/scw/custom-marshalling.js +131 -0
- package/dist/scw/errors/error-parser.js +107 -0
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +36 -0
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +27 -0
- package/dist/scw/errors/scw-error.js +66 -0
- package/dist/scw/errors/standard/already-exists-error.js +26 -0
- package/dist/scw/errors/standard/denied-authentication-error.js +52 -0
- package/dist/scw/errors/standard/index.js +13 -0
- package/dist/scw/errors/standard/invalid-arguments-error.js +67 -0
- package/dist/scw/errors/standard/out-of-stock-error.js +22 -0
- package/dist/scw/errors/standard/permissions-denied-error.js +48 -0
- package/dist/scw/errors/standard/precondition-failed-error.js +42 -0
- package/dist/scw/errors/standard/quotas-exceeded-error.js +68 -0
- package/dist/scw/errors/standard/resource-expired-error.js +26 -0
- package/dist/scw/errors/standard/resource-locked-error.js +25 -0
- package/dist/scw/errors/standard/resource-not-found-error.js +25 -0
- package/dist/scw/errors/standard/too-many-requests-error.js +70 -0
- package/dist/scw/errors/standard/transient-state-error.js +26 -0
- package/dist/scw/errors/types.js +23 -0
- package/dist/scw/fetch/build-fetcher.js +72 -0
- package/dist/scw/fetch/http-dumper.js +54 -0
- package/dist/scw/fetch/http-interceptors.js +99 -0
- package/dist/scw/fetch/resource-paginator.js +84 -0
- package/dist/scw/fetch/response-parser.js +72 -0
- package/package.json +2 -2
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
2
|
+
import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
|
|
3
|
+
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
|
+
import { marshalCreateProjectRequest, unmarshalProject, unmarshalListProjectsResponse, marshalUpdateProjectRequest } from './marshalling.gen.js';
|
|
5
|
+
|
|
6
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
7
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
8
|
+
const jsonContentHeaders = {
|
|
9
|
+
'Content-Type': 'application/json; charset=utf-8'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Account API.
|
|
14
|
+
*
|
|
15
|
+
* User related data. This API allows you to manage projects.
|
|
16
|
+
*/
|
|
17
|
+
class API extends API$1 {
|
|
18
|
+
/**
|
|
19
|
+
* Create a new Project for an Organization. Deprecated in favor of Account
|
|
20
|
+
* API v3. Generate a new Project for an Organization, specifying its
|
|
21
|
+
* configuration including name and description.
|
|
22
|
+
*
|
|
23
|
+
* @deprecated
|
|
24
|
+
* @param request - The request {@link CreateProjectRequest}
|
|
25
|
+
* @returns A Promise of Project
|
|
26
|
+
*/
|
|
27
|
+
createProject = (() => {
|
|
28
|
+
var _this = this;
|
|
29
|
+
return function (request) {
|
|
30
|
+
if (request === void 0) {
|
|
31
|
+
request = {};
|
|
32
|
+
}
|
|
33
|
+
return _this.client.fetch({
|
|
34
|
+
body: JSON.stringify(marshalCreateProjectRequest(request, _this.client.settings)),
|
|
35
|
+
headers: jsonContentHeaders,
|
|
36
|
+
method: 'POST',
|
|
37
|
+
path: `/account/v2/projects`
|
|
38
|
+
}, unmarshalProject);
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
pageOfListProjects = (() => {
|
|
42
|
+
var _this2 = this;
|
|
43
|
+
return function (request) {
|
|
44
|
+
if (request === void 0) {
|
|
45
|
+
request = {};
|
|
46
|
+
}
|
|
47
|
+
return _this2.client.fetch({
|
|
48
|
+
method: 'GET',
|
|
49
|
+
path: `/account/v2/projects`,
|
|
50
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? _this2.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_ids', request.projectIds])
|
|
51
|
+
}, unmarshalListProjectsResponse);
|
|
52
|
+
};
|
|
53
|
+
})();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* List all Projects of an Organization. Deprecated in favor of Account API
|
|
57
|
+
* v3. List all Projects of an Organization. The response will include the
|
|
58
|
+
* total number of Projects as well as their associated Organizations, names
|
|
59
|
+
* and IDs. Other information include the creation and update date of the
|
|
60
|
+
* Project.
|
|
61
|
+
*
|
|
62
|
+
* @deprecated
|
|
63
|
+
* @param request - The request {@link ListProjectsRequest}
|
|
64
|
+
* @returns A Promise of ListProjectsResponse
|
|
65
|
+
*/
|
|
66
|
+
listProjects = (() => {
|
|
67
|
+
var _this3 = this;
|
|
68
|
+
return function (request) {
|
|
69
|
+
if (request === void 0) {
|
|
70
|
+
request = {};
|
|
71
|
+
}
|
|
72
|
+
return enrichForPagination('projects', _this3.pageOfListProjects, request);
|
|
73
|
+
};
|
|
74
|
+
})();
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Get an existing Project. Deprecated in favor of Account API v3. Retrieve
|
|
78
|
+
* information about an existing Project, specified by its Project ID. Its
|
|
79
|
+
* full details, including ID, name and description, are returned in the
|
|
80
|
+
* response object.
|
|
81
|
+
*
|
|
82
|
+
* @deprecated
|
|
83
|
+
* @param request - The request {@link GetProjectRequest}
|
|
84
|
+
* @returns A Promise of Project
|
|
85
|
+
*/
|
|
86
|
+
getProject = (() => {
|
|
87
|
+
var _this4 = this;
|
|
88
|
+
return function (request) {
|
|
89
|
+
if (request === void 0) {
|
|
90
|
+
request = {};
|
|
91
|
+
}
|
|
92
|
+
return _this4.client.fetch({
|
|
93
|
+
method: 'GET',
|
|
94
|
+
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this4.client.settings.defaultProjectId)}`
|
|
95
|
+
}, unmarshalProject);
|
|
96
|
+
};
|
|
97
|
+
})();
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Delete an existing Project. Deprecated in favor of Account API v3. Delete
|
|
101
|
+
* an existing Project, specified by its Project ID. The Project needs to be
|
|
102
|
+
* empty (meaning there are no resources left in it) to be deleted
|
|
103
|
+
* effectively. Note that deleting a Project is permanent, and cannot be
|
|
104
|
+
* undone.
|
|
105
|
+
*
|
|
106
|
+
* @deprecated
|
|
107
|
+
* @param request - The request {@link DeleteProjectRequest}
|
|
108
|
+
*/
|
|
109
|
+
deleteProject = (() => {
|
|
110
|
+
var _this5 = this;
|
|
111
|
+
return function (request) {
|
|
112
|
+
if (request === void 0) {
|
|
113
|
+
request = {};
|
|
114
|
+
}
|
|
115
|
+
return _this5.client.fetch({
|
|
116
|
+
method: 'DELETE',
|
|
117
|
+
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this5.client.settings.defaultProjectId)}`
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
})();
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Update Project. Deprecated in favor of Account API v3. Update the
|
|
124
|
+
* parameters of an existing Project, specified by its Project ID. These
|
|
125
|
+
* parameters include the name and description.
|
|
126
|
+
*
|
|
127
|
+
* @deprecated
|
|
128
|
+
* @param request - The request {@link UpdateProjectRequest}
|
|
129
|
+
* @returns A Promise of Project
|
|
130
|
+
*/
|
|
131
|
+
updateProject = (() => {
|
|
132
|
+
var _this6 = this;
|
|
133
|
+
return function (request) {
|
|
134
|
+
if (request === void 0) {
|
|
135
|
+
request = {};
|
|
136
|
+
}
|
|
137
|
+
return _this6.client.fetch({
|
|
138
|
+
body: JSON.stringify(marshalUpdateProjectRequest(request, _this6.client.settings)),
|
|
139
|
+
headers: jsonContentHeaders,
|
|
140
|
+
method: 'PATCH',
|
|
141
|
+
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this6.client.settings.defaultProjectId)}`
|
|
142
|
+
}, unmarshalProject);
|
|
143
|
+
};
|
|
144
|
+
})();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export { API };
|
|
@@ -0,0 +1,39 @@
|
|
|
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 unmarshalProject = data => {
|
|
8
|
+
if (!isJSONObject(data)) {
|
|
9
|
+
throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
createdAt: unmarshalDate(data.created_at),
|
|
13
|
+
description: data.description,
|
|
14
|
+
id: data.id,
|
|
15
|
+
name: data.name,
|
|
16
|
+
organizationId: data.organization_id,
|
|
17
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const unmarshalListProjectsResponse = data => {
|
|
21
|
+
if (!isJSONObject(data)) {
|
|
22
|
+
throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
|
|
26
|
+
totalCount: data.total_count
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const marshalCreateProjectRequest = (request, defaults) => ({
|
|
30
|
+
description: request.description,
|
|
31
|
+
name: request.name || randomName('proj'),
|
|
32
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId
|
|
33
|
+
});
|
|
34
|
+
const marshalUpdateProjectRequest = (request, defaults) => ({
|
|
35
|
+
description: request.description,
|
|
36
|
+
name: request.name
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export { marshalCreateProjectRequest, marshalUpdateProjectRequest, unmarshalListProjectsResponse, unmarshalProject };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
2
|
+
import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
|
|
3
|
+
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
|
+
import { marshalProjectApiCreateProjectRequest, unmarshalProject, unmarshalListProjectsResponse, marshalProjectApiUpdateProjectRequest } from './marshalling.gen.js';
|
|
5
|
+
|
|
6
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
7
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
8
|
+
const jsonContentHeaders = {
|
|
9
|
+
'Content-Type': 'application/json; charset=utf-8'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Account API.
|
|
14
|
+
*
|
|
15
|
+
* This API allows you to manage projects.
|
|
16
|
+
*/
|
|
17
|
+
class ProjectAPI extends API$1 {
|
|
18
|
+
/**
|
|
19
|
+
* Create a new Project for an Organization. Generate a new Project for an
|
|
20
|
+
* Organization, specifying its configuration including name and description.
|
|
21
|
+
*
|
|
22
|
+
* @param request - The request {@link ProjectApiCreateProjectRequest}
|
|
23
|
+
* @returns A Promise of Project
|
|
24
|
+
*/
|
|
25
|
+
createProject = request => this.client.fetch({
|
|
26
|
+
body: JSON.stringify(marshalProjectApiCreateProjectRequest(request, this.client.settings)),
|
|
27
|
+
headers: jsonContentHeaders,
|
|
28
|
+
method: 'POST',
|
|
29
|
+
path: `/account/v3/projects`
|
|
30
|
+
}, unmarshalProject);
|
|
31
|
+
pageOfListProjects = (() => {
|
|
32
|
+
var _this = this;
|
|
33
|
+
return function (request) {
|
|
34
|
+
if (request === void 0) {
|
|
35
|
+
request = {};
|
|
36
|
+
}
|
|
37
|
+
return _this.client.fetch({
|
|
38
|
+
method: 'GET',
|
|
39
|
+
path: `/account/v3/projects`,
|
|
40
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_ids', request.projectIds])
|
|
41
|
+
}, unmarshalListProjectsResponse);
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* List all Projects of an Organization. List all Projects of an Organization.
|
|
47
|
+
* The response will include the total number of Projects as well as their
|
|
48
|
+
* associated Organizations, names, and IDs. Other information includes the
|
|
49
|
+
* creation and update date of the Project.
|
|
50
|
+
*
|
|
51
|
+
* @param request - The request {@link ProjectApiListProjectsRequest}
|
|
52
|
+
* @returns A Promise of ListProjectsResponse
|
|
53
|
+
*/
|
|
54
|
+
listProjects = (() => {
|
|
55
|
+
var _this2 = this;
|
|
56
|
+
return function (request) {
|
|
57
|
+
if (request === void 0) {
|
|
58
|
+
request = {};
|
|
59
|
+
}
|
|
60
|
+
return enrichForPagination('projects', _this2.pageOfListProjects, request);
|
|
61
|
+
};
|
|
62
|
+
})();
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get an existing Project. Retrieve information about an existing Project,
|
|
66
|
+
* specified by its Project ID. Its full details, including ID, name and
|
|
67
|
+
* description, are returned in the response object.
|
|
68
|
+
*
|
|
69
|
+
* @param request - The request {@link ProjectApiGetProjectRequest}
|
|
70
|
+
* @returns A Promise of Project
|
|
71
|
+
*/
|
|
72
|
+
getProject = (() => {
|
|
73
|
+
var _this3 = this;
|
|
74
|
+
return function (request) {
|
|
75
|
+
if (request === void 0) {
|
|
76
|
+
request = {};
|
|
77
|
+
}
|
|
78
|
+
return _this3.client.fetch({
|
|
79
|
+
method: 'GET',
|
|
80
|
+
path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? _this3.client.settings.defaultProjectId)}`
|
|
81
|
+
}, unmarshalProject);
|
|
82
|
+
};
|
|
83
|
+
})();
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Delete an existing Project. Delete an existing Project, specified by its
|
|
87
|
+
* Project ID. The Project needs to be empty (meaning there are no resources
|
|
88
|
+
* left in it) to be deleted effectively. Note that deleting a Project is
|
|
89
|
+
* permanent, and cannot be undone.
|
|
90
|
+
*
|
|
91
|
+
* @param request - The request {@link ProjectApiDeleteProjectRequest}
|
|
92
|
+
*/
|
|
93
|
+
deleteProject = (() => {
|
|
94
|
+
var _this4 = this;
|
|
95
|
+
return function (request) {
|
|
96
|
+
if (request === void 0) {
|
|
97
|
+
request = {};
|
|
98
|
+
}
|
|
99
|
+
return _this4.client.fetch({
|
|
100
|
+
method: 'DELETE',
|
|
101
|
+
path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? _this4.client.settings.defaultProjectId)}`
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
})();
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Update Project. Update the parameters of an existing Project, specified by
|
|
108
|
+
* its Project ID. These parameters include the name and description.
|
|
109
|
+
*
|
|
110
|
+
* @param request - The request {@link ProjectApiUpdateProjectRequest}
|
|
111
|
+
* @returns A Promise of Project
|
|
112
|
+
*/
|
|
113
|
+
updateProject = (() => {
|
|
114
|
+
var _this5 = this;
|
|
115
|
+
return function (request) {
|
|
116
|
+
if (request === void 0) {
|
|
117
|
+
request = {};
|
|
118
|
+
}
|
|
119
|
+
return _this5.client.fetch({
|
|
120
|
+
body: JSON.stringify(marshalProjectApiUpdateProjectRequest(request, _this5.client.settings)),
|
|
121
|
+
headers: jsonContentHeaders,
|
|
122
|
+
method: 'PATCH',
|
|
123
|
+
path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? _this5.client.settings.defaultProjectId)}`
|
|
124
|
+
}, unmarshalProject);
|
|
125
|
+
};
|
|
126
|
+
})();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { ProjectAPI };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ProjectAPI } from './api.gen.js';
|
|
2
|
+
import * as validationRules_gen from './validation-rules.gen.js';
|
|
3
|
+
export { validationRules_gen as ValidationRules };
|
|
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.
|
|
@@ -0,0 +1,39 @@
|
|
|
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 unmarshalProject = data => {
|
|
8
|
+
if (!isJSONObject(data)) {
|
|
9
|
+
throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
createdAt: unmarshalDate(data.created_at),
|
|
13
|
+
description: data.description,
|
|
14
|
+
id: data.id,
|
|
15
|
+
name: data.name,
|
|
16
|
+
organizationId: data.organization_id,
|
|
17
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const unmarshalListProjectsResponse = data => {
|
|
21
|
+
if (!isJSONObject(data)) {
|
|
22
|
+
throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
|
|
26
|
+
totalCount: data.total_count
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const marshalProjectApiCreateProjectRequest = (request, defaults) => ({
|
|
30
|
+
description: request.description,
|
|
31
|
+
name: request.name || randomName('proj'),
|
|
32
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId
|
|
33
|
+
});
|
|
34
|
+
const marshalProjectApiUpdateProjectRequest = (request, defaults) => ({
|
|
35
|
+
description: request.description,
|
|
36
|
+
name: request.name
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export { marshalProjectApiCreateProjectRequest, marshalProjectApiUpdateProjectRequest, unmarshalListProjectsResponse, unmarshalProject };
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
const ProjectApiCreateProjectRequest = {
|
|
5
|
+
description: {
|
|
6
|
+
maxLength: 200
|
|
7
|
+
},
|
|
8
|
+
name: {
|
|
9
|
+
maxLength: 64,
|
|
10
|
+
minLength: 1,
|
|
11
|
+
pattern: /^[a-zA-Z0-9\._\- ]+$/
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const ProjectApiListProjectsRequest = {
|
|
15
|
+
name: {
|
|
16
|
+
maxLength: 64,
|
|
17
|
+
minLength: 1,
|
|
18
|
+
pattern: /^[a-zA-Z0-9\._\- ]+$/
|
|
19
|
+
},
|
|
20
|
+
page: {
|
|
21
|
+
greaterThan: 0
|
|
22
|
+
},
|
|
23
|
+
pageSize: {
|
|
24
|
+
greaterThanOrEqual: 1,
|
|
25
|
+
lessThanOrEqual: 100
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const ProjectApiUpdateProjectRequest = {
|
|
29
|
+
description: {
|
|
30
|
+
maxLength: 200
|
|
31
|
+
},
|
|
32
|
+
name: {
|
|
33
|
+
maxLength: 64,
|
|
34
|
+
minLength: 1,
|
|
35
|
+
pattern: /^[a-zA-Z0-9\._\- ]+$/
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { ProjectApiCreateProjectRequest, ProjectApiListProjectsRequest, ProjectApiUpdateProjectRequest };
|
|
@@ -0,0 +1,220 @@
|
|
|
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 };
|
|
@@ -0,0 +1,7 @@
|
|
|
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 };
|