调用CreateDBProxyEndpointAddress接口创建RDS实例数据库代理的连接地址。
RDS MySQL开启独享代理或RDS PostgreSQL开启数据库代理后默认有一个代理连接地址,您可以通过本接口创建其他不同网络类型的代理连接地址。
- RDS MySQL本地盘实例支持内网(专有网络)、内网(经典网络)和外网三种网络类型。
- 云盘实例支持内网(专有网络)和外网两种网络类型。为确保客户端与RDS实例的连通性,如果开通外网类型连接地址,需要在主实例和只读实例设置白名单,允许客户端访问。可调用ModifySecurityIps接口设置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateDBProxyEndpointAddress |
系统规定参数。取值:CreateDBProxyEndpointAddress。 |
RegionId | String | 是 | cn-hangzhou |
地域ID,可以调用DescribeRegions接口查看地域ID。 |
DBInstanceId | String | 是 | rm-t4n3axxxxx |
RDS实例ID。可调用DescribeDBInstances接口查询。 |
DBProxyEndpointId | String | 是 | ta9um4xxxxx |
独享代理连接地址ID。可以调用DescribeDBProxyEndpoint接口查询。 |
ConnectionStringPrefix | String | 是 | test1234 |
新的独享代理连接地址的前缀。自定义。 |
DBProxyNewConnectStringPort | String | 否 | 3306 |
新的独享代理连接地址的端口,默认值:
|
DBProxyConnectStringNetType | String | 是 | Public |
新的独享代理连接地址的网络类型,取值:
默认值:Classic。 |
VPCId | String | 否 | vpc-bpxxxxxx |
新的独享代理连接地址的VPC ID。可调用DescribeDBInstanceAttribute接口查询。 说明 当DBProxyConnectStringNetType取值为VPC时, 必须传入此参数。
|
VSwitchId | String | 否 | vsw-bpxxxxxx |
新的独享代理连接地址的虚拟交换机ID。可调用DescribeDBInstanceAttribute接口查询。 说明 当DBProxyConnectStringNetType取值为VPC时, 必须传入此参数。
|
DBProxyEngineType | String | 否 | normal |
内部参数,无需传入值。 |
ResourceGroupId | String | 否 | rg-acfmy***** |
资源组ID。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | F2911788-25E8-42E5-A3A3-1B38D263F01E |
请求ID。 |
示例
请求示例
http(s)://rds.aliyuncs.com/?Action=CreateDBProxyEndpointAddress
&RegionId=cn-hangzhou
&DBInstanceId=m-t4n3axxxxx
&DBProxyEndpointId=ta9um4xxxxx
&DBProxyConnectStringNetType=Public
&ConnectionStringPrefix=test1234
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateDBProxyEndpointAddressResponse>
<RequestId>F2911788-25E8-42E5-A3A3-1B38D263F01E</RequestId>
</CreateDBProxyEndpointAddressResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "F2911788-25E8-42E5-A3A3-1B38D263F01E"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidPort.Malformed | Specified port is not valid. | 指定的端口无效。 |
400 | NetTypeExists | Specified net type already existed. | 网络类型切换失败,当前网络类型已经存在。 |
400 | IncorrectDBInstanceNetType | Current DB instance net type does not support this operation. | 操作失败,实例网络类型不支持。 |
400 | InvalidConnectionString.Duplicate | Specified connection string already exists in the Aliyun RDS. | 链接地址名重复,请重新设置连接字符串。 |
400 | InvalidVpcInstanceId | Specified vpc instance id is not valid. | 操作失败,当前VPC实例ID无效。 |
400 | InvalidDBInstanceName | Specified parameter DBInstanceName is not valid. | 指定的实例名称(DBInstanceName)无效,请检查参数值是否为null或空字符串。 |
403 | IncorrectDBInstanceType | Current DB instance type does not support this operation. | 操作失败,该实例状态下不支持此操作。 |
403 | IncorrectDBInstanceState | Current DB instance state does not support this operation. | 操作失败,该实例状态下不支持此操作。 |
404 | Endpoint.NotFound | Specified endpoint is not found. | 未找到指定独享代理连接地址的端口。 |
404 | InvalidVSwitchId.NotFound | The specified VSwitch is invalid. | 操作失败,无效的VSwitch,请检查该参数的正确性。 |
404 | Maxscale.NotFound | The related maxscale instance is not found. | 操作失败,未找到关联的maxscale实例。 |
访问错误中心查看更多错误码。