Updated on 2025-02-28 GMT+08:00

Changing a Database Port

Function

This API is used to change the database port of an instance.

Constraints

This API supports the following instance types:

  • GeminiDB Cassandra
  • GeminiDB Mongo
  • GeminiDB Redis

This operation is not supported for frozen or abnormal instances.

GeminiDB Redis and GeminiDB Cassandra do not allow you to change the database port of a DR instance. To change the database port, you have to change the port of the primary instance first. The load balancer port of a GeminiDB Redis instance is changed accordingly.

The instance must be restarted to make changes take effect. Exercise caution when modifying the database port.

URI

PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/port

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Explanation:

Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID.

Constraints:

N/A

Values:

N/A

Default value:

N/A

instance_id

Yes

String

Explanation:

Instance ID, which can be obtained by calling the API described in Querying Instances and Details. If there are no instances available, call the API described in Creating an Instance to create one.

Constraints:

N/A

Values:

N/A

Default value:

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

User token

You can obtain the token by calling the IAM API by following Obtaining a User Token Through Password Authentication.

Constraints:

N/A

Values:

N/A

Default value:

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

port

Yes

Integer

Explanation:

New database port number.

Constraints:

N/A

Values:

The database port number of GeminiDB Mongo replica sets 4.0 ranges from 2100 to 9500, except 8636, 8637, and 8638.

The database port number of GeminiDB Cassandra instances ranges from 2100 to 9500, except 7000, 7001, 7199, 8636, 8479, 8484, 8999, 8018, 2180, 2887, 3887, 8079, 8091, and 8092.

The port number of the GeminiDB Redis instance ranges from 1024 to 65535, except 2180, 2887, 3887, 6377, 6378, 6380, 8018, 8079, 8091, 8479, 8484, 8999, 9864, 9866, 9867, 12017, 12333 and 50069.

Default value:

N/A

Response Parameters

Status code: 202

Table 4 Response body parameters

Parameter

Type

Description

job_id

String

Explanation:

Task ID

Values:

N/A

Example Request

  • URI example
    PUT https://gaussdb-nosql.ap-southeast-1.myhuaweicloud.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/c865f921f3dd45198f209a607533a779in06/port 
  • Changing the database port number to 8888
    { 
      "port" : 8888 
    }

Example Response

Status code: 202

Accepted

{ 
  "job_id" : "89638f5e-0780-497c-b3c0-4d0968383e19" 
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.