latitudesh-typescript-sdk 0.3.5 → 0.3.7
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 +3 -1
- package/bin/mcp-server.js +989 -688
- package/bin/mcp-server.js.map +16 -11
- package/dist/commonjs/funcs/kubernetesClustersUpdateKubernetesCluster.d.ts +29 -0
- package/dist/commonjs/funcs/kubernetesClustersUpdateKubernetesCluster.d.ts.map +1 -0
- package/dist/commonjs/funcs/kubernetesClustersUpdateKubernetesCluster.js +140 -0
- package/dist/commonjs/funcs/kubernetesClustersUpdateKubernetesCluster.js.map +1 -0
- package/dist/commonjs/funcs/serversReinstall.d.ts +2 -1
- package/dist/commonjs/funcs/serversReinstall.d.ts.map +1 -1
- package/dist/commonjs/funcs/serversReinstall.js +9 -3
- package/dist/commonjs/funcs/serversReinstall.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +19 -8
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/kubernetesClustersUpdateKubernetesCluster.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/kubernetesClustersUpdateKubernetesCluster.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/kubernetesClustersUpdateKubernetesCluster.js +75 -0
- package/dist/commonjs/mcp-server/tools/kubernetesClustersUpdateKubernetesCluster.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +2 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/kubernetesclusterdata.d.ts +43 -0
- package/dist/commonjs/models/kubernetesclusterdata.d.ts.map +1 -1
- package/dist/commonjs/models/kubernetesclusterdata.js +34 -1
- package/dist/commonjs/models/kubernetesclusterdata.js.map +1 -1
- package/dist/commonjs/models/kubernetesclusterupdateresponse.d.ts +92 -0
- package/dist/commonjs/models/kubernetesclusterupdateresponse.d.ts.map +1 -0
- package/dist/commonjs/models/kubernetesclusterupdateresponse.js +131 -0
- package/dist/commonjs/models/kubernetesclusterupdateresponse.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/updatekubernetescluster.d.ts +23 -0
- package/dist/commonjs/models/operations/updatekubernetescluster.d.ts.map +1 -0
- package/dist/commonjs/models/operations/updatekubernetescluster.js +72 -0
- package/dist/commonjs/models/operations/updatekubernetescluster.js.map +1 -0
- package/dist/commonjs/models/updatekubernetescluster.d.ts +73 -0
- package/dist/commonjs/models/updatekubernetescluster.d.ts.map +1 -0
- package/dist/commonjs/models/updatekubernetescluster.js +116 -0
- package/dist/commonjs/models/updatekubernetescluster.js.map +1 -0
- package/dist/commonjs/sdk/kubernetesclusters.d.ts +17 -0
- package/dist/commonjs/sdk/kubernetesclusters.d.ts.map +1 -1
- package/dist/commonjs/sdk/kubernetesclusters.js +20 -0
- package/dist/commonjs/sdk/kubernetesclusters.js.map +1 -1
- package/dist/esm/funcs/kubernetesClustersUpdateKubernetesCluster.d.ts +29 -0
- package/dist/esm/funcs/kubernetesClustersUpdateKubernetesCluster.d.ts.map +1 -0
- package/dist/esm/funcs/kubernetesClustersUpdateKubernetesCluster.js +104 -0
- package/dist/esm/funcs/kubernetesClustersUpdateKubernetesCluster.js.map +1 -0
- package/dist/esm/funcs/serversReinstall.d.ts +2 -1
- package/dist/esm/funcs/serversReinstall.d.ts.map +1 -1
- package/dist/esm/funcs/serversReinstall.js +9 -3
- package/dist/esm/funcs/serversReinstall.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/security.d.ts +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +19 -8
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/kubernetesClustersUpdateKubernetesCluster.d.ts +8 -0
- package/dist/esm/mcp-server/tools/kubernetesClustersUpdateKubernetesCluster.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/kubernetesClustersUpdateKubernetesCluster.js +39 -0
- package/dist/esm/mcp-server/tools/kubernetesClustersUpdateKubernetesCluster.js.map +1 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +2 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/kubernetesclusterdata.d.ts +43 -0
- package/dist/esm/models/kubernetesclusterdata.d.ts.map +1 -1
- package/dist/esm/models/kubernetesclusterdata.js +33 -0
- package/dist/esm/models/kubernetesclusterdata.js.map +1 -1
- package/dist/esm/models/kubernetesclusterupdateresponse.d.ts +92 -0
- package/dist/esm/models/kubernetesclusterupdateresponse.d.ts.map +1 -0
- package/dist/esm/models/kubernetesclusterupdateresponse.js +89 -0
- package/dist/esm/models/kubernetesclusterupdateresponse.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/updatekubernetescluster.d.ts +23 -0
- package/dist/esm/models/operations/updatekubernetescluster.d.ts.map +1 -0
- package/dist/esm/models/operations/updatekubernetescluster.js +34 -0
- package/dist/esm/models/operations/updatekubernetescluster.js.map +1 -0
- package/dist/esm/models/updatekubernetescluster.d.ts +73 -0
- package/dist/esm/models/updatekubernetescluster.d.ts.map +1 -0
- package/dist/esm/models/updatekubernetescluster.js +74 -0
- package/dist/esm/models/updatekubernetescluster.js.map +1 -0
- package/dist/esm/sdk/kubernetesclusters.d.ts +17 -0
- package/dist/esm/sdk/kubernetesclusters.d.ts.map +1 -1
- package/dist/esm/sdk/kubernetesclusters.js +20 -0
- package/dist/esm/sdk/kubernetesclusters.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/funcs/kubernetesClustersUpdateKubernetesCluster.ts +199 -0
- package/src/funcs/serversReinstall.ts +14 -3
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +14 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/kubernetesClustersUpdateKubernetesCluster.ts +50 -0
- package/src/models/index.ts +2 -0
- package/src/models/kubernetesclusterdata.ts +61 -0
- package/src/models/kubernetesclusterupdateresponse.ts +245 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/updatekubernetescluster.ts +72 -0
- package/src/models/updatekubernetescluster.ts +198 -0
- package/src/sdk/kubernetesclusters.ts +28 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { LatitudeshCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { LatitudeshError } from "../models/errors/latitudesherror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as models from "../models/index.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Scale Kubernetes Cluster
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Scales the worker nodes or control plane nodes of a Kubernetes cluster. The cluster must be in `Provisioned` phase to accept updates.
|
|
34
|
+
*
|
|
35
|
+
* Exactly one of `worker_count` or `control_plane_count` must be provided per request. You cannot scale workers and control plane nodes in the same request.
|
|
36
|
+
*
|
|
37
|
+
* When scaling up, the API validates that sufficient server stock is available for the requested delta (e.g., scaling from 2 to 5 workers checks for 3 available servers).
|
|
38
|
+
*
|
|
39
|
+
* When scaling from 0 workers, you must provide a `worker_plan` since there is no existing configuration to inherit the plan from.
|
|
40
|
+
*
|
|
41
|
+
* Control plane scaling has a minimum of 1 node. You cannot scale control plane nodes to zero.
|
|
42
|
+
*
|
|
43
|
+
* Returns 202 Accepted when a scaling operation is triggered. Poll the GET endpoint to monitor progress. Returns 200 OK if the requested count matches the current count (no-op).
|
|
44
|
+
*/
|
|
45
|
+
export function kubernetesClustersUpdateKubernetesCluster(
|
|
46
|
+
client: LatitudeshCore,
|
|
47
|
+
request: operations.UpdateKubernetesClusterRequest,
|
|
48
|
+
options?: RequestOptions,
|
|
49
|
+
): APIPromise<
|
|
50
|
+
Result<
|
|
51
|
+
models.KubernetesClusterUpdateResponse,
|
|
52
|
+
| errors.ErrorObject
|
|
53
|
+
| LatitudeshError
|
|
54
|
+
| ResponseValidationError
|
|
55
|
+
| ConnectionError
|
|
56
|
+
| RequestAbortedError
|
|
57
|
+
| RequestTimeoutError
|
|
58
|
+
| InvalidRequestError
|
|
59
|
+
| UnexpectedClientError
|
|
60
|
+
| SDKValidationError
|
|
61
|
+
>
|
|
62
|
+
> {
|
|
63
|
+
return new APIPromise($do(
|
|
64
|
+
client,
|
|
65
|
+
request,
|
|
66
|
+
options,
|
|
67
|
+
));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function $do(
|
|
71
|
+
client: LatitudeshCore,
|
|
72
|
+
request: operations.UpdateKubernetesClusterRequest,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<
|
|
75
|
+
[
|
|
76
|
+
Result<
|
|
77
|
+
models.KubernetesClusterUpdateResponse,
|
|
78
|
+
| errors.ErrorObject
|
|
79
|
+
| LatitudeshError
|
|
80
|
+
| ResponseValidationError
|
|
81
|
+
| ConnectionError
|
|
82
|
+
| RequestAbortedError
|
|
83
|
+
| RequestTimeoutError
|
|
84
|
+
| InvalidRequestError
|
|
85
|
+
| UnexpectedClientError
|
|
86
|
+
| SDKValidationError
|
|
87
|
+
>,
|
|
88
|
+
APICall,
|
|
89
|
+
]
|
|
90
|
+
> {
|
|
91
|
+
const parsed = safeParse(
|
|
92
|
+
request,
|
|
93
|
+
(value) =>
|
|
94
|
+
operations.UpdateKubernetesClusterRequest$outboundSchema.parse(value),
|
|
95
|
+
"Input validation failed",
|
|
96
|
+
);
|
|
97
|
+
if (!parsed.ok) {
|
|
98
|
+
return [parsed, { status: "invalid" }];
|
|
99
|
+
}
|
|
100
|
+
const payload = parsed.value;
|
|
101
|
+
const body = encodeJSON("body", payload.update_kubernetes_cluster, {
|
|
102
|
+
explode: true,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const pathParams = {
|
|
106
|
+
kubernetes_cluster_id: encodeSimple(
|
|
107
|
+
"kubernetes_cluster_id",
|
|
108
|
+
payload.kubernetes_cluster_id,
|
|
109
|
+
{ explode: false, charEncoding: "percent" },
|
|
110
|
+
),
|
|
111
|
+
};
|
|
112
|
+
const path = pathToFunc("/kubernetes_clusters/{kubernetes_cluster_id}")(
|
|
113
|
+
pathParams,
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
const headers = new Headers(compactMap({
|
|
117
|
+
"Content-Type": "application/vnd.api+json",
|
|
118
|
+
Accept: "application/vnd.api+json",
|
|
119
|
+
}));
|
|
120
|
+
|
|
121
|
+
const secConfig = await extractSecurity(client._options.bearer);
|
|
122
|
+
const securityInput = secConfig == null ? {} : { bearer: secConfig };
|
|
123
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
124
|
+
|
|
125
|
+
const context = {
|
|
126
|
+
options: client._options,
|
|
127
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
128
|
+
operationID: "update-kubernetes-cluster",
|
|
129
|
+
oAuth2Scopes: null,
|
|
130
|
+
|
|
131
|
+
resolvedSecurity: requestSecurity,
|
|
132
|
+
|
|
133
|
+
securitySource: client._options.bearer,
|
|
134
|
+
retryConfig: options?.retries
|
|
135
|
+
|| client._options.retryConfig
|
|
136
|
+
|| { strategy: "none" },
|
|
137
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const requestRes = client._createRequest(context, {
|
|
141
|
+
security: requestSecurity,
|
|
142
|
+
method: "PATCH",
|
|
143
|
+
baseURL: options?.serverURL,
|
|
144
|
+
path: path,
|
|
145
|
+
headers: headers,
|
|
146
|
+
body: body,
|
|
147
|
+
userAgent: client._options.userAgent,
|
|
148
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
149
|
+
}, options);
|
|
150
|
+
if (!requestRes.ok) {
|
|
151
|
+
return [requestRes, { status: "invalid" }];
|
|
152
|
+
}
|
|
153
|
+
const req = requestRes.value;
|
|
154
|
+
|
|
155
|
+
const doResult = await client._do(req, {
|
|
156
|
+
context,
|
|
157
|
+
errorCodes: ["400", "403", "404", "422", "4XX", "503", "5XX"],
|
|
158
|
+
retryConfig: context.retryConfig,
|
|
159
|
+
retryCodes: context.retryCodes,
|
|
160
|
+
});
|
|
161
|
+
if (!doResult.ok) {
|
|
162
|
+
return [doResult, { status: "request-error", request: req }];
|
|
163
|
+
}
|
|
164
|
+
const response = doResult.value;
|
|
165
|
+
|
|
166
|
+
const responseFields = {
|
|
167
|
+
HttpMeta: { Response: response, Request: req },
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const [result] = await M.match<
|
|
171
|
+
models.KubernetesClusterUpdateResponse,
|
|
172
|
+
| errors.ErrorObject
|
|
173
|
+
| LatitudeshError
|
|
174
|
+
| ResponseValidationError
|
|
175
|
+
| ConnectionError
|
|
176
|
+
| RequestAbortedError
|
|
177
|
+
| RequestTimeoutError
|
|
178
|
+
| InvalidRequestError
|
|
179
|
+
| UnexpectedClientError
|
|
180
|
+
| SDKValidationError
|
|
181
|
+
>(
|
|
182
|
+
M.json([200, 202], models.KubernetesClusterUpdateResponse$inboundSchema, {
|
|
183
|
+
ctype: "application/vnd.api+json",
|
|
184
|
+
}),
|
|
185
|
+
M.jsonErr([400, 403, 404, 422], errors.ErrorObject$inboundSchema, {
|
|
186
|
+
ctype: "application/vnd.api+json",
|
|
187
|
+
}),
|
|
188
|
+
M.jsonErr(503, errors.ErrorObject$inboundSchema, {
|
|
189
|
+
ctype: "application/vnd.api+json",
|
|
190
|
+
}),
|
|
191
|
+
M.fail("4XX"),
|
|
192
|
+
M.fail("5XX"),
|
|
193
|
+
)(response, req, { extraFields: responseFields });
|
|
194
|
+
if (!result.ok) {
|
|
195
|
+
return [result, { status: "complete", request: req, response }];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return [result, { status: "complete", request: req, response }];
|
|
199
|
+
}
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
RequestTimeoutError,
|
|
19
19
|
UnexpectedClientError,
|
|
20
20
|
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
21
22
|
import { LatitudeshError } from "../models/errors/latitudesherror.js";
|
|
22
23
|
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
24
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
@@ -35,6 +36,7 @@ export function serversReinstall(
|
|
|
35
36
|
): APIPromise<
|
|
36
37
|
Result<
|
|
37
38
|
void,
|
|
39
|
+
| errors.ErrorObject
|
|
38
40
|
| LatitudeshError
|
|
39
41
|
| ResponseValidationError
|
|
40
42
|
| ConnectionError
|
|
@@ -60,6 +62,7 @@ async function $do(
|
|
|
60
62
|
[
|
|
61
63
|
Result<
|
|
62
64
|
void,
|
|
65
|
+
| errors.ErrorObject
|
|
63
66
|
| LatitudeshError
|
|
64
67
|
| ResponseValidationError
|
|
65
68
|
| ConnectionError
|
|
@@ -94,7 +97,7 @@ async function $do(
|
|
|
94
97
|
|
|
95
98
|
const headers = new Headers(compactMap({
|
|
96
99
|
"Content-Type": "application/json",
|
|
97
|
-
Accept: "
|
|
100
|
+
Accept: "application/vnd.api+json",
|
|
98
101
|
}));
|
|
99
102
|
|
|
100
103
|
const secConfig = await extractSecurity(client._options.bearer);
|
|
@@ -133,7 +136,7 @@ async function $do(
|
|
|
133
136
|
|
|
134
137
|
const doResult = await client._do(req, {
|
|
135
138
|
context,
|
|
136
|
-
errorCodes: ["4XX", "5XX"],
|
|
139
|
+
errorCodes: ["404", "422", "4XX", "5XX"],
|
|
137
140
|
retryConfig: context.retryConfig,
|
|
138
141
|
retryCodes: context.retryCodes,
|
|
139
142
|
});
|
|
@@ -142,8 +145,13 @@ async function $do(
|
|
|
142
145
|
}
|
|
143
146
|
const response = doResult.value;
|
|
144
147
|
|
|
148
|
+
const responseFields = {
|
|
149
|
+
HttpMeta: { Response: response, Request: req },
|
|
150
|
+
};
|
|
151
|
+
|
|
145
152
|
const [result] = await M.match<
|
|
146
153
|
void,
|
|
154
|
+
| errors.ErrorObject
|
|
147
155
|
| LatitudeshError
|
|
148
156
|
| ResponseValidationError
|
|
149
157
|
| ConnectionError
|
|
@@ -154,9 +162,12 @@ async function $do(
|
|
|
154
162
|
| SDKValidationError
|
|
155
163
|
>(
|
|
156
164
|
M.nil(201, z.void()),
|
|
165
|
+
M.jsonErr([404, 422], errors.ErrorObject$inboundSchema, {
|
|
166
|
+
ctype: "application/vnd.api+json",
|
|
167
|
+
}),
|
|
157
168
|
M.fail("4XX"),
|
|
158
169
|
M.fail("5XX"),
|
|
159
|
-
)(response, req);
|
|
170
|
+
)(response, req, { extraFields: responseFields });
|
|
160
171
|
if (!result.ok) {
|
|
161
172
|
return [result, { status: "complete", request: req, response }];
|
|
162
173
|
}
|
package/src/lib/config.ts
CHANGED
|
@@ -74,8 +74,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
74
74
|
export const SDK_METADATA = {
|
|
75
75
|
language: "typescript",
|
|
76
76
|
openapiDocVersion: "2023-06-01",
|
|
77
|
-
sdkVersion: "0.3.
|
|
78
|
-
genVersion: "2.
|
|
77
|
+
sdkVersion: "0.3.7",
|
|
78
|
+
genVersion: "2.879.6",
|
|
79
79
|
userAgent:
|
|
80
|
-
"speakeasy-sdk/typescript 0.3.
|
|
80
|
+
"speakeasy-sdk/typescript 0.3.7 2.879.6 2023-06-01 latitudesh-typescript-sdk",
|
|
81
81
|
} as const;
|
package/src/lib/security.ts
CHANGED
|
@@ -240,8 +240,9 @@ function applyBearer(
|
|
|
240
240
|
|
|
241
241
|
export function resolveGlobalSecurity(
|
|
242
242
|
security: Partial<models.Security> | null | undefined,
|
|
243
|
+
allowedFields?: number[],
|
|
243
244
|
): SecurityState | null {
|
|
244
|
-
|
|
245
|
+
let inputs: SecurityInput[][] = [
|
|
245
246
|
[
|
|
246
247
|
{
|
|
247
248
|
fieldName: "Authorization",
|
|
@@ -249,7 +250,18 @@ export function resolveGlobalSecurity(
|
|
|
249
250
|
value: security?.bearer ?? env().LATITUDESH_BEARER,
|
|
250
251
|
},
|
|
251
252
|
],
|
|
252
|
-
|
|
253
|
+
];
|
|
254
|
+
|
|
255
|
+
if (allowedFields) {
|
|
256
|
+
inputs = allowedFields.map((i) => {
|
|
257
|
+
if (i < 0 || i >= inputs.length) {
|
|
258
|
+
throw new RangeError(`invalid allowedFields index ${i}`);
|
|
259
|
+
}
|
|
260
|
+
return inputs[i]!;
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return resolveSecurity(...inputs);
|
|
253
265
|
}
|
|
254
266
|
|
|
255
267
|
export async function extractSecurity<
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -41,6 +41,7 @@ import { tool$kubernetesClustersDeleteKubernetesCluster } from "./tools/kubernet
|
|
|
41
41
|
import { tool$kubernetesClustersGetKubernetesCluster } from "./tools/kubernetesClustersGetKubernetesCluster.js";
|
|
42
42
|
import { tool$kubernetesClustersGetKubernetesClusterKubeconfig } from "./tools/kubernetesClustersGetKubernetesClusterKubeconfig.js";
|
|
43
43
|
import { tool$kubernetesClustersListKubernetesClusters } from "./tools/kubernetesClustersListKubernetesClusters.js";
|
|
44
|
+
import { tool$kubernetesClustersUpdateKubernetesCluster } from "./tools/kubernetesClustersUpdateKubernetesCluster.js";
|
|
44
45
|
import { tool$operatingSystemsListPlans } from "./tools/operatingSystemsListPlans.js";
|
|
45
46
|
import { tool$plansGet } from "./tools/plansGet.js";
|
|
46
47
|
import { tool$plansGetBandwidth } from "./tools/plansGetBandwidth.js";
|
|
@@ -152,7 +153,7 @@ export function createMCPServer(deps: {
|
|
|
152
153
|
}) {
|
|
153
154
|
const server = new McpServer({
|
|
154
155
|
name: "Latitudesh",
|
|
155
|
-
version: "0.3.
|
|
156
|
+
version: "0.3.7",
|
|
156
157
|
});
|
|
157
158
|
|
|
158
159
|
const client = new LatitudeshCore({
|
|
@@ -215,6 +216,7 @@ export function createMCPServer(deps: {
|
|
|
215
216
|
tool(tool$kubernetesClustersCreateKubernetesCluster);
|
|
216
217
|
tool(tool$kubernetesClustersGetKubernetesCluster);
|
|
217
218
|
tool(tool$kubernetesClustersDeleteKubernetesCluster);
|
|
219
|
+
tool(tool$kubernetesClustersUpdateKubernetesCluster);
|
|
218
220
|
tool(tool$kubernetesClustersGetKubernetesClusterKubeconfig);
|
|
219
221
|
tool(tool$plansList);
|
|
220
222
|
tool(tool$plansGet);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { kubernetesClustersUpdateKubernetesCluster } from "../../funcs/kubernetesClustersUpdateKubernetesCluster.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.UpdateKubernetesClusterRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$kubernetesClustersUpdateKubernetesCluster: ToolDefinition<
|
|
14
|
+
typeof args
|
|
15
|
+
> = {
|
|
16
|
+
name: "kubernetes-clusters-update-kubernetes-cluster",
|
|
17
|
+
description: `Scale Kubernetes Cluster
|
|
18
|
+
|
|
19
|
+
Scales the worker nodes or control plane nodes of a Kubernetes cluster. The cluster must be in \`Provisioned\` phase to accept updates.
|
|
20
|
+
|
|
21
|
+
Exactly one of \`worker_count\` or \`control_plane_count\` must be provided per request. You cannot scale workers and control plane nodes in the same request.
|
|
22
|
+
|
|
23
|
+
When scaling up, the API validates that sufficient server stock is available for the requested delta (e.g., scaling from 2 to 5 workers checks for 3 available servers).
|
|
24
|
+
|
|
25
|
+
When scaling from 0 workers, you must provide a \`worker_plan\` since there is no existing configuration to inherit the plan from.
|
|
26
|
+
|
|
27
|
+
Control plane scaling has a minimum of 1 node. You cannot scale control plane nodes to zero.
|
|
28
|
+
|
|
29
|
+
Returns 202 Accepted when a scaling operation is triggered. Poll the GET endpoint to monitor progress. Returns 200 OK if the requested count matches the current count (no-op).
|
|
30
|
+
`,
|
|
31
|
+
args,
|
|
32
|
+
tool: async (client, args, ctx) => {
|
|
33
|
+
const [result, apiCall] = await kubernetesClustersUpdateKubernetesCluster(
|
|
34
|
+
client,
|
|
35
|
+
args.request,
|
|
36
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
37
|
+
).$inspect();
|
|
38
|
+
|
|
39
|
+
if (!result.ok) {
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: "text", text: result.error.message }],
|
|
42
|
+
isError: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const value = result.value;
|
|
47
|
+
|
|
48
|
+
return formatResult(value, apiCall);
|
|
49
|
+
},
|
|
50
|
+
};
|
package/src/models/index.ts
CHANGED
|
@@ -37,6 +37,7 @@ export * from "./kubernetesclusterdata.js";
|
|
|
37
37
|
export * from "./kubernetesclusterkubeconfig.js";
|
|
38
38
|
export * from "./kubernetesclusters.js";
|
|
39
39
|
export * from "./kubernetesclustersummarydata.js";
|
|
40
|
+
export * from "./kubernetesclusterupdateresponse.js";
|
|
40
41
|
export * from "./membership.js";
|
|
41
42
|
export * from "./objectstoragedata.js";
|
|
42
43
|
export * from "./objectstorages.js";
|
|
@@ -73,6 +74,7 @@ export * from "./traffic.js";
|
|
|
73
74
|
export * from "./trafficquota.js";
|
|
74
75
|
export * from "./updateapikey.js";
|
|
75
76
|
export * from "./updateelasticip.js";
|
|
77
|
+
export * from "./updatekubernetescluster.js";
|
|
76
78
|
export * from "./user.js";
|
|
77
79
|
export * from "./userdata.js";
|
|
78
80
|
export * from "./userdataobject.js";
|
|
@@ -44,6 +44,33 @@ export type Workers = {
|
|
|
44
44
|
availableReplicas?: number | undefined;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Current status of worker nodes. 'idle' when 0 workers, 'ready' when all workers are ready, 'scaling' when workers are being provisioned/removed, 'error' when a worker has failed.
|
|
49
|
+
*/
|
|
50
|
+
export const WorkerStatus = {
|
|
51
|
+
Idle: "idle",
|
|
52
|
+
Ready: "ready",
|
|
53
|
+
Scaling: "scaling",
|
|
54
|
+
Error: "error",
|
|
55
|
+
} as const;
|
|
56
|
+
/**
|
|
57
|
+
* Current status of worker nodes. 'idle' when 0 workers, 'ready' when all workers are ready, 'scaling' when workers are being provisioned/removed, 'error' when a worker has failed.
|
|
58
|
+
*/
|
|
59
|
+
export type WorkerStatus = ClosedEnum<typeof WorkerStatus>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Current status of control plane nodes. 'ready' when control plane is operational, 'scaling' when nodes are being provisioned/removed, 'error' when a control plane node has failed.
|
|
63
|
+
*/
|
|
64
|
+
export const ControlPlaneStatus = {
|
|
65
|
+
Ready: "ready",
|
|
66
|
+
Scaling: "scaling",
|
|
67
|
+
Error: "error",
|
|
68
|
+
} as const;
|
|
69
|
+
/**
|
|
70
|
+
* Current status of control plane nodes. 'ready' when control plane is operational, 'scaling' when nodes are being provisioned/removed, 'error' when a control plane node has failed.
|
|
71
|
+
*/
|
|
72
|
+
export type ControlPlaneStatus = ClosedEnum<typeof ControlPlaneStatus>;
|
|
73
|
+
|
|
47
74
|
/**
|
|
48
75
|
* Step identifier
|
|
49
76
|
*/
|
|
@@ -231,6 +258,14 @@ export type KubernetesClusterDataAttributes = {
|
|
|
231
258
|
* Worker nodes status information
|
|
232
259
|
*/
|
|
233
260
|
workers?: Workers | null | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* Current status of worker nodes. 'idle' when 0 workers, 'ready' when all workers are ready, 'scaling' when workers are being provisioned/removed, 'error' when a worker has failed.
|
|
263
|
+
*/
|
|
264
|
+
workerStatus?: WorkerStatus | null | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* Current status of control plane nodes. 'ready' when control plane is operational, 'scaling' when nodes are being provisioned/removed, 'error' when a control plane node has failed.
|
|
267
|
+
*/
|
|
268
|
+
controlPlaneStatus?: ControlPlaneStatus | undefined;
|
|
234
269
|
/**
|
|
235
270
|
* Whether the underlying infrastructure is ready
|
|
236
271
|
*/
|
|
@@ -384,6 +419,22 @@ export function workersFromJSON(
|
|
|
384
419
|
);
|
|
385
420
|
}
|
|
386
421
|
|
|
422
|
+
/** @internal */
|
|
423
|
+
export const WorkerStatus$inboundSchema: z.ZodNativeEnum<typeof WorkerStatus> =
|
|
424
|
+
z.nativeEnum(WorkerStatus);
|
|
425
|
+
/** @internal */
|
|
426
|
+
export const WorkerStatus$outboundSchema: z.ZodNativeEnum<typeof WorkerStatus> =
|
|
427
|
+
WorkerStatus$inboundSchema;
|
|
428
|
+
|
|
429
|
+
/** @internal */
|
|
430
|
+
export const ControlPlaneStatus$inboundSchema: z.ZodNativeEnum<
|
|
431
|
+
typeof ControlPlaneStatus
|
|
432
|
+
> = z.nativeEnum(ControlPlaneStatus);
|
|
433
|
+
/** @internal */
|
|
434
|
+
export const ControlPlaneStatus$outboundSchema: z.ZodNativeEnum<
|
|
435
|
+
typeof ControlPlaneStatus
|
|
436
|
+
> = ControlPlaneStatus$inboundSchema;
|
|
437
|
+
|
|
387
438
|
/** @internal */
|
|
388
439
|
export const KubernetesClusterDataName$inboundSchema: z.ZodNativeEnum<
|
|
389
440
|
typeof KubernetesClusterDataName
|
|
@@ -595,6 +646,8 @@ export const KubernetesClusterDataAttributes$inboundSchema: z.ZodType<
|
|
|
595
646
|
control_plane: z.nullable(z.lazy(() => ControlPlane$inboundSchema))
|
|
596
647
|
.optional(),
|
|
597
648
|
workers: z.nullable(z.lazy(() => Workers$inboundSchema)).optional(),
|
|
649
|
+
worker_status: z.nullable(WorkerStatus$inboundSchema).optional(),
|
|
650
|
+
control_plane_status: ControlPlaneStatus$inboundSchema.optional(),
|
|
598
651
|
infrastructure_ready: z.boolean().optional(),
|
|
599
652
|
control_plane_ready: z.boolean().optional(),
|
|
600
653
|
message: z.string().optional(),
|
|
@@ -618,6 +671,8 @@ export const KubernetesClusterDataAttributes$inboundSchema: z.ZodType<
|
|
|
618
671
|
"control_plane_count": "controlPlaneCount",
|
|
619
672
|
"worker_count": "workerCount",
|
|
620
673
|
"control_plane": "controlPlane",
|
|
674
|
+
"worker_status": "workerStatus",
|
|
675
|
+
"control_plane_status": "controlPlaneStatus",
|
|
621
676
|
"infrastructure_ready": "infrastructureReady",
|
|
622
677
|
"control_plane_ready": "controlPlaneReady",
|
|
623
678
|
"last_status_change": "lastStatusChange",
|
|
@@ -642,6 +697,8 @@ export type KubernetesClusterDataAttributes$Outbound = {
|
|
|
642
697
|
worker_count?: number | undefined;
|
|
643
698
|
control_plane?: ControlPlane$Outbound | null | undefined;
|
|
644
699
|
workers?: Workers$Outbound | null | undefined;
|
|
700
|
+
worker_status?: string | null | undefined;
|
|
701
|
+
control_plane_status?: string | undefined;
|
|
645
702
|
infrastructure_ready?: boolean | undefined;
|
|
646
703
|
control_plane_ready?: boolean | undefined;
|
|
647
704
|
message?: string | undefined;
|
|
@@ -675,6 +732,8 @@ export const KubernetesClusterDataAttributes$outboundSchema: z.ZodType<
|
|
|
675
732
|
controlPlane: z.nullable(z.lazy(() => ControlPlane$outboundSchema))
|
|
676
733
|
.optional(),
|
|
677
734
|
workers: z.nullable(z.lazy(() => Workers$outboundSchema)).optional(),
|
|
735
|
+
workerStatus: z.nullable(WorkerStatus$outboundSchema).optional(),
|
|
736
|
+
controlPlaneStatus: ControlPlaneStatus$outboundSchema.optional(),
|
|
678
737
|
infrastructureReady: z.boolean().optional(),
|
|
679
738
|
controlPlaneReady: z.boolean().optional(),
|
|
680
739
|
message: z.string().optional(),
|
|
@@ -697,6 +756,8 @@ export const KubernetesClusterDataAttributes$outboundSchema: z.ZodType<
|
|
|
697
756
|
controlPlaneCount: "control_plane_count",
|
|
698
757
|
workerCount: "worker_count",
|
|
699
758
|
controlPlane: "control_plane",
|
|
759
|
+
workerStatus: "worker_status",
|
|
760
|
+
controlPlaneStatus: "control_plane_status",
|
|
700
761
|
infrastructureReady: "infrastructure_ready",
|
|
701
762
|
controlPlaneReady: "control_plane_ready",
|
|
702
763
|
lastStatusChange: "last_status_change",
|