Comments (6)
I need this badly as well
from tencentcloud-sdk-python.
I need this badly as well
proxy with authentication
from tencentcloud-sdk-python.
The current community version of the Tencent Cloud SDK for Python has better support for proxy server configuration.
Take the serverless cloud function product as an example:
Import Module
First we need to import the Tencent Cloud SDK for Python related namespaces and modules:
from tencent.cloud.core import proxies
from tencent.cloud.serverless import functions
Product Client
Next we need to instantiate a serverless cloud function product client instance:
client = functions.Client(
access_proxies = proxies.Proxies(
proxy_name = 'default',
proxy_type = proxies.ProxyType.Http,
proxy_endpoint = '127.0.0.1:1080',
proxy_auth = {
'username': 'root',
'password': 'root'
}
)
)
Of course, there is another way:
client = functions.fetch_client() # This is related to the current hyper-thread.
client.set_access_proxies(...) # The parameters are consistent with access_proxies.
Call Function
Finally we call a serverless cloud function and get the native return value:
text: str = client.easy_invoke('ap-shanghai', 'default', 'hello')
print('return value: ' + text)
Data Type Proxies
also supports managing multiple proxy server configurations, which can be set by accessing the proxies
properties of the client instance.
The Tencent Cloud SDK for Python Community Edition is now available through GitHub and PyPI, see the detailed online documentation for more details.
GitHub repository: https://github.com/nobody-night/tencent-cloud-sdk-python
Online documentation: https://smallso.gitbook.io/tencent-cloud-sdk/
from tencentcloud-sdk-python.
我配置代理时,提示我 missing environment variable <'TENCENTCLOUD_SECRETID'> 请问是什么错误
from tencentcloud-sdk-python.
我配置代理时,提示我 missing environment variable <'TENCENTCLOUD_SECRETID'> 请问是什么错误
@Instantnoodles-madman Hi, Instantnoodles-madman! 该错误指示当前运行环境缺少环境变量 TENCENTCLOUD_SECRETID
,该环境变量用于存储 Tencent Cloud API 访问凭据的 Secret ID 值。我想这可能与您使用 Tencent Cloud SDK for Python 的方式有关,如果没有指定访问凭据,默认 Tencent Cloud SDK for Python 将采用一种被称之为“环境凭据”的访问凭据类型来访问 Tencent Cloud API,也即通过获取运行环境中预设的环境变量作为访问凭据。目前支持的访问凭据类型有:
- 默认凭据(在源代码中硬编码)
- 环境凭据
- 文件凭据
Tencent Cloud SDK for Python 简体中文在线文档的入门篇中会向开发者介绍如何创建并获取适用于您 Tencent Cloud 账户的凭据,然后如何将其用于 Tencent Cloud SDK for Python;最佳实践篇中也会向开发者介绍如何选择并使用适合的访问凭据类型。请您参阅:
- https://smallso.gitbook.io/tencent-cloud-sdk/python-getting-started
- https://smallso.gitbook.io/tencent-cloud-sdk/python-best-practices/other-products/select-credential-type
相信您通过阅读 Tencent Cloud SDK for Python 在线文档能很快掌握其使用方法。如果您有其他关于 Tencent Cloud SDK for Python 等非该 Issue 主题的问题,请考虑转到 https://github.com/nobody-night/tencent-cloud-sdk-python/issues 跟踪器打开一个新 Issue。
from tencentcloud-sdk-python.
fixed by db68d5e
from tencentcloud-sdk-python.
Related Issues (20)
- 问题:测试通过配置文件获取ID和key时报错 KeyError: 'HOME'
- 调用查询实例列表api报错 HOT 1
- 为什么release不更新了,版本太老了... HOT 2
- 访问 sms.tencentclound.com 时报错: SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] HOT 1
- tencentcloud.es.v20180416.models.NodeInfo has no attr ```MemSize``` HOT 1
- cvm 何时能支持按实例名模糊搜索? HOT 1
- 通用印刷体识别 TencentCloudSDKException code:ClientNetworkErroressage HOT 1
- Read time out HOT 1
- Remote end closed connection without response
- code:ClientNetworkError message:HTTPSConnectionPool(host='tts.tencentcloudapi.com', port=443): Max retries exceeded with url: / HOT 1
- sdk是否有提供修改http请求信息的切口 HOT 2
- requests>=2.27.0,<=2.28.0一定要这个吗? HOT 3
- 能否支持异步?
- ModuleNotFoundError: No module named 'tencentcloud.common' HOT 1
- 是否有提供 DNSPOD 的自定義線路相關接口? HOT 1
- COS 对象存储服务支持使用该 SDK 调用吗? HOT 1
- 已经填入了 secretId,secretKey 但还是告警
- 'tencentcloud.common.credential' has no attribute 'token' HOT 1
- TencentCloudSDKException: The combination of parameters between .InternetAccessible.BandwidthPackageId and PublicIpAssigned is incorrect
- 混元大模型API调用示例报错
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tencentcloud-sdk-python.