edit-icon download-icon

How does MPS support multiple regions through SDK call?

Last Updated: Apr 19, 2018

Regions currently supported by MPS and the regionID check list

Region RegionID
Asia-Pacific Southeast 1 (Singapore) ap-southeast-1
Central Europe 1 (Frankfurt) eu-central-1
China North 2 cn-beijing
China East 2 cn-shanghai
China South 1 cn-shenzhen
Asia-Pacific Northeast 1 ap-northeast-1
Hong Kong cn-hongkong
US West 1 (Silicon Valley) us-west-1
China East 1 cn-hangzhou

How JAVA SDK calls the MPS interface which is not in the Hangzhou region?

For example, add Beijing in the supported region (Add other regions in the similar way, and change cn-beijing to the regionID of the corresponding regions), see JAVA SDK > Quick start. Note that the core dependency is updated to the latest version.

  1. import com.aliyuncs.profile.DefaultProfile;
  2. import com.aliyuncs.DefaultAcsClient;
  3. DefaultProfile.addEndpoint("cn-beijing","cn-beijing","Mts","mts.cn-beijing.aliyuncs.com");
  4. DefaultProfile profile = DefaultProfile.getProfile("cn-beijing", accessKeyId, accessKeySecret);
  5. DefaultAcsClient client = new DefaultAcsClient(profile);

How PHP SDK calls the MPS interface which is not in the Hangzhou region?

For example, add Beijing in the supported region (Add other regions in the similar way, and change cn-beijing to the regionID of the corresponding regions), see PHP SDK > Quick start. Note that the core dependency is updated to the latest version.

Edit aliyun-php-sdk-core/Regions/endpoints.xml file, and add the Beijing region before ( ) in the last row (Add other regions in the similar way):

  1. <Endpoint name="mts-cn-beijing">
  2. <RegionIds>
  3. <RegionId>mts-cn-beijing</RegionId>
  4. </RegionIds>
  5. <Products>
  6. <Product>
  7. <ProductName>Mts</ProductName>
  8. <DomainName>mts.cn-beijing.aliyuncs.com</DomainName>
  9. </Product>
  10. </Products>
  11. </Endpoint>
  12. include_once 'aliyun-php-sdk-core/Config.php';
  13. $profile = DefaultProfile::getProfile('mts-cn-beijing',
  14. $access_key_id,
  15. $access_key_secret);
  16. $client = new DefaultAcsClient($profile);

How Python SDK calls the MPS interface which is not in the Hangzhou region?

For example, add Beijing in the supported region (Add other regions in the similar way, and change cn-beijing to the regionID of the corresponding regions), see Python SDK > Quick start. Note that the core dependency is updated to the latest version.

Edit aliyunsdkcore/endpoints.xml file under the site-packages directory of python, and add the Beijing region before ( ) in the last row (Add other regions in the similar way):

  1. <Endpoint name="mts-cn-beijing">
  2. <RegionIds>
  3. <RegionId>mts-cn-beijing</RegionId>
  4. </RegionIds>
  5. <Products>
  6. <Product>
  7. <ProductName>Mts</ProductName>
  8. <DomainName>mts.cn-beijing.aliyuncs.com</DomainName>
  9. </Product>
  10. </Products>
  11. </Endpoint>
  12. from aliyunsdkcore import client
  13. clt = client.AcsClient(access_key_id,
  14. access_key_secret,
  15. 'mts-cn-beijing')
  16. search_media_workflow(clt)
Thank you! We've received your feedback.