Modifying DB Instance Specifications
Function
This API is used to modify DB instance specifications.
Services will be interrupted for 5 to 10 minutes when you modify DB instance specifications. Exercise caution when performing this operation.
Constraints
- This API supports only pay-per-use DB instances.
- The new specifications cannot be the same as the original specifications.
- Specifications can be modified only when the DB instance status is normal.
- This API can only be used to modify specifications within the same series.
The specification series includes general-purpose (s6), enhanced (c3), and enhanced II (c6).
Example:- dds.mongodb.s6.large.4.mongos and dds.mongodb.s6.medium.4.mongos have the same specifications.
- dds.mongodb.s6.large.4.mongos and dds.mongodb.c3.large.4.mongos are not of the same specifications.
URI
Requests
- Parameter description
Table 2 Parameter description Name
Mandatory
Type
Description
resize
Yes
Object
Specifies the specification information. For more information, see Table 3.
Table 3 resize field data structure description Name
Mandatory
Type
Description
target_type
No
String
Specifies the object type:
- This parameter is mandatory for a cluster instance. When the mongos node specifications are to be modified, the value is mongos. When the shard nodes specifications are to be modified, the value is shard.
- This parameter is not transferred for replica set and single node instances.
target_id
Yes
String
Specifies the ID of the DB instance or node whose specifications are to be modified.
- If the mongos node specifications are to be modified, the value is mongos node ID. If the shard nodes specifications are to be modified, the value is shard node ID.
- For a replica set instance, the value is the DB instance ID.
- For a single node instance, the value is the DB instance ID.
target_spec_code
Yes
String
Specifies the resource specification code of the new specification. For details about how to obtain the value, see the response values of flavors.spec_code in Querying All DB Instance Specifications.
- Request header
POST https://DDS endpoint/v3/{project_id}/instances/{instance_id}/resize - Example request
Modify the mongos specifications in a cluster instance.
{ "resize": { "target_type": "mongos", "target_id": "a742c13a284949adad177672e8a0f01cno02", "target_spec_code": "dds.c3.large.4.mongos" } }Modify the shard specifications in a cluster instance.{ "resize": { "target_type": "shard", "target_id": "aeeb40a704904977ad78993d138ec942gr02", "target_spec_code": "dds.c3.large.4.shard" } }Modify specifications of a replica set or a single node instance.{ "resize": { "target_id": "aeeb40a704904977ad78993d138ec942in02", "target_spec_code": "dds.c3.medium.4.repset" } }
Responses
- Parameter description
Table 4 Parameter description Name
Type
Description
job_id
String
Indicates the task ID.
- Response example
{ "job_id": "3711e2ad-5787-49bc-a47f-3f0b066af9f5" }
Status Code
For more information, see Status Code.
Error Code
For more information, see Error Code.
Last Article: Adding Nodes for a Cluster Instance
Next Article: Performing a Primary/Secondary Switchover in a Replica Set Instance
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.