文档数据库服务
| Details
  • 查询API版本
    • ListApiVersion
    • ShowApiVersion
  • 引擎版本和规格
    • ListDatastoreVersions
    • ListFlavorInfos
    • ListFlavors
    • ListStorageType
  • 实例管理
    • AddReadonlyNode
    • AddShardingNode
    • AttachEip
    • AttachInternalIp
    • BatchUpgradeDatabaseVersion
    • CancelEip
    • ChangeOpsWindow
    • CheckWeakPassword
    • CreateInstance
    • CreateIp
    • DeleteInstance
    • DeleteLtsConfig
    • DeleteReadonlyNode
    • ExpandReplicasetNode
    • ListAz2Migrate
    • ListInstances
    • ListLtsConfigs
    • ListRecycleInstances
    • ListSslCertDownloadAddress
    • MigrateAz
    • ResizeInstance
    • ResizeInstanceVolume
    • RestartInstance
    • SetAutoEnlargePolicies
    • SetRecyclePolicy
    • ShowAutoEnlargePolicy
    • ShowClientNetwork
    • ShowDiskUsage
    • ShowRecyclePolicy
    • ShowReplSetName
    • ShowSecondLevelMonitoringStatus
    • ShowUpgradeDuration
    • ShrinkInstanceNodes
    • SwitchoverReplicaSet
    • SwitchSecondLevelMonitoring
    • SwitchSsl
    • UpdateClientNetwork
    • UpdateInstanceName
    • UpdateInstancePort
    • UpdateInstanceRemark
    • UpdateLtsConfig
    • UpdateReplSetName
    • UpdateSecurityGroup
    • UpgradeDatabaseVersion
  • 连接管理
    • DeleteSession
    • ListSessions
    • ShowConnectionStatistics
  • 备份与恢复
    • BatchDeleteBackup
    • CreateManualBackup
    • DeleteManualBackup
    • ListBackups
    • ListRestoreCollections
    • ListRestoreDatabases
    • ListRestoreTimes
    • RestoreInstance
    • RestoreInstanceFromCollection
    • RestoreNewInstance
    • SetBackupPolicy
    • ShowBackupDownloadLink
    • ShowBackupPolicy
    • StopBackup
  • 获取日志信息
    • DeleteAuditLog
    • DownloadErrorlog
    • DownloadSlowlog
    • ListAuditlogLinks
    • ListAuditlogs
    • ListErrorLogs
    • ListLtsErrorLogs
    • ListLtsSlowLogs
    • ListSlowLogs
    • SetAuditlogPolicy
    • ShowAuditlogPolicy
    • ShowSlowlogDesensitizationSwitch
    • SwitchSlowlogDesensitization
  • 标签管理
    • BatchTagAction
    • ListInstancesByTags
    • ListInstanceTags
    • ListProjectTags
  • 管理数据库和用户
    • CheckPassword
    • CreateDatabaseRole
    • CreateDatabaseUser
    • DeleteDatabaseRole
    • DeleteDatabaseUser
    • ListDatabaseRoles
    • ListDatabases
    • ListDatabaseUsers
    • ResetPassword
    • SetBalancerSwitch
    • SetBalancerWindow
    • ShowShardingBalancer
  • 参数配置
    • CompareConfiguration
    • CopyConfiguration
    • CreateConfiguration
    • DeleteConfiguration
    • ListAppliedInstances
    • ListConfigurations
    • ResetConfiguration
    • ShowConfigurationAppliedHistory
    • ShowConfigurationModifyHistory
    • ShowConfigurationParameter
    • ShowEntityConfiguration
    • ShowInstanceConfigurationModifyHistory
    • SwitchConfiguration
    • UpdateConfigurationParameter
    • UpdateEntityConfiguration
    • ValidateConfigurationName
  • 配额管理
    • ShowQuotas
  • 任务管理
    • ListTasks
    • ShowJobDetail
  • 数据库运维
    • CreateKillOpRule
    • DeleteKillOpRuleList
    • ShowKillOpRuleRuleList
    • SwitchInstancePrimary
    • UpdateKillOpRule
  • 定时任务
    • CancelScheduledTask
    • ListScheduledTasks

ResizeInstance

POST
https://dds.af-south-1.myhuaweicloud.com/v3/{project_id}/instances/{instance_id}/resize
Advanced
Required parameters only
Default
Encrypt sensitive parameters
*
Region
Headers
*
Authorization
Parameters
*
project_id
*
instance_id
Body
*{
*
resize
: {
*
target_type
:
*
target_id
:
*
target_ids
: [
+Add
*]
*
target_spec_code
:
*}
*
is_auto_pay
:
}
API Description

