@scaleway/sdk-k8s 1.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.
@@ -0,0 +1,274 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { Region as ScwRegion, WaitForOptions } 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, ListClusterTypesRequest, ListClusterTypesResponse, ListClustersRequest, ListClustersResponse, ListNodesRequest, ListNodesResponse, ListPoolsRequest, ListPoolsResponse, ListVersionsRequest, ListVersionsResponse, Node, NodeMetadata, Pool, RebootNodeRequest, ReplaceNodeRequest, ResetClusterAdminTokenRequest, SetClusterACLRulesRequest, SetClusterACLRulesResponse, SetClusterTypeRequest, UpdateClusterRequest, UpdatePoolRequest, UpgradeClusterRequest, UpgradePoolRequest, Version } from './types.gen';
4
+ /**
5
+ * Kubernetes API.
6
+
7
+ This API allows you to manage Kubernetes Kapsule and Kosmos clusters.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /** Lists the available regions of the API. */
11
+ static readonly LOCALITIES: ScwRegion[];
12
+ protected pageOfListClusters: (request?: Readonly<ListClustersRequest>) => Promise<ListClustersResponse>;
13
+ /**
14
+ * List Clusters. List all existing Kubernetes clusters in a specific region.
15
+ *
16
+ * @param request - The request {@link ListClustersRequest}
17
+ * @returns A Promise of ListClustersResponse
18
+ */
19
+ listClusters: (request?: Readonly<ListClustersRequest>) => Promise<ListClustersResponse> & {
20
+ all: () => Promise<Cluster[]>;
21
+ [Symbol.asyncIterator]: () => AsyncGenerator<Cluster[], void, void>;
22
+ };
23
+ /**
24
+ * Create a new Cluster. Create a new Kubernetes cluster in a Scaleway region.
25
+ *
26
+ * @param request - The request {@link CreateClusterRequest}
27
+ * @returns A Promise of Cluster
28
+ */
29
+ createCluster: (request: Readonly<CreateClusterRequest>) => Promise<Cluster>;
30
+ /**
31
+ * Get a Cluster. Retrieve information about a specific Kubernetes cluster.
32
+ *
33
+ * @param request - The request {@link GetClusterRequest}
34
+ * @returns A Promise of Cluster
35
+ */
36
+ getCluster: (request: Readonly<GetClusterRequest>) => Promise<Cluster>;
37
+ /**
38
+ * Waits for {@link Cluster} to be in a final state.
39
+ *
40
+ * @param request - The request {@link GetClusterRequest}
41
+ * @param options - The waiting options
42
+ * @returns A Promise of Cluster
43
+ */
44
+ waitForCluster: (request: Readonly<GetClusterRequest>, options?: Readonly<WaitForOptions<Cluster>>) => Promise<Cluster>;
45
+ /**
46
+ * Update a Cluster. Update information on a specific Kubernetes cluster. You can update details such as its name, description, tags and configuration. To upgrade a cluster, you will need to use the dedicated endpoint.
47
+ *
48
+ * @param request - The request {@link UpdateClusterRequest}
49
+ * @returns A Promise of Cluster
50
+ */
51
+ updateCluster: (request: Readonly<UpdateClusterRequest>) => Promise<Cluster>;
52
+ /**
53
+ * Delete a Cluster. Delete a specific Kubernetes cluster and all its associated pools and nodes, and possibly its associated Load Balancers or Block Volumes.
54
+ *
55
+ * @param request - The request {@link DeleteClusterRequest}
56
+ * @returns A Promise of Cluster
57
+ */
58
+ deleteCluster: (request: Readonly<DeleteClusterRequest>) => Promise<Cluster>;
59
+ /**
60
+ * Upgrade a Cluster. Upgrade a specific Kubernetes cluster and possibly its associated pools to a specific and supported Kubernetes version.
61
+ *
62
+ * @param request - The request {@link UpgradeClusterRequest}
63
+ * @returns A Promise of Cluster
64
+ */
65
+ upgradeCluster: (request: Readonly<UpgradeClusterRequest>) => Promise<Cluster>;
66
+ /**
67
+ * Change the Cluster type. Change the type of a specific Kubernetes cluster. To see the possible values you can enter for the `type` field, [list available cluster types](#list-available-cluster-types-for-a-cluster).
68
+ *
69
+ * @param request - The request {@link SetClusterTypeRequest}
70
+ * @returns A Promise of Cluster
71
+ */
72
+ setClusterType: (request: Readonly<SetClusterTypeRequest>) => Promise<Cluster>;
73
+ /**
74
+ * List available versions for a Cluster. List the versions that a specific Kubernetes cluster is allowed to upgrade to. Results will include every patch version greater than the current patch, as well as one minor version ahead of the current version. Any upgrade skipping a minor version will not work.
75
+ *
76
+ * @param request - The request {@link ListClusterAvailableVersionsRequest}
77
+ * @returns A Promise of ListClusterAvailableVersionsResponse
78
+ */
79
+ listClusterAvailableVersions: (request: Readonly<ListClusterAvailableVersionsRequest>) => Promise<ListClusterAvailableVersionsResponse>;
80
+ /**
81
+ * List available cluster types for a cluster. List the cluster types that a specific Kubernetes cluster is allowed to switch to.
82
+ *
83
+ * @param request - The request {@link ListClusterAvailableTypesRequest}
84
+ * @returns A Promise of ListClusterAvailableTypesResponse
85
+ */
86
+ listClusterAvailableTypes: (request: Readonly<ListClusterAvailableTypesRequest>) => Promise<ListClusterAvailableTypesResponse>;
87
+ protected _getClusterKubeConfig: (request: Readonly<GetClusterKubeConfigRequest>) => Promise<Blob>;
88
+ /**
89
+ * 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.
90
+ *
91
+ * @param request - The request {@link ResetClusterAdminTokenRequest}
92
+ */
93
+ resetClusterAdminToken: (request: Readonly<ResetClusterAdminTokenRequest>) => Promise<void>;
94
+ protected pageOfListClusterACLRules: (request: Readonly<ListClusterACLRulesRequest>) => Promise<ListClusterACLRulesResponse>;
95
+ /**
96
+ * List ACLs. List ACLs for a specific cluster.
97
+ *
98
+ * @param request - The request {@link ListClusterACLRulesRequest}
99
+ * @returns A Promise of ListClusterACLRulesResponse
100
+ */
101
+ listClusterACLRules: (request: Readonly<ListClusterACLRulesRequest>) => Promise<ListClusterACLRulesResponse> & {
102
+ all: () => Promise<import("./types.gen").ACLRule[]>;
103
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").ACLRule[], void, void>;
104
+ };
105
+ /**
106
+ * Add new ACLs. Add new ACL rules for a specific cluster.
107
+ *
108
+ * @param request - The request {@link AddClusterACLRulesRequest}
109
+ * @returns A Promise of AddClusterACLRulesResponse
110
+ */
111
+ addClusterACLRules: (request: Readonly<AddClusterACLRulesRequest>) => Promise<AddClusterACLRulesResponse>;
112
+ /**
113
+ * Set new ACLs. Set new ACL rules for a specific cluster.
114
+ *
115
+ * @param request - The request {@link SetClusterACLRulesRequest}
116
+ * @returns A Promise of SetClusterACLRulesResponse
117
+ */
118
+ setClusterACLRules: (request: Readonly<SetClusterACLRulesRequest>) => Promise<SetClusterACLRulesResponse>;
119
+ /**
120
+ * Delete an existing ACL.
121
+ *
122
+ * @param request - The request {@link DeleteACLRuleRequest}
123
+ */
124
+ deleteACLRule: (request: Readonly<DeleteACLRuleRequest>) => Promise<void>;
125
+ protected pageOfListPools: (request: Readonly<ListPoolsRequest>) => Promise<ListPoolsResponse>;
126
+ /**
127
+ * List Pools in a Cluster. List all the existing pools for a specific Kubernetes cluster.
128
+ *
129
+ * @param request - The request {@link ListPoolsRequest}
130
+ * @returns A Promise of ListPoolsResponse
131
+ */
132
+ listPools: (request: Readonly<ListPoolsRequest>) => Promise<ListPoolsResponse> & {
133
+ all: () => Promise<Pool[]>;
134
+ [Symbol.asyncIterator]: () => AsyncGenerator<Pool[], void, void>;
135
+ };
136
+ /**
137
+ * Create a new Pool in a Cluster. Create a new pool in a specific Kubernetes cluster.
138
+ *
139
+ * @param request - The request {@link CreatePoolRequest}
140
+ * @returns A Promise of Pool
141
+ */
142
+ createPool: (request: Readonly<CreatePoolRequest>) => Promise<Pool>;
143
+ /**
144
+ * Get a Pool in a Cluster. Retrieve details about a specific pool in a Kubernetes cluster.
145
+ *
146
+ * @param request - The request {@link GetPoolRequest}
147
+ * @returns A Promise of Pool
148
+ */
149
+ getPool: (request: Readonly<GetPoolRequest>) => Promise<Pool>;
150
+ /**
151
+ * Waits for {@link Pool} to be in a final state.
152
+ *
153
+ * @param request - The request {@link GetPoolRequest}
154
+ * @param options - The waiting options
155
+ * @returns A Promise of Pool
156
+ */
157
+ waitForPool: (request: Readonly<GetPoolRequest>, options?: Readonly<WaitForOptions<Pool>>) => Promise<Pool>;
158
+ /**
159
+ * Upgrade a Pool in a Cluster. Upgrade the Kubernetes version of a specific pool. Note that it only works if the targeted version matches the cluster's version.
160
+ This will drain and replace the nodes in that pool.
161
+ *
162
+ * @param request - The request {@link UpgradePoolRequest}
163
+ * @returns A Promise of Pool
164
+ */
165
+ upgradePool: (request: Readonly<UpgradePoolRequest>) => Promise<Pool>;
166
+ /**
167
+ * Update a Pool in a Cluster. Update the attributes of a specific pool, such as its desired size, autoscaling settings, and tags. To upgrade a pool, you will need to use the dedicated endpoint.
168
+ *
169
+ * @param request - The request {@link UpdatePoolRequest}
170
+ * @returns A Promise of Pool
171
+ */
172
+ updatePool: (request: Readonly<UpdatePoolRequest>) => Promise<Pool>;
173
+ /**
174
+ * Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note that all the pool's nodes will also be deleted.
175
+ *
176
+ * @param request - The request {@link DeletePoolRequest}
177
+ * @returns A Promise of Pool
178
+ */
179
+ deletePool: (request: Readonly<DeletePoolRequest>) => Promise<Pool>;
180
+ /**
181
+ * 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.
182
+ *
183
+ * @param request - The request {@link GetNodeMetadataRequest}
184
+ * @returns A Promise of NodeMetadata
185
+ */
186
+ getNodeMetadata: (request?: Readonly<GetNodeMetadataRequest>) => Promise<NodeMetadata>;
187
+ /**
188
+ * Authenticate Kosmos external node. Creates a newer Kosmos node and returns its token. This method is not intended to be called by end users but rather programmatically by the node-installer.
189
+ *
190
+ * @param request - The request {@link AuthExternalNodeRequest}
191
+ * @returns A Promise of ExternalNodeAuth
192
+ */
193
+ authExternalNode: (request: Readonly<AuthExternalNodeRequest>) => Promise<ExternalNodeAuth>;
194
+ /**
195
+ * Create a Kosmos node. Retrieve metadata for a Kosmos node. This method is not intended to be called by end users but rather programmatically by the kapsule-node-agent.
196
+ *
197
+ * @param request - The request {@link CreateExternalNodeRequest}
198
+ * @returns A Promise of ExternalNode
199
+ */
200
+ createExternalNode: (request: Readonly<CreateExternalNodeRequest>) => Promise<ExternalNode>;
201
+ protected pageOfListNodes: (request: Readonly<ListNodesRequest>) => Promise<ListNodesResponse>;
202
+ /**
203
+ * List Nodes in a Cluster. List all the existing nodes for a specific Kubernetes cluster.
204
+ *
205
+ * @param request - The request {@link ListNodesRequest}
206
+ * @returns A Promise of ListNodesResponse
207
+ */
208
+ listNodes: (request: Readonly<ListNodesRequest>) => Promise<ListNodesResponse> & {
209
+ all: () => Promise<Node[]>;
210
+ [Symbol.asyncIterator]: () => AsyncGenerator<Node[], void, void>;
211
+ };
212
+ /**
213
+ * Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node.
214
+ *
215
+ * @param request - The request {@link GetNodeRequest}
216
+ * @returns A Promise of Node
217
+ */
218
+ getNode: (request: Readonly<GetNodeRequest>) => Promise<Node>;
219
+ /**
220
+ * Waits for {@link Node} to be in a final state.
221
+ *
222
+ * @param request - The request {@link GetNodeRequest}
223
+ * @param options - The waiting options
224
+ * @returns A Promise of Node
225
+ */
226
+ waitForNode: (request: Readonly<GetNodeRequest>, options?: Readonly<WaitForOptions<Node>>) => Promise<Node>;
227
+ /**
228
+ * Replace a Node in a Cluster. Replace a specific Node. The node will first be drained and pods will be rescheduled onto another node. Note that when there is not enough space to reschedule all the pods (such as in a one-node cluster, or with specific constraints), disruption of your applications may occur.
229
+ *
230
+ * @deprecated
231
+ * @param request - The request {@link ReplaceNodeRequest}
232
+ * @returns A Promise of Node
233
+ */
234
+ replaceNode: (request: Readonly<ReplaceNodeRequest>) => Promise<Node>;
235
+ /**
236
+ * Reboot a Node in a Cluster. Reboot a specific Node. The node will first be drained and pods will be rescheduled onto another node. Note that when there is not enough space to reschedule all the pods (such as in a one-node cluster, or with specific constraints), disruption of your applications may occur.
237
+ *
238
+ * @param request - The request {@link RebootNodeRequest}
239
+ * @returns A Promise of Node
240
+ */
241
+ rebootNode: (request: Readonly<RebootNodeRequest>) => Promise<Node>;
242
+ /**
243
+ * Delete a Node in a Cluster. Delete a specific Node. The node will first be drained and pods will be rescheduled onto another node. Note that when there is not enough space to reschedule all the pods (such as in a one-node cluster, or with specific constraints), disruption of your applications may occur.
244
+ *
245
+ * @param request - The request {@link DeleteNodeRequest}
246
+ * @returns A Promise of Node
247
+ */
248
+ deleteNode: (request: Readonly<DeleteNodeRequest>) => Promise<Node>;
249
+ /**
250
+ * List all available Versions. List all available versions for the creation of a new Kubernetes cluster.
251
+ *
252
+ * @param request - The request {@link ListVersionsRequest}
253
+ * @returns A Promise of ListVersionsResponse
254
+ */
255
+ listVersions: (request?: Readonly<ListVersionsRequest>) => Promise<ListVersionsResponse>;
256
+ /**
257
+ * Get a Version. Retrieve a specific Kubernetes version and its details.
258
+ *
259
+ * @param request - The request {@link GetVersionRequest}
260
+ * @returns A Promise of Version
261
+ */
262
+ getVersion: (request: Readonly<GetVersionRequest>) => Promise<Version>;
263
+ protected pageOfListClusterTypes: (request?: Readonly<ListClusterTypesRequest>) => Promise<ListClusterTypesResponse>;
264
+ /**
265
+ * List cluster types. List available cluster types and their technical details.
266
+ *
267
+ * @param request - The request {@link ListClusterTypesRequest}
268
+ * @returns A Promise of ListClusterTypesResponse
269
+ */
270
+ listClusterTypes: (request?: Readonly<ListClusterTypesRequest>) => Promise<ListClusterTypesResponse> & {
271
+ all: () => Promise<import("./types.gen").ClusterType[]>;
272
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").ClusterType[], void, void>;
273
+ };
274
+ }