Updated on 2023-11-21 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 types of instances:

  • 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 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

instance_id

Yes

String

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.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

port

Yes

Integer

New database port number.

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 database port number of GeminiDB Redis instances ranges from 1024 to 65535, except 2180, 2887, 3887, 6377, 6378, 6380, 8018, 8079, 8091, 8479, 8484, 8999, 12017, 12333 and 50069.

Response Parameters

Status code: 202

Table 4 Response body parameters

Parameter

Type

Description

job_id

String

Task ID.

Example Requests

  • 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 Responses

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.