Help Center/ Document Database Service/ API Reference/ APIs V3.0 (Recommended)/ DB Instance Management/ Upgrading the Minor Versions of DB Instances in Batches
Updated on 2024-12-02 GMT+08:00

Upgrading the Minor Versions of DB Instances in Batches

Function

This API is used to upgrade the minor versions of DB instances in batches.

Constraints

  • Upgrade is triggered immediately, so you need to upgrade the minor version during off-peak hours.
  • Only Fastest completion can be selected for Method.

URI

POST /v3/{project_id}/instances/db-upgrade
Table 1 Path parameters

Name

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

Request Parameters

Table 2 Request header parameters

Name

Mandatory

Type

Description

X-Auth-Token

Yes

String

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

Table 3 Request body parameters

Name

Mandatory

Type

Description

instance_ids

Yes

Array of strings

IDs of instances whose minor versions need to be upgraded.

A maximum of 10 instance IDs can be transferred at a time.

Response Parameters

Status code: 202

Table 4 Response body parameters

Name

Type

Description

upgrade_results

Array of objects

Batch upgrade result. For details, see Table 5.

Table 5 UpgradeResult

Name

Type

Description

job_id

String

Task ID. This field is returned only when a minor version upgrade task is successfully submitted.

instance_id

String

DB instance ID.

error_code

String

Error code. This field is returned only when a minor version upgrade task fails to be submitted.

error_message

String

Failure cause. This field is returned only when a minor version upgrade task fails to be submitted.

Status code: 400

Table 6 Response body parameters

Name

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Name

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Upgrading the minor versions of DB instances in batches

POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/db-upgrade

{ 
  "instance_ids" : [ "046287aae57843b1a7bc61b7a8812f41in02", "3d1e04f49efa473a8c7eaf07ed7ff870in02" ] 
}

Example Response

Status code: 202

Accepted.

{ 
  "upgrade_results" : [ { 
    "instance_id" : "046287aae57843b1a7bc61b7a8812f41in02", 
    "job_id" : "e4616470-733d-41de-a9b0-a260709293d3" 
  }, { 
    "instance_id" : "3d1e04f49efa473a8c7eaf07ed7ff870in02", 
    "error_code" : "DBS.200011", 
    "error_message" : "The status of DB instance does not allow the operation." 
  } ] 
}

Status Code

Status Code

Description

202

Accepted.

400

Client error.

500

Server error.

Error Code

For details, see Error Code.