Domain Names

更新时间:
复制 MD 格式

An endpoint is a network domain name used to make requests to a service API, such as ecs.cn-hangzhou.aliyuncs.com.

Endpoint resolution

Related source code

  1. User-defined

    The user-defined method has the highest priority. It lets you specify the exact endpoint.

    # Takes effect globally
    client = AcsClient()
    client.add_endpoint("<region_id>", "<product>", "<endpoint>")
    
    # Takes effect only for the current request
    request = DescribeRegionsRequest()
    request.set_endpoint("<endpoint>")

  2. Endpoint construction rule

    This resolution method applies only when you send a request over a VPC network or when the product SDK has an endpoint data file. For an example of an endpoint data file, see the Ecs Endpoint Data File.

    # Public network request
    request.request_network = "public" # Because the default value of `network` is `public`, you do not need to configure `network` by default.
    
    # Cross-origin request
    request.request_network = "share"
    
    # IPv6 request
    request.request_network = "ipv6"
    
    # Proxy request
    request.request_network = "proxy"
    
    # Internal request
    request.request_network = "inner"
    
    # IPv4/IPv6 dual-stack
    request.request_network = "dualstack"
    
    # VPC request
    request.request_network = "vpc"

  3. Resolution based on the endpoints.json data file in the Python SDK Core

    This is an internal operation and requires no extra configuration.

  4. Remote retrieval using the Location Service API

    The product SDK must have a ServiceCode.