@scaleway/sdk-applesilicon 1.5.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/v1alpha1/api.gen.d.ts +49 -3
- package/dist/v1alpha1/api.gen.js +123 -50
- package/dist/v1alpha1/content.gen.d.ts +3 -1
- package/dist/v1alpha1/content.gen.js +11 -2
- package/dist/v1alpha1/index.gen.d.ts +2 -1
- package/dist/v1alpha1/index.gen.js +9 -2
- package/dist/v1alpha1/marshalling.gen.d.ts +5 -1
- package/dist/v1alpha1/marshalling.gen.js +105 -18
- package/dist/v1alpha1/types.gen.d.ts +127 -3
- package/dist/v1alpha1/validation-rules.gen.d.ts +6 -0
- package/dist/v1alpha1/validation-rules.gen.js +9 -0
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1alpha1/api.gen.cjs +0 -359
- package/dist/v1alpha1/content.gen.cjs +0 -16
- package/dist/v1alpha1/index.gen.cjs +0 -29
- package/dist/v1alpha1/marshalling.gen.cjs +0 -384
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-applesilicon
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-applesilicon)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-applesilicon)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Applesilicon API.
|
|
8
|
+
|
|
9
|
+
> **Note**
|
|
10
|
+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @scaleway/sdk-applesilicon @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-applesilicon @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-applesilicon @scaleway/sdk-client
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
38
|
+
import { Applesilicon } from '@scaleway/sdk-applesilicon'
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
|
|
42
|
+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
43
|
+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
44
|
+
defaultRegion: 'fr-par',
|
|
45
|
+
defaultZone: 'fr-par-1',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const api = new Applesilicon.v1.API(client)
|
|
49
|
+
|
|
50
|
+
// Use the API
|
|
51
|
+
// Example: await api.listServers()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Using Configuration Loader
|
|
55
|
+
|
|
56
|
+
For a simpler setup, you can load credentials from the configuration file or environment variables:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
60
|
+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
|
|
61
|
+
import { Applesilicon } from '@scaleway/sdk-applesilicon'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Applesilicon.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Applesilicon API Documentation](https://www.scaleway.com/en/developers/api/applesilicon/)
|
|
72
|
+
- 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
|
|
73
|
+
- 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- ✅ Full TypeScript support with complete type definitions
|
|
78
|
+
- ✅ Promise-based API
|
|
79
|
+
- ✅ Automatic pagination helpers
|
|
80
|
+
- ✅ Built-in error handling
|
|
81
|
+
- ✅ Compatible with Node.js ≥ 20
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
We love feedback! Feel free to reach us on:
|
|
86
|
+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
|
+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
-
import
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
|
+
import type { BatchCreateServersRequest, BatchCreateServersResponse, ConnectivityDiagnostic, CreateRunnerRequest, CreateServerRequest, DeleteRunnerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, GetRunnerRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse, ListRunnersRequest, ListRunnersResponse, ListServerPrivateNetworksResponse, ListServersRequest, ListServersResponse, ListServerTypesRequest, ListServerTypesResponse, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiGetServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, Runner, Server, ServerPrivateNetwork, ServerType, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateRunnerRequest, UpdateServerRequest } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Apple silicon API.
|
|
6
6
|
|
|
@@ -105,7 +105,7 @@ export declare class API extends ParentAPI {
|
|
|
105
105
|
*/
|
|
106
106
|
rebootServer: (request: Readonly<RebootServerRequest>) => Promise<Server>;
|
|
107
107
|
/**
|
|
108
|
-
* Reinstall a server. Reinstall an existing Apple silicon server (specified by its server ID) from a new image (OS). All the data on the disk is deleted and all configuration is reset to the
|
|
108
|
+
* Reinstall a server. Reinstall an existing Apple silicon server (specified by its server ID) from a new image (OS). All the data on the disk is deleted and all configuration is reset to the default configuration values of the image (OS).
|
|
109
109
|
*
|
|
110
110
|
* @param request - The request {@link ReinstallServerRequest}
|
|
111
111
|
* @returns A Promise of Server
|
|
@@ -113,6 +113,52 @@ export declare class API extends ParentAPI {
|
|
|
113
113
|
reinstallServer: (request: Readonly<ReinstallServerRequest>) => Promise<Server>;
|
|
114
114
|
startConnectivityDiagnostic: (request: Readonly<StartConnectivityDiagnosticRequest>) => Promise<StartConnectivityDiagnosticResponse>;
|
|
115
115
|
getConnectivityDiagnostic: (request: Readonly<GetConnectivityDiagnosticRequest>) => Promise<ConnectivityDiagnostic>;
|
|
116
|
+
/**
|
|
117
|
+
* Create a new runner configuration.
|
|
118
|
+
*
|
|
119
|
+
* @param request - The request {@link CreateRunnerRequest}
|
|
120
|
+
* @returns A Promise of Runner
|
|
121
|
+
*/
|
|
122
|
+
createRunner: (request: Readonly<CreateRunnerRequest>) => Promise<Runner>;
|
|
123
|
+
/**
|
|
124
|
+
* Retrieve a runner configuration.
|
|
125
|
+
*
|
|
126
|
+
* @param request - The request {@link GetRunnerRequest}
|
|
127
|
+
* @returns A Promise of Runner
|
|
128
|
+
*/
|
|
129
|
+
getRunner: (request: Readonly<GetRunnerRequest>) => Promise<Runner>;
|
|
130
|
+
/**
|
|
131
|
+
* Waits for {@link Runner} to be in a final state.
|
|
132
|
+
*
|
|
133
|
+
* @param request - The request {@link GetRunnerRequest}
|
|
134
|
+
* @param options - The waiting options
|
|
135
|
+
* @returns A Promise of Runner
|
|
136
|
+
*/
|
|
137
|
+
waitForRunner: (request: Readonly<GetRunnerRequest>, options?: Readonly<WaitForOptions<Runner>>) => Promise<Runner>;
|
|
138
|
+
protected pageOfListRunners: (request?: Readonly<ListRunnersRequest>) => Promise<ListRunnersResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* List runner configurations associated with a server.
|
|
141
|
+
*
|
|
142
|
+
* @param request - The request {@link ListRunnersRequest}
|
|
143
|
+
* @returns A Promise of ListRunnersResponse
|
|
144
|
+
*/
|
|
145
|
+
listRunners: (request?: Readonly<ListRunnersRequest>) => Promise<ListRunnersResponse> & {
|
|
146
|
+
all: () => Promise<Runner[]>;
|
|
147
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Runner[], void, void>;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Create a new runner configuration.
|
|
151
|
+
*
|
|
152
|
+
* @param request - The request {@link UpdateRunnerRequest}
|
|
153
|
+
* @returns A Promise of Runner
|
|
154
|
+
*/
|
|
155
|
+
updateRunner: (request: Readonly<UpdateRunnerRequest>) => Promise<Runner>;
|
|
156
|
+
/**
|
|
157
|
+
* Create a new runner configuration.
|
|
158
|
+
*
|
|
159
|
+
* @param request - The request {@link DeleteRunnerRequest}
|
|
160
|
+
*/
|
|
161
|
+
deleteRunner: (request: Readonly<DeleteRunnerRequest>) => Promise<void>;
|
|
116
162
|
}
|
|
117
163
|
/**
|
|
118
164
|
* Apple silicon - Private Networks API.
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as API$1, toApiLocality, validatePathParam, urlParams, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
|
|
2
|
-
import { SERVER_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
-
import { unmarshalListServerTypesResponse, unmarshalServerType, marshalCreateServerRequest, unmarshalServer, marshalBatchCreateServersRequest, unmarshalBatchCreateServersResponse, unmarshalListServersResponse, unmarshalListOSResponse, unmarshalOS, marshalUpdateServerRequest, marshalReinstallServerRequest, marshalStartConnectivityDiagnosticRequest, unmarshalStartConnectivityDiagnosticResponse, unmarshalConnectivityDiagnostic, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse } from "./marshalling.gen.js";
|
|
2
|
+
import { SERVER_TRANSIENT_STATUSES, RUNNER_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import { unmarshalListServerTypesResponse, unmarshalServerType, marshalCreateServerRequest, unmarshalServer, marshalBatchCreateServersRequest, unmarshalBatchCreateServersResponse, unmarshalListServersResponse, unmarshalListOSResponse, unmarshalOS, marshalUpdateServerRequest, marshalReinstallServerRequest, marshalStartConnectivityDiagnosticRequest, unmarshalStartConnectivityDiagnosticResponse, unmarshalConnectivityDiagnostic, marshalCreateRunnerRequest, unmarshalRunner, unmarshalListRunnersResponse, marshalUpdateRunnerRequest, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse } from "./marshalling.gen.js";
|
|
4
4
|
const jsonContentHeaders = {
|
|
5
5
|
"Content-Type": "application/json; charset=utf-8"
|
|
6
6
|
};
|
|
@@ -10,7 +10,9 @@ class API extends API$1 {
|
|
|
10
10
|
* type ∈ {'zone','region','global','unspecified'}
|
|
11
11
|
*/
|
|
12
12
|
static LOCALITY = toApiLocality({
|
|
13
|
-
zones: [
|
|
13
|
+
zones: [
|
|
14
|
+
"fr-par-3"
|
|
15
|
+
]
|
|
14
16
|
});
|
|
15
17
|
/**
|
|
16
18
|
* List server types. List all technical details about Apple silicon server types available in the specified zone. Since there is only one Availability Zone for Apple silicon servers, the targeted value is `fr-par-3`.
|
|
@@ -80,10 +82,7 @@ class API extends API$1 {
|
|
|
80
82
|
["order_by", request.orderBy],
|
|
81
83
|
["organization_id", request.organizationId],
|
|
82
84
|
["page", request.page],
|
|
83
|
-
[
|
|
84
|
-
"page_size",
|
|
85
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
86
|
-
],
|
|
85
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
87
86
|
["project_id", request.projectId]
|
|
88
87
|
)
|
|
89
88
|
},
|
|
@@ -103,10 +102,7 @@ class API extends API$1 {
|
|
|
103
102
|
urlParams: urlParams(
|
|
104
103
|
["name", request.name],
|
|
105
104
|
["page", request.page],
|
|
106
|
-
[
|
|
107
|
-
"page_size",
|
|
108
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
109
|
-
],
|
|
105
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
110
106
|
["server_type", request.serverType]
|
|
111
107
|
)
|
|
112
108
|
},
|
|
@@ -153,9 +149,7 @@ class API extends API$1 {
|
|
|
153
149
|
* @returns A Promise of Server
|
|
154
150
|
*/
|
|
155
151
|
waitForServer = (request, options) => waitForResource(
|
|
156
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
157
|
-
!SERVER_TRANSIENT_STATUSES.includes(res.status)
|
|
158
|
-
)),
|
|
152
|
+
options?.stop ?? ((res) => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))),
|
|
159
153
|
this.getServer,
|
|
160
154
|
request,
|
|
161
155
|
options
|
|
@@ -182,10 +176,12 @@ class API extends API$1 {
|
|
|
182
176
|
*
|
|
183
177
|
* @param request - The request {@link DeleteServerRequest}
|
|
184
178
|
*/
|
|
185
|
-
deleteServer = (request) => this.client.fetch(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
179
|
+
deleteServer = (request) => this.client.fetch(
|
|
180
|
+
{
|
|
181
|
+
method: "DELETE",
|
|
182
|
+
path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
|
|
183
|
+
}
|
|
184
|
+
);
|
|
189
185
|
/**
|
|
190
186
|
* Reboot a server. Reboot an existing Apple silicon server, specified by its server ID.
|
|
191
187
|
*
|
|
@@ -202,7 +198,7 @@ class API extends API$1 {
|
|
|
202
198
|
unmarshalServer
|
|
203
199
|
);
|
|
204
200
|
/**
|
|
205
|
-
* Reinstall a server. Reinstall an existing Apple silicon server (specified by its server ID) from a new image (OS). All the data on the disk is deleted and all configuration is reset to the
|
|
201
|
+
* Reinstall a server. Reinstall an existing Apple silicon server (specified by its server ID) from a new image (OS). All the data on the disk is deleted and all configuration is reset to the default configuration values of the image (OS).
|
|
206
202
|
*
|
|
207
203
|
* @param request - The request {@link ReinstallServerRequest}
|
|
208
204
|
* @returns A Promise of Server
|
|
@@ -221,10 +217,7 @@ class API extends API$1 {
|
|
|
221
217
|
startConnectivityDiagnostic = (request) => this.client.fetch(
|
|
222
218
|
{
|
|
223
219
|
body: JSON.stringify(
|
|
224
|
-
marshalStartConnectivityDiagnosticRequest(
|
|
225
|
-
request,
|
|
226
|
-
this.client.settings
|
|
227
|
-
)
|
|
220
|
+
marshalStartConnectivityDiagnosticRequest(request, this.client.settings)
|
|
228
221
|
),
|
|
229
222
|
headers: jsonContentHeaders,
|
|
230
223
|
method: "POST",
|
|
@@ -239,6 +232,98 @@ class API extends API$1 {
|
|
|
239
232
|
},
|
|
240
233
|
unmarshalConnectivityDiagnostic
|
|
241
234
|
);
|
|
235
|
+
/**
|
|
236
|
+
* Create a new runner configuration.
|
|
237
|
+
*
|
|
238
|
+
* @param request - The request {@link CreateRunnerRequest}
|
|
239
|
+
* @returns A Promise of Runner
|
|
240
|
+
*/
|
|
241
|
+
createRunner = (request) => this.client.fetch(
|
|
242
|
+
{
|
|
243
|
+
body: JSON.stringify(
|
|
244
|
+
marshalCreateRunnerRequest(request, this.client.settings)
|
|
245
|
+
),
|
|
246
|
+
headers: jsonContentHeaders,
|
|
247
|
+
method: "POST",
|
|
248
|
+
path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/runners`
|
|
249
|
+
},
|
|
250
|
+
unmarshalRunner
|
|
251
|
+
);
|
|
252
|
+
/**
|
|
253
|
+
* Retrieve a runner configuration.
|
|
254
|
+
*
|
|
255
|
+
* @param request - The request {@link GetRunnerRequest}
|
|
256
|
+
* @returns A Promise of Runner
|
|
257
|
+
*/
|
|
258
|
+
getRunner = (request) => this.client.fetch(
|
|
259
|
+
{
|
|
260
|
+
method: "GET",
|
|
261
|
+
path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/runners/${validatePathParam("runnerId", request.runnerId)}`
|
|
262
|
+
},
|
|
263
|
+
unmarshalRunner
|
|
264
|
+
);
|
|
265
|
+
/**
|
|
266
|
+
* Waits for {@link Runner} to be in a final state.
|
|
267
|
+
*
|
|
268
|
+
* @param request - The request {@link GetRunnerRequest}
|
|
269
|
+
* @param options - The waiting options
|
|
270
|
+
* @returns A Promise of Runner
|
|
271
|
+
*/
|
|
272
|
+
waitForRunner = (request, options) => waitForResource(
|
|
273
|
+
options?.stop ?? ((res) => Promise.resolve(!RUNNER_TRANSIENT_STATUSES.includes(res.status))),
|
|
274
|
+
this.getRunner,
|
|
275
|
+
request,
|
|
276
|
+
options
|
|
277
|
+
);
|
|
278
|
+
pageOfListRunners = (request = {}) => this.client.fetch(
|
|
279
|
+
{
|
|
280
|
+
method: "GET",
|
|
281
|
+
path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/runners`,
|
|
282
|
+
urlParams: urlParams(
|
|
283
|
+
["organization_id", request.organizationId],
|
|
284
|
+
["page", request.page],
|
|
285
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
286
|
+
["project_id", request.projectId],
|
|
287
|
+
["server_id", request.serverId]
|
|
288
|
+
)
|
|
289
|
+
},
|
|
290
|
+
unmarshalListRunnersResponse
|
|
291
|
+
);
|
|
292
|
+
/**
|
|
293
|
+
* List runner configurations associated with a server.
|
|
294
|
+
*
|
|
295
|
+
* @param request - The request {@link ListRunnersRequest}
|
|
296
|
+
* @returns A Promise of ListRunnersResponse
|
|
297
|
+
*/
|
|
298
|
+
listRunners = (request = {}) => enrichForPagination("runners", this.pageOfListRunners, request);
|
|
299
|
+
/**
|
|
300
|
+
* Create a new runner configuration.
|
|
301
|
+
*
|
|
302
|
+
* @param request - The request {@link UpdateRunnerRequest}
|
|
303
|
+
* @returns A Promise of Runner
|
|
304
|
+
*/
|
|
305
|
+
updateRunner = (request) => this.client.fetch(
|
|
306
|
+
{
|
|
307
|
+
body: JSON.stringify(
|
|
308
|
+
marshalUpdateRunnerRequest(request, this.client.settings)
|
|
309
|
+
),
|
|
310
|
+
headers: jsonContentHeaders,
|
|
311
|
+
method: "PATCH",
|
|
312
|
+
path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/runners/${validatePathParam("runnerId", request.runnerId)}`
|
|
313
|
+
},
|
|
314
|
+
unmarshalRunner
|
|
315
|
+
);
|
|
316
|
+
/**
|
|
317
|
+
* Create a new runner configuration.
|
|
318
|
+
*
|
|
319
|
+
* @param request - The request {@link DeleteRunnerRequest}
|
|
320
|
+
*/
|
|
321
|
+
deleteRunner = (request) => this.client.fetch(
|
|
322
|
+
{
|
|
323
|
+
method: "DELETE",
|
|
324
|
+
path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/runners/${validatePathParam("runnerId", request.runnerId)}`
|
|
325
|
+
}
|
|
326
|
+
);
|
|
242
327
|
}
|
|
243
328
|
class PrivateNetworkAPI extends API$1 {
|
|
244
329
|
/**
|
|
@@ -246,7 +331,10 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
246
331
|
* type ∈ {'zone','region','global','unspecified'}
|
|
247
332
|
*/
|
|
248
333
|
static LOCALITY = toApiLocality({
|
|
249
|
-
zones: [
|
|
334
|
+
zones: [
|
|
335
|
+
"fr-par-1",
|
|
336
|
+
"fr-par-3"
|
|
337
|
+
]
|
|
250
338
|
});
|
|
251
339
|
getServerPrivateNetwork = (request) => this.client.fetch(
|
|
252
340
|
{
|
|
@@ -263,11 +351,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
263
351
|
* @returns A Promise of ServerPrivateNetwork
|
|
264
352
|
*/
|
|
265
353
|
waitForServerPrivateNetwork = (request, options) => waitForResource(
|
|
266
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
267
|
-
!SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES.includes(
|
|
268
|
-
res.status
|
|
269
|
-
)
|
|
270
|
-
)),
|
|
354
|
+
options?.stop ?? ((res) => Promise.resolve(!SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES.includes(res.status))),
|
|
271
355
|
this.getServerPrivateNetwork,
|
|
272
356
|
request,
|
|
273
357
|
options
|
|
@@ -281,10 +365,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
281
365
|
addServerPrivateNetwork = (request) => this.client.fetch(
|
|
282
366
|
{
|
|
283
367
|
body: JSON.stringify(
|
|
284
|
-
marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
|
|
285
|
-
request,
|
|
286
|
-
this.client.settings
|
|
287
|
-
)
|
|
368
|
+
marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)
|
|
288
369
|
),
|
|
289
370
|
headers: jsonContentHeaders,
|
|
290
371
|
method: "POST",
|
|
@@ -301,10 +382,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
301
382
|
setServerPrivateNetworks = (request) => this.client.fetch(
|
|
302
383
|
{
|
|
303
384
|
body: JSON.stringify(
|
|
304
|
-
marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
|
|
305
|
-
request,
|
|
306
|
-
this.client.settings
|
|
307
|
-
)
|
|
385
|
+
marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)
|
|
308
386
|
),
|
|
309
387
|
headers: jsonContentHeaders,
|
|
310
388
|
method: "PUT",
|
|
@@ -321,10 +399,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
321
399
|
["order_by", request.orderBy],
|
|
322
400
|
["organization_id", request.organizationId],
|
|
323
401
|
["page", request.page],
|
|
324
|
-
[
|
|
325
|
-
"page_size",
|
|
326
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
327
|
-
],
|
|
402
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
328
403
|
["private_network_id", request.privateNetworkId],
|
|
329
404
|
["project_id", request.projectId],
|
|
330
405
|
["server_id", request.serverId]
|
|
@@ -338,20 +413,18 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
338
413
|
* @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
|
|
339
414
|
* @returns A Promise of ListServerPrivateNetworksResponse
|
|
340
415
|
*/
|
|
341
|
-
listServerPrivateNetworks = (request = {}) => enrichForPagination(
|
|
342
|
-
"serverPrivateNetworks",
|
|
343
|
-
this.pageOfListServerPrivateNetworks,
|
|
344
|
-
request
|
|
345
|
-
);
|
|
416
|
+
listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
|
|
346
417
|
/**
|
|
347
418
|
* Delete a Private Network.
|
|
348
419
|
*
|
|
349
420
|
* @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
|
|
350
421
|
*/
|
|
351
|
-
deleteServerPrivateNetwork = (request) => this.client.fetch(
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
422
|
+
deleteServerPrivateNetwork = (request) => this.client.fetch(
|
|
423
|
+
{
|
|
424
|
+
method: "DELETE",
|
|
425
|
+
path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
|
|
426
|
+
}
|
|
427
|
+
);
|
|
355
428
|
}
|
|
356
429
|
export {
|
|
357
430
|
API,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { ServerPrivateNetworkServerStatus, ServerPrivateNetworkStatus, ServerStatus } from './types.gen.js';
|
|
1
|
+
import type { RunnerStatus, ServerPrivateNetworkServerStatus, ServerPrivateNetworkStatus, ServerStatus } from './types.gen.js';
|
|
2
|
+
/** Lists transient statutes of the enum {@link RunnerStatus}. */
|
|
3
|
+
export declare const RUNNER_TRANSIENT_STATUSES: RunnerStatus[];
|
|
2
4
|
/** Lists transient statutes of the enum {@link ServerPrivateNetworkServerStatus}. */
|
|
3
5
|
export declare const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES: ServerPrivateNetworkServerStatus[];
|
|
4
6
|
/** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const RUNNER_TRANSIENT_STATUSES = [
|
|
2
|
+
"waiting"
|
|
3
|
+
];
|
|
4
|
+
const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES = [
|
|
5
|
+
"attaching",
|
|
6
|
+
"detaching"
|
|
7
|
+
];
|
|
8
|
+
const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = [
|
|
9
|
+
"vpc_updating"
|
|
10
|
+
];
|
|
3
11
|
const SERVER_TRANSIENT_STATUSES = [
|
|
4
12
|
"starting",
|
|
5
13
|
"rebooting",
|
|
@@ -10,6 +18,7 @@ const SERVER_TRANSIENT_STATUSES = [
|
|
|
10
18
|
"busy"
|
|
11
19
|
];
|
|
12
20
|
export {
|
|
21
|
+
RUNNER_TRANSIENT_STATUSES,
|
|
13
22
|
SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES,
|
|
14
23
|
SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES,
|
|
15
24
|
SERVER_TRANSIENT_STATUSES
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { API, PrivateNetworkAPI, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
|
-
export type { BatchCreateServersRequest, BatchCreateServersRequestBatchInnerCreateServerRequest, BatchCreateServersResponse, Commitment, CommitmentType, CommitmentTypeValue, ConnectivityDiagnostic, ConnectivityDiagnosticActionType, ConnectivityDiagnosticDiagnosticStatus, ConnectivityDiagnosticServerHealth, CreateServerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse,
|
|
4
|
+
export type { AppliedRunnerConfigurations, BatchCreateServersRequest, BatchCreateServersRequestBatchInnerCreateServerRequest, BatchCreateServersResponse, Commitment, CommitmentType, CommitmentTypeValue, ConnectivityDiagnostic, ConnectivityDiagnosticActionType, ConnectivityDiagnosticDiagnosticStatus, ConnectivityDiagnosticServerHealth, CreateRunnerRequest, CreateServerRequest, DeleteRunnerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, GetRunnerRequest, GetServerRequest, GetServerTypeRequest, GithubRunnerConfiguration, GitlabRunnerConfiguration, ListOSRequest, ListOSResponse, ListRunnersRequest, ListRunnersResponse, ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, ListServerTypesRequest, ListServerTypesResponse, OS, OSSupportedServerType, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiGetServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, Runner, RunnerConfiguration, RunnerConfigurationProvider, RunnerConfigurationV2, RunnerConfigurationV2Provider, RunnerStatus, Server, ServerPrivateNetwork, ServerPrivateNetworkServerStatus, ServerPrivateNetworkStatus, ServerStatus, ServerType, ServerTypeCPU, ServerTypeDisk, ServerTypeGPU, ServerTypeMemory, ServerTypeNetwork, ServerTypeNPU, ServerTypeStock, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateRunnerRequest, UpdateServerRequest, } from './types.gen.js';
|
|
5
|
+
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
import { API, PrivateNetworkAPI } from "./api.gen.js";
|
|
2
|
-
import { SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
-
import { marshalBatchCreateServersRequest, marshalCreateServerRequest, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, marshalReinstallServerRequest, marshalStartConnectivityDiagnosticRequest, marshalUpdateServerRequest, unmarshalBatchCreateServersResponse, unmarshalConnectivityDiagnostic, unmarshalListOSResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServerTypesResponse, unmarshalListServersResponse, unmarshalOS, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalServerType, unmarshalSetServerPrivateNetworksResponse, unmarshalStartConnectivityDiagnosticResponse } from "./marshalling.gen.js";
|
|
2
|
+
import { RUNNER_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import { marshalBatchCreateServersRequest, marshalCreateRunnerRequest, marshalCreateServerRequest, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, marshalReinstallServerRequest, marshalStartConnectivityDiagnosticRequest, marshalUpdateRunnerRequest, marshalUpdateServerRequest, unmarshalBatchCreateServersResponse, unmarshalConnectivityDiagnostic, unmarshalListOSResponse, unmarshalListRunnersResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServerTypesResponse, unmarshalListServersResponse, unmarshalOS, unmarshalRunner, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalServerType, unmarshalSetServerPrivateNetworksResponse, unmarshalStartConnectivityDiagnosticResponse } from "./marshalling.gen.js";
|
|
4
|
+
import * as validationRules_gen from "./validation-rules.gen.js";
|
|
4
5
|
export {
|
|
5
6
|
API,
|
|
6
7
|
PrivateNetworkAPI,
|
|
8
|
+
RUNNER_TRANSIENT_STATUSES,
|
|
7
9
|
SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES,
|
|
8
10
|
SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES,
|
|
9
11
|
SERVER_TRANSIENT_STATUSES,
|
|
12
|
+
validationRules_gen as ValidationRules,
|
|
10
13
|
marshalBatchCreateServersRequest,
|
|
14
|
+
marshalCreateRunnerRequest,
|
|
11
15
|
marshalCreateServerRequest,
|
|
12
16
|
marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
|
|
13
17
|
marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
|
|
14
18
|
marshalReinstallServerRequest,
|
|
15
19
|
marshalStartConnectivityDiagnosticRequest,
|
|
20
|
+
marshalUpdateRunnerRequest,
|
|
16
21
|
marshalUpdateServerRequest,
|
|
17
22
|
unmarshalBatchCreateServersResponse,
|
|
18
23
|
unmarshalConnectivityDiagnostic,
|
|
19
24
|
unmarshalListOSResponse,
|
|
25
|
+
unmarshalListRunnersResponse,
|
|
20
26
|
unmarshalListServerPrivateNetworksResponse,
|
|
21
27
|
unmarshalListServerTypesResponse,
|
|
22
28
|
unmarshalListServersResponse,
|
|
23
29
|
unmarshalOS,
|
|
30
|
+
unmarshalRunner,
|
|
24
31
|
unmarshalServer,
|
|
25
32
|
unmarshalServerPrivateNetwork,
|
|
26
33
|
unmarshalServerType,
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { BatchCreateServersRequest, BatchCreateServersResponse, ConnectivityDiagnostic, CreateServerRequest, ListOSResponse,
|
|
2
|
+
import type { BatchCreateServersRequest, BatchCreateServersResponse, ConnectivityDiagnostic, CreateRunnerRequest, CreateServerRequest, ListOSResponse, ListRunnersResponse, ListServerPrivateNetworksResponse, ListServersResponse, ListServerTypesResponse, OS, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ReinstallServerRequest, Runner, Server, ServerPrivateNetwork, ServerType, SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateRunnerRequest, UpdateServerRequest } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalOS: (data: unknown) => OS;
|
|
4
4
|
export declare const unmarshalServer: (data: unknown) => Server;
|
|
5
|
+
export declare const unmarshalRunner: (data: unknown) => Runner;
|
|
5
6
|
export declare const unmarshalServerPrivateNetwork: (data: unknown) => ServerPrivateNetwork;
|
|
6
7
|
export declare const unmarshalServerType: (data: unknown) => ServerType;
|
|
7
8
|
export declare const unmarshalBatchCreateServersResponse: (data: unknown) => BatchCreateServersResponse;
|
|
8
9
|
export declare const unmarshalConnectivityDiagnostic: (data: unknown) => ConnectivityDiagnostic;
|
|
9
10
|
export declare const unmarshalListOSResponse: (data: unknown) => ListOSResponse;
|
|
11
|
+
export declare const unmarshalListRunnersResponse: (data: unknown) => ListRunnersResponse;
|
|
10
12
|
export declare const unmarshalListServerPrivateNetworksResponse: (data: unknown) => ListServerPrivateNetworksResponse;
|
|
11
13
|
export declare const unmarshalListServerTypesResponse: (data: unknown) => ListServerTypesResponse;
|
|
12
14
|
export declare const unmarshalListServersResponse: (data: unknown) => ListServersResponse;
|
|
13
15
|
export declare const unmarshalSetServerPrivateNetworksResponse: (data: unknown) => SetServerPrivateNetworksResponse;
|
|
14
16
|
export declare const unmarshalStartConnectivityDiagnosticResponse: (data: unknown) => StartConnectivityDiagnosticResponse;
|
|
15
17
|
export declare const marshalBatchCreateServersRequest: (request: BatchCreateServersRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
18
|
+
export declare const marshalCreateRunnerRequest: (request: CreateRunnerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
16
19
|
export declare const marshalCreateServerRequest: (request: CreateServerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
17
20
|
export declare const marshalPrivateNetworkApiAddServerPrivateNetworkRequest: (request: PrivateNetworkApiAddServerPrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
18
21
|
export declare const marshalPrivateNetworkApiSetServerPrivateNetworksRequest: (request: PrivateNetworkApiSetServerPrivateNetworksRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
19
22
|
export declare const marshalReinstallServerRequest: (request: ReinstallServerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
20
23
|
export declare const marshalStartConnectivityDiagnosticRequest: (request: StartConnectivityDiagnosticRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
24
|
+
export declare const marshalUpdateRunnerRequest: (request: UpdateRunnerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
21
25
|
export declare const marshalUpdateServerRequest: (request: UpdateServerRequest, defaults: DefaultValues) => Record<string, unknown>;
|