Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Modifying DB Instance Specifications

Updated on 2024-12-26 GMT+08:00

API Description

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

NOTICE:

Services will be interrupted for 5 to 10 minutes when you modify DB instance specifications. Exercise caution when performing this operation.

Change Rules

Considering the stability and performance of DDS DB instances, you can change the DB instance class according to the rules listed in Table 1. Exercise caution when performing this operation.

Table 1 Change rules

Original Specification

Target Specification

Supported

General-purpose

General-purpose

Enhanced

×

Enhanced II

Enhanced

General-purpose

Enhanced

×

Enhanced II

Enhanced II

General-purpose

×

Enhanced

×

Enhanced II

NOTE:

√ indicates that an item is supported, and × indicates that an item is not supported.

Restrictions

  • This API supports both yearly/monthly and 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.
  • The specifications of read replicas in a cluster instance cannot be changed.

URI

  • URI format

    POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/resize

  • URI example

    https://dds.ap-southeast-1.myhuaweicloud.com/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/9136fd2a9fcd405ea4674276ce36dae8in02/resize

Table 2 Request parameters

Name

Type

IN

Mandatory

Description

X-Auth-Token

string

header

Yes

User token obtained from IAM. For details, see Authentication.

project_id

string

path

Yes

Project ID of a tenant in a region. To obtain the project ID, see Obtaining a Project ID.

instance_id

string

path

Yes

Instance ID, which can be obtained by calling the API described in Querying Instances and Details. If you do not have an instance, call the API described in Creating a DB Instance to create one.

Requests

  • Parameter description
    Table 3 Parameter description

    Name

    Type

    Mandatory

    Description

    resize

    Object

    Yes

    The specification information. For more information, see Table 4.

    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.

    • This parameter is invalid when the instance class is scaled down.
    • When the instance class is scaled up, this parameter can be set to:
      • 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.
    Table 4 Data structure description of the resize field

    Name

    Type

    Mandatory

    Description

    target_type

    String

    No

    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.
    • Enumerated values:
      • mongos
      • shard
      • config
      • readonly

    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 a DB 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

    IDs of the node groups whose specifications are to be modified, 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 a DB instance.

    • For a cluster instance, this parameter is not transferred when the specifications of a mongos node are to be changed, when the specifications of a single shard group are to be changed, or when the specifications of a config group are to be changed. When you change the specifications of multiple shard groups in batches, the value is the IDs of the shard groups. A maximum of 16 shard groups can be selected in batches.
    • 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. For details about how to obtain the value, see the response values of flavors.spec_code in Querying Database Specifications.

Example Request

  • Modifying the mongos specifications in a cluster instance
    {
      "resize": {
        "target_type": "mongos",
        "target_id": "a742c13a284949adad177672e8a0f01cno02",
        "target_spec_code": "dds.mongodb.c6.large.4.mongos"
      }
    }
  • Modifying the shard specifications in a cluster instance
    {
      "resize": {
        "target_type": "shard",
        "target_id": "aeeb40a704904977ad78993d138ec942gr02",
        "target_spec_code": "dds.momgodb.c6.large.4.shard"
      }
    }
  • Modifying the config specifications in a cluster instance
    {
      "resize": {
        "target_type": "config",
        "target_id": "10a1c330537b42c1a9b3f7a5ebcda35egr02",
        "target_spec_code": "dds.momgodb.c6.xlarge.2.config"
      }
    }
  • Modifying specifications of a replica set or a single node instance
    {
      "resize": {
        "target_id": "aeeb40a704904977ad78993d138ec942in02",
        "target_spec_code": "dds.mongodb.c6.medium.4.repset"
      }
    }
  • Modifying the specifications of multiple shard groups in a cluster instance in batches
    POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/054e292c9880d4992f02c0196d3eain02/resize 
     { 
       "resize" : { 
         "target_type" : "shard", 
         "target_ids" : [ "aeeb40a704904977ad78993d138ec942gr02", "5cbbb49b8f88424590a8a7b744b2dcf0gr02", "0407115681454784b1446c15590e42f0gr02" ], 
         "target_spec_code" : "dds.mongodb.c6.large.4.shard" 
       } 
     }

Responses

  • Parameter description
    Table 5 Parameter description

    Name

    Type

    Mandatory

    Description

    job_id

    String

    Yes

    The task ID.

    order_id

    String

    No

    The order ID. This parameter is returned only when the specifications of a yearly/monthly DB instance are changed.

  • Response example
    {
        "job_id": "3711e2ad-5787-49bc-a47f-3f0b066af9f5"
    }

SDK

Click Document Database Service DDS SDK to download the SDK or view the SDK document. To learn how to install and authenticate an SDK, read the Usage section.

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback