Accessing OBS
The IP address obtained through DNS resolution for accessing a Huawei Cloud OBS bucket domain name may change over time. Therefore, you are not advised to directly use an IP address to access OBS.
Related Concepts
Before learning about how to access OBS, you are advised to understand the related concepts.
| Concept | Definition | Format | Usage |
|---|---|---|---|
| Region | Regions are divided based on geographical location and latency characteristics. Public services, such as Elastic Cloud Server (ECS), Elastic Volume Service (EVS), Object Storage Service (OBS), Virtual Private Cloud (VPC), Elastic IP (EIP), and Image Management Service (IMS), are shared within the same region. | Format: <area name>-<city name> Example: CN North-Beijing4 | Select the region for your bucket and its objects based on the location of your workloads. |
| Region ID | A region ID uniquely identifies a region. | Format: <area ID>-<number> For example, the area ID of North China is cn-north, so the region ID of CN North-Beijing4 is cn-north-4. | Used for request signing and other operations when APIs, SDKs, or obsutil are used to access OBS |
| Endpoint | OBS provides an endpoint for each region. An endpoint is the region-specific OBS domain name used to process requests within that region. | Example: obs.cn-north-4.myhuaweicloud.com | Used in scenarios such as establishing network connections with OBS when APIs, SDKs, or obsutil are used to access OBS |
| Access domain name | OBS assigns a default access domain name to each bucket. An access domain name is the publicly accessible domain name of a bucket. You can use this domain name to access the bucket. | Format: BucketName.Endpoint BucketName is the bucket name, and Endpoint is the endpoint for the bucket's region. | Used in scenarios such as browser access to buckets, static website hosting, user-defined domain names, and CDN acceleration |
| Static website domain name | The domain name used to access a static website hosted in a bucket | Format: BucketName.obs-website.Endpoint Example: bucketname.obs-website.cn-north-4.myhuaweicloud.com | Used to access static files when a static website is hosted in a bucket |
| User-defined domain name | A domain name you register with Huawei Cloud or another provider and license through Ministry of Industry and Information Technology (MIIT) | Format: <user-defined-name>.<domain-name-suffix> Suffixes include .com, .cn, and others. Example: www.example.com | Map a user-defined domain name to a bucket's access domain name to access the bucket through the user-defined domain name. |
| CDN acceleration domain name | A user-defined domain name accelerated through Content Delivery Network (CDN) to improve access performance | Its format is the same as that of a user-defined domain name, but you must configure the service scope (Chinese mainland, outside Chinese mainland, or global) and service type (website acceleration, file download acceleration, or VOD acceleration). | Used to accelerate access to objects stored in OBS buckets worldwide |
| Intranet CIDR block | The CIDR block used to access OBS buckets over the Huawei Cloud intranet | The intranet CIDR block is the same across all regions: 100.125.0.0/16. | Used for accessing OBS over the intranet |
OBS Access Solutions
OBS provides multiple access solutions. Based on your access needs, OBS recommends the appropriate features and configurations to help you build an efficient, stable, and secure access architecture, as shown in Table 2.
| Access Need | Network Access Type | Scenario | Recommended Solution |
|---|---|---|---|
| Basic access | Public/Intranet access | Obtain region IDs, endpoints, intranet CIDR blocks, or Direct Connect CIDR blocks. | |
| Public/Intranet access | Use a bucket domain name, user-defined domain name, or CDN acceleration domain name to access OBS. | ||
| Public access | Preview files online or use a unified domain name to access your content. | ||
| Accelerated access | Public access | Enable global acceleration for accessing objects stored in OBS buckets. | |
| Secure access | Public access | Configure an HTTPS certificate for a user-defined domain name so you can access OBS securely over HTTPS (for example, using https://example.com). | |
| Public access | Prevent resources stored in OBS buckets from being stolen by unauthorized websites, avoiding data leakage and unexpected traffic costs. | Configuring URL Validation to Prevent Unauthorized Access to Your Data | |
| Web access | Public access | Store static web pages in an OBS bucket and publish them as a website. | |
| Public access | Enable scripts and content from different origins (with different protocols, domain names, or ports) to interact with each other, allowing for cross-origin access. | ||
| Intranet access | Intranet access | Access OBS through the internal communication network between services. | |
| Fixed access | Public access | Access OBS using a fixed IP address through a reverse proxy. |
Regions and Endpoints
The following provides common OBS regions and their endpoints, dual-stack endpoints, intranet CIDR blocks, and Direct Connect CIDR blocks of OBS across global areas. For more information about regions and endpoints, see Regions and Endpoints.
The intranet CIDR block is the same across all regions: 100.125.0.0/16.
| Region Name | Region ID | Endpoint | Intranet CIDR Block | Direct Connect CIDR Block |
|---|---|---|---|---|
| CN North-Beijing4 | cn-north-4 | obs.cn-north-4.myhuaweicloud.com | 100.125.0.0/16 | 120.46.235.0/25 |
| CN North-Ulanqab1 | cn-north-9 | obs.cn-north-9.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| CN North3 | cn-north-12 | obs.cn-north-12.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| CN East-Shanghai1 | cn-east-3 | obs.cn-east-3.myhuaweicloud.com | 100.125.0.0/16 | 123.60.199.0/25 |
| CN East-Qingdao | cn-east-5 | obs.cn-east-5.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| CN East2 | cn-east-4 | obs.cn-east-4.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| CN South-Guangzhou | cn-south-1 | obs.cn-south-1.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| CN South-Guangzhou-InvitationOnly | cn-south-4 | obs.cn-south-4.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| CN Southwest-Guiyang1 | cn-southwest-2 | obs.cn-southwest-2.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| CN-Hong Kong | ap-southeast-1 | obs.ap-southeast-1.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| AP-Bangkok | ap-southeast-2 | obs.ap-southeast-2.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| AP-Singapore | ap-southeast-3 | obs.ap-southeast-3.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| AP-Jakarta | ap-southeast-4 | obs.ap-southeast-4.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| AP-Manila | ap-southeast-5 | obs.ap-southeast-5.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| Region Name | Region ID | Endpoint | Intranet CIDR block | Direct Connect CIDR block |
|---|---|---|---|---|
| LA-Mexico City1 | na-mexico-1 | obs.na-mexico-1.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| LA-Mexico City2 | la-north-2 | obs.la-north-2.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| LA-Sao Paulo1 | sa-brazil-1 | obs.sa-brazil-1.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| LA-Santiago | la-south-2 | obs.la-south-2.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| Region Name | Region ID | Endpoint | Intranet CIDR Block | Direct Connect CIDR Block |
|---|---|---|---|---|
| AF-Cairo | af-north-1 | obs.af-north-1.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| AF-Johannesburg | af-south-1 | obs.af-south-1.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| Region Name | Region ID | Endpoint | Intranet CIDR Block | Direct Connect CIDR Block |
|---|---|---|---|---|
| ME-Riyadh | me-east-1 | obs.me-east-1.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
| Region Name | Region ID | Endpoint | Intranet CIDR Block | Direct Connect CIDR Block |
|---|---|---|---|---|
| TR-Istanbul | tr-west-1 | obs.tr-west-1.myhuaweicloud.com | 100.125.0.0/16 | Submit a service ticket to obtain it. |
Endpoints
Generally, the endpoint in a request must match the region where the requested OBS resource resides. In certain cases, however, you can use any endpoint.
- Scenarios where the endpoint must match the resource's region
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 ap-southeast-1, you can list objects in the bucket by sending a request shown in the following example:
A correct example of an object listing request and its response:
[Request]
GET / HTTP/1.1 Host: mybucket.obs.ap-southeast-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 x-obs-bucket-location: ap-southeast-1 Content-Length: 259 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ListBucketResult xmlns="http://obs.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 you use does not match the region where the bucket belongs, there will be an error message indicating that the bucket does not exist.
In the example above, bucket mybucket is in region ap-southeast-1. If you use the endpoint of cn-south-1 (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 make an API call to obtain the bucket's region ID, and then send the request again.
An incorrect example of an object listing request and its response:
[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: 318 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Error> <Code>NoSuchBucket</Code> <Message>The specified bucket does not exist</Message> <RequestId>0001EF710C000001536176DA465E4E6H</RequestId> <HostId>R2zskemlm0PtIQqw9dRrW+RVjYUj6kLtcvdPjHLdyMCgThSrWToXNyJIyx5Oe2nu</HostId> <BucketName>bucket05</BucketName> </Error>
- Scenarios where any endpoint can be used
You can use the endpoint of any region in the API requests for listing buckets and for obtaining a bucket's location information, because these APIs search for buckets across all regions.
Example request and response for obtaining a bucket's location information:
For example, if bucket mybucket is in region ap-southeast-1 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.myhuaweicloud.com/doc/2015-06-30/">ap-southeast-1</Location>
OBS Domain Names
The following describes OBS domain name types with examples.
OBS Domain Name Types
Table 8 lists the OBS domain names, along with their formats and protocols.
| Domain Name Type | Domain Name Format | Description | Configuration Required | Protocol | |
|---|---|---|---|---|---|
| User-defined domain name (recommended) | [Format] <user-defined-name>.<domain-name-suffix> Suffixes include .com, .cn, and others. [Example] www.example.com | A user-defined domain name is a domain name you register with Huawei Cloud or another provider and license through Ministry of Industry and Information Technology (MIIT). You can map a user-defined domain name to a bucket's access domain name to access the bucket through the user-defined domain name. | HTTPS HTTP | ||
| User-defined domain name (acceleration domain name) | Its format is the same as that of a user-defined domain name, but you must configure the service scope (Chinese mainland, outside Chinese mainland, or global) and service type (website acceleration, file download acceleration, or VOD acceleration). | Content Delivery Network (CDN) can accelerate a user-defined domain name to improve OBS access performance. Acceleration domain names accelerate access to objects stored in OBS buckets worldwide. | HTTPS HTTP | ||
| Huawei Cloud OBS domain name NOTE: To protect your services from being affected if Huawei Cloud public domain names are taken over by relevant organizations, you are advised to use a user-defined domain name to access a bucket. | Region-specific domain name (endpoint) | [Format] Endpoint [Example] obs.ap-southeast-1.myhuaweicloud.com | OBS provides an endpoint for each region. An endpoint is the region-specific OBS domain name used to process requests within that region. For the mapping between regions and OBS endpoints, see Regions and Endpoints. | Available by default | HTTPS HTTP |
| Bucket access domain name | [Format] BucketName.Endpoint [Example] bucketname.obs.ap-southeast-1.myhuaweicloud.com | OBS assigns a default access domain name to each bucket. An access domain name is the publicly accessible domain name of a bucket. You can use this domain name to access the bucket. You can construct the bucket's access domain name according to its format or obtain it directly from the bucket's basic information on OBS Console or OBS Browser+. | Available by default | HTTPS HTTP | |
| Object access domain name | [Format] BucketName.Endpoint/ObjectName [Example] bucketname.obs.ap-southeast-1.myhuaweicloud.com/object.txt | After an object is uploaded to a bucket, you can access the object using its access domain name. You can construct the object URL according to its format or obtain it directly from the object details on OBS Console or OBS Browser+. You can also use an SDK to call the GetObjectUrl API to obtain the object URL. | Available by default | HTTPS HTTP | |
| Static website domain name | [Format] BucketName.obs-website.Endpoint [Example] bucketname.obs-website.ap-southeast-1.myhuaweicloud.com | This type of domain name is used to access the static website hosted in a bucket. You can use such a domain name to access static files when a static website is hosted in a bucket. | HTTPS HTTP | ||
Examples of Using OBS Domain Names
- Using a browser
The following example shows how to access an object using a browser.
For security and compliance purposes, when you use an object access domain name to access objects (such as videos, images, and web pages) in a bucket through a browser, the object content will not be displayed. Instead, the content is downloaded as an attachment. To preview objects online, see How Do I Preview OBS Objects in My Web Browser?
- Go to the object list page. Then, click the target bucket name to open its object list.
- Click the required object name to open the object details page.
- Copy the object URL.
- Paste the object URL into your browser to access the object.
- Using obsutil
The following example shows how to download objects using obsutil. You can use bucket-cname to specify the user-defined domain name bound to the bucket and e to specify the endpoint.
obsutil cp obs://bucket/key file_or_folder_url [-bucket-cname=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
The following table describes the parameter settings for different domain name types.
Table 9 Parameter settings for different domain name types Domain Name Type
Parameter Configuration
Object access domain name
Set e to the endpoint of the region where the bucket is located. Example: -e=obs.cn-north-4.myhuaweicloud.com
User-defined domain name
Set bucket-cname to the user-defined domain name bound to the bucket. Example: -bucket-cname=www.example.com
bucket-cname is supported only in obsutil 5.7.9 and later.
Protocols and Ports
Endpoints and bucket access domain names in all regions support both HTTP and HTTPS. To ensure secure access to OBS data, you are advised to use HTTPS.
The following table lists the protocols and ports supported by OBS.
| Protocol | Port | Description |
|---|---|---|
| HTTPS | 443 | HTTPS uses port 443 by default when no port is specified. |
| HTTP | 80 | HTTP uses port 80 by default when no port is specified. |
Accessing OBS over the Internet or Intranet
Accessing OBS over a public network generates inbound traffic for write operations (for example, uploading data) and outbound traffic for read operations (for example, downloading data). Inbound traffic is free, while outbound traffic is billed.
For pricing of outbound Internet traffic, see Product Pricing Details.
If you access OBS over a public network, you can use a URL to specify resources in OBS. An OBS URL is formatted as follows:
Protocol://[BucketName].Endpoint[:Port][/Object][?Param]
| Parameter | Description | Mandatory (Yes/No) |
|---|---|---|
| Protocol | The protocol used to send requests, either HTTP or HTTPS. HTTPS ensures secure access to resources. | Yes |
| BucketName | The name of the requested bucket, which uniquely identifies a bucket in OBS | Yes under certain conditions All API requests except the one for listing buckets must include BucketName. |
| Endpoint | The domain name (endpoint) of the region where the OBS bucket resides For the mapping between regions and OBS endpoints, see Regions and Endpoints. | Yes |
| Port | The port used for sending requests. The actual port depends on the software server's deployment. If no port is specified, the protocol uses its default port. Each protocol has a predefined default port. In OBS, the default HTTP port is 80 and the default HTTPS port is 443. | No |
| Object | The path of the OBS object to access | No |
| Param | The specific resource. By default, it is the requested bucket or object itself. | No |
Example: You have a bucket named mybucket in the CN-Hong Kong (ap-southeast-1) region. The bucket contains an object named myfolder/myfile.txt. The URL for accessing the object over the public network is as follows:
https://mybucket.obs.ap-southeast-1.myhuaweicloud.com/myfolder/myfile.txt
All API requests except the one for listing buckets must include BucketName. To ensure DNS resolution performance and reliability, OBS requires the bucket name to precede the endpoint when constructing a request that includes a bucket name. This produces a three-level domain name, also known as a virtual-hosted-style access domain name.
Accessing OBS over the intranet refers to accessing OBS through the internal communication network between cloud services. Both inbound traffic for write operations (such as uploading data) and outbound traffic for read operations (such as downloading data) are free of charge.
For example, you can access OBS from an Elastic Cloud Server (ECS) over a private network. This type of access is not affected by public network quality issues and reduces costs.
OBS provides a best practice for configuring intranet access. For details, see Accessing OBS from an ECS over the Intranet.
References
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot