All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

Use KS3 endpoints

Last updated:2021-09-14 16:17:51

KS3 assigns a default domain name for each bucket. This topic describes the format of a KS3 domain name and how to use it.

KS3 domain name format

All requests to KS3 except the GET Service API operation include third-level domain names. The third-level domain names contain the bucket information.

The domain names are in the following format: BucketName.Endpoint. In this format, Endpoint indicates the endpoint used to access KS3 in the region where your bucket resides, and BucketName indicates the name of your bucket.

Use a public endpoint to access KS3

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

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>://<Bucket>.<Public endpoint>/<Object>
    • Schema: HTTP or HTTPS.
    • Bucket: the name of the KS3 bucket.
    • Public endpoint: the pubic endpoint of KS3 in the region where the bucket resides. For more information about the endpoints in different regions, see Regions and endpoints.
    • Object: the path to access the KS3 object.

    Example 1: Your bucket resides in the CN North 1(Beijing) region. The KS3 region ID is ks3-cn-beijing. The name of your bucket is test. The path to access the object is aaa/bbb.txt. The domain name to access the object over the Internet is test.ks3-cn-beijing.ksyuncs.com/aaa/bbb.txt.

    Example 2: You can also add the URL of the object whose access path is aaa/ddd.png to an HTML file as follows:

    <img src="https://test.ks3-cn-beijing.ksyuncs.com/aaa/ddd.png" />
  • Method 2: Specify the public endpoint by using KS3 SDKs.

    KS3 SDKs can generate a domain name for each operation. To perform operations on a bucket, you need to specify the public endpoint of KS3 in the region where the bucket resides.

    The following code provides an example on how to specify the public endpoint by using the SDK for Java to perform operations on a bucket that resides in the CN North 1(Beijing) region:

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

Use an internal endpoint to access KS3

By using an internal endpoint, you can access KS3 over the internal network, which is used for communications between Kingsoft Cloud services. For example, you can access KS3 from a KEC instance over the internal network. 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 format of the URL is as follows:

    <Schema>://<Bucket>.<Internal endpoint>/<Object>
    • Schema: HTTP or HTTPS.
    • Bucket: the name of the KS3 bucket.
    • Internal endpoint: the internal endpoint of KS3 in the region where the bucket resides. KEC instances in the same region as the bucket can use this internal endpoint to access the bucket. For more information about the endpoints in different regions, see Regions and endpoints.
    • Object: the path to access the KS3 object.

    Example: Your bucket resides in the CN North 1(Beijing) region. The name of your bucket is test. The path to access the object is aaa/bbb.txt. The domain name to access the object over the internal network is test.ks3-cn-beijing-internal.ksyuncs.com/aaa/bbb.txt.

  • Method 2: Specify the internal endpoint by using KS3 SDKs for access from a KEC instance.

    The following code provides an example on how to specify the internal endpoint by using the SDK for Java to perform operations on a bucket that resides in the CN North 1(Beijing) region:

    Ks3ClientConfig config = new Ks3ClientConfig();
    config.setEndpoint("ks3-cn-beijing-internal.ksyuncs.com");
    Ks3 client = new Ks3Client("<Your AccessKeyID>","<Your SecretAccessKey>",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:

  • CN North 1(Beijing)
  • CN East 1(Shanghai)
  • CN South 1(Guangzhou)

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

On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback