Creating Requests

This section describes how to access OBS using domain names or REST APIs.

An OBS bucket must belong to a region and each region has its domain name. After the static website hosting settings take effect on an OBS bucket, you can use the static website domain name of the region to access the static website hosted by the bucket. The following table describes the basic concepts.

Table 1 Basic concepts

Basic Concept

Example Value

Description

Region name

cn-north-1

Each region has its own name. When creating a bucket, you need to specify a region where the bucket resides.

Endpoint

obs.cn-north-1.myhwclouds.com

Each region has its own domain name (endpoint), which is the accessing point of OBS in this region.

Static website hosting

obs-website.cn-north-1.myhwclouds.com

Each region has its static website domain name, which is the accessing point of the hosted website in this region.

You can use the virtual-hosting or path-based method to access OBS.

  • Virtual-hosting: A bucket name is a part of a URL, for example http://mybucket.obs.cn-north-1.myhwclouds.com. If you access OBS using the virtual-hosting method, DNS can resolve the access request into the IP address that can be used by the client to access the bucket.
  • When using a path to access bucket resources on OBS, you must use the domain name of the specified region. For example, you have a bucket named mybucket in the cn-north-1 region (whose domain name is obs.cn-north-1.myhwclouds.com). Then the URL for accessing the bucket is http://obs.cn-north-1.myhwclouds.com/mybucket.

The following table lists examples of planned regions and domain names.

Table 2 Planned regions and domain names

Region and Domain Name

Role

region1

Default region

obs.region1.example.com

Default region's domain name

region2, region3

Non-default regions

obs.region2.example.com, obs.region3.example.com

Non-default regions' domain names

Figure 1 Example of permanent redirection

1

On the client, create a DNS request obs.cn-north-1.myhwclouds.com to access a bucket stored in OBS.

2

The client receives one or more IP addresses of the default region that can process the request.

3

Then on the client, create a request obs.cn-north-1.myhwclouds.com/mybucket that is applicable to the default region.

4

The default region recognizes the path style and returns a 301 redirection to require the client to use the virtual-hosting style access.

Figure 2 Example of temporary redirection

1

On the client, create a DNS request mybucket.obs.cn-north-1.myhwclouds.com to access a bucket stored in OBS.

2

The client receives one or more IP addresses of the default region that can process the request.

3

Then on the client, create a request that is applicable to the default region.

4

The default region recognizes the virtual-hosting style and returns a 307 temporary redirection indicating that the bucket can be accessed from Region2.

5

The client then sends the request to Region2.

6

Region2 returns the bucket information.

Registration