@takashito/linode-mcp-server
Version:
MCP server for Linode API
158 lines • 9.47 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTierVersionSchema = exports.listTierVersionsSchema = exports.getNodeSchema = exports.regenerateClusterSchema = exports.deleteKubeconfigSchema = exports.deleteControlPlaneACLSchema = exports.updateControlPlaneACLSchema = exports.getControlPlaneACLSchema = exports.getTypesSchema = exports.getVersionSchema = exports.getVersionsSchema = 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.coerce.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.coerce.number().describe('The number of nodes in this pool (minimum: 1)'),
tags: schemas_1.tagsSchema,
autoscaler: zod_1.z.object({
enabled: (0, schemas_1.coerceBoolean)().describe('Whether autoscaling is enabled for this node pool'),
min: zod_1.z.coerce.number().optional().describe('The minimum number of nodes to autoscale to'),
max: zod_1.z.coerce.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: (0, schemas_1.coerceBoolean)().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.coerce.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: (0, schemas_1.coerceBoolean)().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.coerce.number().describe('The ID of the Kubernetes cluster')
});
// Node pool schemas
exports.getNodePoolsSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster')
});
exports.getNodePoolSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster'),
poolId: zod_1.z.coerce.number().describe('The ID of the node pool')
});
exports.createNodePoolSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.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.coerce.number().describe('The number of nodes in this pool (minimum: 1)'),
tags: schemas_1.tagsSchema,
autoscaler: zod_1.z.object({
enabled: (0, schemas_1.coerceBoolean)().describe('Whether autoscaling is enabled for this node pool'),
min: zod_1.z.coerce.number().optional().describe('The minimum number of nodes to autoscale to'),
max: zod_1.z.coerce.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.coerce.number().describe('The ID of the Kubernetes cluster'),
poolId: zod_1.z.coerce.number().describe('The ID of the node pool'),
count: zod_1.z.coerce.number().optional().describe('The number of nodes in this pool'),
tags: schemas_1.tagsSchema,
autoscaler: zod_1.z.object({
enabled: (0, schemas_1.coerceBoolean)().describe('Whether autoscaling is enabled for this node pool'),
min: zod_1.z.coerce.number().optional().describe('The minimum number of nodes to autoscale to'),
max: zod_1.z.coerce.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.coerce.number().describe('The ID of the Kubernetes cluster'),
poolId: zod_1.z.coerce.number().describe('The ID of the node pool')
});
exports.recycleNodesSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster'),
poolId: zod_1.z.coerce.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.coerce.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.coerce.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({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster')
});
exports.getAPIEndpointsSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster')
});
exports.getDashboardURLSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster')
});
exports.deleteServiceTokenSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster')
});
// Cluster management schemas
exports.recycleClusterSchema = zod_1.z.object({
id: zod_1.z.coerce.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
});
// Control Plane ACL schemas
exports.getControlPlaneACLSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster')
});
exports.updateControlPlaneACLSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster'),
acl: zod_1.z.object({
enabled: (0, schemas_1.coerceBoolean)().optional().describe('Whether the Control Plane ACL is enabled'),
'revision-id': zod_1.z.string().optional().describe('The revision ID of the ACL for optimistic concurrency control'),
addresses: zod_1.z.object({
ipv4: zod_1.z.array(zod_1.z.string()).optional().describe('A list of IPv4 addresses or CIDR ranges allowed to access the control plane'),
ipv6: zod_1.z.array(zod_1.z.string()).optional().describe('A list of IPv6 addresses or CIDR ranges allowed to access the control plane')
}).optional().describe('The allowed addresses for the control plane')
}).describe('The ACL configuration for the control plane')
});
exports.deleteControlPlaneACLSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster')
});
// Delete Kubeconfig schema
exports.deleteKubeconfigSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster')
});
// Regenerate cluster schema
exports.regenerateClusterSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster')
});
// Get node schema
exports.getNodeSchema = zod_1.z.object({
clusterId: zod_1.z.coerce.number().describe('The ID of the Kubernetes cluster'),
nodeId: zod_1.z.string().describe('The ID of the node')
});
// Tier version schemas
exports.listTierVersionsSchema = zod_1.z.object({
tier: zod_1.z.string().describe('The tier of the Kubernetes cluster (e.g., "standard", "enterprise")')
});
exports.getTierVersionSchema = zod_1.z.object({
tier: zod_1.z.string().describe('The tier of the Kubernetes cluster (e.g., "standard", "enterprise")'),
version: zod_1.z.string().describe('The Kubernetes version')
});
//# sourceMappingURL=schemas.js.map