L'API Image Search utilise des requêtes HTTP/HTTPS basées sur des URL, avec des paramètres inclus directement dans l'URL. Cette rubrique répertorie les endpoints, les adresses VPC et la structure des requêtes pour chaque région prise en charge.
Endpoints
|
Région |
Région |
Endpoint |
Adresse réseau VPC |
|
Chine (Hangzhou) |
cn-hangzhou |
imagesearch.cn-hangzhou.aliyuncs.com |
imagesearch-vpc.cn-hangzhou.aliyuncs.com |
|
Chine (Shanghai) |
cn-shanghai |
imagesearch.cn-shanghai.aliyuncs.com |
imagesearch-vpc.cn-shanghai.aliyuncs.com |
|
Chine (Pékin) |
cn-beijing |
imagesearch.cn-beijing.aliyuncs.com |
imagesearch-vpc.cn-beijing.aliyuncs.com |
|
Chine (Shenzhen) |
cn-shenzhen |
imagesearch.cn-shenzhen.aliyuncs.com |
imagesearch-vpc.cn-shenzhen.aliyuncs.com |
|
Asie-Pacifique SE 1 (Singapour) |
ap-southeast-1 |
imagesearch.ap-southeast-1.aliyuncs.com |
imagesearch-vpc.ap-southeast-1.aliyuncs.com |
|
Chine (Hong Kong) |
cn-hongkong |
imagesearch.cn-hongkong.aliyuncs.com |
imagesearch-vpc.cn-hongkong.aliyuncs.com |
|
Asie-Pacifique NE 1 (Tokyo) |
ap-northeast-1 |
imagesearch.ap-northeast-1.aliyuncs.com |
imagesearch-vpc.ap-northeast-1.aliyuncs.com |
|
Europe centrale 1 (Francfort) |
eu-central-1 |
imagesearch.eu-central-1.aliyuncs.com |
imagesearch-vpc.eu-central-1.aliyuncs.com |
Les comptes du site Alibaba Cloud Chine ne peuvent sélectionner que les régions suivantes dans la console : China (Shanghai), China (Hangzhou), China (Shenzhen) et China (Beijing).
Accès au réseau VPC : Image Search est accessible uniquement depuis des instances ECS ou d'autres ressources situées dans la même région. Par exemple, une instance Image Search en Chine (Hangzhou) nécessite que votre instance ECS ou vos autres ressources se trouvent également en Chine (Hangzhou). Les appels VPC interrégion échouent.
Endpoint VPC : le trafic transitant par un endpoint VPC ne consomme pas le trafic Internet de votre instance ECS, ce qui réduit les coûts liés à la bande passante publique. Consultez l'exemple d'utilisation du VPC.
Liste blanche de domaines
Ajoutez les noms de domaine suivants à votre liste blanche d'exploitation et de maintenance (O&M) en fonction de votre région de service.
|
Région |
Région |
Noms de domaine |
|
Chine (Hangzhou) |
cn-hangzhou |
openplatform.aliyuncs.com hangzhou-imagesearch-transfer-station.oss-cn-hangzhou.aliyuncs.com imagesearch.cn-hangzhou.aliyuncs.com |
|
Chine (Shanghai) |
cn-shanghai |
openplatform.aliyuncs.com sh-imagesearch-transfer-station.oss-cn-shanghai.aliyuncs.com imagesearch.cn-shanghai.aliyuncs.com |
|
Chine (Pékin) |
cn-beijing |
openplatform.aliyuncs.com bj-imagesearch-transfer-station.oss-cn-beijing.aliyuncs.com imagesearch.cn-beijing.aliyuncs.com |
|
Chine (Shenzhen) |
cn-shenzhen |
openplatform.aliyuncs.com sz-imagesearch-transfer-station.oss-cn-shenzhen.aliyuncs.com imagesearch.cn-shenzhen.aliyuncs.com |
|
Asie-Pacifique SE 1 (Singapour) |
ap-southeast-1 |
openplatform.aliyuncs.com sg-imagesearch-transfer-station-new.oss-ap-southeast-1.aliyuncs.com imagesearch.ap-southeast-1.aliyuncs.com |
|
Chine (Hong Kong) |
cn-hongkong |
openplatform.aliyuncs.com hk-imagesearch-transfer-station.oss-cn-hongkong.aliyuncs.com imagesearch.cn-hongkong.aliyuncs.com |
|
Asie-Pacifique NE 1 (Tokyo) |
ap-northeast-1 |
openplatform.aliyuncs.com jp-imagesearch-transfer-station.oss-ap-northeast-1.aliyuncs.com imagesearch.ap-northeast-1.aliyuncs.com |
|
Europe centrale 1 (Francfort) |
eu-central-1 |
openplatform.aliyuncs.com de-imagesearch-transfer-station.oss-eu-central-1.aliyuncs.com imagesearch.eu-central-1.aliyuncs.com |
Protocoles de communication
Les protocoles HTTP et HTTPS sont pris en charge. Nous recommandons l'utilisation du protocole HTTPS pour des raisons de sécurité.
Méthodes de requête
Toutes les requêtes utilisent la méthode HTTP POST.
Paramètres de requête
Chaque requête inclut des paramètres d'en-tête communs ainsi que des paramètres spécifiques à l'opération.
Encodage des caractères
Toutes les requêtes et réponses utilisent l'encodage UTF-8.
Exemple d'utilisation du VPC
SDK v3 :
# Use the VPC domain name
authConfig.endpoint = "imagesearch-vpc.cn-shanghai.aliyuncs.com";
# Add a new configuration
authConfig.endpointType = "internal";
Pour un exemple avec le SDK Java, reportez-vous à l'opération Add.
Accès au réseau VPC : Image Search est accessible uniquement depuis des instances ECS ou d'autres ressources situées dans la même région. Par exemple, une instance Image Search en Chine (Hangzhou) nécessite que votre instance ECS se trouve également en Chine (Hangzhou). Les appels VPC interrégion échouent.
SDK antérieurs à la v3 :
// An Alibaba Cloud account AccessKey has full permissions for all APIs. For better security, use a RAM user for API calls and daily O&M.
// Do not hard-code your AccessKey ID and AccessKey secret in your project code. Otherwise, the AccessKey pair may be leaked and the security of all the resources in your account may be compromised.
// This example shows how to store the AccessKey ID and AccessKey secret in environment variables. You can also store them in a configuration file as needed.
IClientProfile profile = DefaultProfile.getProfile("cn-shanghai", System.getenv("CC_AK_ENV"), System.getenv("CC_SK_ENV"));
// Use the VPC domain name
DefaultProfile.addEndpoint("cn-shanghai", "ImageSearch", "imagesearch-vpc.cn-shanghai.aliyuncs.com");
this.client = new DefaultAcsClient(profile);