Skip to main content
Glama
aliyun

Alibaba Cloud RDS OpenAPI MCP Server

Official
by aliyun

modify_db_instance_spec

Change RDS instance specifications to adjust compute power, storage, or payment type for scaling database performance or cost optimization.

Instructions

Modify RDS instance specifications.

Args:
    region_id: The region ID of the RDS instance.
    dbinstance_id: The ID of the RDS instance.
    dbinstance_class: Target instance specification.
    dbinstance_storage: Target storage space in GB.
    pay_type: Instance payment type. Values: Postpaid, Prepaid, Serverless.
    effective_time: When the new configuration takes effect. Values: Immediate, MaintainTime, ScheduleTime.
    switch_time: Scheduled switch time in format: yyyy-MM-ddTHH:mm:ssZ (UTC time).
    switch_time_mode: Switch time mode. Values: Immediate, MaintainTime, ScheduleTime.
    source_biz: Source business type.
    dedicated_host_group_id: Dedicated host group ID.
    zone_id: Zone ID.
    vswitch_id: VSwitch ID.
    category: Instance category.
    instance_network_type: Instance network type.
    direction: Specification change direction. Values: UP, DOWN.
    auto_pause: Whether to enable auto pause for Serverless instances.
    max_capacity: Maximum capacity for Serverless instances.
    min_capacity: Minimum capacity for Serverless instances.
    switch_force: Whether to force switch for Serverless instances.
    client_token: Client token for idempotency, max 64 ASCII characters.

Returns:
    Dict[str, Any]: The response containing the request ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
region_idYes
dbinstance_idYes
dbinstance_classNo
dbinstance_storageNo
pay_typeNo
effective_timeNo
switch_timeNo
switch_time_modeNo
source_bizNo
dedicated_host_group_idNo
zone_idNo
vswitch_idNo
categoryNo
instance_network_typeNo
directionNo
auto_pauseNo
max_capacityNo
min_capacityNo
switch_forceNo
client_tokenNo

Implementation Reference

  • The handler function that implements the 'modify_db_instance_spec' MCP tool by constructing and sending a ModifyDBInstanceSpecRequest to the Alibaba Cloud RDS SDK client.
    async def modify_db_instance_spec(
            region_id: str,
            dbinstance_id: str,
            dbinstance_class: str = None,
            dbinstance_storage: int = None,
            pay_type: str = None,
            effective_time: str = None,
            switch_time: str = None,
            switch_time_mode: str = None,
            source_biz: str = None,
            dedicated_host_group_id: str = None,
            zone_id: str = None,
            vswitch_id: str = None,
            category: str = None,
            instance_network_type: str = None,
            direction: str = None,
            auto_pause: bool = None,
            max_capacity: float = None,
            min_capacity: float = None,
            switch_force: bool = None,
            client_token: str = None
    ) -> Dict[str, Any]:
        """Modify RDS instance specifications.
    
        Args:
            region_id: The region ID of the RDS instance.
            dbinstance_id: The ID of the RDS instance.
            dbinstance_class: Target instance specification.
            dbinstance_storage: Target storage space in GB.
            pay_type: Instance payment type. Values: Postpaid, Prepaid, Serverless.
            effective_time: When the new configuration takes effect. Values: Immediate, MaintainTime, ScheduleTime.
            switch_time: Scheduled switch time in format: yyyy-MM-ddTHH:mm:ssZ (UTC time).
            switch_time_mode: Switch time mode. Values: Immediate, MaintainTime, ScheduleTime.
            source_biz: Source business type.
            dedicated_host_group_id: Dedicated host group ID.
            zone_id: Zone ID.
            vswitch_id: VSwitch ID.
            category: Instance category.
            instance_network_type: Instance network type.
            direction: Specification change direction. Values: UP, DOWN.
            auto_pause: Whether to enable auto pause for Serverless instances.
            max_capacity: Maximum capacity for Serverless instances.
            min_capacity: Minimum capacity for Serverless instances.
            switch_force: Whether to force switch for Serverless instances.
            client_token: Client token for idempotency, max 64 ASCII characters.
    
        Returns:
            Dict[str, Any]: The response containing the request ID.
        """
        try:
            # Initialize the client
            client = get_rds_client(region_id)
    
            # Create request
            request = rds_20140815_models.ModifyDBInstanceSpecRequest(
                dbinstance_id=dbinstance_id
            )
    
            # Add optional parameters if provided
            if dbinstance_class:
                request.dbinstance_class = dbinstance_class
            if dbinstance_storage:
                request.dbinstance_storage = dbinstance_storage
            if pay_type:
                request.pay_type = pay_type
            if effective_time:
                request.effective_time = effective_time
            if switch_time:
                request.switch_time = switch_time
            if switch_time_mode:
                request.switch_time_mode = switch_time_mode
            if source_biz:
                request.source_biz = source_biz
            if dedicated_host_group_id:
                request.dedicated_host_group_id = dedicated_host_group_id
            if zone_id:
                request.zone_id = zone_id
            if vswitch_id:
                request.vswitch_id = vswitch_id
            if category:
                request.category = category
            if instance_network_type:
                request.instance_network_type = instance_network_type
            if direction:
                request.direction = direction
            if auto_pause is not None:
                request.auto_pause = auto_pause
            if max_capacity:
                request.max_capacity = max_capacity
            if min_capacity:
                request.min_capacity = min_capacity
            if switch_force is not None:
                request.switch_force = switch_force
            if client_token:
                request.client_token = client_token
    
            # Make the API request
            response = client.modify_dbinstance_spec(request)
            return response.body.to_map()
    
        except Exception as e:
            logger.error(f"Error occurred while modifying instance specifications: {str(e)}")
            raise OpenAPIError(f"Failed to modify RDS instance specifications: {str(e)}")

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-rds-openapi-mcp-server'

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