Domain name for API request: mongodb.intl.tencentcloudapi.com.
This API is used to adjust the TencentDB for MongoDB instance configuration. The DescribeSpecInfo API can be called to query and obtain the supported sales specifications.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: ModifyDBInstanceSpec. |
| Version | Yes | String | Common Params. The value used for this API: 2019-07-25. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| InstanceId | Yes | String | Instance ID. Log in to the MongoDB console and copy the instance ID from the instance list. |
| Memory | No | Integer | Memory size after instance configuration modification. Unit: GB. The current instance memory size is used by default if this parameter is left blank. For supported memory specifications, please refer to product specifications. |
| Volume | No | Integer | Hard disk size after instance configuration modification. Unit: GB. The current instance disk size is used by default if this parameter is left blank. For supported disk capacity, please refer to product specification.
|
| NodeNum | No | Integer | Number of mongod nodes after instance change (excluding read-only nodes).
|
| ReplicateSetNum | No | Integer | Number of shards after instance change.
|
| InMaintenance | No | Integer | Switch time for instance configuration change.
|
| MongosMemory | No | String | Memory size of mongos after sharding instance configuration change. Unit: GB. For instance support specifications, see product specification. |
| AddNodeList.N | No | Array of AddNodeList | List of nodes to be added, containing the node type and AZ information. |
| RemoveNodeList.N | No | Array of RemoveNodeList | Delete node list. |
| Cpu | No | Integer | CPU size after instance configuration changes. Unit: C. If empty, the default value is the current CPU size of the instance. For currently supported CPU specifications, see Product Specifications. |
| MachineCode | No | String | The product specification type after instance configuration change. If empty, the default value is the current instance product specification type.
Product allowlist specification types:
Note:
|
| Parameter Name | Type | Description |
|---|---|---|
| DealId | String | Order ID. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to delete 2 secondary nodes in total from Guangzhou Zone 2 and Zone 3. The final number of nodes changes to 3.
POST / HTTP/1.1
Host: mongodb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyDBInstanceSpec
<Common request parameters>
{
"InstanceId": "cmgo-abcdef",
"Memory": 4,
"Volume": 100,
"OplogSize": 30,
"NodeNum": 3,
"ReplicateSetNum": 1,
"InMaintenance": 1,
"RemoveNodeList": [
{
"NodeName": "cmgo-3iecwbfx_0-node0",
"Role": "SECONDARY",
"Zone": "ap-guangzhou-2"
},
{
"NodeName": "cmgo-3iecwbfx_0-node1",
"Role": "SECONDARY",
"Zone": "ap-guangzhou-3"
}
]
}
{
"Response": {
"DealId": "7142863",
"RequestId": "d88095e5-50e8-4245-a0cf-993a536f9b20"
}
}
This example shows you how to add 2 secondary nodes in total to Guangzhou Zone 2 and Zone 3. The final number of nodes changes to 5.
POST / HTTP/1.1
Host: mongodb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyDBInstanceSpec
<Common request parameters>
{
"InstanceId": "cmgo-p8vn****",
"Memory": 4,
"Volume": 100,
"OplogSize": 30,
"NodeNum": 5,
"ReplicateSetNum": 1,
"InMaintenance": 1,
"AddNodeList": [
{
"Role": "SECONDARY",
"Zone": "ap-guangzhou-2"
},
{
"Role": "SECONDARY",
"Zone": "ap-guangzhou-3"
}
]
}
{
"Response": {
"DealId": "7142863",
"RequestId": "d88095e5-50e8-4245-a0cf-993a536f9b20"
}
}
This example shows you how to adjust the configuration of a TencentDB for MongoDB instance.
POST / HTTP/1.1
Host: mongodb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyDBInstanceSpec
<Common request parameters>
{
"InstanceId": "cmgo-p8vn****",
"Volume": 250,
"Memory": 4
}
{
"Response": {
"RequestId": "d88095e5-50e8-4245-a0cf-993a536f9b20",
"DealId": "7142863"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InvalidParameter.PermissionDenied | The current sub-account has no permission to perform this operation. |
| InvalidParameter.ZoneClosed | Instances are not purchasable in this AZ. |
| InvalidParameterValue.InvalidTradeOperation | Billing error. Corresponding purchase/renewal/configuration change operations are not allowed for the current instance. |
| InvalidParameterValue.ModifyModeError | Memory and disk must be upgraded or degraded simultaneously. |
| InvalidParameterValue.NotFoundInstance | The instance was not found. |
| InvalidParameterValue.OplogSizeOutOfRange | The OplogSize parameter is set incorrectly and should be between 10% and 90% of the disk capacity. |
| InvalidParameterValue.SetDiskLessThanUsed | The disk size to be set cannot be less than 1.2 times the used disk capacity. |
| InvalidParameterValue.SpecNotOnSale | Incorrect purchasable specification. |
| InvalidParameterValue.StatusAbnormal | The instance is in a status where operations are not allowed. |
文档反馈