{"id":28333,"library":"tencentcloud-sdk-python-ecdn","title":"Tencent Cloud ECDN SDK for Python","description":"Official Tencent Cloud SDK for Enterprise Content Delivery Network (ECDN) services. Current version 3.0.1459, released weekly alongside the main tencentcloud-sdk-python suite. Provides Pythonic access to ECDN APIs including domain management, log reporting, and DSA configuration.","status":"active","version":"3.0.1459","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencentcloud","ecdn","cdn","cloud","sdk"],"install":[{"cmd":"pip install tencentcloud-sdk-python-ecdn","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for credential and HTTP handling","package":"tencentcloud-sdk-python-common","optional":false}],"imports":[{"note":"Direct class import sometimes fails due to __init__ reloads; use module-level import","wrong":"from tencentcloud.ecdn.v20191012.ecdn_client import EcdnClient","symbol":"EcdnClient","correct":"from tencentcloud.ecdn.v20191012 import ecdn_client"}],"quickstart":{"code":"from tencentcloud.common import credential\nfrom tencentcloud.ecdn.v20191012 import ecdn_client\nfrom tencentcloud.ecdn.v20191012 import models\n\ncred = credential.Credential(\n    secret_id=os.environ.get('TENCENTCLOUD_SECRET_ID', ''),\n    secret_key=os.environ.get('TENCENTCLOUD_SECRET_KEY', '')\n)\nclient = ecdn_client.EcdnClient(cred, 'ap-guangzhou')\n\nreq = models.DescribeDomainsConfigRequest()\nresp = client.DescribeDomainsConfig(req)\nprint(resp.to_json_string())","lang":"python","description":"Authenticate with environment variables and list ECDN domain configurations."},"warnings":[{"fix":"Use 'from tencentcloud.ecdn.v20191012 import ecdn_client' then reference ecdn_client.EcdnClient.","message":"In v3.0.1000+, the 'from tencentcloud.ecdn.v20191012 import ecdn_client' pattern is required; older direct import of EcdnClient class from the ecdn_client module may cause ImportError.","severity":"breaking","affected_versions":">=3.0.1000"},{"fix":"Always use v20191012 in the import path.","message":"The v20191012 API version is the only available version for ECDN; do not attempt to import other versions (e.g., v2018...).","severity":"deprecated","affected_versions":"all"},{"fix":"Specify an actual region like 'ap-guangzhou' or use client.set_region() after initialization.","message":"Region parameter is required even for global services; incorrectly setting region to empty string leads to an AuthenticationError.","severity":"gotcha","affected_versions":"all"},{"fix":"Install 'pip install tencentcloud-sdk-python-common[async]' for async support, then import from tencentcloud.ecdn.v20191012.async_ecdn_client.","message":"When using async client (EcdnClient from async version), you must import from the same module but the async variant is not available in this package; must install tencentcloud-sdk-python-common with async extras.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use: from tencentcloud.ecdn.v20191012 import ecdn_client; then ecdn_client.EcdnClient","cause":"Python may sometimes resolve the module as a script and the class is not at top-level; the correct import is the module itself.","error":"ImportError: cannot import name 'EcdnClient' from 'tencentcloud.ecdn.v20191012.ecdn_client'"},{"fix":"Set TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY environment variables correctly.","cause":"Missing or invalid secret ID/Key environment variables.","error":"tencentcloud.common.exception.TencentCloudSDKException: [TencentCloudSDKException] code: AuthFailure.SecretIdNotFound"},{"fix":"Ensure you are using the correct API version (v20191012) and upgrading to the latest SDK version.","cause":"Using an older or mismatched API version where the method does not exist.","error":"AttributeError: 'EcdnClient' object has no attribute 'DescribeDomainsConfig'"},{"fix":"Use credential.Credential(secret_id, secret_key) without keyword arguments or upgrade to latest SDK.","cause":"Credential class expects positional arguments in older versions; or using old credential pattern.","error":"TypeError: __init__() got an unexpected keyword argument 'secret_id'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}