File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,34 @@ async def get_cluster(cluster_id: str) -> str:
142142 return format_clusters_response ({"items" : [data ]})
143143
144144
145+ @mcp .tool ()
146+ async def create_cluster (
147+ cluster_name : str ,
148+ region : str = "us-east-1" ,
149+ multi_az : bool = False ,
150+ nodes : int = 4 ,
151+ instance_type : str = "m5.xlarge" ,
152+ ) -> str :
153+ """Provision a new cluster and add it to the collection of clusters. Only supports Classic OSD on AWS."""
154+ url = f"{ OCM_API_BASE } /api/clusters_mgmt/v1/clusters"
155+ data = {
156+ "byoc" : False ,
157+ "name" : cluster_name ,
158+ "region" : {"id" : region },
159+ "nodes" : {
160+ "compute" : nodes ,
161+ "compute_machine_type" : {"id" : instance_type },
162+ },
163+ "managed" : True ,
164+ "cloud_provider" : {"id" : "aws" },
165+ "multi_az" : multi_az ,
166+ "load_balancer_quota" : 0 ,
167+ "storage_quota" : {"unit" : "B" , "value" : 107374182400 },
168+ }
169+ response = await make_request (url , method = "POST" , data = data )
170+ return response
171+
172+
145173@mcp .tool ()
146174async def get_clusters_logs (cluster_id : str ) -> str :
147175 """Get all service logs for a cluster specified by cluster_id"""
You can’t perform that action at this time.
0 commit comments