Help Center> GaussDB> API Reference> APIs (Recommended)> Version Upgrade> Querying Upgrade Types and Versions That Instances Can Be Upgraded to in Batches
Updated on 2024-07-12 GMT+08:00

Querying Upgrade Types and Versions That Instances Can Be Upgraded to in Batches

Function

This API is used to query the available upgrade types and versions that instances can be upgraded to in batches. Before calling this API:

URI

POST https://{Endpoint}/v3/{project_id}/instances/db-upgrade/candidate-versions

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

Minimum characters: 32

Maximum characters: 100

Request Parameters

Table 2 Request parameters

Parameter

Mandatory

Type

Description

instance_ids

No

Array of strings

Instance IDs for batch upgrade.

Response Parameters

Table 3 Response parameters

Parameter

Type

Description

upgrade_type_list

Array of Table 4 objects

Upgrade types.

Array length: 0 to 1000

target_version

String

Target version. The upgrade was performed without encountering null returns during the rolling upgrade process.

Minimum length: 0

Maximum characters: 1000

upgrade_candidate_versions

Array of strings

Versions that can be upgraded, including major and minor versions.

Minimum length: 0

Maximum characters: 1000

Array length: 0 to 1000

hotfix_upgrade_infos

Array of Table 6 objects

Information about hot patch versions that can be installed.

Array length: 0 to 1000

Table 4 UpgradeTypeInfo

Parameter

Type

Description

upgrade_type

String

Upgrade type. There are three upgrade types: grey (gray upgrade), inplace (in-place upgrade), and hotfix (hot patch upgrade).

Minimum length: 0

Maximum characters: 1000

Value:

  • grey
  • inplace
  • hotfix

enable

Boolean

Check if the upgrade type is available.

  • true: yes.
  • false: no.

upgrade_action_list

Array of Table 5 objects

Upgrade actions.

Array length: 0 to 1000

is_parallel_upgrade

Boolean

Whether intra-AZ parallel upgrade is supported.

  • true: The current instance is in the rolling upgrade phase of the gray upgrade. The intra-AZ parallel upgrade is supported. Once this parameter is configured, it cannot be changed later.
  • false: The current instance is being upgraded. The intra-AZ parallel upgrade is not supported. Once this parameter is configured, it cannot be changed later.
  • null: The current instance is not in the upgrade process.
Table 5 UpgradeActionInfo

Parameter

Type

Description

upgrade_action

String

Upgrade action. The value can be upgrade, upgradeAutoCommit, commit, and rollback.

Minimum length: 0

Maximum characters: 1000

Value:

  • upgrade
  • upgradeAutoCommit
  • commit
  • rollback

enable

Boolean

Check if the upgrade type is available.

  • true: yes.
  • false: no.
Table 6 HotfixInfo

Parameter

Type

Description

version

String

Hot patch version.

common_patch

String

Common or customized patch information. The value common indicates a common patch and certain indicates a customized patch.

Value:

  • common
  • certain

backup_sensitive

Boolean

Whether the patch is related to backups.

descripition

String

Description of the patch.

Example Request

Querying the upgrade types and versions that instances can be upgraded to in batches.

POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v30483b6b16e954cb88930a360d2c4e663/instances/db-upgrade/candidate-versions
{ 
  "instance_ids" : [ "cc0ae5c47bf94834bf9e44138f7f995ain14", "aa0ae5c47bf94834bf9e44138f7f995ain14" ] 
}

Example Response

Currently, only in-place upgrade is supported for batch upgrade.

{ 
  "upgrade_type_list" : [ { 
    "upgrade_type" : "inplace", 
    "enable" : true, 
    "upgrade_action_list" : [ { 
      "upgrade_action" : "upgradeAutoCommit", 
      "enable" : true 
    } ] 
  }, { 
    "upgrade_type" : "grey", 
    "enable" : false 
  } ], 
  "upgrade_candidate_versions" : [ "8.100.0", "8.101.0" ] 
}

Status Code

Error Code

For details, see Error Codes.