Skip to main content
Glama
aliyun

AlibabaCloud MCP Server

Official
by aliyun

StartRDSInstances

Start multiple AlibabaCloud RDS instances simultaneously for efficient management during application deployment or high-availability scenarios.

Instructions

批量启动RDS实例,适用于需要同时管理和启动多台RDS实例的场景,例如应用部署和高可用性场景。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
InstanceIdsYesAlibabaCloud ECS instance ID List
RegionIdNoAlibabaCloud region IDcn-hangzhou

Implementation Reference

  • The handler function OOS_StartRDSInstances starts multiple Alibaba Cloud RDS instances using the OOS template 'ACS-RDS-BulkyStartInstances'. It defines the input schema via Pydantic Fields and calls the helper _start_execution_sync.
    @tools.append
    def OOS_StartRDSInstances(
        InstanceIds: List[str] = Field(description='AlibabaCloud ECS instance ID List'),
        RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou')
    ):
        """批量启动RDS实例,适用于需要同时管理和启动多台RDS实例的场景,例如应用部署和高可用性场景。"""
    
        parameters = {
            'regionId': RegionId,
            'resourceType': 'ALIYUN::RDS::Instance',
            'targets': {
                'ResourceIds': InstanceIds,
                'RegionId': RegionId,
                'Type': 'ResourceIds'
            }
        }
        return _start_execution_sync(region_id=RegionId, template_name='ACS-RDS-BulkyStartInstances', parameters=parameters)
  • Helper function that synchronously starts an OOS execution by polling its status until completion or failure. Used by OOS_StartRDSInstances and other OOS tools.
    def _start_execution_sync(region_id: str, template_name: str, parameters: dict):
        client = create_client(region_id=region_id)
        start_execution_request = oos_20190601_models.StartExecutionRequest(
            region_id=region_id,
            template_name=template_name,
            parameters=json.dumps(parameters)
        )
        start_execution_resp = client.start_execution(start_execution_request)
        execution_id = start_execution_resp.body.execution.execution_id
    
        while True:
            list_executions_request = oos_20190601_models.ListExecutionsRequest(
                region_id=region_id,
                execution_id=execution_id
            )
            list_executions_resp = client.list_executions(list_executions_request)
            status = list_executions_resp.body.executions[0].status
            if status == FAILED:
                status_message = list_executions_resp.body.executions[0].status_message
                raise exception.OOSExecutionFailed(reason=status_message)
            elif status in END_STATUSES:
                return list_executions_resp.body
            time.sleep(1)
    @tools.append
  • Registers all tools from oos_tools (including OOS_StartRDSInstances) to the FastMCP server.
    for tool in oos_tools.tools:
        mcp.tool(tool)
  • Imports the oos_tools module containing the OOS_StartRDSInstances tool.
    from alibaba_cloud_ops_mcp_server.tools import cms_tools, oos_tools, oss_tools, api_tools, common_api_tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aliyun/alibabacloud-core-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server