You cannot call API operations on VPC-type elastic container instances that do not have public IP addresses. This topic describes how to call API operations on VPC-type elastic container instances over the Alibaba Cloud internal network.

Background information

The default access endpoint provided by an elastic container instance is a public IP address. When your elastic container instance does not have a public IP address or assigned public bandwidth, you can use tools such as Alibaba Cloud CLI or SDK to make API requests. In this case, you can configure the internal endpoint of the SDK on an elastic container instance to call API operations over the Alibaba Cloud internal network. Take note of the following items:
  • Supported SDK core libraries are version 4.5.3 and later.
  • You can use only the access endpoint of the region where the elastic container instance resides to perform operations on resources within that region. Cross-region operations are not supported.

Configure SDKs to call API operations over the internal network

The following table describes the endpoints over which you can use SDKs to call API operations. Make sure that you use an endpoint listed in the table.

Region Region ID Internet endpoint
China (Hangzhou) cn-hangzhou eci-vpc.cn-hangzhou.aliyuncs.com
China (Shanghai) cn-shanghai eci-vpc.cn-shanghai.aliyuncs.com
China (Qingdao) cn-qingdao eci-vpc.cn-qingdao.aliyuncs.com
China (Beijing) cn-beijing eci-vpc.cn-beijing.aliyuncs.com
China (Zhangjiakou) cn-zhangjiakou eci-vpc.cn-zhangjiakou.aliyuncs.com
China (Hohhot) cn-huhehaote eci-vpc.cn-huhehaote.aliyuncs.com
China (Shenzhen) cn-shenzhen eci-vpc.cn-shenzhen.aliyuncs.com
China (Heyuan) cn-heyuan eci-vpc.cn-heyuan.aliyuncs.com
China (Guangzhou) cn-guangzhou eci-vpc.cn-guangzhou.aliyuncs.com
China (Chengdu) cn-chengdu eci-vpc.cn-chengdu.aliyuncs.com
Hong Kong cn-hongkong eci-vpc.cn-hongkong.aliyuncs.com
Singapore ap-southeast-1 eci-vpc.ap-southeast-1.aliyuncs.com
Australia (Sydney) ap-southeast-2 eci-vpc.ap-southeast-2.aliyuncs.com
Malaysia (Kuala Lumpur) ap-southeast-3 eci-vpc.ap-southeast-3.aliyuncs.com
Indonesia (Jakarta) ap-southeast-5 eci-vpc.ap-southeast-5.aliyuncs.com
India (Mumbai) ap-south-1 eci-vpc.ap-south-1.aliyuncs.com
Japan (Tokyo) ap-northeast-1 eci-vpc.ap-northeast-1.aliyuncs.com
US (Silicon Valley) us-west-1 eci-vpc.us-west-1.aliyuncs.com
US (Virginia) us-east-1 eci-vpc.us-east-1.aliyuncs.com
Germany (Frankfurt) eu-central-1 eci-vpc.eu-central-1.aliyuncs.com
UK (London) eu-west-1 eci-vpc.eu-west-1.aliyuncs.com
When you use SDKs, you can configure endpoints to take effect globally or only for current requests. This allows you to call API operations over the internal network. Sample code in Java:
DefaultProfile profile = DefaultProfile.getProfile("<RegionId>", "<AccessKeyId>", "<AccessKeySecret>");
IAcsClient client = new DefaultAcsClient(profile);

// Make the configurations take effect globally. <product> specifies the service name. Set the value to Eci for Elastic Container Service. 
DefaultProfile.addEndpoint("<RegionId>", "<product>", "<Endpoint>");

// Make the configurations take effect only for the request. For example, when you call the DescribeRegions operation, you can make the following configurations: 
DescribeRegionsRequest regionsRequest = new DescribeRegionsRequest();
// If you have set the productNetwork parameter, you do not need to set the SysEndpoint parameter. 
regionsRequest.setSysEndpoint("<Endpoint>");
// Configure the network. Valid values of productNetwork: vpc and public. vpc indicates that API operations are called over the internal network. public indicates that API operations are called over the Internet. Default value: public. 
regionsRequest.productNetwork = "vpc";
DescribeRegionsResponse regionsResponse = client.getAcsResponse(regionsRequest);