@scaleway/sdk 1.13.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/account/v2/api.gen.js +77 -60
- package/dist/api/applesilicon/v1alpha1/api.gen.js +175 -173
- package/dist/api/baremetal/v1/api.gen.js +434 -378
- package/dist/api/baremetal/v1/api.utils.js +19 -22
- package/dist/api/billing/v2alpha1/api.gen.js +21 -17
- package/dist/api/cockpit/v1beta1/api.gen.js +308 -232
- package/dist/api/container/v1beta1/api.gen.js +384 -337
- package/dist/api/domain/v2beta1/api.gen.js +754 -668
- package/dist/api/flexibleip/v1alpha1/api.gen.js +164 -151
- package/dist/api/function/v1beta1/api.gen.js +467 -407
- package/dist/api/iam/v1alpha1/api.gen.js +641 -557
- package/dist/api/instance/v1/api.gen.js +802 -677
- package/dist/api/instance/v1/api.utils.js +337 -325
- package/dist/api/instance/v1/marshalling.gen.js +2 -1
- package/dist/api/iot/v1/api.gen.js +508 -452
- package/dist/api/ipfs/index.js +2 -0
- package/dist/api/ipfs/v1alpha1/api.gen.js +197 -0
- package/dist/api/ipfs/v1alpha1/content.gen.js +7 -0
- package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +125 -0
- package/dist/api/k8s/v1/api.gen.js +403 -342
- package/dist/api/k8s/v1/api.utils.js +7 -10
- package/dist/api/k8s/v1/marshalling.gen.js +19 -1
- package/dist/api/k8s/v1/validation-rules.gen.js +10 -1
- package/dist/api/lb/v1/api.gen.js +1501 -1363
- package/dist/api/lb/v1/api.utils.js +71 -75
- package/dist/api/lb/v1/marshalling.gen.js +6 -0
- package/dist/api/marketplace/v1/api.gen.js +35 -32
- package/dist/api/marketplace/v2/api.gen.js +117 -102
- package/dist/api/mnq/v1alpha1/api.gen.js +154 -137
- package/dist/api/rdb/v1/api.gen.js +897 -819
- package/dist/api/redis/v1/api.gen.js +358 -333
- package/dist/api/registry/v1/api.gen.js +211 -189
- package/dist/api/secret/v1alpha1/api.gen.js +265 -245
- package/dist/api/secret/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/tem/v1alpha1/api.gen.js +183 -156
- package/dist/api/tem/v1alpha1/marshalling.gen.js +32 -1
- package/dist/api/test/v1/api.gen.js +116 -104
- package/dist/api/vpc/v1/api.gen.js +74 -65
- package/dist/api/vpc/v2/api.gen.js +200 -178
- package/dist/api/vpc/v2/marshalling.gen.js +2 -0
- package/dist/api/vpcgw/v1/api.gen.js +575 -501
- package/dist/api/webhosting/v1alpha1/api.gen.js +127 -117
- package/dist/index.cjs +738 -343
- package/dist/index.d.ts +2067 -1592
- package/dist/index.js +28 -26
- package/dist/internal/logger/console-logger.js +4 -5
- package/dist/scw/constants.js +1 -1
- package/dist/scw/errors/scw-error.js +0 -1
- package/package.json +2 -2
|
@@ -15,18 +15,16 @@ const jsonContentHeaders = {
|
|
|
15
15
|
* User related data. This API allows you to manage projects.
|
|
16
16
|
*/
|
|
17
17
|
class API extends API$1 {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*/
|
|
29
|
-
this.createProject = function (request) {
|
|
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 CreateProjectRequest}
|
|
23
|
+
* @returns A Promise of Project
|
|
24
|
+
*/
|
|
25
|
+
createProject = (() => {
|
|
26
|
+
var _this = this;
|
|
27
|
+
return function (request) {
|
|
30
28
|
if (request === void 0) {
|
|
31
29
|
request = {};
|
|
32
30
|
}
|
|
@@ -37,84 +35,103 @@ class API extends API$1 {
|
|
|
37
35
|
path: `/account/v2/projects`
|
|
38
36
|
}, unmarshalProject);
|
|
39
37
|
};
|
|
40
|
-
|
|
38
|
+
})();
|
|
39
|
+
pageOfListProjects = (() => {
|
|
40
|
+
var _this2 = this;
|
|
41
|
+
return function (request) {
|
|
41
42
|
if (request === void 0) {
|
|
42
43
|
request = {};
|
|
43
44
|
}
|
|
44
|
-
return
|
|
45
|
+
return _this2.client.fetch({
|
|
45
46
|
method: 'GET',
|
|
46
47
|
path: `/account/v2/projects`,
|
|
47
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ??
|
|
48
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this2.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_ids', request.projectIds])
|
|
48
49
|
}, unmarshalListProjectsResponse);
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
})();
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* List all Projects of an Organization. List all Projects of an Organization.
|
|
55
|
+
* The response will include the total number of Projects as well as their
|
|
56
|
+
* associated Organizations, names and IDs. Other information include the
|
|
57
|
+
* creation and update date of the Project.
|
|
58
|
+
*
|
|
59
|
+
* @param request - The request {@link ListProjectsRequest}
|
|
60
|
+
* @returns A Promise of ListProjectsResponse
|
|
61
|
+
*/
|
|
62
|
+
listProjects = (() => {
|
|
63
|
+
var _this3 = this;
|
|
64
|
+
return function (request) {
|
|
60
65
|
if (request === void 0) {
|
|
61
66
|
request = {};
|
|
62
67
|
}
|
|
63
|
-
return enrichForPagination('projects',
|
|
68
|
+
return enrichForPagination('projects', _this3.pageOfListProjects, request);
|
|
64
69
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
})();
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get an existing Project. Retrieve information about an existing Project,
|
|
74
|
+
* specified by its Project ID. Its full details, including ID, name and
|
|
75
|
+
* description, are returned in the response object.
|
|
76
|
+
*
|
|
77
|
+
* @param request - The request {@link GetProjectRequest}
|
|
78
|
+
* @returns A Promise of Project
|
|
79
|
+
*/
|
|
80
|
+
getProject = (() => {
|
|
81
|
+
var _this4 = this;
|
|
82
|
+
return function (request) {
|
|
74
83
|
if (request === void 0) {
|
|
75
84
|
request = {};
|
|
76
85
|
}
|
|
77
|
-
return
|
|
86
|
+
return _this4.client.fetch({
|
|
78
87
|
method: 'GET',
|
|
79
|
-
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ??
|
|
88
|
+
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this4.client.settings.defaultProjectId)}`
|
|
80
89
|
}, unmarshalProject);
|
|
81
90
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
})();
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Delete an existing Project. Delete an existing Project, specified by its
|
|
95
|
+
* Project ID. The Project needs to be empty (meaning there are no resources
|
|
96
|
+
* left in it) to be deleted effectively. Note that deleting a Project is
|
|
97
|
+
* permanent, and cannot be undone.
|
|
98
|
+
*
|
|
99
|
+
* @param request - The request {@link DeleteProjectRequest}
|
|
100
|
+
*/
|
|
101
|
+
deleteProject = (() => {
|
|
102
|
+
var _this5 = this;
|
|
103
|
+
return function (request) {
|
|
91
104
|
if (request === void 0) {
|
|
92
105
|
request = {};
|
|
93
106
|
}
|
|
94
|
-
return
|
|
107
|
+
return _this5.client.fetch({
|
|
95
108
|
method: 'DELETE',
|
|
96
|
-
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ??
|
|
109
|
+
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this5.client.settings.defaultProjectId)}`
|
|
97
110
|
});
|
|
98
111
|
};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
})();
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Update Project. Update the parameters of an existing Project, specified by
|
|
116
|
+
* its Project ID. These parameters include the name and description.
|
|
117
|
+
*
|
|
118
|
+
* @param request - The request {@link UpdateProjectRequest}
|
|
119
|
+
* @returns A Promise of Project
|
|
120
|
+
*/
|
|
121
|
+
updateProject = (() => {
|
|
122
|
+
var _this6 = this;
|
|
123
|
+
return function (request) {
|
|
107
124
|
if (request === void 0) {
|
|
108
125
|
request = {};
|
|
109
126
|
}
|
|
110
|
-
return
|
|
111
|
-
body: JSON.stringify(marshalUpdateProjectRequest(request,
|
|
127
|
+
return _this6.client.fetch({
|
|
128
|
+
body: JSON.stringify(marshalUpdateProjectRequest(request, _this6.client.settings)),
|
|
112
129
|
headers: jsonContentHeaders,
|
|
113
130
|
method: 'PATCH',
|
|
114
|
-
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ??
|
|
131
|
+
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this6.client.settings.defaultProjectId)}`
|
|
115
132
|
}, unmarshalProject);
|
|
116
133
|
};
|
|
117
|
-
}
|
|
134
|
+
})();
|
|
118
135
|
}
|
|
119
136
|
|
|
120
137
|
export { API };
|
|
@@ -11,41 +11,22 @@ const jsonContentHeaders = {
|
|
|
11
11
|
'Content-Type': 'application/json; charset=utf-8'
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Apple silicon API.
|
|
16
|
-
*
|
|
17
|
-
* Apple Mac mini as a service. Scaleway Apple silicon as-a-Service is built
|
|
18
|
-
* using the latest generation of Apple Mac mini hardware (fifth generation).
|
|
19
|
-
*
|
|
20
|
-
* These dedicated Mac mini M1s are designed for developing, building, testing,
|
|
21
|
-
* and signing applications for Apple devices, including iPhones, iPads, Mac
|
|
22
|
-
* computers and much more.
|
|
23
|
-
*
|
|
24
|
-
* Get set to explore, learn and build on a dedicated Mac mini M1 with more
|
|
25
|
-
* performance and speed than you ever thought possible.
|
|
26
|
-
*
|
|
27
|
-
* _Apple silicon as a Service comes with a minimum allocation period of 24
|
|
28
|
-
* hours_*.
|
|
29
|
-
*
|
|
30
|
-
* Mac mini and macOS are trademarks of Apple Inc., registered in the U.S. and
|
|
31
|
-
* other countries and regions. IOS is a trademark or registered trademark of
|
|
32
|
-
* Cisco in the U.S. and other countries and is used by Apple under license.
|
|
33
|
-
* Scaleway is not affiliated with Apple Inc.
|
|
34
|
-
*/
|
|
14
|
+
/** Apple silicon API. */
|
|
35
15
|
class API extends API$1 {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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) {
|
|
49
30
|
if (request === void 0) {
|
|
50
31
|
request = {};
|
|
51
32
|
}
|
|
@@ -54,165 +35,186 @@ class API extends API$1 {
|
|
|
54
35
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/server-types`
|
|
55
36
|
}, unmarshalListServerTypesResponse);
|
|
56
37
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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) {
|
|
82
68
|
if (request === void 0) {
|
|
83
69
|
request = {};
|
|
84
70
|
}
|
|
85
|
-
return
|
|
71
|
+
return _this2.client.fetch({
|
|
86
72
|
method: 'GET',
|
|
87
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ??
|
|
88
|
-
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ??
|
|
73
|
+
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/servers`,
|
|
74
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
89
75
|
}, unmarshalListServersResponse);
|
|
90
76
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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) {
|
|
100
90
|
if (request === void 0) {
|
|
101
91
|
request = {};
|
|
102
92
|
}
|
|
103
|
-
return enrichForPagination('servers',
|
|
93
|
+
return enrichForPagination('servers', _this3.pageOfListServers, request);
|
|
104
94
|
};
|
|
105
|
-
|
|
95
|
+
})();
|
|
96
|
+
pageOfListOS = (() => {
|
|
97
|
+
var _this4 = this;
|
|
98
|
+
return function (request) {
|
|
106
99
|
if (request === void 0) {
|
|
107
100
|
request = {};
|
|
108
101
|
}
|
|
109
|
-
return
|
|
102
|
+
return _this4.client.fetch({
|
|
110
103
|
method: 'GET',
|
|
111
|
-
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ??
|
|
112
|
-
urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ??
|
|
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])
|
|
113
106
|
}, unmarshalListOSResponse);
|
|
114
107
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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) {
|
|
124
121
|
if (request === void 0) {
|
|
125
122
|
request = {};
|
|
126
123
|
}
|
|
127
|
-
return enrichForPagination('os',
|
|
124
|
+
return enrichForPagination('os', _this5.pageOfListOS, request);
|
|
128
125
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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);
|
|
215
218
|
}
|
|
216
|
-
API.LOCALITIES = ['fr-par-3'];
|
|
217
219
|
|
|
218
220
|
export { API };
|