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. |
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 resolutionfunc (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 clients3cli := s3.New(s3.Options{Credentials: credentials.NewStaticCredentialsProvider("AccessKeyId", // Replace with your AccessKeyID"SecretAccessKey", // Replace with your SecretAccessKey""),EndpointResolverV2: new(customEndpointResolverV2), // Custom domain configurationUsePathStyle: false, // Disable path-style requestsLogger: logging.NewStandardLogger(os.Stdout), // Log output to the standard output streamClientLogMode: aws.LogRequest | aws.LogResponse, // Log request/response headersRegion: "ap-guangzhou", // Storage region})// Get media file metadata_, _ = s3cli.HeadObject(context.TODO(), &s3.HeadObjectInput{Bucket: aws.String("bucketid1"), // Bucket ID in VOD Pro applicationKey: 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 resolverpublic static void main(String[] args) {// Initialize S3 clientS3Client 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 metadatatry {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 SDKconst Aws::SDKOptions options;InitAPI(options);// Custom domain configurationAws::Client::ClientConfiguration clientConfig;clientConfig.scheme = Aws::Http::Scheme::HTTPS;clientConfig.endpointOverride = "vodpro.ap-guangzhou.eovod.com";// Create S3 clientconst 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 requestAws::S3::Model::HeadObjectRequest request;request.SetBucket("bucketid1"); // Bucket ID in VOD Pro applicationrequest.SetKey("a/b/c.jpeg"); // Media file path in bucket// Send requestauto 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 SDKAws::ShutdownAPI(options);return 0;}
import boto3from botocore.config import Configfrom botocore.exceptions import ClientError# Create S3 clients3_client = boto3.client('s3',aws_access_key_id='AccessKeyId', # AccessKey ID from your IAM credentialsaws_secret_access_key='SecretAccessKey', # SecretAccessKey from your IAM credentialsendpoint_url='https://vodpro.ap-guangzhou.eovod.com', # Custom endpoint URLconfig=Config(s3={'addressing_style': 'virtual'}), # Use virtual hosted-style addressing)try:# Retrieve media file metadataresponse = s3_client.head_object(Bucket="bucketid1", # Bucket ID in your VOD Pro applicationKey="a/b/c.jpeg" # Media file path within the bucket)print(response)except ClientError as e:print(f"Error: {e}")
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.AccessKeyId
and SecretAccessKey
from the key management of the Pro application. For detailed steps, refer to the Key Management documentation.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: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 pointfunc (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 domainUsePathStyle: false, // request block path styleLogger: logging.NewStandardLogger(os.Stdout), // Log to standard output streamClientLogMode: aws.LogRequest | aws.LogResponse, // Print request header and response headerRegion: "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 applicationKey: 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 resolverpublic static void main(String[] args) {// Initialize the S3 clientS3Client 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 metadatatry {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 SDKconst Aws::SDKOptions options;InitAPI(options);// custom access domainAws::Client::ClientConfiguration clientConfig;clientConfig.scheme = Aws::Http::Scheme::HTTPS;clientConfig.endpointOverride = "vodsrc-internal.ap-guangzhou.eovod.com";// Create an S3 clientconst 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 requestAws::S3::Model::HeadObjectRequest request;request.SetBucket("bucketid1"); // Set the bucket to the storage bucket ID in the VOD professional applicationrequest.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 SDKAws::ShutdownAPI(options);return 0;}
import boto3from botocore.config import Configfrom botocore.exceptions import ClientError# Create an S3 clients3_client = boto3.client('s3',aws_access_key_id='AccessKeyId', # Fill in the AccessKeyId from the key pairaws_secret_access_key='SecretAccessKey', # Fill in the SecretAccessKey from the key pairendpoint_url='https://vodsrc-internal.ap-guangzhou.eovod.com', # Custom access domain)try:# Get media file metadataresponse = s3_client.head_object(Bucket="bucketid1", # Set the bucket to the storage bucket ID in the VOD professional applicationKey="a/b/c.jpeg" // Path of the media file in the bucket)print(response)except ClientError as e:print(f"Error: {e}")