modify_db_instance_spec
Modify Alibaba Cloud RDS instance specifications, including class, storage, pay type, and network settings. Control effective time, auto-pause, and capacity for Serverless instances, ensuring configuration updates align with operational needs.
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
| Name | Required | Description | Default |
|---|---|---|---|
| auto_pause | No | ||
| category | No | ||
| client_token | No | ||
| dbinstance_class | No | ||
| dbinstance_id | Yes | ||
| dbinstance_storage | No | ||
| dedicated_host_group_id | No | ||
| direction | No | ||
| effective_time | No | ||
| instance_network_type | No | ||
| max_capacity | No | ||
| min_capacity | No | ||
| pay_type | No | ||
| region_id | Yes | ||
| source_biz | No | ||
| switch_force | No | ||
| switch_time | No | ||
| switch_time_mode | No | ||
| vswitch_id | No | ||
| zone_id | No |
Input Schema (JSON Schema)
{
"properties": {
"auto_pause": {
"default": null,
"title": "Auto Pause",
"type": "boolean"
},
"category": {
"default": null,
"title": "Category",
"type": "string"
},
"client_token": {
"default": null,
"title": "Client Token",
"type": "string"
},
"dbinstance_class": {
"default": null,
"title": "Dbinstance Class",
"type": "string"
},
"dbinstance_id": {
"title": "Dbinstance Id",
"type": "string"
},
"dbinstance_storage": {
"default": null,
"title": "Dbinstance Storage",
"type": "integer"
},
"dedicated_host_group_id": {
"default": null,
"title": "Dedicated Host Group Id",
"type": "string"
},
"direction": {
"default": null,
"title": "Direction",
"type": "string"
},
"effective_time": {
"default": null,
"title": "Effective Time",
"type": "string"
},
"instance_network_type": {
"default": null,
"title": "Instance Network Type",
"type": "string"
},
"max_capacity": {
"default": null,
"title": "Max Capacity",
"type": "number"
},
"min_capacity": {
"default": null,
"title": "Min Capacity",
"type": "number"
},
"pay_type": {
"default": null,
"title": "Pay Type",
"type": "string"
},
"region_id": {
"title": "Region Id",
"type": "string"
},
"source_biz": {
"default": null,
"title": "Source Biz",
"type": "string"
},
"switch_force": {
"default": null,
"title": "Switch Force",
"type": "boolean"
},
"switch_time": {
"default": null,
"title": "Switch Time",
"type": "string"
},
"switch_time_mode": {
"default": null,
"title": "Switch Time Mode",
"type": "string"
},
"vswitch_id": {
"default": null,
"title": "Vswitch Id",
"type": "string"
},
"zone_id": {
"default": null,
"title": "Zone Id",
"type": "string"
}
},
"required": [
"region_id",
"dbinstance_id"
],
"title": "modify_db_instance_specArguments",
"type": "object"
}
Implementation Reference
- The MCP tool handler function 'modify_db_instance_spec' that implements the tool logic by constructing a ModifyDBInstanceSpecRequest and calling the Alibaba Cloud RDS SDK client.modify_dbinstance_spec method.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)}")