tccli 3.0.1268.1__py2.py3-none-any.whl → 3.0.1269.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tccli/__init__.py +1 -1
- tccli/services/__init__.py +5 -1
- tccli/services/aiart/aiart_client.py +106 -0
- tccli/services/aiart/v20221229/api.json +275 -0
- tccli/services/aiart/v20221229/examples.json +16 -0
- tccli/services/billing/billing_client.py +4 -163
- tccli/services/billing/v20180709/api.json +0 -489
- tccli/services/billing/v20180709/examples.json +0 -24
- tccli/services/cat/v20180409/api.json +3 -1
- tccli/services/cbs/v20170312/api.json +9 -0
- tccli/services/ccc/v20200210/api.json +11 -11
- tccli/services/ccc/v20200210/examples.json +2 -2
- tccli/services/cdb/v20170320/api.json +48 -18
- tccli/services/cfw/v20190904/api.json +30 -30
- tccli/services/ckafka/v20190819/api.json +10 -0
- tccli/services/csip/v20221121/api.json +38 -38
- tccli/services/cwp/cwp_client.py +4 -57
- tccli/services/cwp/v20180228/api.json +0 -184
- tccli/services/cwp/v20180228/examples.json +0 -8
- tccli/services/cynosdb/v20190107/api.json +1 -1
- tccli/services/cynosdb/v20190107/examples.json +1 -1
- tccli/services/dcdb/dcdb_client.py +122 -16
- tccli/services/dcdb/v20180411/api.json +222 -0
- tccli/services/dcdb/v20180411/examples.json +16 -0
- tccli/services/dlc/v20210125/api.json +145 -26
- tccli/services/dlc/v20210125/examples.json +18 -18
- tccli/services/domain/v20180808/api.json +8 -8
- tccli/services/domain/v20180808/examples.json +3 -3
- tccli/services/es/v20180416/api.json +9 -9
- tccli/services/ess/v20201111/api.json +1 -1
- tccli/services/essbasic/v20210526/api.json +3 -3
- tccli/services/essbasic/v20210526/examples.json +2 -2
- tccli/services/facefusion/v20220927/api.json +4 -4
- tccli/services/faceid/v20180301/api.json +5 -5
- tccli/services/faceid/v20180301/examples.json +6 -0
- tccli/services/gme/v20180711/api.json +118 -115
- tccli/services/gme/v20180711/examples.json +6 -6
- tccli/services/hunyuan/v20230901/api.json +9 -0
- tccli/services/iotexplorer/v20190423/api.json +4 -4
- tccli/services/iotexplorer/v20190423/examples.json +5 -5
- tccli/services/keewidb/v20220308/api.json +2 -2
- tccli/services/lcic/v20220817/api.json +177 -177
- tccli/services/lcic/v20220817/examples.json +2 -2
- tccli/services/lighthouse/v20200324/api.json +76 -67
- tccli/services/live/v20180801/api.json +1 -1
- tccli/services/lke/v20231130/api.json +31 -0
- tccli/services/lkeap/v20240522/api.json +55 -9
- tccli/services/lkeap/v20240522/examples.json +1 -1
- tccli/services/mna/mna_client.py +106 -0
- tccli/services/mna/v20210119/api.json +246 -0
- tccli/services/mna/v20210119/examples.json +16 -0
- tccli/services/monitor/monitor_client.py +62 -57
- tccli/services/monitor/v20230616/api.json +266 -0
- tccli/services/monitor/v20230616/examples.json +19 -0
- tccli/services/mqtt/mqtt_client.py +489 -12
- tccli/services/mqtt/v20240516/api.json +864 -3
- tccli/services/mqtt/v20240516/examples.json +72 -0
- tccli/services/ocr/ocr_client.py +53 -0
- tccli/services/ocr/v20181119/api.json +246 -1
- tccli/services/ocr/v20181119/examples.json +8 -0
- tccli/services/postgres/postgres_client.py +334 -16
- tccli/services/postgres/v20170312/api.json +717 -34
- tccli/services/postgres/v20170312/examples.json +72 -0
- tccli/services/ssl/v20191205/api.json +496 -493
- tccli/services/ssl/v20191205/examples.json +144 -24
- tccli/services/taf/taf_client.py +0 -159
- tccli/services/taf/v20200210/api.json +0 -665
- tccli/services/taf/v20200210/examples.json +0 -24
- tccli/services/teo/v20220901/api.json +2 -2
- tccli/services/tione/v20211111/api.json +14 -3
- tccli/services/trabbit/__init__.py +4 -0
- tccli/services/trabbit/trabbit_client.py +1691 -0
- tccli/services/trabbit/v20230418/api.json +4773 -0
- tccli/services/trabbit/v20230418/examples.json +237 -0
- tccli/services/trtc/v20190722/api.json +8 -8
- tccli/services/trtc/v20190722/examples.json +2 -2
- tccli/services/vclm/v20240523/api.json +0 -450
- tccli/services/vclm/v20240523/examples.json +0 -48
- tccli/services/vclm/vclm_client.py +0 -159
- tccli/services/wedata/v20210820/api.json +211 -33
- tccli/services/wedata/v20210820/examples.json +14 -0
- tccli/services/wedata/wedata_client.py +53 -0
- {tccli-3.0.1268.1.dist-info → tccli-3.0.1269.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1268.1.dist-info → tccli-3.0.1269.1.dist-info}/RECORD +87 -81
- {tccli-3.0.1268.1.dist-info → tccli-3.0.1269.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1268.1.dist-info → tccli-3.0.1269.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1268.1.dist-info → tccli-3.0.1269.1.dist-info}/license_files/LICENSE +0 -0
@@ -1,9 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"actions": {
|
3
3
|
"ChatCompletions": {
|
4
|
-
"document": "#### 接口功能\n\n调用接口,发起一次对话请求。\n如需使用OpenAI兼容接口, 请参考文档:[OpenAI
|
4
|
+
"document": "#### 接口功能\n\n调用接口,发起一次对话请求。\n如需使用OpenAI兼容接口, 请参考文档:[Deepseek OpenAI对话接口](https://cloud.tencent.com/document/product/1772/115969)\n\n#### 已支持的模型\n- DeepSeek-V3(model 参数值为**deepseek-v3**)\n - DeepSeek-V3为671B参数MoE模型,在百科知识、数学推理等多项任务上优势突出,评测成绩在主流榜单中位列开源模型榜首。\n - 支持64K上下文长度,最大输入56k,最大输出8k(不含思维链)。\n- DeepSeek-R1(model 参数值为**deepseek-r1**)\n - DeepSeek-R1为671B模型,使用强化学习训练,推理过程包含大量反思和验证,思维链长度可达数万字。 该系列模型在数学、代码以及各种复杂逻辑推理任务上推理效果优异,并为用户展现了完整的思考过程。\n - 支持64K上下文长度,最大输入56k,最大输出8k(不含思维链)。\n\n#### 计费说明\n- 限时免费\n\n本接口调用DeepSeek系列模型限时免费。即日至北京时间2025年2月25日23:59:59,所有腾讯云用户均可享受DeepSeek-V3、DeepSeek-R1模型限时免费服务,单账号限制接口并发上限为5。在此之后,模型价格将恢复至原价。\n- 标准计费(2025年2月26日起生效)\n\n \n\n### Openai兼容协议接口\n知识引擎原子能力大模型对话 API 兼容了 OpenAI 的接口规范,这意味着您可以直接使用 OpenAI 官方提供的 SDK 来调用大模型对话接口。您仅需要将 base_url 和 [api_key](https://cloud.tencent.com/document/product/1772/115970) 替换成相关配置,不需要对应用做额外修改,即可无缝将您的应用切换到相应的大模型。请参考文档:[Deepseek OpenAI对话接口](https://cloud.tencent.com/document/product/1772/115969)。\n> base_url: https://api.lkeap.cloud.tencent.com/v1\n\n> api_key的获取请参考[API KEY管理](https://cloud.tencent.com/document/product/1772/115970)\n\n\n#### 快速接入\n1. 完成[实名认证](https://console.cloud.tencent.com/developer/auth)。\n2. 主账户前往[控制台](https://console.cloud.tencent.com/lkeap)开通服务。若为子账户,需由主账号在[权限管理](https://console.cloud.tencent.com/cam)中为子账号授权,关联预设策略,策略名称:QcloudLKEAPFullAccess。\n3. 通过API Explorer[在线调试](https://console.cloud.tencent.com/api/explorer?Product=lkeap&Version=2024-05-22&Action=ChatCompletions)。\n4. 使用[官方 SDK ](https://cloud.tencent.com/document/product/1772/115963#SDK)调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言)。\n\n-----------\n\n### SDK调用示例\n通过本地代码调用本接口(支持Python/Java/PHP/Go/Node.js/.NET等语言):下面的代码以 Python 语言为例,展示如何访问腾讯云上的DeepSeek模型API的样例。\n(1)安装环境\n```\npython3 -m pip install --upgrade tencentcloud-sdk-python-common\npython3 -m pip install --upgrade tencentcloud-sdk-python-lkeap\n```\n\n(2)示例代码\n\n- 其中SecretKey和SecretID需要从腾讯云控制台获取\n\n- 参数params中模型Model字段可以选择“deepseek-r1“和“deepseek-v3”\n\n```\n# -*- coding: utf-8 -*-\nimport json\n\nfrom tencentcloud.common.common_client import CommonClient\nfrom tencentcloud.common import credential\nfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\nfrom tencentcloud.common.profile.client_profile import ClientProfile\nfrom tencentcloud.common.profile.http_profile import HttpProfile\n\nclass NonStreamResponse(object):\n def __init__(self):\n self.response = \"\"\n\n def _deserialize(self, obj):\n self.response = json.dumps(obj)\n\ntry:\n # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密\n # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305\n # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取\n cred = credential.Credential(\"\", \"\")\n\n httpProfile = HttpProfile()\n httpProfile.endpoint = \"lkeap.tencentcloudapi.com\"\n httpProfile.reqTimeout = 40000 # 流式接口可能耗时较长\n clientProfile = ClientProfile()\n clientProfile.httpProfile = httpProfile\n\n params = \"{\\\"Model\\\":\\\"deepseek-r1\\\",\\\"Messages\\\":[{\\\"Role\\\":\\\"user\\\",\\\"Content\\\":\\\"你好\\\"}],\\\"Stream\\\":true}\";\n common_client = CommonClient(\"lkeap\", \"2024-05-22\", cred, \"ap-guangzhou\", profile=clientProfile)\n resp = common_client._call_and_deserialize(\"ChatCompletions\", json.loads(params), NonStreamResponse)\n if isinstance(resp, NonStreamResponse): # 非流式响应\n print(resp.response)\n else: # 流式响应\n for event in resp:\n print(event)\nexcept TencentCloudSDKException as err:\n print(err)\n\n```\n\n**DeepSeek-R1使用建议**\n\n1. 将温度设置在 0.5-0.7 范围内(建议为0.6),以防止无休止的重复或不连贯的输出。\n2. 避免添加system prompt,所有说明都应包含在user prompt中。",
|
5
5
|
"input": "ChatCompletionsRequest",
|
6
|
-
"name": "
|
6
|
+
"name": "DeepSeek API 接口",
|
7
7
|
"output": "ChatCompletionsResponse",
|
8
8
|
"status": "online"
|
9
9
|
},
|
@@ -169,14 +169,14 @@
|
|
169
169
|
"status": "online"
|
170
170
|
},
|
171
171
|
"UploadDoc": {
|
172
|
-
"document": "用于上传文档内容。上传的文档将存储在知识库中,可以通过
|
172
|
+
"document": "用于上传文档内容。上传的文档将存储在知识库中,可以通过RetrieveKnowledge[知识库内容检索接口](https://cloud.tencent.com/document/product/1772/115349)进行检索。 \n使用场景:适用于需要长期存储和检索的文档内容,如产品手册、用户指南等。",
|
173
173
|
"input": "UploadDocRequest",
|
174
174
|
"name": "上传文档",
|
175
175
|
"output": "UploadDocResponse",
|
176
176
|
"status": "online"
|
177
177
|
},
|
178
178
|
"UploadDocRealtime": {
|
179
|
-
"document": "
|
179
|
+
"document": "用于上传实时文档内容。\n实时文档在上传后可以立即通过SearchRealtime进行实时检索,适用于在会话中对文档进行问答的场景。",
|
180
180
|
"input": "UploadDocRealtimeRequest",
|
181
181
|
"name": "实时文档上传",
|
182
182
|
"output": "UploadDocRealtimeResponse",
|
@@ -450,7 +450,7 @@
|
|
450
450
|
"members": [
|
451
451
|
{
|
452
452
|
"disabled": false,
|
453
|
-
"document": "结束标志位,可能为 stop、
|
453
|
+
"document": "结束标志位,可能为 stop、 content_filter。\nstop 表示输出正常结束。\ncontent_filter 只在开启流式输出审核时会出现,表示安全审核未通过。",
|
454
454
|
"example": "stop",
|
455
455
|
"member": "string",
|
456
456
|
"name": "FinishReason",
|
@@ -683,7 +683,7 @@
|
|
683
683
|
},
|
684
684
|
{
|
685
685
|
"disabled": false,
|
686
|
-
"document": "文件的 Base64 值。\n支持的文件大小:所下载文件经Base64编码后不超过 8M。文件下载时间不超过 3 秒。\n支持的图片像素:单边介于20-10000px之间。\n文件的 FileUrl、FileBase64 必须提供一个,如果都提供,只使用 FileUrl。",
|
686
|
+
"document": "文件的 Base64 值。\n支持的文件类型: PNG、JPG、JPEG、PDF、GIF、BMP、TIFF\n支持的文件大小:所下载文件经Base64编码后不超过 8M。文件下载时间不超过 3 秒。\n支持的图片像素:单边介于20-10000px之间。\n文件的 FileUrl、FileBase64 必须提供一个,如果都提供,只使用 FileUrl。",
|
687
687
|
"example": "无",
|
688
688
|
"member": "string",
|
689
689
|
"name": "FileBase64",
|
@@ -2334,7 +2334,7 @@
|
|
2334
2334
|
{
|
2335
2335
|
"disabled": false,
|
2336
2336
|
"document": "检索结果",
|
2337
|
-
"example": "[{\"Metadata\":{\"Type\":\"DOC\",\"ResultSource\":\"SEMANTIC\",\"ChunkPageNumbers\":[1,2]},\"
|
2337
|
+
"example": "[{\"Metadata\":{\"Type\":\"DOC\",\"ResultSource\":\"SEMANTIC\",\"ChunkPageNumbers\":[1,2]},\"Title\":\"example.pdf\",\"Content\":\"国庆放7天假\"}]",
|
2338
2338
|
"member": "RetrievalRecord",
|
2339
2339
|
"name": "Records",
|
2340
2340
|
"output_required": false,
|
@@ -2458,7 +2458,53 @@
|
|
2458
2458
|
},
|
2459
2459
|
"UploadDocRealtimeRequest": {
|
2460
2460
|
"document": "UploadDocRealtime请求参数结构体",
|
2461
|
-
"members": [
|
2461
|
+
"members": [
|
2462
|
+
{
|
2463
|
+
"disabled": false,
|
2464
|
+
"document": "知识库ID",
|
2465
|
+
"example": "4901991032",
|
2466
|
+
"member": "string",
|
2467
|
+
"name": "KnowledgeBaseId",
|
2468
|
+
"required": true,
|
2469
|
+
"type": "string"
|
2470
|
+
},
|
2471
|
+
{
|
2472
|
+
"disabled": false,
|
2473
|
+
"document": "文件名,可选。\n**需带文件类型后缀**,当文件名无法从传入的`FileUrl`获取时需要通过该字段来明确。",
|
2474
|
+
"example": "example.pdf",
|
2475
|
+
"member": "string",
|
2476
|
+
"name": "FileName",
|
2477
|
+
"required": true,
|
2478
|
+
"type": "string"
|
2479
|
+
},
|
2480
|
+
{
|
2481
|
+
"disabled": false,
|
2482
|
+
"document": "文件类型。\n**支持的文件类型:**\n- `PDF`、`DOC`、`DOCX`、`XLS`、`XLSX`、`PPT`、`PPTX`、`MD`、`TXT`、`PNG`、`JPG`、`JPEG`、`CSV`、`HTML`、`EPUB`\n\n**支持的文件大小:**\n - `PDF`、`DOCX`、`DOC`、`PPT`、`PPTX` 最大 200M \n - `TXT`、`MD` 最大10M \n - 其他 最大20M",
|
2483
|
+
"example": "PDF",
|
2484
|
+
"member": "string",
|
2485
|
+
"name": "FileType",
|
2486
|
+
"required": true,
|
2487
|
+
"type": "string"
|
2488
|
+
},
|
2489
|
+
{
|
2490
|
+
"disabled": false,
|
2491
|
+
"document": "文件的 URL 地址。\n文件存储于腾讯云的 URL 可保障更高的下载速度和稳定性,建议文件存储于腾讯云。 非腾讯云存储的 URL 速度和稳定性可能受一定影响。\n参考:[腾讯云COS文档](https://cloud.tencent.com/document/product/436/7749)",
|
2492
|
+
"example": "https://example.com/example.pdf",
|
2493
|
+
"member": "string",
|
2494
|
+
"name": "FileUrl",
|
2495
|
+
"required": true,
|
2496
|
+
"type": "string"
|
2497
|
+
},
|
2498
|
+
{
|
2499
|
+
"disabled": false,
|
2500
|
+
"document": "过期时间的秒数,最长24小时,默认24小时",
|
2501
|
+
"example": "86400",
|
2502
|
+
"member": "int64",
|
2503
|
+
"name": "ExpireTime",
|
2504
|
+
"required": false,
|
2505
|
+
"type": "int"
|
2506
|
+
}
|
2507
|
+
],
|
2462
2508
|
"type": "object"
|
2463
2509
|
},
|
2464
2510
|
"UploadDocRealtimeResponse": {
|
@@ -2487,7 +2533,7 @@
|
|
2487
2533
|
},
|
2488
2534
|
{
|
2489
2535
|
"disabled": false,
|
2490
|
-
"document": "
|
2536
|
+
"document": "文件名。\n**需带文件类型后缀**",
|
2491
2537
|
"example": "example.pdf",
|
2492
2538
|
"member": "string",
|
2493
2539
|
"name": "FileName",
|
@@ -227,7 +227,7 @@
|
|
227
227
|
"UploadDocRealtime": [
|
228
228
|
{
|
229
229
|
"document": "实时文档上传",
|
230
|
-
"input": "POST / HTTP/1.1\nHost: lkeap.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: UploadDocRealtime\n<公共请求参数>\n\n{}",
|
230
|
+
"input": "POST / HTTP/1.1\nHost: lkeap.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: UploadDocRealtime\n<公共请求参数>\n\n{\n \"KnowledgeBaseId\": \"594669442\",\n \"FileName\": \"changan-short.doc\",\n \"FileType\": \"DOC\",\n \"FileUrl\": \"https://qidian-qbot-test-1251316161.cos.ap-guangzhou.myqcloud.com/2024-08-20/1251316161/20548499/changan-short.doc?q-sign-algorithm=sha1&q-ak=AKxxxxxxx&q-sign-time=1726245910;1726253110&q-key-time=1726245910;1726253110&q-header-list=&q-url-param-list=&q-signature=114996cce2050ca1edbe6e69606e5c01b4c5a3a1\"\n}",
|
231
231
|
"output": "{\n\t\"IsFinal\": true,\n\t\"DocId\": \"1828430526517084160\",\n\t\"Progress\": 80,\n\t\"PageNum\": 0,\n\t\"Status\": \"SUCCESS\"\n}",
|
232
232
|
"title": "实时文档上传"
|
233
233
|
}
|
tccli/services/mna/mna_client.py
CHANGED
@@ -121,6 +121,58 @@ def doGetDevicePayMode(args, parsed_globals):
|
|
121
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
122
|
|
123
123
|
|
124
|
+
def doDownloadActiveDeviceCount(args, parsed_globals):
|
125
|
+
g_param = parse_global_arg(parsed_globals)
|
126
|
+
|
127
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
128
|
+
cred = credential.CVMRoleCredential()
|
129
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
130
|
+
cred = credential.STSAssumeRoleCredential(
|
131
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
132
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
133
|
+
)
|
134
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
135
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
136
|
+
else:
|
137
|
+
cred = credential.Credential(
|
138
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
139
|
+
)
|
140
|
+
http_profile = HttpProfile(
|
141
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
142
|
+
reqMethod="POST",
|
143
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
144
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
145
|
+
)
|
146
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
147
|
+
if g_param[OptionsDefine.Language]:
|
148
|
+
profile.language = g_param[OptionsDefine.Language]
|
149
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
150
|
+
client = mod.MnaClient(cred, g_param[OptionsDefine.Region], profile)
|
151
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
152
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
+
model = models.DownloadActiveDeviceCountRequest()
|
154
|
+
model.from_json_string(json.dumps(args))
|
155
|
+
start_time = time.time()
|
156
|
+
while True:
|
157
|
+
rsp = client.DownloadActiveDeviceCount(model)
|
158
|
+
result = rsp.to_json_string()
|
159
|
+
try:
|
160
|
+
json_obj = json.loads(result)
|
161
|
+
except TypeError as e:
|
162
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
163
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
164
|
+
break
|
165
|
+
cur_time = time.time()
|
166
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
167
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
168
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
169
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
170
|
+
else:
|
171
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
172
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
173
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
|
+
|
175
|
+
|
124
176
|
def doModifyPackageRenewFlag(args, parsed_globals):
|
125
177
|
g_param = parse_global_arg(parsed_globals)
|
126
178
|
|
@@ -849,6 +901,58 @@ def doDeleteGroup(args, parsed_globals):
|
|
849
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
902
|
|
851
903
|
|
904
|
+
def doGetActiveDeviceCount(args, parsed_globals):
|
905
|
+
g_param = parse_global_arg(parsed_globals)
|
906
|
+
|
907
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
908
|
+
cred = credential.CVMRoleCredential()
|
909
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
910
|
+
cred = credential.STSAssumeRoleCredential(
|
911
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
912
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
913
|
+
)
|
914
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
915
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
916
|
+
else:
|
917
|
+
cred = credential.Credential(
|
918
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
919
|
+
)
|
920
|
+
http_profile = HttpProfile(
|
921
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
922
|
+
reqMethod="POST",
|
923
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
924
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
925
|
+
)
|
926
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
927
|
+
if g_param[OptionsDefine.Language]:
|
928
|
+
profile.language = g_param[OptionsDefine.Language]
|
929
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
930
|
+
client = mod.MnaClient(cred, g_param[OptionsDefine.Region], profile)
|
931
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
932
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
+
model = models.GetActiveDeviceCountRequest()
|
934
|
+
model.from_json_string(json.dumps(args))
|
935
|
+
start_time = time.time()
|
936
|
+
while True:
|
937
|
+
rsp = client.GetActiveDeviceCount(model)
|
938
|
+
result = rsp.to_json_string()
|
939
|
+
try:
|
940
|
+
json_obj = json.loads(result)
|
941
|
+
except TypeError as e:
|
942
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
943
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
944
|
+
break
|
945
|
+
cur_time = time.time()
|
946
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
947
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
948
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
949
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
950
|
+
else:
|
951
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
952
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
953
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
|
+
|
955
|
+
|
852
956
|
def doGetFlowStatisticByRegion(args, parsed_globals):
|
853
957
|
g_param = parse_global_arg(parsed_globals)
|
854
958
|
|
@@ -2162,6 +2266,7 @@ MODELS_MAP = {
|
|
2162
2266
|
ACTION_MAP = {
|
2163
2267
|
"SetNotifyUrl": doSetNotifyUrl,
|
2164
2268
|
"GetDevicePayMode": doGetDevicePayMode,
|
2269
|
+
"DownloadActiveDeviceCount": doDownloadActiveDeviceCount,
|
2165
2270
|
"ModifyPackageRenewFlag": doModifyPackageRenewFlag,
|
2166
2271
|
"GetFlowStatistic": doGetFlowStatistic,
|
2167
2272
|
"GetFlowStatisticByGroup": doGetFlowStatisticByGroup,
|
@@ -2176,6 +2281,7 @@ ACTION_MAP = {
|
|
2176
2281
|
"CreateQos": doCreateQos,
|
2177
2282
|
"DeleteL3Conn": doDeleteL3Conn,
|
2178
2283
|
"DeleteGroup": doDeleteGroup,
|
2284
|
+
"GetActiveDeviceCount": doGetActiveDeviceCount,
|
2179
2285
|
"GetFlowStatisticByRegion": doGetFlowStatisticByRegion,
|
2180
2286
|
"DeleteDevice": doDeleteDevice,
|
2181
2287
|
"UpdateDevice": doUpdateDevice,
|
@@ -84,6 +84,20 @@
|
|
84
84
|
"output": "DescribeQosResponse",
|
85
85
|
"status": "deprecated"
|
86
86
|
},
|
87
|
+
"DownloadActiveDeviceCount": {
|
88
|
+
"document": "下载活跃设备数量统计",
|
89
|
+
"input": "DownloadActiveDeviceCountRequest",
|
90
|
+
"name": "下载活跃设备数量统计",
|
91
|
+
"output": "DownloadActiveDeviceCountResponse",
|
92
|
+
"status": "online"
|
93
|
+
},
|
94
|
+
"GetActiveDeviceCount": {
|
95
|
+
"document": "活跃设备数量统计",
|
96
|
+
"input": "GetActiveDeviceCountRequest",
|
97
|
+
"name": "活跃设备数量统计",
|
98
|
+
"output": "GetActiveDeviceCountResponse",
|
99
|
+
"status": "online"
|
100
|
+
},
|
87
101
|
"GetDevice": {
|
88
102
|
"document": "通过指定设备的ID查找设备详细信息",
|
89
103
|
"input": "GetDeviceRequest",
|
@@ -459,6 +473,32 @@
|
|
459
473
|
],
|
460
474
|
"type": "object"
|
461
475
|
},
|
476
|
+
"ActiveDeviceList": {
|
477
|
+
"document": "激活设备数统计",
|
478
|
+
"members": [
|
479
|
+
{
|
480
|
+
"disabled": false,
|
481
|
+
"document": "数量",
|
482
|
+
"example": "1",
|
483
|
+
"member": "int64",
|
484
|
+
"name": "Count",
|
485
|
+
"output_required": false,
|
486
|
+
"type": "int",
|
487
|
+
"value_allowed_null": false
|
488
|
+
},
|
489
|
+
{
|
490
|
+
"disabled": false,
|
491
|
+
"document": "时间",
|
492
|
+
"example": "2024-11-20",
|
493
|
+
"member": "string",
|
494
|
+
"name": "Time",
|
495
|
+
"output_required": false,
|
496
|
+
"type": "string",
|
497
|
+
"value_allowed_null": false
|
498
|
+
}
|
499
|
+
],
|
500
|
+
"usage": "out"
|
501
|
+
},
|
462
502
|
"AddDeviceRequest": {
|
463
503
|
"document": "AddDevice请求参数结构体",
|
464
504
|
"members": [
|
@@ -1621,6 +1661,79 @@
|
|
1621
1661
|
],
|
1622
1662
|
"usage": "out"
|
1623
1663
|
},
|
1664
|
+
"DownloadActiveDeviceCountRequest": {
|
1665
|
+
"document": "DownloadActiveDeviceCount请求参数结构体",
|
1666
|
+
"members": [
|
1667
|
+
{
|
1668
|
+
"disabled": false,
|
1669
|
+
"document": "查询粒度。0:day, 1:week, 2:month, 不传默认为day",
|
1670
|
+
"example": "0",
|
1671
|
+
"member": "int64",
|
1672
|
+
"name": "Period",
|
1673
|
+
"required": false,
|
1674
|
+
"type": "int"
|
1675
|
+
},
|
1676
|
+
{
|
1677
|
+
"disabled": false,
|
1678
|
+
"document": "开始时间。单位秒",
|
1679
|
+
"example": "1732176361",
|
1680
|
+
"member": "int64",
|
1681
|
+
"name": "StartTime",
|
1682
|
+
"required": false,
|
1683
|
+
"type": "int"
|
1684
|
+
},
|
1685
|
+
{
|
1686
|
+
"disabled": false,
|
1687
|
+
"document": "结束时间。单位秒",
|
1688
|
+
"example": "1732176361",
|
1689
|
+
"member": "int64",
|
1690
|
+
"name": "EndTime",
|
1691
|
+
"required": false,
|
1692
|
+
"type": "int"
|
1693
|
+
},
|
1694
|
+
{
|
1695
|
+
"disabled": false,
|
1696
|
+
"document": "设备组, 不传查询全部",
|
1697
|
+
"example": "group1",
|
1698
|
+
"member": "string",
|
1699
|
+
"name": "DevGroup",
|
1700
|
+
"required": false,
|
1701
|
+
"type": "string"
|
1702
|
+
},
|
1703
|
+
{
|
1704
|
+
"disabled": false,
|
1705
|
+
"document": "license类型, 不传查询全部, 1: 租户月付,2:厂商月付,3:永久授权",
|
1706
|
+
"example": "1",
|
1707
|
+
"member": "int64",
|
1708
|
+
"name": "LicenseType",
|
1709
|
+
"required": false,
|
1710
|
+
"type": "int"
|
1711
|
+
}
|
1712
|
+
],
|
1713
|
+
"type": "object"
|
1714
|
+
},
|
1715
|
+
"DownloadActiveDeviceCountResponse": {
|
1716
|
+
"document": "DownloadActiveDeviceCount返回参数结构体",
|
1717
|
+
"members": [
|
1718
|
+
{
|
1719
|
+
"disabled": false,
|
1720
|
+
"document": "URL地址",
|
1721
|
+
"example": "http://cos.com",
|
1722
|
+
"member": "string",
|
1723
|
+
"name": "FilePath",
|
1724
|
+
"output_required": false,
|
1725
|
+
"type": "string",
|
1726
|
+
"value_allowed_null": false
|
1727
|
+
},
|
1728
|
+
{
|
1729
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
1730
|
+
"member": "string",
|
1731
|
+
"name": "RequestId",
|
1732
|
+
"type": "string"
|
1733
|
+
}
|
1734
|
+
],
|
1735
|
+
"type": "object"
|
1736
|
+
},
|
1624
1737
|
"ExpectedThreshold": {
|
1625
1738
|
"document": "用户期望门限",
|
1626
1739
|
"members": [
|
@@ -1859,6 +1972,139 @@
|
|
1859
1972
|
],
|
1860
1973
|
"usage": "out"
|
1861
1974
|
},
|
1975
|
+
"GetActiveDeviceCountRequest": {
|
1976
|
+
"document": "GetActiveDeviceCount请求参数结构体",
|
1977
|
+
"members": [
|
1978
|
+
{
|
1979
|
+
"disabled": false,
|
1980
|
+
"document": "查询粒度。0:day, 1:week, 2:month, 不传默认为day",
|
1981
|
+
"example": "0",
|
1982
|
+
"member": "int64",
|
1983
|
+
"name": "Period",
|
1984
|
+
"required": false,
|
1985
|
+
"type": "int"
|
1986
|
+
},
|
1987
|
+
{
|
1988
|
+
"disabled": false,
|
1989
|
+
"document": "开始时间。单位秒",
|
1990
|
+
"example": "1732176361",
|
1991
|
+
"member": "int64",
|
1992
|
+
"name": "StartTime",
|
1993
|
+
"required": false,
|
1994
|
+
"type": "int"
|
1995
|
+
},
|
1996
|
+
{
|
1997
|
+
"disabled": false,
|
1998
|
+
"document": "结束时间。单位秒",
|
1999
|
+
"example": "1732176361",
|
2000
|
+
"member": "int64",
|
2001
|
+
"name": "EndTime",
|
2002
|
+
"required": false,
|
2003
|
+
"type": "int"
|
2004
|
+
},
|
2005
|
+
{
|
2006
|
+
"disabled": false,
|
2007
|
+
"document": "设备组, 不传查询全部",
|
2008
|
+
"example": "group1",
|
2009
|
+
"member": "string",
|
2010
|
+
"name": "DevGroup",
|
2011
|
+
"required": false,
|
2012
|
+
"type": "string"
|
2013
|
+
},
|
2014
|
+
{
|
2015
|
+
"disabled": false,
|
2016
|
+
"document": "license类型, 不传查询全部, 1: 租户月付,2:厂商月付,3:永久授权",
|
2017
|
+
"example": "1",
|
2018
|
+
"member": "int64",
|
2019
|
+
"name": "LicenseType",
|
2020
|
+
"required": false,
|
2021
|
+
"type": "int"
|
2022
|
+
}
|
2023
|
+
],
|
2024
|
+
"type": "object"
|
2025
|
+
},
|
2026
|
+
"GetActiveDeviceCountResponse": {
|
2027
|
+
"document": "GetActiveDeviceCount返回参数结构体",
|
2028
|
+
"members": [
|
2029
|
+
{
|
2030
|
+
"disabled": false,
|
2031
|
+
"document": "激活设备统计",
|
2032
|
+
"example": "[ { \"count\": 1, \"time\": \"2024-11-20\" } ]",
|
2033
|
+
"member": "ActiveDeviceList",
|
2034
|
+
"name": "ActiveDeviceList",
|
2035
|
+
"output_required": false,
|
2036
|
+
"type": "list",
|
2037
|
+
"value_allowed_null": false
|
2038
|
+
},
|
2039
|
+
{
|
2040
|
+
"disabled": false,
|
2041
|
+
"document": "查询粒度,0:day, 1:week, 2:month, 不传默认为day",
|
2042
|
+
"example": "1",
|
2043
|
+
"member": "int64",
|
2044
|
+
"name": "Period",
|
2045
|
+
"output_required": false,
|
2046
|
+
"type": "int",
|
2047
|
+
"value_allowed_null": false
|
2048
|
+
},
|
2049
|
+
{
|
2050
|
+
"disabled": false,
|
2051
|
+
"document": "开始时间",
|
2052
|
+
"example": "2024-11-20",
|
2053
|
+
"member": "string",
|
2054
|
+
"name": "StartTime",
|
2055
|
+
"output_required": false,
|
2056
|
+
"type": "string",
|
2057
|
+
"value_allowed_null": false
|
2058
|
+
},
|
2059
|
+
{
|
2060
|
+
"disabled": false,
|
2061
|
+
"document": "结束时间",
|
2062
|
+
"example": "2024-11-20",
|
2063
|
+
"member": "string",
|
2064
|
+
"name": "EndTime",
|
2065
|
+
"output_required": false,
|
2066
|
+
"type": "string",
|
2067
|
+
"value_allowed_null": false
|
2068
|
+
},
|
2069
|
+
{
|
2070
|
+
"disabled": false,
|
2071
|
+
"document": "设备组",
|
2072
|
+
"example": "group1",
|
2073
|
+
"member": "string",
|
2074
|
+
"name": "DevGroup",
|
2075
|
+
"output_required": false,
|
2076
|
+
"type": "string",
|
2077
|
+
"value_allowed_null": false
|
2078
|
+
},
|
2079
|
+
{
|
2080
|
+
"disabled": false,
|
2081
|
+
"document": "license类型, 不传查询全部, 1: 租户月付,2:厂商月付,3:永久授权",
|
2082
|
+
"example": "1",
|
2083
|
+
"member": "string",
|
2084
|
+
"name": "LicenseType",
|
2085
|
+
"output_required": false,
|
2086
|
+
"type": "string",
|
2087
|
+
"value_allowed_null": false
|
2088
|
+
},
|
2089
|
+
{
|
2090
|
+
"disabled": false,
|
2091
|
+
"document": "租户ID",
|
2092
|
+
"example": "251198806",
|
2093
|
+
"member": "string",
|
2094
|
+
"name": "AppId",
|
2095
|
+
"output_required": false,
|
2096
|
+
"type": "string",
|
2097
|
+
"value_allowed_null": false
|
2098
|
+
},
|
2099
|
+
{
|
2100
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
2101
|
+
"member": "string",
|
2102
|
+
"name": "RequestId",
|
2103
|
+
"type": "string"
|
2104
|
+
}
|
2105
|
+
],
|
2106
|
+
"type": "object"
|
2107
|
+
},
|
1862
2108
|
"GetDevicePayModeRequest": {
|
1863
2109
|
"document": "GetDevicePayMode请求参数结构体",
|
1864
2110
|
"members": [
|
@@ -96,6 +96,22 @@
|
|
96
96
|
"title": "获取Qos加速状态"
|
97
97
|
}
|
98
98
|
],
|
99
|
+
"DownloadActiveDeviceCount": [
|
100
|
+
{
|
101
|
+
"document": "下载活跃设备数量统计",
|
102
|
+
"input": "POST / HTTP/1.1\nHost: mna.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DownloadActiveDeviceCount\n<公共请求参数>\n\n{\n \"Period\": 0,\n \"StartTime\": 1732176361,\n \"EndTime\": 1732176362,\n \"DevGroup\": \"comollit\",\n \"LicenseType\": 3\n}",
|
103
|
+
"output": "{\n \"Response\": {\n \"FilePath\": \"http://cos.com\",\n \"RequestId\": \"3c140219-cfe9-470e-b241-907877d6fb03\"\n }\n}",
|
104
|
+
"title": "下载活跃设备数量统计"
|
105
|
+
}
|
106
|
+
],
|
107
|
+
"GetActiveDeviceCount": [
|
108
|
+
{
|
109
|
+
"document": "查询活跃设备数量统计",
|
110
|
+
"input": "POST / HTTP/1.1\nHost: mna.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetActiveDeviceCount\n<公共请求参数>\n\n{\n \"Period\": 0,\n \"StartTime\": 1732176361,\n \"EndTime\": 1732176362,\n \"DevGroup\": \"comollit\",\n \"LicenseType\": 3\n}",
|
111
|
+
"output": "{\n \"Response\": {\n \"ActiveDeviceList\": [\n {\n \"Count\": 1,\n \"Time\": \"2024-11-20\"\n }\n ],\n \"DevGroup\": \"group1\",\n \"EndTime\": \"2024-11-20\",\n \"LicenseType\": \"1\",\n \"Period\": 0,\n \"StartTime\": \"2024-11-20\",\n \"RequestId\": \"3c140219-cfe9-470e-b241-907877d6fb03\"\n }\n}",
|
112
|
+
"title": "活跃设备数量统计"
|
113
|
+
}
|
114
|
+
],
|
99
115
|
"GetDevice": [
|
100
116
|
{
|
101
117
|
"document": "获取设备基本信息和网络信息",
|