Comparison Item | LHCOS | COS |
Supported Region | Public Cloud (Hong Kong (China) and other regions outside Chinese mainland): Hong Kong (China), Singapore, Jakarta, Tokyo, Frankfurt, Virginia (US East), Sao Paulo Financial Cloud: Not supported | Public Cloud (Chinese mainland regions): Beijing, Shanghai, Guangzhou, Nanjing, Chengdu, Chongqing Public Cloud (Hong Kong (China) and other regions outside Chinese mainland): Hong Kong (China), Singapore, Jakarta, Seoul, Bangkok, Tokyo, Riyadh, Silicon Valley (US West), Virginia (US East), Sao Paulo, Frankfurt Financial Cloud: Shenzhen Finance, Shanghai Finance, Beijing Finance |
Access Domain | <Bucket-Appid>.cos.<Region>.myqcloud.com, Custom origin server domain name is not supported. | <Bucket-Appid>.cos.<Region>.myqcloud.com, Custom origin server domain name is supported. |
Billing | Only storage capacity fees and public network downstream traffic fees are charged. | In addition to storage capacity fees and traffic fees, other billable items such as request fees and retrieval fees are also charged. |
Prepaid | - | Supports multiple storage type packages such as storage capacity packages, public network downstream traffic packages, number of requests packages. Each account supports the purchase of multiple resource packages, and multiple resource packages can be stacked. |
Supported Storage Type | Makes no distinction between storage types | Standard Storage, Infrequent Access Storage, Archive Storage, Deep Archive Storage, Intelligent Tiering Storage, and so on. |
Object operations | Supports basic operations such as object upload (simple upload, form-based upload, multipart upload), copy, download, delete, and listing. For details, see File Operations. | In addition to basic operations, advanced features such as COS Select, Object Tag, Multi-AZ Storage, and multiple storage types are supported. For details, see COS Feature Overview. |
Bucket operations | Supports only basic features, including creating buckets, emptying buckets, deleting buckets, hosting static websites, and setting bucket access permissions. For details, see Bucket operations. | In addition to basic features, advanced features such as lifecycle, version control, bucket inventory, and cross-region replication are supported. For details, see COS Feature Overview. |
Lighthouse Integration | - | |
| | |
API | Object-level operations support invoking APIs. | Object-level operations and bucket operations both support invoking APIs. |
SDK | Supports COS SDK | Supports COS SDK |
# -*- coding=utf-8from qcloud_cos import CosConfigfrom qcloud_cos import CosS3Clientimport sysimport osimport logging# Normally, the log level uses INFO. When troubleshooting is required, it can be changed to DEBUG, at which time the SDK will print communication information with the server.logging.basicConfig(level=logging.INFO, stream=sys.stdout)# 1. Set user attributes, including secret_id, secret_key, region, etc. Appid has been removed from CosConfig. Please include the Appid in the Bucket parameter. The Bucket is composed of BucketName-Appid.secret_id = os.environ['COS_SECRET_ID'] # User's SecretId. It is recommended to use a sub-account key, as authorization follows the principle of least privilege to reduce usage risks. For obtaining sub-account keys, refer to https://www.tencentcloud.com/document/product/598/37140?from_cn_redirect=1secret_key = os.environ['COS_SECRET_KEY'] # User's SecretKey. It is recommended to use a sub-account key, as authorization follows the principle of least privilege to reduce usage risks. For obtaining sub-account keys, refer to https://www.tencentcloud.com/document/product/598/37140?from_cn_redirect=1region = 'ap-beijing' # Replace with the user's region. The region to which the created bucket belongs can be viewed in the console at https://console.tencentcloud.com/cos5/bucket# For a list of all regions supported by COS, refer to https://www.tencentcloud.com/document/product/436/6224?from_cn_redirect=1token = None # If using permanent credentials, the token does not need to be entered. If using temporary credentials, it must be provided. For guidance on generating and using temporary credentials, refer to https://www.tencentcloud.com/document/product/436/14048?from_cn_redirect=1scheme = 'https' # Specifies the protocol (http/https) used to access COS. The default is https, and this field is optional.config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key, Token=token, Scheme=scheme)client = CosS3Client(config)# Method 1: Explicitly set StorageClass to DEFAULTfile_name = 'test.txt'with open('test.txt', 'rb') as fp:response = client.put_object(Bucket='examplebucket-1250000000', # The Bucket is composed of BucketName-APPIDBody=fp,Key=file_name,StorageClass='DEFAULT',ContentType='text/html; charset=utf-8')print(response['ETag'])# Method 2: Do not set the StorageClass parameterfile_name = 'test.txt'with open('test.txt', 'rb') as fp:response = client.put_object(Bucket='examplebucket-1250000000', # The Bucket is composed of BucketName-APPIDBody=fp,Key=file_name,ContentType='text/html; charset=utf-8')print(response['ETag'])
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan