tccli 3.0.1311.1__py2.py3-none-any.whl → 3.0.1312.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/batch/v20170312/api.json +119 -143
- tccli/services/batch/v20170312/examples.json +5 -5
- tccli/services/cbs/v20170312/api.json +19 -16
- tccli/services/cbs/v20170312/examples.json +1 -1
- tccli/services/clb/v20180317/api.json +33 -33
- tccli/services/clb/v20180317/examples.json +8 -8
- tccli/services/cynosdb/v20190107/examples.json +1 -1
- tccli/services/dbbrain/dbbrain_client.py +147 -41
- tccli/services/dbbrain/v20210527/api.json +224 -0
- tccli/services/dbbrain/v20210527/examples.json +16 -0
- tccli/services/dnspod/dnspod_client.py +53 -0
- tccli/services/dnspod/v20210323/api.json +287 -0
- tccli/services/dnspod/v20210323/examples.json +8 -0
- tccli/services/domain/v20180808/api.json +21 -21
- tccli/services/domain/v20180808/examples.json +2 -2
- tccli/services/goosefs/v20220519/api.json +5 -5
- tccli/services/ims/v20201229/api.json +93 -102
- tccli/services/lkeap/v20240522/api.json +1 -1
- tccli/services/mps/v20190612/api.json +96 -1
- tccli/services/postgres/v20170312/api.json +4 -4
- tccli/services/tcb/v20180608/api.json +5 -5
- tccli/services/thpc/thpc_client.py +53 -0
- tccli/services/thpc/v20211109/api.json +2 -2
- tccli/services/thpc/v20220401/api.json +3 -3
- tccli/services/thpc/v20230321/api.json +43 -0
- tccli/services/thpc/v20230321/examples.json +8 -0
- tccli/services/tmt/tmt_client.py +61 -8
- tccli/services/tmt/v20180321/api.json +166 -0
- tccli/services/tmt/v20180321/examples.json +14 -0
- tccli/services/vpc/v20170312/api.json +9 -9
- tccli/services/vpc/v20170312/examples.json +6 -6
- tccli/services/waf/v20180125/api.json +11 -0
- tccli/services/wedata/v20210820/api.json +603 -0
- tccli/services/wedata/v20210820/examples.json +16 -0
- tccli/services/wedata/wedata_client.py +106 -0
- {tccli-3.0.1311.1.dist-info → tccli-3.0.1312.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1311.1.dist-info → tccli-3.0.1312.1.dist-info}/RECORD +41 -41
- {tccli-3.0.1311.1.dist-info → tccli-3.0.1312.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1311.1.dist-info → tccli-3.0.1312.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1311.1.dist-info → tccli-3.0.1312.1.dist-info}/license_files/LICENSE +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"actions": {
|
3
3
|
"ChatCompletions": {
|
4
|
-
"document": "### 接口功能\n\n调用接口,发起一次对话请求。单账号限制接口并发上限为100。\n如需使用OpenAI兼容接口, 请参考文档:[Deepseek OpenAI对话接口](https://cloud.tencent.com/document/product/1772/115969)\n\n#### 在线体验\n如您希望在网页内直接体验 DeepSeek 模型对话,推荐您前往[腾讯云大模型知识引擎](https://cloud.tencent.com/product/lke),使用[ DeepSeek 联网助手](https://lke.cloud.tencent.com/webim_exp/#/chat/wQrAwR)。\n\n#### 已支持的模型\n- DeepSeek-V3-0324(model 参数值为**deepseek-v3-0324**)\n - DeepSeek-V3-0324为671B参数MoE模型,在编程与技术能力、上下文理解与长文本处理等方面优势突出。\n - 支持128K上下文长度,最大输出16k(不含思维链)。\n - 注意:相比于DeepSeek-V3,DeepSeek-V3-0324仅更新了模型权重,未增加参数量。总模型大小为685B,其中包括671B的主模型权重和 14B 的多令牌预测(MTP)模块权重,后续均描述主模型参数量。\n- DeepSeek-V3(model 参数值为**deepseek-v3**)\n - DeepSeek-V3为671B参数MoE模型,在百科知识、数学推理等多项任务上优势突出,评测成绩在主流榜单中位列开源模型榜首。\n - 支持64K上下文长度,最大输出16k。\n- DeepSeek-R1(model 参数值为**deepseek-r1**)\n - DeepSeek-R1为671B模型,使用强化学习训练,推理过程包含大量反思和验证,思维链长度可达数万字。 该系列模型在数学、代码以及各种复杂逻辑推理任务上推理效果优异,并为用户展现了完整的思考过程。\n - 支持
|
4
|
+
"document": "### 接口功能\n\n调用接口,发起一次对话请求。单账号限制接口并发上限为100。\n如需使用OpenAI兼容接口, 请参考文档:[Deepseek OpenAI对话接口](https://cloud.tencent.com/document/product/1772/115969)\n\n#### 在线体验\n如您希望在网页内直接体验 DeepSeek 模型对话,推荐您前往[腾讯云大模型知识引擎](https://cloud.tencent.com/product/lke),使用[ DeepSeek 联网助手](https://lke.cloud.tencent.com/webim_exp/#/chat/wQrAwR)。\n\n#### 已支持的模型\n- DeepSeek-V3-0324(model 参数值为**deepseek-v3-0324**)\n - DeepSeek-V3-0324为671B参数MoE模型,在编程与技术能力、上下文理解与长文本处理等方面优势突出。\n - 支持128K上下文长度,最大输出16k(不含思维链)。\n - 注意:相比于DeepSeek-V3,DeepSeek-V3-0324仅更新了模型权重,未增加参数量。总模型大小为685B,其中包括671B的主模型权重和 14B 的多令牌预测(MTP)模块权重,后续均描述主模型参数量。\n- DeepSeek-V3(model 参数值为**deepseek-v3**)\n - DeepSeek-V3为671B参数MoE模型,在百科知识、数学推理等多项任务上优势突出,评测成绩在主流榜单中位列开源模型榜首。\n - 支持64K上下文长度,最大输出16k。\n- DeepSeek-R1(model 参数值为**deepseek-r1**)\n - DeepSeek-R1为671B模型,使用强化学习训练,推理过程包含大量反思和验证,思维链长度可达数万字。 该系列模型在数学、代码以及各种复杂逻辑推理任务上推理效果优异,并为用户展现了完整的思考过程。\n - 支持96K上下文长度,最大输入长度64k,最大输出16k(默认4k),最大思维链输出长度32k。\n- DeepSeek-Prover-V2(model 参数值为**deepseek-prover-v2**)\n - DeepSeek-Prover-V2 为671B 参数 MoE 模型,在数学定理证明和复杂计算任务中表现出色。\n - 支持64K上下文长度,最大输出16k。\n\n\n### 计费说明\n\n- 标准计费(2025年2月26日起生效),计费模式为后付费小时结,为保证您账户资源的正常使用,请提前[开通后付费](https://lke.cloud.tencent.com/lke#/app/system/charge/postpaid)并及时[充值](https://console.cloud.tencent.com/expense/recharge)。\n\n - DeepSeek-R1 模型 | 输入:0.004元/千token | 输出(含思维链):0.016元/千token\n\n - DeepSeek-V3 模型 | 输入:0.002元/千token | 输出:0.008元/千token\n\n - DeepSeek-V3-0324 模型 | 输入:0.002元/千token | 输出:0.008元/千token\n\n - DeepSeek-Prover-V2 模型 | 暂不计费\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
6
|
"name": "DeepSeek API 接口",
|
7
7
|
"output": "ChatCompletionsResponse",
|
@@ -17941,12 +17941,40 @@
|
|
17941
17941
|
],
|
17942
17942
|
"usage": "out"
|
17943
17943
|
},
|
17944
|
+
"ImageAreaBoxInfo": {
|
17945
|
+
"document": "图片框选区域信息",
|
17946
|
+
"members": [
|
17947
|
+
{
|
17948
|
+
"disabled": false,
|
17949
|
+
"document": "图片框选区域类型,可选值:\n<li>logo:图标;</li>\n<li>text:文字。</li>\n默认值:logo。\n注意:此字段可能返回 null,表示取不到有效值。",
|
17950
|
+
"example": "logo",
|
17951
|
+
"member": "string",
|
17952
|
+
"name": "Type",
|
17953
|
+
"output_required": false,
|
17954
|
+
"required": false,
|
17955
|
+
"type": "string",
|
17956
|
+
"value_allowed_null": true
|
17957
|
+
},
|
17958
|
+
{
|
17959
|
+
"disabled": false,
|
17960
|
+
"document": "图片框选区域坐标 (像素级),[x1, y1, x2, y2],即左上角坐标、右下角坐标。\n示例值:[101, 85, 111, 95]\n注意:此字段可能返回 null,表示取不到有效值。",
|
17961
|
+
"example": "[101, 85, 111, 95]",
|
17962
|
+
"member": "int64",
|
17963
|
+
"name": "AreaCoordSet",
|
17964
|
+
"output_required": false,
|
17965
|
+
"required": false,
|
17966
|
+
"type": "list",
|
17967
|
+
"value_allowed_null": true
|
17968
|
+
}
|
17969
|
+
],
|
17970
|
+
"usage": "both"
|
17971
|
+
},
|
17944
17972
|
"ImageEncodeConfig": {
|
17945
17973
|
"document": "图片编码格式参数",
|
17946
17974
|
"members": [
|
17947
17975
|
{
|
17948
17976
|
"disabled": false,
|
17949
|
-
"document": "图片格式,取值范围:
|
17977
|
+
"document": "图片格式,取值范围:JPEG、PNG、BMP、WebP,缺省为原图格式。不支持动画。\n注意:此字段可能返回 null,表示取不到有效值。",
|
17950
17978
|
"example": "JPEG",
|
17951
17979
|
"member": "string",
|
17952
17980
|
"name": "Format",
|
@@ -17983,6 +18011,17 @@
|
|
17983
18011
|
"type": "object",
|
17984
18012
|
"value_allowed_null": true
|
17985
18013
|
},
|
18014
|
+
{
|
18015
|
+
"disabled": false,
|
18016
|
+
"document": "综合增强配置。\n注意:此字段可能返回 null,表示取不到有效值。",
|
18017
|
+
"example": "无",
|
18018
|
+
"member": "ImageQualityEnhanceConfig",
|
18019
|
+
"name": "ImageQualityEnhance",
|
18020
|
+
"output_required": false,
|
18021
|
+
"required": false,
|
18022
|
+
"type": "object",
|
18023
|
+
"value_allowed_null": true
|
18024
|
+
},
|
17986
18025
|
{
|
17987
18026
|
"disabled": false,
|
17988
18027
|
"document": "色彩增强配置。\n注意:此字段可能返回 null,表示取不到有效值。",
|
@@ -18019,6 +18058,51 @@
|
|
18019
18058
|
],
|
18020
18059
|
"usage": "both"
|
18021
18060
|
},
|
18061
|
+
"ImageEraseConfig": {
|
18062
|
+
"document": "图片擦除参数",
|
18063
|
+
"members": [
|
18064
|
+
{
|
18065
|
+
"disabled": false,
|
18066
|
+
"document": "图标擦除配置。\n注意:此字段可能返回 null,表示取不到有效值。",
|
18067
|
+
"example": "无",
|
18068
|
+
"member": "ImageEraseLogoConfig",
|
18069
|
+
"name": "ImageEraseLogo",
|
18070
|
+
"output_required": false,
|
18071
|
+
"required": false,
|
18072
|
+
"type": "object",
|
18073
|
+
"value_allowed_null": true
|
18074
|
+
}
|
18075
|
+
],
|
18076
|
+
"usage": "both"
|
18077
|
+
},
|
18078
|
+
"ImageEraseLogoConfig": {
|
18079
|
+
"document": "图标擦除配置",
|
18080
|
+
"members": [
|
18081
|
+
{
|
18082
|
+
"disabled": false,
|
18083
|
+
"document": "能力配置开关,可选值:\n<li>ON:开启;</li>\n<li>OFF:关闭。</li>\n默认值:ON。\n注意:此字段可能返回 null,表示取不到有效值。",
|
18084
|
+
"example": "ON",
|
18085
|
+
"member": "string",
|
18086
|
+
"name": "Switch",
|
18087
|
+
"output_required": false,
|
18088
|
+
"required": false,
|
18089
|
+
"type": "string",
|
18090
|
+
"value_allowed_null": true
|
18091
|
+
},
|
18092
|
+
{
|
18093
|
+
"disabled": false,
|
18094
|
+
"document": "需要擦除的多个框选区域,注意:参数数组长度最大为2。\n注意:此字段可能返回 null,表示取不到有效值。\n注意:此字段可能返回 null,表示取不到有效值。",
|
18095
|
+
"example": "无",
|
18096
|
+
"member": "ImageAreaBoxInfo",
|
18097
|
+
"name": "ImageAreaBoxes",
|
18098
|
+
"output_required": false,
|
18099
|
+
"required": false,
|
18100
|
+
"type": "list",
|
18101
|
+
"value_allowed_null": true
|
18102
|
+
}
|
18103
|
+
],
|
18104
|
+
"usage": "both"
|
18105
|
+
},
|
18022
18106
|
"ImageQualityEnhanceConfig": {
|
18023
18107
|
"document": "综合增强配置",
|
18024
18108
|
"members": [
|
@@ -18288,6 +18372,17 @@
|
|
18288
18372
|
"required": false,
|
18289
18373
|
"type": "object",
|
18290
18374
|
"value_allowed_null": true
|
18375
|
+
},
|
18376
|
+
{
|
18377
|
+
"disabled": false,
|
18378
|
+
"document": "图片擦除配置。\n注意:此字段可能返回 null,表示取不到有效值。",
|
18379
|
+
"example": "无",
|
18380
|
+
"member": "ImageEraseConfig",
|
18381
|
+
"name": "EraseConfig",
|
18382
|
+
"output_required": false,
|
18383
|
+
"required": false,
|
18384
|
+
"type": "object",
|
18385
|
+
"value_allowed_null": true
|
18291
18386
|
}
|
18292
18387
|
],
|
18293
18388
|
"usage": "both"
|
@@ -2895,8 +2895,8 @@
|
|
2895
2895
|
"type": "string"
|
2896
2896
|
},
|
2897
2897
|
{
|
2898
|
-
"disabled":
|
2899
|
-
"document": "
|
2898
|
+
"disabled": true,
|
2899
|
+
"document": "不再需要指定,内核版本号与主实例保持一致",
|
2900
2900
|
"example": "DBVersion",
|
2901
2901
|
"member": "string",
|
2902
2902
|
"name": "DBVersion",
|
@@ -8201,8 +8201,8 @@
|
|
8201
8201
|
"type": "string"
|
8202
8202
|
},
|
8203
8203
|
{
|
8204
|
-
"disabled":
|
8205
|
-
"document": "
|
8204
|
+
"disabled": true,
|
8205
|
+
"document": "实例计费类型。",
|
8206
8206
|
"example": "PREPAID",
|
8207
8207
|
"member": "string",
|
8208
8208
|
"name": "InstanceChargeType",
|
@@ -5140,8 +5140,8 @@
|
|
5140
5140
|
},
|
5141
5141
|
{
|
5142
5142
|
"disabled": false,
|
5143
|
-
"document": "
|
5144
|
-
"example": "
|
5143
|
+
"document": "Dockerfile的路径",
|
5144
|
+
"example": "Dockerfile",
|
5145
5145
|
"member": "string",
|
5146
5146
|
"name": "DockerfilePath",
|
5147
5147
|
"output_required": true,
|
@@ -6619,8 +6619,8 @@
|
|
6619
6619
|
},
|
6620
6620
|
{
|
6621
6621
|
"disabled": false,
|
6622
|
-
"document": "
|
6623
|
-
"example": "
|
6622
|
+
"document": "Dockerfile的路径",
|
6623
|
+
"example": "Dockerfile",
|
6624
6624
|
"member": "string",
|
6625
6625
|
"name": "DockerfilePath",
|
6626
6626
|
"output_required": true,
|
@@ -6680,7 +6680,7 @@
|
|
6680
6680
|
{
|
6681
6681
|
"disabled": false,
|
6682
6682
|
"document": "策略类型",
|
6683
|
-
"example": "
|
6683
|
+
"example": "Dockerfile",
|
6684
6684
|
"member": "string",
|
6685
6685
|
"name": "PolicyType",
|
6686
6686
|
"output_required": true,
|
@@ -1165,6 +1165,58 @@ def doModifyInitNodeScripts(args, parsed_globals):
|
|
1165
1165
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1166
1166
|
|
1167
1167
|
|
1168
|
+
def doModifyWorkspacesRenewFlag(args, parsed_globals):
|
1169
|
+
g_param = parse_global_arg(parsed_globals)
|
1170
|
+
|
1171
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1172
|
+
cred = credential.CVMRoleCredential()
|
1173
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1174
|
+
cred = credential.STSAssumeRoleCredential(
|
1175
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1176
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1177
|
+
)
|
1178
|
+
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):
|
1179
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1180
|
+
else:
|
1181
|
+
cred = credential.Credential(
|
1182
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1183
|
+
)
|
1184
|
+
http_profile = HttpProfile(
|
1185
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1186
|
+
reqMethod="POST",
|
1187
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1188
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1189
|
+
)
|
1190
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1191
|
+
if g_param[OptionsDefine.Language]:
|
1192
|
+
profile.language = g_param[OptionsDefine.Language]
|
1193
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1194
|
+
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
1195
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1196
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1197
|
+
model = models.ModifyWorkspacesRenewFlagRequest()
|
1198
|
+
model.from_json_string(json.dumps(args))
|
1199
|
+
start_time = time.time()
|
1200
|
+
while True:
|
1201
|
+
rsp = client.ModifyWorkspacesRenewFlag(model)
|
1202
|
+
result = rsp.to_json_string()
|
1203
|
+
try:
|
1204
|
+
json_obj = json.loads(result)
|
1205
|
+
except TypeError as e:
|
1206
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1207
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1208
|
+
break
|
1209
|
+
cur_time = time.time()
|
1210
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1211
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1212
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1213
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1214
|
+
else:
|
1215
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1216
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1217
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1218
|
+
|
1219
|
+
|
1168
1220
|
def doDeleteQueue(args, parsed_globals):
|
1169
1221
|
g_param = parse_global_arg(parsed_globals)
|
1170
1222
|
|
@@ -1306,6 +1358,7 @@ ACTION_MAP = {
|
|
1306
1358
|
"DescribeClusterStorageOption": doDescribeClusterStorageOption,
|
1307
1359
|
"BindAutoScalingGroup": doBindAutoScalingGroup,
|
1308
1360
|
"ModifyInitNodeScripts": doModifyInitNodeScripts,
|
1361
|
+
"ModifyWorkspacesRenewFlag": doModifyWorkspacesRenewFlag,
|
1309
1362
|
"DeleteQueue": doDeleteQueue,
|
1310
1363
|
"DeleteCluster": doDeleteCluster,
|
1311
1364
|
|
@@ -442,8 +442,8 @@
|
|
442
442
|
},
|
443
443
|
{
|
444
444
|
"disabled": false,
|
445
|
-
"document": "调度器类型。<br><li>
|
446
|
-
"example": "
|
445
|
+
"document": "调度器类型。<br><li>SLURM:SLURM调度器。</li>",
|
446
|
+
"example": "SLURM",
|
447
447
|
"member": "string",
|
448
448
|
"name": "SchedulerType",
|
449
449
|
"required": false,
|
@@ -296,7 +296,7 @@
|
|
296
296
|
},
|
297
297
|
{
|
298
298
|
"disabled": false,
|
299
|
-
"document": "队列名称。不指定则为默认队列。<li>SLURM默认队列为:compute。</li
|
299
|
+
"document": "队列名称。不指定则为默认队列。<li>SLURM默认队列为:compute。</li>",
|
300
300
|
"example": "compute",
|
301
301
|
"member": "string",
|
302
302
|
"name": "QueueName",
|
@@ -959,8 +959,8 @@
|
|
959
959
|
},
|
960
960
|
{
|
961
961
|
"disabled": false,
|
962
|
-
"document": "调度器类型。默认取值:SLURM。<br><li>
|
963
|
-
"example": "
|
962
|
+
"document": "调度器类型。默认取值:SLURM。<br><li>SLURM:SLURM调度器。</li>",
|
963
|
+
"example": "SLURM",
|
964
964
|
"member": "string",
|
965
965
|
"name": "SchedulerType",
|
966
966
|
"required": false,
|
@@ -147,6 +147,13 @@
|
|
147
147
|
"output": "ModifyWorkspacesAttributeResponse",
|
148
148
|
"status": "online"
|
149
149
|
},
|
150
|
+
"ModifyWorkspacesRenewFlag": {
|
151
|
+
"document": "本接口 (ModifyWorkspacesAttribute) 用于修改工作空间的属性(目前只支持修改工作空间的名称)。",
|
152
|
+
"input": "ModifyWorkspacesRenewFlagRequest",
|
153
|
+
"name": "修改工作空间的续费标识",
|
154
|
+
"output": "ModifyWorkspacesRenewFlagResponse",
|
155
|
+
"status": "online"
|
156
|
+
},
|
150
157
|
"SetAutoScalingConfiguration": {
|
151
158
|
"document": "本接口(SetAutoScalingConfiguration)用于为集群设置集群弹性伸缩配置信息。",
|
152
159
|
"input": "SetAutoScalingConfigurationRequest",
|
@@ -2829,6 +2836,42 @@
|
|
2829
2836
|
],
|
2830
2837
|
"type": "object"
|
2831
2838
|
},
|
2839
|
+
"ModifyWorkspacesRenewFlagRequest": {
|
2840
|
+
"document": "ModifyWorkspacesRenewFlag请求参数结构体",
|
2841
|
+
"members": [
|
2842
|
+
{
|
2843
|
+
"disabled": false,
|
2844
|
+
"document": "工作空间列表",
|
2845
|
+
"example": "[\"wks-rf6ogz49\"]",
|
2846
|
+
"member": "string",
|
2847
|
+
"name": "SpaceIds",
|
2848
|
+
"required": true,
|
2849
|
+
"type": "list"
|
2850
|
+
},
|
2851
|
+
{
|
2852
|
+
"disabled": false,
|
2853
|
+
"document": "自动续费标识。取值范围:<br><li>NOTIFY_AND_AUTO_RENEW:通知过期且自动续费</li><li>NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费</li><li>DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费</li><br>若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。",
|
2854
|
+
"example": "NOTIFY_AND_AUTO_RENEW",
|
2855
|
+
"member": "string",
|
2856
|
+
"name": "RenewFlag",
|
2857
|
+
"required": true,
|
2858
|
+
"type": "string"
|
2859
|
+
}
|
2860
|
+
],
|
2861
|
+
"type": "object"
|
2862
|
+
},
|
2863
|
+
"ModifyWorkspacesRenewFlagResponse": {
|
2864
|
+
"document": "ModifyWorkspacesRenewFlag返回参数结构体",
|
2865
|
+
"members": [
|
2866
|
+
{
|
2867
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
2868
|
+
"member": "string",
|
2869
|
+
"name": "RequestId",
|
2870
|
+
"type": "string"
|
2871
|
+
}
|
2872
|
+
],
|
2873
|
+
"type": "object"
|
2874
|
+
},
|
2832
2875
|
"NodeActivity": {
|
2833
2876
|
"document": "节点活动信息。",
|
2834
2877
|
"members": [
|
@@ -168,6 +168,14 @@
|
|
168
168
|
"title": "修改工作空间的名称"
|
169
169
|
}
|
170
170
|
],
|
171
|
+
"ModifyWorkspacesRenewFlag": [
|
172
|
+
{
|
173
|
+
"document": "修改工作空间实例的续费标识",
|
174
|
+
"input": "POST / HTTP/1.1\nHost: thpc.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyWorkspacesRenewFlag\n<公共请求参数>\n\n{\n \"SpaceIds\": [\n \"wks-xxxx\"\n ],\n \"RenewFlag\": \"NOTIFY_AND_AUTO_RENEW\"\n}",
|
175
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"84dea32c-55a7-4a07-b2e9-f7ba4dfaad58\"\n }\n}",
|
176
|
+
"title": "修改工作空间实例的续费标识"
|
177
|
+
}
|
178
|
+
],
|
171
179
|
"SetAutoScalingConfiguration": [
|
172
180
|
{
|
173
181
|
"document": "集群配置弹性伸缩策略信息。",
|
tccli/services/tmt/tmt_client.py
CHANGED
@@ -121,7 +121,7 @@ def doTextTranslateBatch(args, parsed_globals):
|
|
121
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
122
|
|
123
123
|
|
124
|
-
def
|
124
|
+
def doImageTranslateLLM(args, parsed_globals):
|
125
125
|
g_param = parse_global_arg(parsed_globals)
|
126
126
|
|
127
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +150,11 @@ def doImageTranslate(args, parsed_globals):
|
|
150
150
|
client = mod.TmtClient(cred, g_param[OptionsDefine.Region], profile)
|
151
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
153
|
+
model = models.ImageTranslateLLMRequest()
|
154
154
|
model.from_json_string(json.dumps(args))
|
155
155
|
start_time = time.time()
|
156
156
|
while True:
|
157
|
-
rsp = client.
|
157
|
+
rsp = client.ImageTranslateLLM(model)
|
158
158
|
result = rsp.to_json_string()
|
159
159
|
try:
|
160
160
|
json_obj = json.loads(result)
|
@@ -225,6 +225,58 @@ def doGetFileTranslate(args, parsed_globals):
|
|
225
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
226
|
|
227
227
|
|
228
|
+
def doFileTranslate(args, parsed_globals):
|
229
|
+
g_param = parse_global_arg(parsed_globals)
|
230
|
+
|
231
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
232
|
+
cred = credential.CVMRoleCredential()
|
233
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
234
|
+
cred = credential.STSAssumeRoleCredential(
|
235
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
236
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
237
|
+
)
|
238
|
+
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):
|
239
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
240
|
+
else:
|
241
|
+
cred = credential.Credential(
|
242
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
243
|
+
)
|
244
|
+
http_profile = HttpProfile(
|
245
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
246
|
+
reqMethod="POST",
|
247
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
248
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
249
|
+
)
|
250
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
251
|
+
if g_param[OptionsDefine.Language]:
|
252
|
+
profile.language = g_param[OptionsDefine.Language]
|
253
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
254
|
+
client = mod.TmtClient(cred, g_param[OptionsDefine.Region], profile)
|
255
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
256
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
+
model = models.FileTranslateRequest()
|
258
|
+
model.from_json_string(json.dumps(args))
|
259
|
+
start_time = time.time()
|
260
|
+
while True:
|
261
|
+
rsp = client.FileTranslate(model)
|
262
|
+
result = rsp.to_json_string()
|
263
|
+
try:
|
264
|
+
json_obj = json.loads(result)
|
265
|
+
except TypeError as e:
|
266
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
267
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
268
|
+
break
|
269
|
+
cur_time = time.time()
|
270
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
271
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
272
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
273
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
274
|
+
else:
|
275
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
276
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
277
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
|
+
|
279
|
+
|
228
280
|
def doTextTranslate(args, parsed_globals):
|
229
281
|
g_param = parse_global_arg(parsed_globals)
|
230
282
|
|
@@ -277,7 +329,7 @@ def doTextTranslate(args, parsed_globals):
|
|
277
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
330
|
|
279
331
|
|
280
|
-
def
|
332
|
+
def doImageTranslate(args, parsed_globals):
|
281
333
|
g_param = parse_global_arg(parsed_globals)
|
282
334
|
|
283
335
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -306,11 +358,11 @@ def doFileTranslate(args, parsed_globals):
|
|
306
358
|
client = mod.TmtClient(cred, g_param[OptionsDefine.Region], profile)
|
307
359
|
client._sdkVersion += ("_CLI_" + __version__)
|
308
360
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.
|
361
|
+
model = models.ImageTranslateRequest()
|
310
362
|
model.from_json_string(json.dumps(args))
|
311
363
|
start_time = time.time()
|
312
364
|
while True:
|
313
|
-
rsp = client.
|
365
|
+
rsp = client.ImageTranslate(model)
|
314
366
|
result = rsp.to_json_string()
|
315
367
|
try:
|
316
368
|
json_obj = json.loads(result)
|
@@ -394,10 +446,11 @@ MODELS_MAP = {
|
|
394
446
|
ACTION_MAP = {
|
395
447
|
"LanguageDetect": doLanguageDetect,
|
396
448
|
"TextTranslateBatch": doTextTranslateBatch,
|
397
|
-
"
|
449
|
+
"ImageTranslateLLM": doImageTranslateLLM,
|
398
450
|
"GetFileTranslate": doGetFileTranslate,
|
399
|
-
"TextTranslate": doTextTranslate,
|
400
451
|
"FileTranslate": doFileTranslate,
|
452
|
+
"TextTranslate": doTextTranslate,
|
453
|
+
"ImageTranslate": doImageTranslate,
|
401
454
|
"SpeechTranslate": doSpeechTranslate,
|
402
455
|
|
403
456
|
}
|