@scaleway/sdk-k8s 1.8.0 → 2.2.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/README.md +96 -0
- package/dist/v1/api.gen.d.ts +2 -2
- package/dist/v1/api.gen.js +49 -52
- package/dist/v1/index.gen.d.ts +2 -2
- package/dist/v1/marshalling.gen.d.ts +2 -2
- package/dist/v1/marshalling.gen.js +63 -81
- package/dist/v1/types.gen.d.ts +138 -138
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1/api.gen.cjs +0 -583
- package/dist/v1/api.utils.cjs +0 -13
- package/dist/v1/content.gen.cjs +0 -23
- package/dist/v1/index.cjs +0 -10
- package/dist/v1/marshalling.gen.cjs +0 -644
- package/dist/v1/validation-rules.gen.cjs +0 -171
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-k8s
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-k8s)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-k8s)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for K8S 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-k8s @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-k8s @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-k8s @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 { K8S } from '@scaleway/sdk-k8s'
|
|
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 K8S.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 { K8S } from '@scaleway/sdk-k8s'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new K8S.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway K8S API Documentation](https://www.scaleway.com/en/developers/api/k8s/)
|
|
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
|
+
|
package/dist/v1/api.gen.d.ts
CHANGED
|
@@ -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 { AddClusterACLRulesRequest, AddClusterACLRulesResponse, AuthExternalNodeRequest, Cluster, CreateClusterRequest, CreateExternalNodeRequest, CreatePoolRequest, DeleteACLRuleRequest, DeleteClusterRequest, DeleteNodeRequest, DeletePoolRequest, ExternalNode, ExternalNodeAuth, GetClusterKubeConfigRequest, GetClusterRequest, GetNodeMetadataRequest, GetNodeRequest, GetPoolRequest, GetVersionRequest, ListClusterACLRulesRequest, ListClusterACLRulesResponse, ListClusterAvailableTypesRequest, ListClusterAvailableTypesResponse, ListClusterAvailableVersionsRequest, ListClusterAvailableVersionsResponse, ListClustersRequest, ListClustersResponse, ListClusterTypesRequest, ListClusterTypesResponse, ListNodesRequest, ListNodesResponse, ListPoolsRequest, ListPoolsResponse, ListVersionsRequest, ListVersionsResponse, MigratePoolsToNewImagesRequest, Node, NodeMetadata, Pool, RebootNodeRequest, ReplaceNodeRequest, ResetClusterAdminTokenRequest, SetClusterACLRulesRequest, SetClusterACLRulesResponse, SetClusterTypeRequest, UpdateClusterRequest, UpdatePoolRequest, UpgradeClusterRequest, UpgradePoolRequest, Version } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Kubernetes API.
|
|
6
6
|
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -10,7 +10,11 @@ class API extends API$1 {
|
|
|
10
10
|
* type ∈ {'zone','region','global','unspecified'}
|
|
11
11
|
*/
|
|
12
12
|
static LOCALITY = toApiLocality({
|
|
13
|
-
regions: [
|
|
13
|
+
regions: [
|
|
14
|
+
"fr-par",
|
|
15
|
+
"nl-ams",
|
|
16
|
+
"pl-waw"
|
|
17
|
+
]
|
|
14
18
|
});
|
|
15
19
|
pageOfListClusters = (request = {}) => this.client.fetch(
|
|
16
20
|
{
|
|
@@ -21,10 +25,7 @@ class API extends API$1 {
|
|
|
21
25
|
["order_by", request.orderBy],
|
|
22
26
|
["organization_id", request.organizationId],
|
|
23
27
|
["page", request.page],
|
|
24
|
-
[
|
|
25
|
-
"page_size",
|
|
26
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
27
|
-
],
|
|
28
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
28
29
|
["private_network_id", request.privateNetworkId],
|
|
29
30
|
["project_id", request.projectId],
|
|
30
31
|
["status", request.status],
|
|
@@ -78,9 +79,7 @@ class API extends API$1 {
|
|
|
78
79
|
* @returns A Promise of Cluster
|
|
79
80
|
*/
|
|
80
81
|
waitForCluster = (request, options) => waitForResource(
|
|
81
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
82
|
-
!CLUSTER_TRANSIENT_STATUSES.includes(res.status)
|
|
83
|
-
)),
|
|
82
|
+
options?.stop ?? ((res) => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES.includes(res.status))),
|
|
84
83
|
this.getCluster,
|
|
85
84
|
request,
|
|
86
85
|
options
|
|
@@ -112,10 +111,9 @@ class API extends API$1 {
|
|
|
112
111
|
{
|
|
113
112
|
method: "DELETE",
|
|
114
113
|
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}`,
|
|
115
|
-
urlParams: urlParams(
|
|
116
|
-
"with_additional_resources",
|
|
117
|
-
|
|
118
|
-
])
|
|
114
|
+
urlParams: urlParams(
|
|
115
|
+
["with_additional_resources", request.withAdditionalResources]
|
|
116
|
+
)
|
|
119
117
|
},
|
|
120
118
|
unmarshalCluster
|
|
121
119
|
);
|
|
@@ -179,33 +177,37 @@ class API extends API$1 {
|
|
|
179
177
|
},
|
|
180
178
|
unmarshalListClusterAvailableTypesResponse
|
|
181
179
|
);
|
|
182
|
-
_getClusterKubeConfig = (request) => this.client.fetch(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
180
|
+
_getClusterKubeConfig = (request) => this.client.fetch(
|
|
181
|
+
{
|
|
182
|
+
method: "GET",
|
|
183
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/kubeconfig`,
|
|
184
|
+
urlParams: urlParams(
|
|
185
|
+
["dl", 1],
|
|
186
|
+
["redacted", request.redacted]
|
|
187
|
+
),
|
|
188
|
+
responseType: "blob"
|
|
189
|
+
}
|
|
190
|
+
);
|
|
188
191
|
/**
|
|
189
192
|
* Reset the admin token of a Cluster. Reset the admin token for a specific Kubernetes cluster. This will revoke the old admin token (which will not be usable afterwards) and create a new one. Note that you will need to download the kubeconfig again to keep interacting with the cluster.
|
|
190
193
|
*
|
|
191
194
|
* @param request - The request {@link ResetClusterAdminTokenRequest}
|
|
192
195
|
*/
|
|
193
|
-
resetClusterAdminToken = (request) => this.client.fetch(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
resetClusterAdminToken = (request) => this.client.fetch(
|
|
197
|
+
{
|
|
198
|
+
body: "{}",
|
|
199
|
+
headers: jsonContentHeaders,
|
|
200
|
+
method: "POST",
|
|
201
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/reset-admin-token`
|
|
202
|
+
}
|
|
203
|
+
);
|
|
199
204
|
pageOfListClusterACLRules = (request) => this.client.fetch(
|
|
200
205
|
{
|
|
201
206
|
method: "GET",
|
|
202
207
|
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/acls`,
|
|
203
208
|
urlParams: urlParams(
|
|
204
209
|
["page", request.page],
|
|
205
|
-
[
|
|
206
|
-
"page_size",
|
|
207
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
208
|
-
]
|
|
210
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
209
211
|
)
|
|
210
212
|
},
|
|
211
213
|
unmarshalListClusterACLRulesResponse
|
|
@@ -256,10 +258,12 @@ class API extends API$1 {
|
|
|
256
258
|
*
|
|
257
259
|
* @param request - The request {@link DeleteACLRuleRequest}
|
|
258
260
|
*/
|
|
259
|
-
deleteACLRule = (request) => this.client.fetch(
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
deleteACLRule = (request) => this.client.fetch(
|
|
262
|
+
{
|
|
263
|
+
method: "DELETE",
|
|
264
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam("aclId", request.aclId)}`
|
|
265
|
+
}
|
|
266
|
+
);
|
|
263
267
|
pageOfListPools = (request) => this.client.fetch(
|
|
264
268
|
{
|
|
265
269
|
method: "GET",
|
|
@@ -268,10 +272,7 @@ class API extends API$1 {
|
|
|
268
272
|
["name", request.name],
|
|
269
273
|
["order_by", request.orderBy],
|
|
270
274
|
["page", request.page],
|
|
271
|
-
[
|
|
272
|
-
"page_size",
|
|
273
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
274
|
-
],
|
|
275
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
275
276
|
["status", request.status]
|
|
276
277
|
)
|
|
277
278
|
},
|
|
@@ -380,14 +381,16 @@ class API extends API$1 {
|
|
|
380
381
|
*
|
|
381
382
|
* @param request - The request {@link MigratePoolsToNewImagesRequest}
|
|
382
383
|
*/
|
|
383
|
-
migratePoolsToNewImages = (request) => this.client.fetch(
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
384
|
+
migratePoolsToNewImages = (request) => this.client.fetch(
|
|
385
|
+
{
|
|
386
|
+
body: JSON.stringify(
|
|
387
|
+
marshalMigratePoolsToNewImagesRequest(request, this.client.settings)
|
|
388
|
+
),
|
|
389
|
+
headers: jsonContentHeaders,
|
|
390
|
+
method: "POST",
|
|
391
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/migrate-pools-to-new-images`
|
|
392
|
+
}
|
|
393
|
+
);
|
|
391
394
|
/**
|
|
392
395
|
* Fetch node metadata. Rerieve metadata to instantiate a Kapsule/Kosmos node. This method is not intended to be called by end users but rather programmatically by the node-installer.
|
|
393
396
|
*
|
|
@@ -439,10 +442,7 @@ class API extends API$1 {
|
|
|
439
442
|
["name", request.name],
|
|
440
443
|
["order_by", request.orderBy],
|
|
441
444
|
["page", request.page],
|
|
442
|
-
[
|
|
443
|
-
"page_size",
|
|
444
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
445
|
-
],
|
|
445
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
446
446
|
["pool_id", request.poolId],
|
|
447
447
|
["status", request.status]
|
|
448
448
|
)
|
|
@@ -562,10 +562,7 @@ class API extends API$1 {
|
|
|
562
562
|
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-types`,
|
|
563
563
|
urlParams: urlParams(
|
|
564
564
|
["page", request.page],
|
|
565
|
-
[
|
|
566
|
-
"page_size",
|
|
567
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
568
|
-
]
|
|
565
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
569
566
|
)
|
|
570
567
|
},
|
|
571
568
|
unmarshalListClusterTypesResponse
|
package/dist/v1/index.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
|
-
export type { ACLRule, ACLRuleRequest, AddClusterACLRulesRequest, AddClusterACLRulesResponse, AuthExternalNodeRequest, AutoscalerEstimator, AutoscalerExpander,
|
|
4
|
+
export type { ACLRule, ACLRuleRequest, AddClusterACLRulesRequest, AddClusterACLRulesResponse, AuthExternalNodeRequest, AutoscalerEstimator, AutoscalerExpander, Cluster, ClusterAutoscalerConfig, ClusterAutoUpgrade, ClusterOpenIDConnectConfig, ClusterStatus, ClusterType, ClusterTypeAvailability, ClusterTypeResiliency, CNI, CreateClusterRequest, CreateClusterRequestAutoscalerConfig, CreateClusterRequestAutoUpgrade, CreateClusterRequestOpenIDConnectConfig, CreateClusterRequestPoolConfig, CreateClusterRequestPoolConfigUpgradePolicy, CreateExternalNodeRequest, CreatePoolRequest, CreatePoolRequestUpgradePolicy, DeleteACLRuleRequest, DeleteClusterRequest, DeleteNodeRequest, DeletePoolRequest, ExternalNode, ExternalNodeAuth, ExternalNodeCoreV1Taint, GetClusterKubeConfigRequest, GetClusterRequest, GetNodeMetadataRequest, GetNodeRequest, GetPoolRequest, GetVersionRequest, ListClusterACLRulesRequest, ListClusterACLRulesResponse, ListClusterAvailableTypesRequest, ListClusterAvailableTypesResponse, ListClusterAvailableVersionsRequest, ListClusterAvailableVersionsResponse, ListClustersRequest, ListClustersRequestOrderBy, ListClustersResponse, ListClusterTypesRequest, ListClusterTypesResponse, ListNodesRequest, ListNodesRequestOrderBy, ListNodesResponse, ListPoolsRequest, ListPoolsRequestOrderBy, ListPoolsResponse, ListVersionsRequest, ListVersionsResponse, MaintenanceWindow, MaintenanceWindowDayOfTheWeek, MigratePoolsToNewImagesRequest, Node, NodeMetadata, NodeMetadataCoreV1Taint, NodeStatus, Pool, PoolStatus, PoolUpgradePolicy, PoolVolumeType, RebootNodeRequest, ReplaceNodeRequest, ResetClusterAdminTokenRequest, Runtime, SetClusterACLRulesRequest, SetClusterACLRulesResponse, SetClusterTypeRequest, UpdateClusterRequest, UpdateClusterRequestAutoscalerConfig, UpdateClusterRequestAutoUpgrade, UpdateClusterRequestOpenIDConnectConfig, UpdatePoolRequest, UpdatePoolRequestUpgradePolicy, UpgradeClusterRequest, UpgradePoolRequest, Version, } from './types.gen.js';
|
|
5
5
|
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { AddClusterACLRulesRequest, AddClusterACLRulesResponse, Cluster, CreateClusterRequest, CreatePoolRequest, ExternalNode, ExternalNodeAuth, ListClusterACLRulesResponse, ListClusterAvailableTypesResponse, ListClusterAvailableVersionsResponse,
|
|
3
|
-
export declare const unmarshalPool: (data: unknown) => Pool;
|
|
2
|
+
import type { AddClusterACLRulesRequest, AddClusterACLRulesResponse, Cluster, CreateClusterRequest, CreatePoolRequest, ExternalNode, ExternalNodeAuth, ListClusterACLRulesResponse, ListClusterAvailableTypesResponse, ListClusterAvailableVersionsResponse, ListClustersResponse, ListClusterTypesResponse, ListNodesResponse, ListPoolsResponse, ListVersionsResponse, MigratePoolsToNewImagesRequest, Node, NodeMetadata, Pool, SetClusterACLRulesRequest, SetClusterACLRulesResponse, SetClusterTypeRequest, UpdateClusterRequest, UpdatePoolRequest, UpgradeClusterRequest, UpgradePoolRequest, Version } from './types.gen.js';
|
|
4
3
|
export declare const unmarshalVersion: (data: unknown) => Version;
|
|
5
4
|
export declare const unmarshalCluster: (data: unknown) => Cluster;
|
|
6
5
|
export declare const unmarshalNode: (data: unknown) => Node;
|
|
6
|
+
export declare const unmarshalPool: (data: unknown) => Pool;
|
|
7
7
|
export declare const unmarshalAddClusterACLRulesResponse: (data: unknown) => AddClusterACLRulesResponse;
|
|
8
8
|
export declare const unmarshalExternalNode: (data: unknown) => ExternalNode;
|
|
9
9
|
export declare const unmarshalExternalNodeAuth: (data: unknown) => ExternalNodeAuth;
|
|
@@ -1,50 +1,5 @@
|
|
|
1
1
|
import randomName from "@scaleway/random-name";
|
|
2
2
|
import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
3
|
-
const unmarshalPoolUpgradePolicy = (data) => {
|
|
4
|
-
if (!isJSONObject(data)) {
|
|
5
|
-
throw new TypeError(
|
|
6
|
-
`Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.`
|
|
7
|
-
);
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
maxSurge: data.max_surge,
|
|
11
|
-
maxUnavailable: data.max_unavailable
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
const unmarshalPool = (data) => {
|
|
15
|
-
if (!isJSONObject(data)) {
|
|
16
|
-
throw new TypeError(
|
|
17
|
-
`Unmarshalling the type 'Pool' failed as data isn't a dictionary.`
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
autohealing: data.autohealing,
|
|
22
|
-
autoscaling: data.autoscaling,
|
|
23
|
-
clusterId: data.cluster_id,
|
|
24
|
-
containerRuntime: data.container_runtime,
|
|
25
|
-
createdAt: unmarshalDate(data.created_at),
|
|
26
|
-
id: data.id,
|
|
27
|
-
kubeletArgs: data.kubelet_args,
|
|
28
|
-
maxSize: data.max_size,
|
|
29
|
-
minSize: data.min_size,
|
|
30
|
-
name: data.name,
|
|
31
|
-
newImagesEnabled: data.new_images_enabled,
|
|
32
|
-
nodeType: data.node_type,
|
|
33
|
-
placementGroupId: data.placement_group_id,
|
|
34
|
-
publicIpDisabled: data.public_ip_disabled,
|
|
35
|
-
region: data.region,
|
|
36
|
-
rootVolumeSize: data.root_volume_size,
|
|
37
|
-
rootVolumeType: data.root_volume_type,
|
|
38
|
-
securityGroupId: data.security_group_id,
|
|
39
|
-
size: data.size,
|
|
40
|
-
status: data.status,
|
|
41
|
-
tags: data.tags,
|
|
42
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
43
|
-
upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : void 0,
|
|
44
|
-
version: data.version,
|
|
45
|
-
zone: data.zone
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
3
|
const unmarshalVersion = (data) => {
|
|
49
4
|
if (!isJSONObject(data)) {
|
|
50
5
|
throw new TypeError(
|
|
@@ -183,6 +138,51 @@ const unmarshalNode = (data) => {
|
|
|
183
138
|
updatedAt: unmarshalDate(data.updated_at)
|
|
184
139
|
};
|
|
185
140
|
};
|
|
141
|
+
const unmarshalPoolUpgradePolicy = (data) => {
|
|
142
|
+
if (!isJSONObject(data)) {
|
|
143
|
+
throw new TypeError(
|
|
144
|
+
`Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.`
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
maxSurge: data.max_surge,
|
|
149
|
+
maxUnavailable: data.max_unavailable
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
const unmarshalPool = (data) => {
|
|
153
|
+
if (!isJSONObject(data)) {
|
|
154
|
+
throw new TypeError(
|
|
155
|
+
`Unmarshalling the type 'Pool' failed as data isn't a dictionary.`
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
autohealing: data.autohealing,
|
|
160
|
+
autoscaling: data.autoscaling,
|
|
161
|
+
clusterId: data.cluster_id,
|
|
162
|
+
containerRuntime: data.container_runtime,
|
|
163
|
+
createdAt: unmarshalDate(data.created_at),
|
|
164
|
+
id: data.id,
|
|
165
|
+
kubeletArgs: data.kubelet_args,
|
|
166
|
+
maxSize: data.max_size,
|
|
167
|
+
minSize: data.min_size,
|
|
168
|
+
name: data.name,
|
|
169
|
+
newImagesEnabled: data.new_images_enabled,
|
|
170
|
+
nodeType: data.node_type,
|
|
171
|
+
placementGroupId: data.placement_group_id,
|
|
172
|
+
publicIpDisabled: data.public_ip_disabled,
|
|
173
|
+
region: data.region,
|
|
174
|
+
rootVolumeSize: data.root_volume_size,
|
|
175
|
+
rootVolumeType: data.root_volume_type,
|
|
176
|
+
securityGroupId: data.security_group_id,
|
|
177
|
+
size: data.size,
|
|
178
|
+
status: data.status,
|
|
179
|
+
tags: data.tags,
|
|
180
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
181
|
+
upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : void 0,
|
|
182
|
+
version: data.version,
|
|
183
|
+
zone: data.zone
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
186
|
const unmarshalACLRule = (data) => {
|
|
187
187
|
if (!isJSONObject(data)) {
|
|
188
188
|
throw new TypeError(
|
|
@@ -236,10 +236,7 @@ const unmarshalExternalNode = (data) => {
|
|
|
236
236
|
kubeletConfig: data.kubelet_config,
|
|
237
237
|
name: data.name,
|
|
238
238
|
nodeLabels: data.node_labels,
|
|
239
|
-
nodeTaints: unmarshalArrayOfObject(
|
|
240
|
-
data.node_taints,
|
|
241
|
-
unmarshalExternalNodeCoreV1Taint
|
|
242
|
-
),
|
|
239
|
+
nodeTaints: unmarshalArrayOfObject(data.node_taints, unmarshalExternalNodeCoreV1Taint),
|
|
243
240
|
poolVersion: data.pool_version,
|
|
244
241
|
runcVersion: data.runc_version
|
|
245
242
|
};
|
|
@@ -292,10 +289,7 @@ const unmarshalListClusterAvailableTypesResponse = (data) => {
|
|
|
292
289
|
);
|
|
293
290
|
}
|
|
294
291
|
return {
|
|
295
|
-
clusterTypes: unmarshalArrayOfObject(
|
|
296
|
-
data.cluster_types,
|
|
297
|
-
unmarshalClusterType
|
|
298
|
-
),
|
|
292
|
+
clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType),
|
|
299
293
|
totalCount: data.total_count
|
|
300
294
|
};
|
|
301
295
|
};
|
|
@@ -316,10 +310,7 @@ const unmarshalListClusterTypesResponse = (data) => {
|
|
|
316
310
|
);
|
|
317
311
|
}
|
|
318
312
|
return {
|
|
319
|
-
clusterTypes: unmarshalArrayOfObject(
|
|
320
|
-
data.cluster_types,
|
|
321
|
-
unmarshalClusterType
|
|
322
|
-
),
|
|
313
|
+
clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType),
|
|
323
314
|
totalCount: data.total_count
|
|
324
315
|
};
|
|
325
316
|
};
|
|
@@ -395,10 +386,7 @@ const unmarshalNodeMetadata = (data) => {
|
|
|
395
386
|
kubeletConfig: data.kubelet_config,
|
|
396
387
|
name: data.name,
|
|
397
388
|
nodeLabels: data.node_labels,
|
|
398
|
-
nodeTaints: unmarshalArrayOfObject(
|
|
399
|
-
data.node_taints,
|
|
400
|
-
unmarshalNodeMetadataCoreV1Taint
|
|
401
|
-
),
|
|
389
|
+
nodeTaints: unmarshalArrayOfObject(data.node_taints, unmarshalNodeMetadataCoreV1Taint),
|
|
402
390
|
poolVersion: data.pool_version,
|
|
403
391
|
providerId: data.provider_id,
|
|
404
392
|
repoUri: data.repo_uri,
|
|
@@ -422,8 +410,14 @@ const unmarshalSetClusterACLRulesResponse = (data) => {
|
|
|
422
410
|
const marshalACLRuleRequest = (request, defaults) => ({
|
|
423
411
|
description: request.description,
|
|
424
412
|
...resolveOneOf([
|
|
425
|
-
{
|
|
426
|
-
|
|
413
|
+
{
|
|
414
|
+
param: "ip",
|
|
415
|
+
value: request.ip
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
param: "scaleway_ranges",
|
|
419
|
+
value: request.scalewayRanges
|
|
420
|
+
}
|
|
427
421
|
])
|
|
428
422
|
});
|
|
429
423
|
const marshalAddClusterACLRulesRequest = (request, defaults) => ({
|
|
@@ -478,29 +472,21 @@ const marshalCreateClusterRequestPoolConfig = (request, defaults) => ({
|
|
|
478
472
|
security_group_id: request.securityGroupId,
|
|
479
473
|
size: request.size,
|
|
480
474
|
tags: request.tags,
|
|
481
|
-
upgrade_policy: request.upgradePolicy !== void 0 ? marshalCreateClusterRequestPoolConfigUpgradePolicy(
|
|
482
|
-
request.upgradePolicy
|
|
483
|
-
) : void 0,
|
|
475
|
+
upgrade_policy: request.upgradePolicy !== void 0 ? marshalCreateClusterRequestPoolConfigUpgradePolicy(request.upgradePolicy) : void 0,
|
|
484
476
|
zone: request.zone
|
|
485
477
|
});
|
|
486
478
|
const marshalCreateClusterRequest = (request, defaults) => ({
|
|
487
479
|
admission_plugins: request.admissionPlugins,
|
|
488
480
|
apiserver_cert_sans: request.apiserverCertSans,
|
|
489
481
|
auto_upgrade: request.autoUpgrade !== void 0 ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade) : void 0,
|
|
490
|
-
autoscaler_config: request.autoscalerConfig !== void 0 ? marshalCreateClusterRequestAutoscalerConfig(
|
|
491
|
-
request.autoscalerConfig
|
|
492
|
-
) : void 0,
|
|
482
|
+
autoscaler_config: request.autoscalerConfig !== void 0 ? marshalCreateClusterRequestAutoscalerConfig(request.autoscalerConfig) : void 0,
|
|
493
483
|
cni: request.cni,
|
|
494
484
|
description: request.description,
|
|
495
485
|
feature_gates: request.featureGates,
|
|
496
486
|
name: request.name || randomName("k8s"),
|
|
497
|
-
open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalCreateClusterRequestOpenIDConnectConfig(
|
|
498
|
-
request.openIdConnectConfig
|
|
499
|
-
) : void 0,
|
|
487
|
+
open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalCreateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : void 0,
|
|
500
488
|
pod_cidr: request.podCidr,
|
|
501
|
-
pools: request.pools !== void 0 ? request.pools.map(
|
|
502
|
-
(elt) => marshalCreateClusterRequestPoolConfig(elt)
|
|
503
|
-
) : void 0,
|
|
489
|
+
pools: request.pools !== void 0 ? request.pools.map((elt) => marshalCreateClusterRequestPoolConfig(elt)) : void 0,
|
|
504
490
|
private_network_id: request.privateNetworkId,
|
|
505
491
|
service_cidr: request.serviceCidr,
|
|
506
492
|
service_dns_ip: request.serviceDnsIp,
|
|
@@ -581,15 +567,11 @@ const marshalUpdateClusterRequest = (request, defaults) => ({
|
|
|
581
567
|
admission_plugins: request.admissionPlugins,
|
|
582
568
|
apiserver_cert_sans: request.apiserverCertSans,
|
|
583
569
|
auto_upgrade: request.autoUpgrade !== void 0 ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade) : void 0,
|
|
584
|
-
autoscaler_config: request.autoscalerConfig !== void 0 ? marshalUpdateClusterRequestAutoscalerConfig(
|
|
585
|
-
request.autoscalerConfig
|
|
586
|
-
) : void 0,
|
|
570
|
+
autoscaler_config: request.autoscalerConfig !== void 0 ? marshalUpdateClusterRequestAutoscalerConfig(request.autoscalerConfig) : void 0,
|
|
587
571
|
description: request.description,
|
|
588
572
|
feature_gates: request.featureGates,
|
|
589
573
|
name: request.name,
|
|
590
|
-
open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalUpdateClusterRequestOpenIDConnectConfig(
|
|
591
|
-
request.openIdConnectConfig
|
|
592
|
-
) : void 0,
|
|
574
|
+
open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalUpdateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : void 0,
|
|
593
575
|
tags: request.tags
|
|
594
576
|
});
|
|
595
577
|
const marshalUpdatePoolRequestUpgradePolicy = (request, defaults) => ({
|