tencent cloud

All product documents
Video on Demand
Storage Access Method
Last updated: 2025-03-20 16:46:26
Storage Access Method
Last updated: 2025-03-20 16:46:26
This article mainly introduces the storage access methods supported by the Professional Version and how to use these access methods.
Note:
For console access methods, refer to the Console Guide. For Tencent Cloud API 3.0 access methods, refer to the Server APIs. These two methods will not be repeated in this article.

Access Methods

The storage access methods supported by the Professional Version application are as follows:
Type
Access Method
Access Endpoint Domain Names
Function
Preset domain name
​Public domain of the bucket
[BucketId].vodpro.[storage region].eovod.com
Used for ​CRUD operations (Create, Read, Update, Delete) on media files over the public network.
Private domain of the bucket
[BucketId].vodsrc-internal.[storage region].eovod.com
Used for CRUD operations on media files within the same region of Tencent Cloud's private network, supports downloading without incurring traffic fees.
Custom Domain Name
EdgeOne acceleration distribution domain name
Custom
Used for media file distribution and playback.

Usage

Public Domain of the bucket

Each bucket in a Professional Edition application comes with a pre-configured public network domain. Use this domain to perform CRUD operations on media files in the bucket. For a full list of supported operations, refer to the Supported Storage Operations documentation.
Note:
• The public domain ​takes 30-120 minutes to become active after bucket creation.
• ​Downloading files or browsing content via the public network domain is ​not supported. Use the ​EdgeOne accelerated domain instead.

Preparations

1. ​Create an Application and Bucket
Create a Professional Edition application and bucket in the VOD Console. For steps, see the Quick Start and Creating a Bucket documentation.
2. ​Obtain Access Credentials
Retrieve the ​AccessKey pair from the application’s ​Key Management section. Refer to the Key Management guide for details.

Accessing Buckets with S3 SDK

Below are examples of initializing an S3 client and retrieving object metadata in common programming languages.
Assumptions:
​Region: ap-guangzhou.
​Bucket ID: bucketid1.
​Code Samples:
GO
Java
C++
Python
import (
"context"
"errors"
"fmt"
"net/url"
"os"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/s3"
smep "github.com/aws/smithy-go/endpoints"
"github.com/aws/smithy-go/logging"
)

type customEndpointResolverV2 struct {
}

// ResolveEndpoint custom endpoint resolution
func (r *customEndpointResolverV2) ResolveEndpoint(ctx context.Context,
params s3.EndpointParameters) (smep.Endpoint, error) {
if params.Bucket == nil || params.Region == nil {
return smep.Endpoint{}, errors.New("invalid endpoint param")
}
return smep.Endpoint{
URI: url.URL{
Scheme: "https",
Host: fmt.Sprintf("%s.vodpro.%s.eovod.com", *params.Bucket, *params.Region),
},
}, nil
}

func main() {
// Initialize client
s3cli := s3.New(s3.Options{
Credentials: credentials.NewStaticCredentialsProvider(
"AccessKeyId", // Replace with your AccessKeyID
"SecretAccessKey", // Replace with your SecretAccessKey
""),
EndpointResolverV2: new(customEndpointResolverV2), // Custom domain configuration
UsePathStyle: false, // Disable path-style requests
Logger: logging.NewStandardLogger(os.Stdout), // Log output to the standard output stream
ClientLogMode: aws.LogRequest | aws.LogResponse, // Log request/response headers
Region: "ap-guangzhou", // Storage region
})
// Get media file metadata
_, _ = s3cli.HeadObject(context.TODO(), &s3.HeadObjectInput{
Bucket: aws.String("bucketid1"), // Bucket ID in VOD Pro application
Key: aws.String("a/b/c.jpeg"), // Media file path in bucket
})
}
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.HeadObjectRequest;
import software.amazon.awssdk.services.s3.model.HeadObjectResponse;

import java.net.URI;

public class Main {
// Custom endpoint resolver
public static void main(String[] args) {
// Initialize S3 client
S3Client s3Client = S3Client.builder()
.credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(
"AccessKeyId", // Replace with your AccessKey
"SecretAccessKey" // Replace with your SecretAccessKey
)))
.endpointOverride(URI.create("https://vodpro.ap-guangzhou.eovod.com"))
.region(Region.of("ap-guangzhou"))
.build();

// Get media file metadata
try {
HeadObjectRequest headObjectRequest = HeadObjectRequest.builder()
.bucket("bucketid1") // Bucket ID in VOD Pro application
.key("a/b/c.jpeg") // Media file path in the bucket
.build();
HeadObjectResponse headObjectResponse = s3Client.headObject(headObjectRequest);
System.out.println("Content Length: " + headObjectResponse.contentLength());
} catch (Exception e) {
e.printStackTrace();
} finally {
s3Client.close();
}
}
}
#include <aws/core/Aws.h>
#include <aws/core/auth/AWSCredentials.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/HeadObjectRequest.h>
#include <iostream>
#include <string>

