Endpoints and Access Domain Names

  1. Concepts about endpoints and access domain names
    Table 1 Basic concepts

    Concept

    Example

    Description

    Endpoint

    obs.region.myhuaweicloud.com. In this address, region means the area where the service is available.

    [Example]

    obs.cn-east-3.myhuaweicloud.com

    obs.cn-south-1.myhuaweicloud.com

    obs.cn-north-4.myhuaweicloud.com

    OBS provides an endpoint for each region. An endpoint can be considered as the domain name of OBS in a region, and is used to process access requests from the region.

    For details about endpoints of each region, see Regions and Endpoints.

    Bucket access domain name

    BucketName.Endpoint

    [Example]

    For example, if the bucket examplebucket resides in the cn-east-3 region, you can access the bucket through the following access domain names:

    examplebucket.obs.cn-east-3.myhuaweicloud.com

    OBS allocates a default access domain name to each bucket. The access domain name is the Internet address of the bucket. You can directly access the bucket through the domain name when, for example, developing cloud applications or sharing data.

  2. Endpoint access requests

    OBS provides different endpoints for different regions. How does a user select an appropriate endpoint?

    Generally, the endpoint carried in a request for accessing OBS must be the endpoint of the region where the requested resource resides. However, in some special cases, you can use any endpoint.

    1. Scenarios when the endpoint in request must be consistent with the endpoint of the region where the requested resources reside

      When accessing a bucket or an object, the endpoint in the request must be the endpoint of the region where the bucket or object resides.

      For example, if bucket mybucket is in region cn-north-4, you can list objects in the bucket by referring to the following example:

      A correct example of request and response for listing objects:

      [Request]

      GET / HTTP/1.1  
      Host: mybucket.obs.cn-north-4.myhuaweicloud.com
      Accept: */*  
      Date: Thu, 10 Mar 2016 08:51:25 GMT  
      Authorization: authorization 

      [Response]

      HTTP/1.1 200 OK  
      x-obs-request-id: 0001EF710C000001536176DA465E4E6G  
      x-obs-id-2: Rdj0zZvRkihRcjcQUqjkDGt8JuAgi2CGuLiP7Pv/cYYplsS0xTFJQHP5vSg5yOYC  
      Content-Type: application/xml  
      Date: Thu, 10 Mar 2016 16:58:12 GMT  
      x-obs-bucket-location: cn-north-4
      Content-Length: 259  
      
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <ListBucketResult xmlns="http://obs.cn-north-4.myhuaweicloud.com/doc/2015-06-30/">
        <Name>mybucket</Name>
        <Prefix/>
        <Marker/>
        <MaxKeys>1000</MaxKeys>
        <IsTruncated>false</IsTruncated>
        <Contents>
          <Key>object001</Key>
          <LastModified>2015-07-01T00:32:16.482Z</LastModified>
          <ETag>"2fa3bcaaec668adc5da177e67a122d7c"</ETag>
          <Size>12041</Size>
          <Owner>
            <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID>
          </Owner>
          <StorageClass>STANDARD</StorageClass>
        </Contents>
      </ListBucketResult>

      If the endpoint in the request is not consistent with the endpoint of the requested region, an error message is returned indicating that the bucket does not exist.

      In the preceding example, bucket mybucket is in region cn-north-4. If you use the cn-south-1 endpoint (mybucket.obs.cn-south-1.myhuaweicloud.com) to access the bucket, HTTP 404 is returned, indicating that the bucket does not exist. In this case, you can call the API of Obtaining Bucket Location to obtain the bucket's region ID, and then re-send the request.

      An incorrect example of request and response for listing objects:

      [Request]

      GET / HTTP/1.1  
      Host: mybucket.obs.cn-south-1.myhuaweicloud.com
      Accept: */*  
      Date: Thu, 10 Mar 2016 08:51:25 GMT  
      Authorization: authorization 

      [Response]

      HTTP/1.1 404 NoSuchBucket  
      x-obs-request-id: 0001EF710C000001536176DA465E4E6H  
      x-obs-id-2: Rdj0zZvRkihRcjcQUqjkDGt8JuAgi2CGuLiP7Pv/cYYplsS0xTFJQHP5vSg5yOYL  
      Date: Thu, 10 Mar 2016 08:51:30 GMT  
      Content-Length: 0  
    2. Scenarios when any endpoint can be used in a request

      For APIs to obtain the list of buckets and obtain a bucket region information, the endpoint in the request can be any regional endpoint, because these two APIs search for the requested buckets in all regions.

      An example of request and response for obtaining the bucket region information:

      For example, if bucket mybucket is in region cn-north-4 and the endpoint of the cn-south-1 region is used in the request, the bucket location information can still be obtained.

      [Request]
      GET /?location HTTP/1.1  
      Host: mybucket.obs.cn-south-1.myhuaweicloud.com
      Accept: */*  
      Date: Thu, 10 Mar 2016 08:51:25 GMT  
      Authorization: authorization 
      [Response]
      HTTP/1.1 200 OK  
      x-obs-request-id: 0001EF710C000001536176DA465E4E6G  
      x-obs-id-2: Rdj0zZvRkihRcjcQUqjkDGt8JuAgi2CGuLiP7Pv/cYYplsS0xTFJQHP5vSg5yOYC  
      Content-Type: application/xml  
      Date: Thu, 10 Mar 2016 16:58:12 GMT  
      Content-Length: length  
      
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <Location xmlns="http://obs.cn-north-4.myhuaweicloud.com/doc/2015-06-30/">cn-north-4</Location>