@takashito/linode-mcp-server
Version:
MCP server for Linode API
122 lines • 6.91 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTypesSchema = exports.getVersionSchema = exports.getVersionsSchema = exports.upgradeClusterSchema = exports.recycleClusterSchema = exports.deleteServiceTokenSchema = exports.getDashboardURLSchema = exports.getAPIEndpointsSchema = exports.getKubeconfigSchema = exports.recycleNodeSchema = exports.deleteNodeSchema = exports.recycleNodesSchema = exports.deleteNodePoolSchema = exports.updateNodePoolSchema = exports.createNodePoolSchema = exports.getNodePoolSchema = exports.getNodePoolsSchema = exports.deleteClusterSchema = exports.updateClusterSchema = exports.createClusterSchema = exports.getClusterSchema = exports.listKubernetesClustersSchema = void 0;
const zod_1 = require("zod");
const schemas_1 = require("../common/schemas");
// Kubernetes cluster schemas
exports.listKubernetesClustersSchema = zod_1.z.object({
...schemas_1.pagingParamsSchema.shape
});
exports.getClusterSchema = zod_1.z.object({
id: zod_1.z.number().describe('The ID of the Kubernetes cluster')
});
exports.createClusterSchema = zod_1.z.object({
label: zod_1.z.string().describe('A unique label for the cluster (1-32 alphanumeric characters, hyphen, and underscore)'),
region: zod_1.z.string().describe('The region where the Kubernetes cluster will be deployed'),
k8s_version: zod_1.z.string().describe('The Kubernetes version to use for this cluster'),
tags: schemas_1.tagsSchema,
node_pools: zod_1.z.array(zod_1.z.object({
type: zod_1.z.string().describe('The Linode Type ID for nodes in this pool'),
count: zod_1.z.number().describe('The number of nodes in this pool (minimum: 1)'),
tags: schemas_1.tagsSchema,
autoscaler: zod_1.z.object({
enabled: zod_1.z.boolean().describe('Whether autoscaling is enabled for this node pool'),
min: zod_1.z.number().optional().describe('The minimum number of nodes to autoscale to'),
max: zod_1.z.number().optional().describe('The maximum number of nodes to autoscale to')
}).optional().describe('Node pool autoscaler settings')
})).describe('An array of node pools for the cluster (minimum: 1)'),
control_plane: zod_1.z.object({
high_availability: zod_1.z.boolean().optional().describe('Whether High Availability is enabled for the control plane')
}).optional().describe('Control plane settings')
});
exports.updateClusterSchema = zod_1.z.object({
id: zod_1.z.number().describe('The ID of the Kubernetes cluster'),
label: zod_1.z.string().optional().describe('A unique label for the cluster'),
k8s_version: zod_1.z.string().optional().describe('The Kubernetes version to upgrade to'),
tags: schemas_1.tagsSchema,
control_plane: zod_1.z.object({
high_availability: zod_1.z.boolean().optional().describe('Whether High Availability is enabled for the control plane')
}).optional().describe('Control plane settings')
});
exports.deleteClusterSchema = zod_1.z.object({
id: zod_1.z.number().describe('The ID of the Kubernetes cluster')
});
// Node pool schemas
exports.getNodePoolsSchema = zod_1.z.object({
clusterId: zod_1.z.number().describe('The ID of the Kubernetes cluster')
});
exports.getNodePoolSchema = zod_1.z.object({
clusterId: zod_1.z.number().describe('The ID of the Kubernetes cluster'),
poolId: zod_1.z.number().describe('The ID of the node pool')
});
exports.createNodePoolSchema = zod_1.z.object({
clusterId: zod_1.z.number().describe('The ID of the Kubernetes cluster'),
type: zod_1.z.string().describe('The Linode Type ID for nodes in this pool'),
count: zod_1.z.number().describe('The number of nodes in this pool (minimum: 1)'),
tags: schemas_1.tagsSchema,
autoscaler: zod_1.z.object({
enabled: zod_1.z.boolean().describe('Whether autoscaling is enabled for this node pool'),
min: zod_1.z.number().optional().describe('The minimum number of nodes to autoscale to'),
max: zod_1.z.number().optional().describe('The maximum number of nodes to autoscale to')
}).optional().describe('Node pool autoscaler settings')
});
exports.updateNodePoolSchema = zod_1.z.object({
clusterId: zod_1.z.number().describe('The ID of the Kubernetes cluster'),
poolId: zod_1.z.number().describe('The ID of the node pool'),
count: zod_1.z.number().optional().describe('The number of nodes in this pool'),
tags: schemas_1.tagsSchema,
autoscaler: zod_1.z.object({
enabled: zod_1.z.boolean().describe('Whether autoscaling is enabled for this node pool'),
min: zod_1.z.number().optional().describe('The minimum number of nodes to autoscale to'),
max: zod_1.z.number().optional().describe('The maximum number of nodes to autoscale to')
}).optional().describe('Node pool autoscaler settings')
});
exports.deleteNodePoolSchema = zod_1.z.object({
clusterId: zod_1.z.number().describe('The ID of the Kubernetes cluster'),
poolId: zod_1.z.number().describe('The ID of the node pool')
});
exports.recycleNodesSchema = zod_1.z.object({
clusterId: zod_1.z.number().describe('The ID of the Kubernetes cluster'),
poolId: zod_1.z.number().describe('The ID of the node pool'),
nodes: zod_1.z.array(zod_1.z.string()).describe('An array of node IDs to recycle')
});
// Node operations
exports.deleteNodeSchema = zod_1.z.object({
clusterId: zod_1.z.number().describe('The ID of the Kubernetes cluster'),
nodeId: zod_1.z.string().describe('The ID of the node to delete')
});
exports.recycleNodeSchema = zod_1.z.object({
clusterId: zod_1.z.number().describe('The ID of the Kubernetes cluster'),
nodeId: zod_1.z.string().describe('The ID of the node to recycle')
});
// Cluster access schemas
exports.getKubeconfigSchema = zod_1.z.object({
id: zod_1.z.number().describe('The ID of the Kubernetes cluster')
});
exports.getAPIEndpointsSchema = zod_1.z.object({
id: zod_1.z.number().describe('The ID of the Kubernetes cluster')
});
exports.getDashboardURLSchema = zod_1.z.object({
id: zod_1.z.number().describe('The ID of the Kubernetes cluster')
});
exports.deleteServiceTokenSchema = zod_1.z.object({
id: zod_1.z.number().describe('The ID of the Kubernetes cluster')
});
// Cluster management schemas
exports.recycleClusterSchema = zod_1.z.object({
id: zod_1.z.number().describe('The ID of the Kubernetes cluster')
});
exports.upgradeClusterSchema = zod_1.z.object({
id: zod_1.z.number().describe('The ID of the Kubernetes cluster')
});
// Version and type schemas
exports.getVersionsSchema = zod_1.z.object({
...schemas_1.pagingParamsSchema.shape
});
exports.getVersionSchema = zod_1.z.object({
version: zod_1.z.string().describe('The Kubernetes version to get details for')
});
exports.getTypesSchema = zod_1.z.object({
...schemas_1.pagingParamsSchema.shape
});
//# sourceMappingURL=schemas.js.map