tccli 3.0.1126.1__py2.py3-none-any.whl → 3.0.1128.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/services/asr/v20190614/api.json +7 -7
- tccli/services/asr/v20190614/examples.json +1 -1
- tccli/services/billing/v20180709/api.json +2 -2
- tccli/services/cam/cam_client.py +110 -57
- tccli/services/cam/v20190116/api.json +128 -0
- tccli/services/cam/v20190116/examples.json +8 -0
- tccli/services/cat/v20180409/api.json +10 -0
- tccli/services/ccc/v20200210/api.json +1 -1
- tccli/services/cds/v20180420/api.json +2 -2
- tccli/services/cls/v20201016/api.json +28 -0
- tccli/services/domain/v20180808/api.json +16 -16
- tccli/services/domain/v20180808/examples.json +9 -9
- tccli/services/dsgc/v20190723/api.json +10 -1
- tccli/services/dts/v20180330/api.json +2 -2
- tccli/services/emr/emr_client.py +53 -0
- tccli/services/emr/v20190103/api.json +354 -0
- tccli/services/emr/v20190103/examples.json +8 -0
- tccli/services/ess/v20201111/api.json +4 -4
- tccli/services/ess/v20201111/examples.json +0 -6
- tccli/services/essbasic/v20210526/api.json +6 -6
- tccli/services/hunyuan/hunyuan_client.py +12 -118
- tccli/services/hunyuan/v20230901/api.json +0 -260
- tccli/services/hunyuan/v20230901/examples.json +0 -58
- tccli/services/iotexplorer/v20190423/api.json +30 -13
- tccli/services/iotexplorer/v20190423/examples.json +3 -3
- tccli/services/mongodb/mongodb_client.py +212 -0
- tccli/services/mongodb/v20190725/api.json +322 -0
- tccli/services/mongodb/v20190725/examples.json +32 -0
- tccli/services/monitor/v20180724/api.json +6 -5
- tccli/services/monitor/v20180724/examples.json +1 -1
- tccli/services/tmt/v20180321/api.json +5 -4
- tccli/services/trtc/v20190722/api.json +1 -1
- tccli/services/tse/v20201207/api.json +2 -2
- tccli/services/tse/v20201207/examples.json +2 -2
- tccli/services/waf/v20180125/api.json +94 -0
- tccli/services/waf/v20180125/examples.json +16 -0
- tccli/services/waf/waf_client.py +106 -0
- {tccli-3.0.1126.1.dist-info → tccli-3.0.1128.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1126.1.dist-info → tccli-3.0.1128.1.dist-info}/RECORD +43 -43
- {tccli-3.0.1126.1.dist-info → tccli-3.0.1128.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1126.1.dist-info → tccli-3.0.1128.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1126.1.dist-info → tccli-3.0.1128.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '3.0.
|
1
|
+
__version__ = '3.0.1128.1'
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"status": "online"
|
30
30
|
},
|
31
31
|
"CreateRecTask": {
|
32
|
-
"document": "本接口可对较长的录音文件进行识别。如希望直接使用带界面的语音识别产品,请访问[产品体验中心](https://console.cloud.tencent.com/asr/demonstrate)。产品计费标准请查阅 [计费概述(在线版)](https://cloud.tencent.com/document/product/1093/35686)\n• 接口默认限频:20次/秒。此处仅限制任务提交频次,与识别结果返回时效无关\n• 返回时效:异步回调,非实时返回。最长3小时返回识别结果,**大多数情况下,1小时的音频1-3分钟即可完成识别**。请注意:上述返回时长不含音频下载时延,且30分钟内发送超过1000小时录音或2万条任务的情况除外\n• 音频格式:wav、mp3、m4a、flv、mp4、wma、3gp、amr、aac、ogg-opus、flac\n• 支持语言:在本页面上搜索 **EngineModelType**,或前往 [产品功能](https://cloud.tencent.com/document/product/1093/35682) 查看\n• 音频提交方式:本接口支持**音频 URL 、本地音频文件**两种请求方式。推荐使用 [腾讯云COS](https://cloud.tencent.com/document/product/436/38484) 来存储、生成URL并提交任务,此种方式将不产生外网和流量下行费用,可节约成本、提升任务速度(COS桶权限需要设置公有读私有写,或URL设置外部可访问)\n• 音频限制:音频 URL 时长不能大于5小时,文件大小不超过1GB;本地音频文件不能大于5MB\n• 如何获取识别结果:支持**回调或轮询**的方式获取结果,具体请参考 [录音文件识别结果查询](https://cloud.tencent.com/document/product/1093/37822)\n•
|
32
|
+
"document": "本接口可对较长的录音文件进行识别。如希望直接使用带界面的语音识别产品,请访问[产品体验中心](https://console.cloud.tencent.com/asr/demonstrate)。产品计费标准请查阅 [计费概述(在线版)](https://cloud.tencent.com/document/product/1093/35686)\n• 接口默认限频:20次/秒。此处仅限制任务提交频次,与识别结果返回时效无关\n• 返回时效:异步回调,非实时返回。最长3小时返回识别结果,**大多数情况下,1小时的音频1-3分钟即可完成识别**。请注意:上述返回时长不含音频下载时延,且30分钟内发送超过1000小时录音或2万条任务的情况除外\n• 音频格式:wav、mp3、m4a、flv、mp4、wma、3gp、amr、aac、ogg-opus、flac\n• 支持语言:在本页面上搜索 **EngineModelType**,或前往 [产品功能](https://cloud.tencent.com/document/product/1093/35682) 查看\n• 音频提交方式:本接口支持**音频 URL 、本地音频文件**两种请求方式。推荐使用 [腾讯云COS](https://cloud.tencent.com/document/product/436/38484) 来存储、生成URL并提交任务,此种方式将不产生外网和流量下行费用,可节约成本、提升任务速度(COS桶权限需要设置公有读私有写,或URL设置外部可访问)\n• 音频限制:音频 URL 时长不能大于5小时,文件大小不超过1GB;本地音频文件不能大于5MB\n• 如何获取识别结果:支持**回调或轮询**的方式获取结果,具体请参考 [录音文件识别结果查询](https://cloud.tencent.com/document/product/1093/37822)\n• 识别结果有效时间:识别结果在服务端保存24小时\n• 签名方法参考 [公共参数](https://cloud.tencent.com/document/api/1093/35640) 中签名方法 v3",
|
33
33
|
"input": "CreateRecTaskRequest",
|
34
34
|
"name": "录音文件识别请求",
|
35
35
|
"output": "CreateRecTaskResponse",
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"status": "online"
|
58
58
|
},
|
59
59
|
"DescribeTaskStatus": {
|
60
|
-
"document": "
|
60
|
+
"document": "调用录音文件识别请求接口后,有回调和轮询两种方式获取识别结果。\n• **注意任务有效期为24小时,超过24小时的任务请不要再查询,且不要依赖TaskId作为业务唯一ID,不同日期可能出现重复TaskId。**\n• 当采用回调方式时,识别完成后会将结果通过 POST 请求的形式通知到用户在请求时填写的回调 URL,具体请参见[ 录音识别结果回调 ](https://cloud.tencent.com/document/product/1093/52632)。\n• 当采用轮询方式时,需要主动提交任务ID来轮询识别结果,共有任务成功、等待、执行中和失败四种结果,具体信息请参见下文说明。\n• 请求方法为 HTTP POST , Content-Type为\"application/json; charset=utf-8\"\n• 签名方法参考 [公共参数](https://cloud.tencent.com/document/api/1093/35640) 中签名方法v3。\n• 默认接口请求频率限制:50次/秒,如您有提高请求频率限制的需求,请提[工单](https://console.cloud.tencent.com/workorder/category)进行咨询。",
|
61
61
|
"input": "DescribeTaskStatusRequest",
|
62
62
|
"name": "录音文件识别结果查询",
|
63
63
|
"output": "DescribeTaskStatusResponse",
|
@@ -582,7 +582,7 @@
|
|
582
582
|
},
|
583
583
|
{
|
584
584
|
"disabled": false,
|
585
|
-
"document": "回调 URL\n用户自行搭建的用于接收识别结果的服务URL\n回调格式和内容详见:[录音识别回调说明](https://cloud.tencent.com/document/product/1093/52632)\n\n注意:\n
|
585
|
+
"document": "回调 URL\n用户自行搭建的用于接收识别结果的服务URL\n回调格式和内容详见:[录音识别回调说明](https://cloud.tencent.com/document/product/1093/52632)\n\n注意:\n\n- 如果用户使用轮询方式获取识别结果,则无需提交该参数\n- 建议在回调URL中带上您的业务ID等信息,以便处理业务逻辑",
|
586
586
|
"example": "无",
|
587
587
|
"member": "string",
|
588
588
|
"name": "CallbackUrl",
|
@@ -714,7 +714,7 @@
|
|
714
714
|
"members": [
|
715
715
|
{
|
716
716
|
"disabled": false,
|
717
|
-
"document": "录音文件识别的请求返回结果,包含结果查询需要的TaskId",
|
717
|
+
"document": "录音文件识别的请求返回结果,包含结果查询需要的TaskId。\n**注意:TaskId有效期为24小时,不同日期可能出现重复TaskId,请不要依赖TaskId作为您业务系统里的唯一ID。**\n",
|
718
718
|
"example": "无",
|
719
719
|
"member": "Task",
|
720
720
|
"name": "Data",
|
@@ -816,7 +816,7 @@
|
|
816
816
|
"members": [
|
817
817
|
{
|
818
818
|
"disabled": false,
|
819
|
-
"document": "从CreateRecTask接口获取的TaskId
|
819
|
+
"document": "从CreateRecTask接口获取的TaskId,用于获取任务状态与结果。\n**注意:TaskId有效期为24小时,超过24小时的TaskId请不要再查询。**",
|
820
820
|
"example": "4500055927",
|
821
821
|
"member": "uint64",
|
822
822
|
"name": "TaskId",
|
@@ -835,7 +835,7 @@
|
|
835
835
|
"example": "{ \"Response\": { \"RequestId\": \"8824366f-0e8f-4bd4-892",
|
836
836
|
"member": "TaskStatus",
|
837
837
|
"name": "Data",
|
838
|
-
"
|
838
|
+
"output_required": true,
|
839
839
|
"type": "object",
|
840
840
|
"value_allowed_null": false
|
841
841
|
},
|
@@ -1888,7 +1888,7 @@
|
|
1888
1888
|
"members": [
|
1889
1889
|
{
|
1890
1890
|
"disabled": false,
|
1891
|
-
"document": "任务ID,可通过此ID
|
1891
|
+
"document": "任务ID,可通过此ID在轮询接口获取识别状态与结果。TaskId数据类型为**uint64**。\n**注意:TaskId有效期为24小时,不同日期可能出现重复TaskId,请不要依赖TaskId作为您业务系统里的唯一ID。**",
|
1892
1892
|
"example": "400000000",
|
1893
1893
|
"member": "uint64",
|
1894
1894
|
"name": "TaskId",
|
@@ -80,7 +80,7 @@
|
|
80
80
|
{
|
81
81
|
"document": "用户通过轮询方式获取识别结果,任务成功,并返回识别结果。",
|
82
82
|
"input": "POST / HTTP/1.1\nHost: asr.tencentcloudapi.com\nContent-Type: application/json; charset=utf-8\nX-TC-Version: 2019-06-14\nX-TC-Region: ap-shanghai\nX-TC-Action: DescribeTaskStatus\nX-TC-Timestamp: 1599142563\nAuthorization: TC3-HMAC-SHA256 Credential=AKIDYu6A16GdCxUlnbTSVItxvhOr6Bxxxxx2/2020-09-03/asr/tc3_request, SignedHeaders=content-type;host, Signature=6647fa852c9329ac5aa355c68c838358139c2d941f4ed175dd5858978f5d79c8\nContent-Length: 21\n<公共请求参数>\n\n{\n \"TaskId\": 522931820\n}",
|
83
|
-
"output": "{\n \"Response\": {\n \"RequestId\": \"a73b14a6-5044-41cb-bf32-e735d5bd69de\",\n \"Data\": {\n \"TaskId\": 9266418,\n \"Status\": 2,\n \"StatusStr\": \"success\",\n \"AudioDuration\": 2.38,\n \"Result\": \"[0:0.020,0:2.380] 腾讯云语音识别欢迎您。\\n\",\n \"ResultDetail\": [\n {\n \"FinalSentence\": \"腾讯云语音识别欢迎您。\",\n \"SliceSentence\": \"腾讯云 语音识别 欢迎 您\",\n \"StartMs\": 20,\n \"EndMs\": 2380,\n \"SpeechSpeed\": 5.9,\n \"WordsNum\": 4,\n \"Words\": [\n {\n \"OffsetStartMs\": 120,\n \"OffsetEndMs\": 780,\n \"Word\": \"腾讯云\"\n },\n {\n \"OffsetStartMs\": 780,\n \"OffsetEndMs\": 1530,\n \"Word\": \"语音识别\"\n },\n {\n \"OffsetStartMs\": 1530,\n \"OffsetEndMs\": 1860,\n \"Word\": \"欢迎\"\n },\n {\n \"OffsetStartMs\": 1860,\n \"OffsetEndMs\": 2250,\n \"Word\": \"您\"\n }\n ]\n }\n ],\n \"ErrorMsg\": \"\"\n }\n }\n}",
|
83
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"a73b14a6-5044-41cb-bf32-e735d5bd69de\",\n \"Data\": {\n \"TaskId\": 9266418,\n \"Status\": 2,\n \"StatusStr\": \"success\",\n \"AudioDuration\": 2.38,\n \"Result\": \"[0:0.020,0:2.380] 腾讯云语音识别欢迎您。\\n\",\n \"ResultDetail\": [\n {\n \"FinalSentence\": \"腾讯云语音识别欢迎您。\",\n \"SliceSentence\": \"腾讯云 语音识别 欢迎 您\",\n \"StartMs\": 20,\n \"EndMs\": 2380,\n \"SpeechSpeed\": 5.9,\n \"WordsNum\": 4,\n \"EmotionalEnergy\": 0,\n \"SpeakerId\": 0,\n \"SilenceTime\": 0,\n \"EmotionType\": [\n \"happy\"\n ],\n \"Words\": [\n {\n \"OffsetStartMs\": 120,\n \"OffsetEndMs\": 780,\n \"Word\": \"腾讯云\"\n },\n {\n \"OffsetStartMs\": 780,\n \"OffsetEndMs\": 1530,\n \"Word\": \"语音识别\"\n },\n {\n \"OffsetStartMs\": 1530,\n \"OffsetEndMs\": 1860,\n \"Word\": \"欢迎\"\n },\n {\n \"OffsetStartMs\": 1860,\n \"OffsetEndMs\": 2250,\n \"Word\": \"您\"\n }\n ]\n }\n ],\n \"ErrorMsg\": \"\"\n }\n }\n}",
|
84
84
|
"title": "轮询结果——任务成功"
|
85
85
|
},
|
86
86
|
{
|
@@ -8784,7 +8784,7 @@
|
|
8784
8784
|
},
|
8785
8785
|
{
|
8786
8786
|
"disabled": false,
|
8787
|
-
"document": "分页偏移量,Offset=0表示第一页,如果Limit=100,则Offset=100表示第二页,Offset=200
|
8787
|
+
"document": "分页偏移量,Offset=0表示第一页,如果Limit=100,则Offset=100表示第二页,Offset=200表示第三页,以此类推",
|
8788
8788
|
"example": "0",
|
8789
8789
|
"member": "uint64",
|
8790
8790
|
"name": "Offset",
|
@@ -8904,7 +8904,7 @@
|
|
8904
8904
|
},
|
8905
8905
|
{
|
8906
8906
|
"disabled": false,
|
8907
|
-
"document": "分页偏移量,Offset=0表示第一页,如果Limit=100,则Offset=100表示第二页,Offset=200
|
8907
|
+
"document": "分页偏移量,Offset=0表示第一页,如果Limit=100,则Offset=100表示第二页,Offset=200表示第三页,以此类推",
|
8908
8908
|
"example": "0",
|
8909
8909
|
"member": "uint64",
|
8910
8910
|
"name": "Offset",
|
tccli/services/cam/cam_client.py
CHANGED
@@ -901,6 +901,58 @@ def doUpdateRoleDescription(args, parsed_globals):
|
|
901
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
902
|
|
903
903
|
|
904
|
+
def doBuildDataFlowAuthToken(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.CamClient(cred, g_param[OptionsDefine.Region], profile)
|
931
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
932
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
+
model = models.BuildDataFlowAuthTokenRequest()
|
934
|
+
model.from_json_string(json.dumps(args))
|
935
|
+
start_time = time.time()
|
936
|
+
while True:
|
937
|
+
rsp = client.BuildDataFlowAuthToken(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
|
+
|
904
956
|
def doUpdateSAMLProvider(args, parsed_globals):
|
905
957
|
g_param = parse_global_arg(parsed_globals)
|
906
958
|
|
@@ -2617,58 +2669,6 @@ def doGetSecurityLastUsed(args, parsed_globals):
|
|
2617
2669
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2618
2670
|
|
2619
2671
|
|
2620
|
-
def doCreateGroup(args, parsed_globals):
|
2621
|
-
g_param = parse_global_arg(parsed_globals)
|
2622
|
-
|
2623
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2624
|
-
cred = credential.CVMRoleCredential()
|
2625
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2626
|
-
cred = credential.STSAssumeRoleCredential(
|
2627
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2628
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2629
|
-
)
|
2630
|
-
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):
|
2631
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2632
|
-
else:
|
2633
|
-
cred = credential.Credential(
|
2634
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2635
|
-
)
|
2636
|
-
http_profile = HttpProfile(
|
2637
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2638
|
-
reqMethod="POST",
|
2639
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
2640
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2641
|
-
)
|
2642
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2643
|
-
if g_param[OptionsDefine.Language]:
|
2644
|
-
profile.language = g_param[OptionsDefine.Language]
|
2645
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2646
|
-
client = mod.CamClient(cred, g_param[OptionsDefine.Region], profile)
|
2647
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
2648
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2649
|
-
model = models.CreateGroupRequest()
|
2650
|
-
model.from_json_string(json.dumps(args))
|
2651
|
-
start_time = time.time()
|
2652
|
-
while True:
|
2653
|
-
rsp = client.CreateGroup(model)
|
2654
|
-
result = rsp.to_json_string()
|
2655
|
-
try:
|
2656
|
-
json_obj = json.loads(result)
|
2657
|
-
except TypeError as e:
|
2658
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2659
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2660
|
-
break
|
2661
|
-
cur_time = time.time()
|
2662
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2663
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2664
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2665
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2666
|
-
else:
|
2667
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2668
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2669
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2670
|
-
|
2671
|
-
|
2672
2672
|
def doDeletePolicy(args, parsed_globals):
|
2673
2673
|
g_param = parse_global_arg(parsed_globals)
|
2674
2674
|
|
@@ -2721,7 +2721,7 @@ def doDeletePolicy(args, parsed_globals):
|
|
2721
2721
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2722
2722
|
|
2723
2723
|
|
2724
|
-
def
|
2724
|
+
def doCreateGroup(args, parsed_globals):
|
2725
2725
|
g_param = parse_global_arg(parsed_globals)
|
2726
2726
|
|
2727
2727
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2750,11 +2750,11 @@ def doDeletePolicyVersion(args, parsed_globals):
|
|
2750
2750
|
client = mod.CamClient(cred, g_param[OptionsDefine.Region], profile)
|
2751
2751
|
client._sdkVersion += ("_CLI_" + __version__)
|
2752
2752
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2753
|
-
model = models.
|
2753
|
+
model = models.CreateGroupRequest()
|
2754
2754
|
model.from_json_string(json.dumps(args))
|
2755
2755
|
start_time = time.time()
|
2756
2756
|
while True:
|
2757
|
-
rsp = client.
|
2757
|
+
rsp = client.CreateGroup(model)
|
2758
2758
|
result = rsp.to_json_string()
|
2759
2759
|
try:
|
2760
2760
|
json_obj = json.loads(result)
|
@@ -4437,6 +4437,58 @@ def doGetRole(args, parsed_globals):
|
|
4437
4437
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4438
4438
|
|
4439
4439
|
|
4440
|
+
def doDeletePolicyVersion(args, parsed_globals):
|
4441
|
+
g_param = parse_global_arg(parsed_globals)
|
4442
|
+
|
4443
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
4444
|
+
cred = credential.CVMRoleCredential()
|
4445
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
4446
|
+
cred = credential.STSAssumeRoleCredential(
|
4447
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
4448
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
4449
|
+
)
|
4450
|
+
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):
|
4451
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
4452
|
+
else:
|
4453
|
+
cred = credential.Credential(
|
4454
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
4455
|
+
)
|
4456
|
+
http_profile = HttpProfile(
|
4457
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
4458
|
+
reqMethod="POST",
|
4459
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
4460
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
4461
|
+
)
|
4462
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
4463
|
+
if g_param[OptionsDefine.Language]:
|
4464
|
+
profile.language = g_param[OptionsDefine.Language]
|
4465
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
4466
|
+
client = mod.CamClient(cred, g_param[OptionsDefine.Region], profile)
|
4467
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
4468
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4469
|
+
model = models.DeletePolicyVersionRequest()
|
4470
|
+
model.from_json_string(json.dumps(args))
|
4471
|
+
start_time = time.time()
|
4472
|
+
while True:
|
4473
|
+
rsp = client.DeletePolicyVersion(model)
|
4474
|
+
result = rsp.to_json_string()
|
4475
|
+
try:
|
4476
|
+
json_obj = json.loads(result)
|
4477
|
+
except TypeError as e:
|
4478
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
4479
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
4480
|
+
break
|
4481
|
+
cur_time = time.time()
|
4482
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
4483
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
4484
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
4485
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
4486
|
+
else:
|
4487
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
4488
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
4489
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4490
|
+
|
4491
|
+
|
4440
4492
|
def doListPolicies(args, parsed_globals):
|
4441
4493
|
g_param = parse_global_arg(parsed_globals)
|
4442
4494
|
|
@@ -4569,6 +4621,7 @@ ACTION_MAP = {
|
|
4569
4621
|
"CreateAccessKey": doCreateAccessKey,
|
4570
4622
|
"DeleteUser": doDeleteUser,
|
4571
4623
|
"UpdateRoleDescription": doUpdateRoleDescription,
|
4624
|
+
"BuildDataFlowAuthToken": doBuildDataFlowAuthToken,
|
4572
4625
|
"UpdateSAMLProvider": doUpdateSAMLProvider,
|
4573
4626
|
"UntagRole": doUntagRole,
|
4574
4627
|
"DescribeSubAccounts": doDescribeSubAccounts,
|
@@ -4602,9 +4655,8 @@ ACTION_MAP = {
|
|
4602
4655
|
"UpdateAssumeRolePolicy": doUpdateAssumeRolePolicy,
|
4603
4656
|
"SetMfaFlag": doSetMfaFlag,
|
4604
4657
|
"GetSecurityLastUsed": doGetSecurityLastUsed,
|
4605
|
-
"CreateGroup": doCreateGroup,
|
4606
4658
|
"DeletePolicy": doDeletePolicy,
|
4607
|
-
"
|
4659
|
+
"CreateGroup": doCreateGroup,
|
4608
4660
|
"ListAccessKeys": doListAccessKeys,
|
4609
4661
|
"DeleteGroup": doDeleteGroup,
|
4610
4662
|
"CreateMessageReceiver": doCreateMessageReceiver,
|
@@ -4637,6 +4689,7 @@ ACTION_MAP = {
|
|
4637
4689
|
"AttachRolePolicy": doAttachRolePolicy,
|
4638
4690
|
"DescribeSafeAuthFlagColl": doDescribeSafeAuthFlagColl,
|
4639
4691
|
"GetRole": doGetRole,
|
4692
|
+
"DeletePolicyVersion": doDeletePolicyVersion,
|
4640
4693
|
"ListPolicies": doListPolicies,
|
4641
4694
|
"DisableUserSSO": doDisableUserSSO,
|
4642
4695
|
|
@@ -35,6 +35,13 @@
|
|
35
35
|
"output": "AttachUserPolicyResponse",
|
36
36
|
"status": "online"
|
37
37
|
},
|
38
|
+
"BuildDataFlowAuthToken": {
|
39
|
+
"document": "获取数据流认证Token",
|
40
|
+
"input": "BuildDataFlowAuthTokenRequest",
|
41
|
+
"name": "获取数据流认证Token",
|
42
|
+
"output": "BuildDataFlowAuthTokenResponse",
|
43
|
+
"status": "online"
|
44
|
+
},
|
38
45
|
"ConsumeCustomMFAToken": {
|
39
46
|
"document": "验证自定义多因子Token",
|
40
47
|
"input": "ConsumeCustomMFATokenRequest",
|
@@ -1385,6 +1392,127 @@
|
|
1385
1392
|
],
|
1386
1393
|
"usage": "out"
|
1387
1394
|
},
|
1395
|
+
"AuthToken": {
|
1396
|
+
"document": "认证凭据Token",
|
1397
|
+
"members": [
|
1398
|
+
{
|
1399
|
+
"disabled": false,
|
1400
|
+
"document": "认证Token",
|
1401
|
+
"example": "Ad3**asf3",
|
1402
|
+
"member": "string",
|
1403
|
+
"name": "Token",
|
1404
|
+
"output_required": true,
|
1405
|
+
"type": "string",
|
1406
|
+
"value_allowed_null": false
|
1407
|
+
},
|
1408
|
+
{
|
1409
|
+
"disabled": false,
|
1410
|
+
"document": "服务器时间戳\n注意:此字段可能返回 null,表示取不到有效值。",
|
1411
|
+
"example": "987654321",
|
1412
|
+
"member": "int64",
|
1413
|
+
"name": "CurrentTime",
|
1414
|
+
"output_required": false,
|
1415
|
+
"type": "int",
|
1416
|
+
"value_allowed_null": true
|
1417
|
+
},
|
1418
|
+
{
|
1419
|
+
"disabled": false,
|
1420
|
+
"document": "毫秒时间戳,根据轮转周期准确计算得到\n注意:此字段可能返回 null,表示取不到有效值。",
|
1421
|
+
"example": "1234567890",
|
1422
|
+
"member": "int64",
|
1423
|
+
"name": "NextRotationTime",
|
1424
|
+
"output_required": false,
|
1425
|
+
"type": "int",
|
1426
|
+
"value_allowed_null": true
|
1427
|
+
},
|
1428
|
+
{
|
1429
|
+
"disabled": false,
|
1430
|
+
"document": "毫秒,如果轮转失败则为 -1\n注意:此字段可能返回 null,表示取不到有效值。",
|
1431
|
+
"example": "150",
|
1432
|
+
"member": "int64",
|
1433
|
+
"name": "LastRotationTimeCost",
|
1434
|
+
"output_required": false,
|
1435
|
+
"type": "int",
|
1436
|
+
"value_allowed_null": true
|
1437
|
+
},
|
1438
|
+
{
|
1439
|
+
"disabled": false,
|
1440
|
+
"document": "成功:success\n失败:failed\n注意:此字段可能返回 null,表示取不到有效值。",
|
1441
|
+
"example": "success",
|
1442
|
+
"member": "string",
|
1443
|
+
"name": "RotationStatus",
|
1444
|
+
"output_required": false,
|
1445
|
+
"type": "string",
|
1446
|
+
"value_allowed_null": true
|
1447
|
+
},
|
1448
|
+
{
|
1449
|
+
"disabled": false,
|
1450
|
+
"document": "成功:success\n失败:失败信息\n注意:此字段可能返回 null,表示取不到有效值。",
|
1451
|
+
"example": "success",
|
1452
|
+
"member": "string",
|
1453
|
+
"name": "RotationMessage",
|
1454
|
+
"output_required": false,
|
1455
|
+
"type": "string",
|
1456
|
+
"value_allowed_null": true
|
1457
|
+
}
|
1458
|
+
],
|
1459
|
+
"usage": "out"
|
1460
|
+
},
|
1461
|
+
"BuildDataFlowAuthTokenRequest": {
|
1462
|
+
"document": "BuildDataFlowAuthToken请求参数结构体",
|
1463
|
+
"members": [
|
1464
|
+
{
|
1465
|
+
"disabled": false,
|
1466
|
+
"document": "资源ID",
|
1467
|
+
"example": "cbd-esq42",
|
1468
|
+
"member": "string",
|
1469
|
+
"name": "ResourceId",
|
1470
|
+
"required": true,
|
1471
|
+
"type": "string"
|
1472
|
+
},
|
1473
|
+
{
|
1474
|
+
"disabled": false,
|
1475
|
+
"document": "资源地域",
|
1476
|
+
"example": "ap-guangzhou",
|
1477
|
+
"member": "string",
|
1478
|
+
"name": "ResourceRegion",
|
1479
|
+
"required": true,
|
1480
|
+
"type": "string"
|
1481
|
+
},
|
1482
|
+
{
|
1483
|
+
"disabled": false,
|
1484
|
+
"document": "资源用户名",
|
1485
|
+
"example": "readOnly",
|
1486
|
+
"member": "string",
|
1487
|
+
"name": "ResourceAccount",
|
1488
|
+
"required": true,
|
1489
|
+
"type": "string"
|
1490
|
+
}
|
1491
|
+
],
|
1492
|
+
"type": "object"
|
1493
|
+
},
|
1494
|
+
"BuildDataFlowAuthTokenResponse": {
|
1495
|
+
"document": "BuildDataFlowAuthToken返回参数结构体",
|
1496
|
+
"members": [
|
1497
|
+
{
|
1498
|
+
"disabled": false,
|
1499
|
+
"document": "认证凭据AuthToken信息\n注意:此字段可能返回 null,表示取不到有效值。",
|
1500
|
+
"example": "无",
|
1501
|
+
"member": "AuthToken",
|
1502
|
+
"name": "Credentials",
|
1503
|
+
"output_required": true,
|
1504
|
+
"type": "object",
|
1505
|
+
"value_allowed_null": true
|
1506
|
+
},
|
1507
|
+
{
|
1508
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
1509
|
+
"member": "string",
|
1510
|
+
"name": "RequestId",
|
1511
|
+
"type": "string"
|
1512
|
+
}
|
1513
|
+
],
|
1514
|
+
"type": "object"
|
1515
|
+
},
|
1388
1516
|
"ConsumeCustomMFATokenRequest": {
|
1389
1517
|
"document": "ConsumeCustomMFAToken请求参数结构体",
|
1390
1518
|
"members": [
|
@@ -40,6 +40,14 @@
|
|
40
40
|
"title": "绑定策略到用户"
|
41
41
|
}
|
42
42
|
],
|
43
|
+
"BuildDataFlowAuthToken": [
|
44
|
+
{
|
45
|
+
"document": "生成AuthToken",
|
46
|
+
"input": "POST / HTTP/1.1\nHost: cam.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: BuildDataFlowAuthToken\n<公共请求参数>\n\n{\n \"ResourceId\": \"cdb-12dd3d\",\n \"ResourceRegion\": \"ap-shanghai\",\n \"ResourceAccount\": \"ReadOnly\"\n}",
|
47
|
+
"output": "{\n \"Response\": {\n \"Credentials\": {\n \"CurrentTime\": 12332343423,\n \"LastRotationTimeCost\": 343,\n \"NextRotationTime\": 10,\n \"RotationMessage\": \"success\",\n \"RotationStatus\": \"success\",\n \"Token\": \"944a***mtHS\"\n },\n \"RequestId\": \"5bc7f0df-18a3-426b-84ce-ddbc8d1c95d1\"\n }\n}",
|
48
|
+
"title": "生成AuthToken"
|
49
|
+
}
|
50
|
+
],
|
43
51
|
"ConsumeCustomMFAToken": [
|
44
52
|
{
|
45
53
|
"document": "",
|
@@ -1422,6 +1422,16 @@
|
|
1422
1422
|
"output_required": true,
|
1423
1423
|
"type": "list",
|
1424
1424
|
"value_allowed_null": true
|
1425
|
+
},
|
1426
|
+
{
|
1427
|
+
"disabled": false,
|
1428
|
+
"document": "是否为同步账号\n注意:此字段可能返回 null,表示取不到有效值。",
|
1429
|
+
"example": "同步标记",
|
1430
|
+
"member": "int64",
|
1431
|
+
"name": "SubSyncFlag",
|
1432
|
+
"output_required": false,
|
1433
|
+
"type": "int",
|
1434
|
+
"value_allowed_null": true
|
1425
1435
|
}
|
1426
1436
|
],
|
1427
1437
|
"usage": "out"
|
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"actions": {
|
3
3
|
"DescribeDasbImageIds": {
|
4
|
-
"document": "获取镜像列表",
|
4
|
+
"document": "这些接口是传统版堡垒机接口.数审未用到,堡垒机的已全部迁移到dasb下,cds这边预下线\n\n获取镜像列表",
|
5
5
|
"input": "DescribeDasbImageIdsRequest",
|
6
6
|
"name": "数盾-DASB-获取镜像列表",
|
7
7
|
"output": "DescribeDasbImageIdsResponse",
|
8
|
-
"status": "
|
8
|
+
"status": "deprecated"
|
9
9
|
},
|
10
10
|
"DescribeDbauditInstanceType": {
|
11
11
|
"document": "本接口 (DescribeDbauditInstanceType) 用于查询可售卖的产品规格列表。",
|
@@ -3971,6 +3971,15 @@
|
|
3971
3971
|
"name": "SyntaxRule",
|
3972
3972
|
"required": false,
|
3973
3973
|
"type": "int"
|
3974
|
+
},
|
3975
|
+
{
|
3976
|
+
"disabled": false,
|
3977
|
+
"document": "导出字段",
|
3978
|
+
"example": "[\"__timestamp__\",\"a\",\"b\"]",
|
3979
|
+
"member": "string",
|
3980
|
+
"name": "DerivedFields",
|
3981
|
+
"required": false,
|
3982
|
+
"type": "list"
|
3974
3983
|
}
|
3975
3984
|
],
|
3976
3985
|
"type": "object"
|
@@ -7891,6 +7900,16 @@
|
|
7891
7900
|
"output_required": true,
|
7892
7901
|
"type": "int",
|
7893
7902
|
"value_allowed_null": false
|
7903
|
+
},
|
7904
|
+
{
|
7905
|
+
"disabled": false,
|
7906
|
+
"document": "导出字段\n注意:此字段可能返回 null,表示取不到有效值。",
|
7907
|
+
"example": "[\"__timestamp__\",\"a\",\"b\"]",
|
7908
|
+
"member": "string",
|
7909
|
+
"name": "DerivedFields",
|
7910
|
+
"output_required": false,
|
7911
|
+
"type": "list",
|
7912
|
+
"value_allowed_null": true
|
7894
7913
|
}
|
7895
7914
|
],
|
7896
7915
|
"usage": "out"
|
@@ -11363,6 +11382,15 @@
|
|
11363
11382
|
"name": "IsWebTracking",
|
11364
11383
|
"required": false,
|
11365
11384
|
"type": "bool"
|
11385
|
+
},
|
11386
|
+
{
|
11387
|
+
"disabled": false,
|
11388
|
+
"document": "日志主题分区数量",
|
11389
|
+
"example": "10",
|
11390
|
+
"member": "uint64",
|
11391
|
+
"name": "PartitionCount",
|
11392
|
+
"required": false,
|
11393
|
+
"type": "int"
|
11366
11394
|
}
|
11367
11395
|
],
|
11368
11396
|
"type": "object"
|