Use Rules of Ks3 Endpoints

Last updated:2020-11-11 13:26:29

Use Rules of KS3 Endpoints

KS3 assigns default domain names for each bucket. This topic describes what composes a KS3 domain name and how to use KS3 domain name.

KS3 domain name format

All requests to KS3 except the GetService API include third level domains. The third level domain names contain the bucket information.

The domain names are in format of Endpoint/BucketName. Endpoint indicates the domain name used to access the region where your bucket is located. BucketName indicates the name of your bucket.

Use a public endpoint to access KS3 service

By using a public endpoint, you can access KS3 over the Internet. KS3 allows you to upload or write data to KS3 over the Internet free of charge. Fees are incurred when you download or read data from KS3.

You can use either of the following methods to access KS3 over the Internet:

  • Method 1: Use a URL that includes information about KS3 resources. The format of the URL is as follows:

      <Schema>://<Public Endpoint>/<Bucket>/<Object>
    
    • Schema:HTTP or HTTPS.
    • Public Endpoint: the domain name used to access the region where the bucket is located over the Internet. For more information about the endpoints used to access each region, see Endpoints and Regions.
    • Bucket: the name of KS3 bucket.
    • Object: the path to access the KS3 object.

    Example: Your bucket is located in the Beijing region. The corresponding KS3 region ID is ks3-cn-beijing. The name of your bucket is aaa. The path to access the object is bbb/ccc.txt. The domain name to access the object over the Internet is ks3-cn-beijing.ksyun.com/aaa/bbb/ccc.txt.

    You can also add the object URL to the HTML file as follows:

      <img src="https://ks3-cn-beijing.ksyun.com/aaa/bbb/ccc.png" />
    
  • Method 2: Configure the public endpoint by using the KS3 SDK.

    The KS3 SDK generates an endpoint by concatenating each operation. A different endpoint is generated for operations on a bucket located in a different region.

    The following code provides an example on how to configure an endpoint by using the Java SDK when the operation is performed on a bucket located in the Beijing region:

    Ks3ClientConfig config = new Ks3ClientConfig();
    config.setEndpoint("ks3-cn-beijing.ksyun.com");
    Ks3 client = new Ks3Client("<Your AccessKeyID>","<Your AccessKeySecret>",config);
    

Use an internal endpoint to access KS3 service

By using an internal endpoint, you can access KS3 over the internal network, which is used for communications between Kingsoft Cloud products. For example, you can access KS3 from a KEC. The inbound and outbound traffic over the internal network is free of charge. However, fees are incurred when you send requests.

You can use either of the following methods to access KS3 over the internal network:

  • Method 1: Use a URL that includes information about KS3 resources. The URL format of KS3 is as follows:

      <Schema>://<Internal Endpoint>/<Bucket>/<Object>
    
    • Schema: HTTP or HTTPS.
    • Internal Endpoint: the domain name used to access the region where the bucket is located from a KEC over the internal network when the bucket and KEC are located within the same region. For more information about the endpoints to access each region, see Regions and endpoints.
    • Bucket: the name of KS3 bucket.
    • Object: the path to access the KS3 object.

    Example: Your bucket is located in the Beijing region. The name of your bucket is aaa. The path to access the object is bbb/ccc.txt. The domain name to access the object over the internal network is ks3-cn-beijing-internal.ksyun.com/aaa/bbb/ccc.txt.

  • Method 2: Configure an internal endpoint by using the KS3 SDK from KEC.

    The following code provides an example on how to configure an internal endpoint by using the Java SDK. The code is used to perform operations on a bucket located in the Beijing region:

    Ks3ClientConfig config = new Ks3ClientConfig();
    config.setEndpoint("ks3-cn-beijing-internal.ksyun.com");
    Ks3 client = new Ks3Client("<Your AccessKeyID>","<Your AccessKeySecret>",config);
    

Use IPv6 addresses to access KS3

IPv6 is the next-generation IP protocol developed by Internet Engineering Task Force (IETF) for replacing existing IPv4.

KS3 supports IPv4/IPv6 dual-stack endpoints.

You can access a KS3 bucket by using the dual-stack endpoint provided by KS3 on both IPv4 and IPv6 clients. Your DNS server returns the correct IP address to you based on your IP protocol version.

The IPv4/IPv6 dual-stack endpoint feature is supported in the following regions:

  • Beijing

  • Shanghai

  • Guangzhou

If you need to use the IPv4/IPv6 dual-stack endpoint feature, submit a ticket or contact your business representative.

Did you find the above information helpful?

Unhelpful
Mostly Unhelpful
A little helpful
Helpful
Very helpful

What might be the problems?

  • Insufficient
  • Outdated
  • Unclear or awkward
  • Redundant or clumsy
  • Lack of context for the complex system or functionality

More suggestions

0/200

Please give us your feedback.

Submitted

Thank you for your feedback.

问题反馈