调用ModifyDBInstanceConnectionString接口修改实例的连接地址和端口。
目前RDS提供内外网两种连接地址,同时也支持混访模式下的专有网络和经典网络地址并存。
说明
- 仅支持修改连接地址的前缀。
- 不支持修改读写分离地址。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ModifyDBInstanceConnectionString |
系统规定参数。取值:ModifyDBInstanceConnectionString。 |
DBInstanceId | String | 是 | rm-uf6wjk5**** |
实例ID。 |
CurrentConnectionString | String | 是 | rm-uf6wjk5x****.mysql.rds.aliyuncs.com |
实例当前的某个连接地址,可以是内外网连接地址,或者混访模式下的经典网络连接地址。 说明 不支持修改读写分离连接地址。
|
ConnectionStringPrefix | String | 是 | rm-**** |
目标连接地址的前缀,即只能修改CurrentConnectionString参数的前缀部分。 说明 长度8~64,不能包含汉字和非法字符(~!#%^&*=+\|{};:'",<>/?),建议由字母、数字、短横线(-)组成。
|
Port | String | 是 | 3306 |
目标端口。 |
BabelfishPort | String | 否 | 1433 |
Babelfish for RDS PostgreSQL TDS端口号。 说明 该参数仅适用于RDS PostgreSQL实例,Babelfish for RDS PostgreSQL的更多介绍,请参见Babelfish简介。
|
GeneralGroupName | String | 否 | rgc-bp1tkv8**** |
专属集群MySQL通用版实例所属的组名。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 65BDA532-28AF-4122-AA39-B382721EEE64 |
请求ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=ModifyDBInstanceConnectionString
&DBInstanceId=rm-uf6wjk5****
&CurrentConnectionString=rm-uf6wjk5x****.mysql.rds.aliyuncs.com
&ConnectionStringPrefix=rm-****
&Port=3306
&GeneralGroupName=rgc-bp1tkv8****
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyDBInstanceConnectionStringResponse>
<RequestId>65BDA532-28AF-4122-AA39-B382721EEE64</RequestId>
</ModifyDBInstanceConnectionStringResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : " 65BDA532-28AF-4122-AA39-B382721EEE64"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | DnsConflict | Dns is conflict with other custins. | DNS与其他客户端冲突。 |
400 | InvalidConnectionString.Malformed | The specified parameter "ConnectionStringPrefix" is not valid. | 连接地址格式不正确。请重新设置。正确格式:长度8~64,不能包含汉字和非法字符(~!#%^&*=+\|{};:'",<>/?),建议由字母、数字、短横线(-)组成。 |
400 | OperationDenied.DBInstanceStatus | The operation is not permitted due to status of instance. | 操作失败,当前实例状态不支持此操作。 |
400 | InvalidConnectionString.NotFound | The specified connection string or network type is not found. | 连接串不存在。请检查连接串是否正确。 |
400 | InvalidConnectionString.Duplicate | The specified connection string needs to be same as current network type. | 该连接字符串或端口需要与当前网络类型相同,请重新设置。 |
400 | MissingConnectionString | The request is missing a ConnectionString parameter. | 操作失败,请求缺少要延期的经典网络连接地址(ConnectionString)。 |
400 | OtherEndpoint.Exist | Other endpoint exist. | 外网连接地址的前缀已存在 |
访问错误中心查看更多错误码。