int main() {
// Initialize AWS SDK
const Aws::SDKOptions options;
InitAPI(options);
// Custom domain configuration
Aws::Client::ClientConfiguration clientConfig;
clientConfig.scheme = Aws::Http::Scheme::HTTPS;
clientConfig.endpointOverride = "vodpro.ap-guangzhou.eovod.com";
// Create S3 client
const Aws::S3::S3Client s3Client(
Aws::Auth::AWSCredentials(
"AccessKeyId", // Replace with your AccessKeyId from IAM
"SecretAccessKey" // Replace with your SecretAccessKey from IAM
),
nullptr, clientConfig);
// Create HeadObject request
Aws::S3::Model::HeadObjectRequest request;
request.SetBucket("bucketid1"); // Bucket ID in VOD Pro application
request.SetKey("a/b/c.jpeg"); // Media file path in bucket
// Send request
auto outcome = s3Client.HeadObject(request);
if (outcome.IsSuccess()) {
std::cout << "Head object succeeded!" << std::endl;
const auto &object = outcome.GetResult();
std::cout << "Content Length: " << object.GetContentLength() << std::endl;
} else {
const auto error = outcome.GetError();
std::cout << "Error: " << error.GetMessage() << std::endl;
}
// Cleanup AWS SDK
Aws::ShutdownAPI(options);
return 0;
}
import boto3
from botocore.config import Config
from botocore.exceptions import ClientError


# Create S3 client
s3_client = boto3.client(
's3',
aws_access_key_id='AccessKeyId', # AccessKey ID from your IAM credentials
aws_secret_access_key='SecretAccessKey', # SecretAccessKey from your IAM credentials
endpoint_url='https://vodpro.ap-guangzhou.eovod.com', # Custom endpoint URL
config=Config(s3={'addressing_style': 'virtual'}), # Use virtual hosted-style addressing
)

try:
# Retrieve media file metadata
response = s3_client.head_object(
Bucket="bucketid1", # Bucket ID in your VOD Pro application
Key="a/b/c.jpeg" # Media file path within the bucket
)
print(response)
except ClientError as e:
print(f"Error: {e}")

Private Domain Of the Bucket

The Professional Edition application pre-assigns a private domain for each bucket. Customers can use this domain to perform CRUD operations on media files within the bucket from servers in the same region of Tencent Cloud's private network. File downloads are supported without incurring traffic fees. For the list of supported operations, see Supported Storage Operations.
Note:
The bucket's private domain has a certain effective time, usually taking effect 30 minutes after the bucket is created.
The private domain must be accessed from Tencent Cloud servers in the same region as the bucket, otherwise a 404 response code will be returned. You can try using commands like nslookups on the server for domain resolution. If you get IPs in the form of 10.*.*.*, 100.*.*.*, or 169.254.*.*, private network access is generally possible.

Preparations

1. Create an application and a bucket.
Create a Pro application and a bucket in the VOD console. For detailed steps, refer to the Quick Start and Creating a Bucket documentation.
2. Get key pair.
Obtain the key pair AccessKeyId and SecretAccessKey from the key management of the Pro application. For detailed steps, refer to the Key Management documentation.
3. Preparing a server.
Prepare a Tencent Cloud server in the same region as the bucket, such as CVM, Lighthouse, TKE, etc.

Accessing a bucket using the s3 sdk

The following introduces how to adapt in common programming languages to access the bucket of the Professional Version application through the private network.
Supposing the storage region is ap-guangzhou and the bucket ID is bucketid1, the code implementation for initializing the S3 client and obtaining object metadata in common languages is as follows:
GO
Java
C++
Python
import (
"context"
"errors"
"fmt"
"net/url"
"os"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/s3"
smep "github.com/aws/smithy-go/endpoints"
"github.com/aws/smithy-go/logging"
)

type customEndpointResolverV2 struct {
}

// ResolveEndpoint custom access point
func (r *customEndpointResolverV2) ResolveEndpoint(ctx context.Context,
params s3.EndpointParameters) (smep.Endpoint, error) {
if params.Bucket == nil || params.Region == nil {
return smep.Endpoint{}, errors.New("invalid endpoint param")
}
return smep.Endpoint{
URI: url.URL{
Scheme: "https",
Host: fmt.Sprintf("%s.vodsrc-internal.%s.eovod.com", *params.Bucket, *params.Region),
},
}, nil
}

