If an ApsaraDB RDS instance resides in a virtual private cloud (VPC) and does not provide a public endpoint, you cannot call API operations on the RDS instance over the Internet. This topic describes how to call API operations on this type of RDS instance over an internal network of Alibaba Cloud.

Background information

ApsaraDB RDS provides public endpoints to allow access over the Internet. If you have not applied for a public endpoint for your RDS instance, you cannot call API operations over the Internet even if you use tools such as Alibaba Cloud CLI and SDKs. In this case, you can call API operations over an internal network of Alibaba Cloud by using one of the following methods:
  • SDK: Use Alibaba Cloud SDK for Java core library v4.5.3 or later.
  • CLI: Use Alibaba Cloud CLI and enter the endpoint of the region to which your RDS instance belongs.
Note If you use the preceding methods, make sure that your RDS instance resides in a VPC and you enter the endpoint of the region to which your RDS instance belongs. Then, you can call API operations on the resources from the region of your RDS instance. You cannot call API operations on the resources from other regions.
The following table describes the endpoints that are available for you to call API operations over an internal network. You must use an endpoint described in the following table.
Alibaba Cloud region Region ID Endpoint
China (Hangzhou) cn-hangzhou rds-vpc.cn-hangzhou.aliyuncs.com
China (Shanghai) cn-shanghai rds-vpc.cn-shanghai.aliyuncs.com
China (Beijing) cn-beijing rds-vpc.cn-beijing.aliyuncs.com
China (Zhangjiakou) cn-zhangjiakou rds-vpc.cn-zhangjiakou.aliyuncs.com
China (Hohhot) cn-huhehaote rds-vpc.cn-huhehaote.aliyuncs.com
China (Shenzhen) cn-shenzhen rds-vpc.cn-shenzhen.aliyuncs.com
China (Chengdu) cn-chengdu rds-vpc.cn-chengdu.aliyuncs.com
China (Hong Kong) cn-hongkong rds-vpc.cn-hongkong.aliyuncs.com
China East 1 Finance cn-hangzhou-finance rds-vpc.cn-hangzhou-finance.aliyuncs.com
Singapore (Singapore) ap-southeast-1 rds-vpc.ap-southeast-1.aliyuncs.com
Australia (Sydney) ap-southeast-2 rds-vpc.ap-southeast-2.aliyuncs.com
Malaysia (Kuala Lumpur) ap-southeast-3 rds-vpc.ap-southeast-3.aliyuncs.com
Indonesia (Jakarta) ap-southeast-5 rds-vpc.ap-southeast-5.aliyuncs.com
Japan (Tokyo) ap-northeast-1 rds-vpc.ap-northeast-1.aliyuncs.com
Germany (Frankfurt) eu-central-1 rds-vpc.eu-central-1.aliyuncs.com
UK (London) eu-west-1 rds-vpc.eu-west-1.aliyuncs.com
India (Mumbai) ap-south-1 rds-vpc.ap-south-1.aliyuncs.com
UAE (Dubai) me-east-1 rds-vpc.me-east-1.aliyuncs.com

Method 1: (Recommended) Use Alibaba Cloud SDK to call API operations over an internal network

If you want to use Alibaba Cloud SDK to call API operations over an internal network, you need only to perform simple configurations. The following code shows how to use Alibaba Cloud SDK for Java to call an API operation over an internal network:
DefaultProfile profile = DefaultProfile.getProfile("<RegionId>", "<AccessKeyId>", "<AccessKeySecret>");
IAcsClient client = new DefaultAcsClient(profile);

// Configure global settings. Specify <product> as the product name. For this example, enter Rds. 
DefaultProfile.addEndpoint("<RegionId>", "<product>", "<Endpoint>");

// Configure settings only for the request. For this example, call the DescribeRegions operation. 
DescribeRegionsRequest regionsRequest = new DescribeRegionsRequest();
// If you want to set the productNetwork parameter, you do not need to set the SysEndpoint parameter. 
regionsRequest.setSysEndpoint("<Endpoint>");
// Configure the network. Valid values of the productNetwork parameter: vpc and public. 
// If you want to call the operation over an internal network, set the parameter to vpc. If you want to call the operation over the Internet, set the parameter to public. Default value: public. 
regionsRequest.productNetwork = "vpc";
DescribeRegionsResponse regionsResponse = client.getAcsResponse(regionsRequest);

Method 2: Use Alibaba Cloud CLI to call API operations over an internal network

The following command shows how to call the DescribeRegions operation over an internal network:
aliyun rds DescribeRegions --endpoint rds-vpc.cn-hangzhou.aliyuncs.com