This API is used to modify the specifications of a DB instance in the same or different DB instance series.

Constraints
  • This API supports only pay-per-use DB instances.
  • If you want to change the specifications to other specifications of the same series, the new specifications cannot be the same as the original specifications.
  • Specifications can be modified only when the DB instance status is normal.
URL
POST  https://dds.af-south-1.myhuaweicloud.com/v3/{project_id}/instances/{instance_id}/resize
Request Parameters
NameTypeINMandatoryDescription
x-auth-token
stringheader Yes

Specifies the user token obtained from the IAM service.

instance_id
stringpath Yes

Specifies the instance ID, which can be obtained by calling the API for querying instances and details. If you do not have an instance, you can call the API used for creating an instance.

project_id
stringpath Yes

Specifies the project ID of a tenant in a region.

Body Parameters
NameTypeMandatoryDescription
resize
ResizeInstanceOption object Yes

Specifies the specification information.

is_auto_pay
boolean No

Whether the order is automatically paid from your account when you change the class of a yearly/monthly DB instance. This parameter does not affect the payment mode of automatic renewal.

  • true: indicates that the order is automatically paid from the account.
  • false: indicates that the order is manually paid from the account. The default value is false.
Parameter:
resize
NameTypeMandatoryDescription
target_type
string No

Specifies the object type:

  • This parameter is mandatory for a cluster instance. To change the specifications of a mongos node, set this parameter to mongos. To change the specifications of a single shard or multiple shards in batches, set this parameter to shard. To change the specifications of a config node, set this parameter to config.
  • This parameter is not specified for replica set instances. If you modify the specifications of a read replica, the value is readonly.
  • This parameter is not specified for single node instances.
target_id
string No

The ID of the node or instance whose specifications are to be modified. You can obtain the ID by calling the API used for querying instances. If you do not have an instance, you can call the API used for creating an instance.

  • For a cluster instance, when you change the specifications of a mongos node, the value is the mongos node ID. When you change the specifications of a single shard group, the value is the shard group ID. When you change the specifications of multiple shard groups in batches, this parameter is not specified. When you change the specifications of a config group, the value is the config group ID.
  • For a replica set instance, the value is the DB instance ID. If you modify the specifications of a read replica, the value is the read replica ID.
  • For a single node instance, the value is the DB instance ID.
target_ids
Array of strings No

The IDs of the node or instance whose specifications are to be modified. You can obtain the IDs by calling the API used for querying instances. If you do not have an instance, you can call the API used for creating an instance.

  • For a cluster instance, the parameter is not specified when you change the specifications of a mongos node, a single shard group or a config group. When you change the specifications of multiple shard groups in batches, the value is the shard group IDs.
  • This parameter is not specified for replica set instances.
  • This parameter is not specified for single node instances.
target_spec_code
string Yes

The resource specification code of the new specification.

Response Parameters
Status code: 200

Success.

NameTypeDescription
job_id
string

Indicates the task ID.

order_id
string

订单ID,仅变更包年包月实例的规格时返回该参数。

Status code: default

Client or server error.

NameTypeDescription
error_code
string

Specifies the error returned when a task submission exception occurs.

error_msg
string

Specifies the description of the error returned when a task submission exception occurs.

Example Request
Example 1

Modify the mongos specifications in a cluster instance.

"POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/054e292c9880d4992f02c0196d3eain02/resize"
{ "resize": { "target_type": "mongos", "target_id": "a742c13a284949adad177672e8a0f01cno02", "target_spec_code": "dds.mongodb.c6.large.4.mongos" } }
Example 2

Modify the shard specifications in a cluster instance.

"POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/054e292c9880d4992f02c0196d3eain02/resize"
{ "resize": { "target_type": "shard", "target_id": "aeeb40a704904977ad78993d138ec942gr02", "target_spec_code": "dds.mongodb.c6.large.4.shard" } }
Example 3

Modify specifications of a replica set or a single node instance.

"POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/054e292c9880d4992f02c0196d3eain02/resize"
{ "resize": { "target_id": "aeeb40a704904977ad78993d138ec942in02", "target_spec_code": "dds.mongodb.c6.medium.4.repset" } }
Example Response
Status code: 200

Success.

Example 1
{
"job_id": "04efe8e2-9255-44ae-a98b-d87cae411890"
}
SDK
Click 文档数据库服务 (DDS) SDK to download the SDK in your programming language or view the SDK documentation. To learn how to install an SDK and perform authentication, read Usage.
Error Code

Outline

API Description
Constraints
URL
Request Parameters
Response Parameters
Example Request
Example Response
SDK
Error Code