func main() {
// Initialize the client.
s3cli := s3.New(s3.Options{
Credentials: credentials.NewStaticCredentialsProvider(
"AccessKeyId", // Fill in the AccessKeyId from the key pair
"SecretAccessKey", // Fill in the SecretAccessKey from the key pair
""),
EndpointResolverV2: new(customEndpointResolverV2), // Custom access domain
UsePathStyle: false, // request block path style
Logger: logging.NewStandardLogger(os.Stdout), // Log to standard output stream
ClientLogMode: aws.LogRequest | aws.LogResponse, // Print request header and response header
Region: "ap-guangzhou", // Storage region
})
// Get media file metadata
_, _ = s3cli.HeadObject(context.TODO(), &s3.HeadObjectInput{
Bucket: aws.String("bucketid1"), // Set the bucket to the storage bucket ID in the VOD professional application
Key: aws.String("a/b/c.jpeg"), // Path of the media file in the bucket
})
}
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.HeadObjectRequest;
import software.amazon.awssdk.services.s3.model.HeadObjectResponse;

import java.net.URI;

public class Main {
// Custom endpoint resolver
public static void main(String[] args) {
// Initialize the S3 client
S3Client s3Client = S3Client.builder()
.credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(
"AccessKeyId", // Fill in the AccessKeyId from the key pair
"SecretAccessKey" // Fill in the SecretAccessKey from the key pair
)))
.endpointOverride(URI.create("https://vodsrc-internal.ap-guangzhou.eovod.com"))
.build();

// Get media file metadata
try {
HeadObjectRequest headObjectRequest = HeadObjectRequest.builder()
.bucket("bucketid1") // Set the bucket to the storage bucket ID in the VOD professional application
.key("a/b/c.jpeg") // Path of the media file in the bucket
.build();
HeadObjectResponse headObjectResponse = s3Client.headObject(headObjectRequest);
System.out.println("Content Length: " + headObjectResponse.contentLength());
} catch (Exception e) {
e.printStackTrace();
} finally {
s3Client.close();
}
}
}
#include <aws/core/Aws.h>
#include <aws/core/auth/AWSCredentials.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/HeadObjectRequest.h>
#include <iostream>
#include <string>

int main() {
// Initialize the AWS SDK
const Aws::SDKOptions options;
InitAPI(options);
// custom access domain
Aws::Client::ClientConfiguration clientConfig;
clientConfig.scheme = Aws::Http::Scheme::HTTPS;
clientConfig.endpointOverride = "vodsrc-internal.ap-guangzhou.eovod.com";
// Create an S3 client
const Aws::S3::S3Client s3Client(
Aws::Auth::AWSCredentials(
"AccessKeyId", // Fill in the AccessKeyId from the key pair
"SecretAccessKey" // Fill in the SecretAccessKey from the key pair
),
nullptr, clientConfig);
// Create HeadObject request
Aws::S3::Model::HeadObjectRequest request;
request.SetBucket("bucketid1"); // Set the bucket to the storage bucket ID in the VOD professional application
request.SetKey("a/b/c.jpeg"); // Path of the media file in the bucket
// Send the request.
auto outcome = s3Client.HeadObject(request);
if (outcome.IsSuccess()) {
std::cout << "Head object succeeded!" << std::endl;
const auto &object = outcome.GetResult();
std::cout << "Content Length: " << object.GetContentLength() << std::endl;
} else {
const auto error = outcome.GetError();
std::cout << "Error: " << error.GetMessage() << std::endl;
}
// Clean up the AWS SDK
Aws::ShutdownAPI(options);
return 0;
}
import boto3
from botocore.config import Config
from botocore.exceptions import ClientError


# Create an S3 client
s3_client = boto3.client(
's3',
aws_access_key_id='AccessKeyId', # Fill in the AccessKeyId from the key pair
aws_secret_access_key='SecretAccessKey', # Fill in the SecretAccessKey from the key pair
endpoint_url='https://vodsrc-internal.ap-guangzhou.eovod.com', # Custom access domain
)

try:
# Get media file metadata
response = s3_client.head_object(
Bucket="bucketid1", # Set the bucket to the storage bucket ID in the VOD professional application
Key="a/b/c.jpeg" // Path of the media file in the bucket
)
print(response)
except ClientError as e:
print(f"Error: {e}")


EdgeOne Acceleration Domain Name

Professional applications support using Tencent Cloud EdgeOne to accelerate the distribution of media content. Customers can configure the origin server of the domain name in EdgeOne as the VOD professional application, enabling the use of a custom domain name to quickly download or play media files through EdgeOne's powerful Secure Content Delivery Network.
For instructions on adding an acceleration domain name for Professional Version applications in EdgeOne, refer to the EdgeOne documentation VOD Origin Server Guide and Adding A Domain Name for Acceleration.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon