tccli 3.0.1169.1__py2.py3-none-any.whl → 3.0.1171.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/aiart/v20221229/api.json +14 -5
- tccli/services/cls/v20201016/api.json +15 -6
- tccli/services/cwp/cwp_client.py +118 -65
- tccli/services/cwp/v20180228/api.json +137 -4
- tccli/services/cwp/v20180228/examples.json +8 -0
- tccli/services/emr/emr_client.py +163 -4
- tccli/services/emr/v20190103/api.json +880 -11
- tccli/services/emr/v20190103/examples.json +25 -1
- tccli/services/ioa/v20220601/api.json +5 -5
- tccli/services/live/v20180801/api.json +4 -4
- tccli/services/ocr/v20181119/api.json +4 -4
- tccli/services/ocr/v20181119/examples.json +2 -2
- tccli/services/smh/smh_client.py +281 -16
- tccli/services/smh/v20210712/api.json +806 -2
- tccli/services/smh/v20210712/examples.json +40 -0
- tccli/services/sms/v20210111/api.json +1 -1
- tccli/services/trtc/v20190722/api.json +7 -7
- tccli/services/vod/v20180717/api.json +12 -0
- tccli/services/vpc/v20170312/api.json +56 -26
- {tccli-3.0.1169.1.dist-info → tccli-3.0.1171.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1169.1.dist-info → tccli-3.0.1171.1.dist-info}/RECORD +25 -25
- {tccli-3.0.1169.1.dist-info → tccli-3.0.1171.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1169.1.dist-info → tccli-3.0.1171.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1169.1.dist-info → tccli-3.0.1171.1.dist-info}/license_files/LICENSE +0 -0
@@ -184,10 +184,18 @@
|
|
184
184
|
"title": "test"
|
185
185
|
}
|
186
186
|
],
|
187
|
+
"DescribeServiceNodeInfos": [
|
188
|
+
{
|
189
|
+
"document": "查询服务进程信息",
|
190
|
+
"input": "https://emr.tencentcloudapi.com/?Action=DescribeServiceNodeInfos\n&InstanceId=emr-3qg9lptu\n&ServiceGroupType=1\n&ServiceNodeType=1\n&Offset=0\n&Limit=10\n&<公共请求参数>",
|
191
|
+
"output": "{\n \"Response\": {\n \"TotalCnt\": 0,\n \"ServiceNodeList\": [\n {\n \"Ip\": \"abc\",\n \"NodeType\": 0,\n \"NodeName\": \"abc\",\n \"ServiceStatus\": 0,\n \"MonitorStatus\": 0,\n \"Status\": 0,\n \"PortsInfo\": \"abc\",\n \"LastRestartTime\": \"abc\",\n \"Flag\": 0,\n \"ConfGroupId\": 0,\n \"ConfGroupName\": \"abc\",\n \"ConfStatus\": 0,\n \"ServiceDetectionInfo\": [\n {\n \"DetectAlert\": \"abc\",\n \"DetetcFunctionKey\": \"abc\",\n \"DetetcFunctionValue\": \"abc\",\n \"DetetcTime\": \"abc\",\n \"DetectFunctionKey\": \"abc\",\n \"DetectFunctionValue\": \"abc\",\n \"DetectTime\": \"abc\"\n }\n ],\n \"NodeFlagFilter\": \"abc\",\n \"HealthStatus\": {\n \"Code\": 0,\n \"Text\": \"abc\",\n \"Desc\": \"abc\"\n },\n \"IsSupportRoleMonitor\": true,\n \"StopPolicies\": [\n {\n \"Name\": \"abc\",\n \"DisplayName\": \"abc\",\n \"Describe\": \"abc\",\n \"BatchSizeRange\": [\n 0\n ],\n \"IsDefault\": \"abc\"\n }\n ],\n \"HAState\": \"abc\",\n \"NameService\": \"abc\",\n \"IsFederation\": true\n }\n ],\n \"AliasInfo\": \"abc\",\n \"SupportNodeFlagFilterList\": [\n \"abc\"\n ],\n \"RequestId\": \"abc\"\n }\n}",
|
192
|
+
"title": "查询服务进程信息"
|
193
|
+
}
|
194
|
+
],
|
187
195
|
"DescribeTrinoQueryInfo": [
|
188
196
|
{
|
189
197
|
"document": "",
|
190
|
-
"input": "POST / HTTP/1.1\nHost: emr.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action:
|
198
|
+
"input": "POST / HTTP/1.1\nHost: emr.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeTrinoQueryInfo\n<公共请求参数>\n\n{\n \"InstanceId\": \"emr-d82w3t9p\",\n \"PageSize\": 10,\n \"StartTime\": 1701792000,\n \"EndTime\": 1701878399,\n \"Page\": 1\n}",
|
191
199
|
"output": "{\n \"Response\": {\n \"QueryInfoList\": [\n {\n \"Catalog\": \"hive\",\n \"ClientIpAddr\": \"10.0.1.104\",\n \"CompletedSplits\": \"\",\n \"CpuTime\": 0,\n \"CumulativeMemory\": 0,\n \"DurationMillis\": 0,\n \"EndTime\": 0,\n \"Id\": \"20240708_111543_00007_lcmdbi8z\",\n \"InternalNetworkBytes\": 0,\n \"OutputBytes\": 0,\n \"PeakUserMemoryBytes\": 0,\n \"PhysicalInputBytes\": 0,\n \"ProcessedInputBytes\": 0,\n \"SqlCompileTime\": 0,\n \"StartTime\": 0,\n \"State\": \"QUEUED\",\n \"Statement\": \"create table impala_ranger\",\n \"User\": \"hadoop\",\n \"WrittenBytes\": 0\n }\n ],\n \"RequestId\": \"cfbbbe0f-5d30-4bf7-b87b-428b14ac3ws22\",\n \"TotalCount\": 18\n }\n}",
|
192
200
|
"title": "获取trino查询结果"
|
193
201
|
}
|
@@ -208,6 +216,14 @@
|
|
208
216
|
"title": "获取Yarn的Applications列表"
|
209
217
|
}
|
210
218
|
],
|
219
|
+
"DescribeYarnScheduleHistory": [
|
220
|
+
{
|
221
|
+
"document": "",
|
222
|
+
"input": "POST / HTTP/1.1\nHost: emr.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeYarnScheduleHistory\n<公共请求参数>\n\n{\n \"InstanceId\": \"emr-a903oah8\",\n \"StartTime\": 1722873600,\n \"EndTime\": 1722959999,\n \"Limit\": 10,\n \"Offset\": 0,\n \"SchedulerType\": \"All\",\n \"TaskState\": -99\n}",
|
223
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"c38e1833-e164-488c-9817-e8ca75d8d214\",\n \"SchedulerNameList\": [\n \"Capacity Scheduler\",\n \"Fair Scheduler\"\n ],\n \"StateList\": [\n 0,\n 1,\n 2,\n -1\n ],\n \"Tasks\": [\n {\n \"CreateTime\": \"2024-08-07 19:13:38\",\n \"Details\": [\n {\n \"FailReason\": \"\",\n \"JobId\": 40005,\n \"Progress\": \"9%\",\n \"Step\": \"开始\"\n },\n {\n \"FailReason\": \"\",\n \"JobId\": 40005,\n \"Progress\": \"45%\",\n \"Step\": \"写 capacity-scheduler.xml\"\n },\n {\n \"FailReason\": \"\",\n \"JobId\": 40005,\n \"Progress\": \"63%\",\n \"Step\": \"重启 resource manager\"\n },\n {\n \"FailReason\": \"\",\n \"JobId\": 40005,\n \"Progress\": \"100%\",\n \"Step\": \"结束\"\n }\n ],\n \"EndTime\": \"2024-08-07 19:13:48\",\n \"OperatorName\": \"change capacity scheduler,disable label,refresh dynamic pools,restart resource manager\",\n \"SchedulerName\": \"Capacity Scheduler\",\n \"State\": 2\n },\n {\n \"CreateTime\": \"2024-08-06 14:30:02\",\n \"Details\": [\n {\n \"FailReason\": \"\",\n \"JobId\": 40000,\n \"Progress\": \"9%\",\n \"Step\": \"开始\"\n },\n {\n \"FailReason\": \"\",\n \"JobId\": 40000,\n \"Progress\": \"45%\",\n \"Step\": \"写 capacity-scheduler.xml\"\n },\n {\n \"FailReason\": \"The task was canceled because of a timeout\",\n \"JobId\": 40000,\n \"Progress\": \"63%\",\n \"Step\": \"重启 resource manager\"\n }\n ],\n \"EndTime\": \"2024-08-06 14:35:05\",\n \"OperatorName\": \"change capacity scheduler,disable label,refresh dynamic pools,restart resource manager\",\n \"SchedulerName\": \"Capacity Scheduler\",\n \"State\": -1\n },\n {\n \"CreateTime\": \"2024-08-06 11:29:15\",\n \"Details\": [\n {\n \"FailReason\": \"\",\n \"JobId\": 39994,\n \"Progress\": \"9%\",\n \"Step\": \"开始\"\n },\n {\n \"FailReason\": \"\",\n \"JobId\": 39994,\n \"Progress\": \"45%\",\n \"Step\": \"写 capacity-scheduler.xml\"\n },\n {\n \"FailReason\": \"\",\n \"JobId\": 39994,\n \"Progress\": \"63%\",\n \"Step\": \"重启 resource manager\"\n },\n {\n \"FailReason\": \"\",\n \"JobId\": 39994,\n \"Progress\": \"100%\",\n \"Step\": \"结束\"\n }\n ],\n \"EndTime\": \"2024-08-06 11:29:25\",\n \"OperatorName\": \"change capacity scheduler,disable label,refresh dynamic pools,restart resource manager\",\n \"SchedulerName\": \"Capacity Scheduler\",\n \"State\": 2\n }\n ],\n \"Total\": 3\n }\n}",
|
224
|
+
"title": "查看yarn资源调度的调度历史"
|
225
|
+
}
|
226
|
+
],
|
211
227
|
"InquirePriceRenewEmr": [
|
212
228
|
{
|
213
229
|
"document": "",
|
@@ -308,6 +324,14 @@
|
|
308
324
|
"title": "test"
|
309
325
|
}
|
310
326
|
],
|
327
|
+
"ModifyYarnDeploy": [
|
328
|
+
{
|
329
|
+
"document": "",
|
330
|
+
"input": "POST / HTTP/1.1\nHost: emr.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyYarnDeploy\n<公共请求参数>\n\n{\n \"InstanceId\": \"emr-a903oah8\",\n \"OldScheduler\": \"capacity\",\n \"NewScheduler\": \"fair\"\n}",
|
331
|
+
"output": "{\n \"Response\": {\n \"ErrorMsg\": null,\n \"IsDraft\": false,\n \"RequestId\": \"d76bd103-947e-49f3-8485-e6aab28ecbbf\"\n }\n}",
|
332
|
+
"title": "部署生效"
|
333
|
+
}
|
334
|
+
],
|
311
335
|
"RunJobFlow": [
|
312
336
|
{
|
313
337
|
"document": "",
|
@@ -446,7 +446,7 @@
|
|
446
446
|
},
|
447
447
|
{
|
448
448
|
"disabled": false,
|
449
|
-
"document": "
|
449
|
+
"document": "【和GroupIds必须有一个填写】设备分组id(需要和OsType匹配)\nid-名称-操作系统\n1\t全网终端\tWin\n2\t未分组终端\tWin\n30000000\t服务器\tWin\n40000101\t全网终端\tLinux\n40000102\t未分组终端\tLinux\n40000103\t服务器\tLinux\n40000201\t全网终端\tmacOS\n40000202\t未分组终端\tmacOS\n40000203\t服务器\tmacOS\n40000401\t全网终端\tAndroid\n40000402\t未分组终端\tAndroid\n40000501\t全网终端\tiOS\n40000502\t未分组终端\tiOS",
|
450
450
|
"example": "1",
|
451
451
|
"member": "int64",
|
452
452
|
"name": "GroupId",
|
@@ -455,7 +455,7 @@
|
|
455
455
|
},
|
456
456
|
{
|
457
457
|
"disabled": false,
|
458
|
-
"document": "
|
458
|
+
"document": "【必填】操作系统类型(0: win,1:linux,2: mac,3: win_srv,4:android,5:ios 默认值0),需要和GroupId或者GroupIds匹配",
|
459
459
|
"example": "0",
|
460
460
|
"member": "int64",
|
461
461
|
"name": "OsType",
|
@@ -464,7 +464,7 @@
|
|
464
464
|
},
|
465
465
|
{
|
466
466
|
"disabled": false,
|
467
|
-
"document": "在线状态 2
|
467
|
+
"document": "在线状态 (2表示在线,0或者1表示离线)",
|
468
468
|
"example": "2",
|
469
469
|
"member": "int64",
|
470
470
|
"name": "OnlineStatus",
|
@@ -491,7 +491,7 @@
|
|
491
491
|
},
|
492
492
|
{
|
493
493
|
"disabled": false,
|
494
|
-
"document": "获取第几页--兼容旧接口,参数同Condition
|
494
|
+
"document": "获取第几页--兼容旧接口,参数同Condition",
|
495
495
|
"example": "1",
|
496
496
|
"member": "int64",
|
497
497
|
"name": "PageNum",
|
@@ -500,7 +500,7 @@
|
|
500
500
|
},
|
501
501
|
{
|
502
502
|
"disabled": false,
|
503
|
-
"document": "每页获取数--兼容旧接口,参数同Condition
|
503
|
+
"document": "每页获取数--兼容旧接口,参数同Condition",
|
504
504
|
"example": "20",
|
505
505
|
"member": "int64",
|
506
506
|
"name": "PageSize",
|
@@ -8076,8 +8076,8 @@
|
|
8076
8076
|
"members": [
|
8077
8077
|
{
|
8078
8078
|
"disabled": false,
|
8079
|
-
"document": "UTC
|
8080
|
-
"example": "2006-01-02T15:04:
|
8079
|
+
"document": "UTC开始时间,支持最近三个月的查询,查询时间最长跨度为一天。使用 UTC 格式时间,例如:2019-01-08T10:00:00Z。注意:北京时间值为 UTC 时间值 + 8 小时,格式按照 ISO 8601 标准表示,详见 [ISO 日期格式说明](https://cloud.tencent.com/document/product/267/38543#:~:text=I-,ISO,-%E6%97%A5%E6%9C%9F%E6%A0%BC%E5%BC%8F)。",
|
8080
|
+
"example": "2006-01-02T15:04:05+08:00",
|
8081
8081
|
"member": "string",
|
8082
8082
|
"name": "StartTime",
|
8083
8083
|
"required": true,
|
@@ -8085,8 +8085,8 @@
|
|
8085
8085
|
},
|
8086
8086
|
{
|
8087
8087
|
"disabled": false,
|
8088
|
-
"document": "UTC
|
8089
|
-
"example": "2006-01-02T15:04:
|
8088
|
+
"document": "UTC结束时间,支持最近三个月的查询,查询时间最长跨度为一天。使用 UTC 格式时间,例如:2019-01-08T10:00:00Z。注意:北京时间值为 UTC 时间值 + 8 小时,格式按照 ISO 8601 标准表示,详见 [ISO 日期格式说明](https://cloud.tencent.com/document/product/267/38543#:~:text=I-,ISO,-%E6%97%A5%E6%9C%9F%E6%A0%BC%E5%BC%8F)。",
|
8089
|
+
"example": "2006-01-02T15:04:05+08:00",
|
8090
8090
|
"member": "string",
|
8091
8091
|
"name": "EndTime",
|
8092
8092
|
"required": true,
|
@@ -3132,7 +3132,7 @@
|
|
3132
3132
|
},
|
3133
3133
|
{
|
3134
3134
|
"disabled": false,
|
3135
|
-
"document": "Code 告警码列表和释义:\n-9102 复印件告警\n-9103 翻拍件告警\n注:告警码可以同时存在多个",
|
3135
|
+
"document": "Code 告警码列表和释义:\n-9102 复印件告警\n-9103 翻拍件告警\n-9104 反光告警\n-9105 模糊告警\n-9106 边框不完整告警\n注:告警码可以同时存在多个",
|
3136
3136
|
"example": "[-9102]",
|
3137
3137
|
"member": "int64",
|
3138
3138
|
"name": "RecognizeWarnCode",
|
@@ -3142,7 +3142,7 @@
|
|
3142
3142
|
},
|
3143
3143
|
{
|
3144
3144
|
"disabled": false,
|
3145
|
-
"document": "告警码说明:\nWARN_DRIVER_LICENSE_COPY_CARD 复印件告警\nWARN_DRIVER_LICENSE_SCREENED_CARD 翻拍件告警\n注:告警信息可以同时存在多个",
|
3145
|
+
"document": "告警码说明:\nWARN_DRIVER_LICENSE_COPY_CARD 复印件告警\nWARN_DRIVER_LICENSE_SCREENED_CARD 翻拍件告警\nWARN_DRIVER_LICENSE_REFLECTION 反光告警\nWARN_DRIVER_LICENSE_BLUR 模糊告警\nWARN_DRIVER_LICENSE_BORDER_INCOMPLETE 边框不完整告警\n注:告警信息可以同时存在多个",
|
3146
3146
|
"example": "[\"WARN_DRIVER_LICENSE_COPY_CARD\"]",
|
3147
3147
|
"member": "string",
|
3148
3148
|
"name": "RecognizeWarnMsg",
|
@@ -20770,7 +20770,7 @@
|
|
20770
20770
|
},
|
20771
20771
|
{
|
20772
20772
|
"disabled": false,
|
20773
|
-
"document": "Code 告警码列表和释义:\n-9102
|
20773
|
+
"document": "Code 告警码列表和释义:\n-9102 复印件告警\n-9103 翻拍件告警\n-9104 反光告警\n-9105 模糊告警\n-9106 边框不完整告警\n注:告警码可以同时存在多个",
|
20774
20774
|
"example": "[-9102]",
|
20775
20775
|
"member": "int64",
|
20776
20776
|
"name": "RecognizeWarnCode",
|
@@ -20780,7 +20780,7 @@
|
|
20780
20780
|
},
|
20781
20781
|
{
|
20782
20782
|
"disabled": false,
|
20783
|
-
"document": "告警码说明:\nWARN_DRIVER_LICENSE_COPY_CARD 复印件告警\nWARN_DRIVER_LICENSE_SCREENED_CARD 翻拍件告警\n注:告警信息可以同时存在多个",
|
20783
|
+
"document": "告警码说明:\nWARN_DRIVER_LICENSE_COPY_CARD 复印件告警\nWARN_DRIVER_LICENSE_SCREENED_CARD 翻拍件告警\nWARN_DRIVER_LICENSE_REFLECTION 反光告警\nWARN_DRIVER_LICENSE_BLUR 模糊告警\nWARN_DRIVER_LICENSE_BORDER_INCOMPLETE 边框不完整告警\n注:告警信息可以同时存在多个",
|
20784
20784
|
"example": "[\"WARN_DRIVER_LICENSE_COPY_CARD\"]",
|
20785
20785
|
"member": "string",
|
20786
20786
|
"name": "RecognizeWarnMsg",
|
@@ -704,13 +704,13 @@
|
|
704
704
|
{
|
705
705
|
"document": "行驶证副页正面识别示例代码2",
|
706
706
|
"input": "POST / HTTP/1.1\nHost: ocr.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: VehicleLicenseOCR\n<公共请求参数>\n\n{\n \"ImageUrl\": \"https://xx/a.jpg\",\n \"CardSide\": \"BACK\"\n}",
|
707
|
-
"output": "{\n \"Response\": {\n \"FrontInfo\": null,\n \"BackInfo\": {\n \"PlateNo\": \"皖AC4L50\",\n \"FileNo\": \"A00-00476807\",\n \"AllowNum\": \"5人\",\n \"TotalMass\": \"1837kg\",\n \"CurbWeight\": \"1431kg\",\n \"LoadQuality\": \"--\",\n \"ExternalSize\": \"4620×1780×1498mm\",\n \"TotalQuasiMass\": \"--\",\n \"Marks\": \"\",\n \"Record\": \"检验有效期至2015年11月皖A(4S)\",\n \"SubPageCode\": \"\"\n },\n \"RecognizeWarnCode\": [\n -9102\n ],\n \"RecognizeWarnMsg\": [\n \"WARN_DRIVER_LICENSE_COPY_CARD\"\n ],\n \"RequestId\": \"e2ebfaa0-19d3-4d2b-9ed8-7c7c21eb2b74\"\n }\n}",
|
707
|
+
"output": "{\n \"Response\": {\n \"FrontInfo\": null,\n \"BackInfo\": {\n \"PlateNo\": \"皖AC4L50\",\n \"FuelType\": \"\",\n \"FileNo\": \"A00-00476807\",\n \"AllowNum\": \"5人\",\n \"TotalMass\": \"1837kg\",\n \"CurbWeight\": \"1431kg\",\n \"LoadQuality\": \"--\",\n \"ExternalSize\": \"4620×1780×1498mm\",\n \"TotalQuasiMass\": \"--\",\n \"Marks\": \"\",\n \"Record\": \"检验有效期至2015年11月皖A(4S)\",\n \"SubPageCode\": \"\"\n },\n \"RecognizeWarnCode\": [\n -9102\n ],\n \"RecognizeWarnMsg\": [\n \"WARN_DRIVER_LICENSE_COPY_CARD\"\n ],\n \"RequestId\": \"e2ebfaa0-19d3-4d2b-9ed8-7c7c21eb2b74\"\n }\n}",
|
708
708
|
"title": "行驶证副页正面识别示例代码2"
|
709
709
|
},
|
710
710
|
{
|
711
711
|
"document": "行驶证副页正面识别示例代码3",
|
712
712
|
"input": "POST / HTTP/1.1\nHost: ocr.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: VehicleLicenseOCR\n<公共请求参数>\n\n{\n \"ImageUrl\": \"https://xx/a.jpg\",\n \"CardSide\": \"BACK\"\n}",
|
713
|
-
"output": "{\n \"Response\": {\n \"FrontInfo\": null,\n \"BackInfo\": {\n \"PlateNo\": \"皖AC4L50\",\n \"FileNo\": \"A00-00476807\",\n \"AllowNum\": \"5人\",\n \"TotalMass\": \"1837kg\",\n \"CurbWeight\": \"1431kg\",\n \"LoadQuality\": \"--\",\n \"ExternalSize\": \"4620×1780×1498mm\",\n \"TotalQuasiMass\": \"--\",\n \"Marks\": \"\",\n \"Record\": \"检验有效期至2015年11月皖A(4S)\",\n \"SubPageCode\": \"\"\n },\n \"RecognizeWarnCode\": [\n -9103\n ],\n \"RecognizeWarnMsg\": [\n \"WARN_DRIVER_LICENSE_SCREENED_CARD\"\n ],\n \"RequestId\": \"e2ebfaa0-19d3-4d2b-9ed8-7c7c21eb2b74\"\n }\n}",
|
713
|
+
"output": "{\n \"Response\": {\n \"FrontInfo\": null,\n \"BackInfo\": {\n \"FuelType\": \"\",\n \"PlateNo\": \"皖AC4L50\",\n \"FileNo\": \"A00-00476807\",\n \"AllowNum\": \"5人\",\n \"TotalMass\": \"1837kg\",\n \"CurbWeight\": \"1431kg\",\n \"LoadQuality\": \"--\",\n \"ExternalSize\": \"4620×1780×1498mm\",\n \"TotalQuasiMass\": \"--\",\n \"Marks\": \"\",\n \"Record\": \"检验有效期至2015年11月皖A(4S)\",\n \"SubPageCode\": \"\"\n },\n \"RecognizeWarnCode\": [\n -9103\n ],\n \"RecognizeWarnMsg\": [\n \"WARN_DRIVER_LICENSE_SCREENED_CARD\"\n ],\n \"RequestId\": \"e2ebfaa0-19d3-4d2b-9ed8-7c7c21eb2b74\"\n }\n}",
|
714
714
|
"title": "行驶证副页正面识别示例代码3"
|
715
715
|
}
|
716
716
|
],
|
tccli/services/smh/smh_client.py
CHANGED
@@ -17,6 +17,110 @@ from tencentcloud.smh.v20210712 import models as models_v20210712
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
+
def doModifyUser(args, parsed_globals):
|
21
|
+
g_param = parse_global_arg(parsed_globals)
|
22
|
+
|
23
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
24
|
+
cred = credential.CVMRoleCredential()
|
25
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
26
|
+
cred = credential.STSAssumeRoleCredential(
|
27
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
28
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
29
|
+
)
|
30
|
+
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):
|
31
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
32
|
+
else:
|
33
|
+
cred = credential.Credential(
|
34
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
35
|
+
)
|
36
|
+
http_profile = HttpProfile(
|
37
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
38
|
+
reqMethod="POST",
|
39
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
40
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
41
|
+
)
|
42
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
43
|
+
if g_param[OptionsDefine.Language]:
|
44
|
+
profile.language = g_param[OptionsDefine.Language]
|
45
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
46
|
+
client = mod.SmhClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
+
model = models.ModifyUserRequest()
|
50
|
+
model.from_json_string(json.dumps(args))
|
51
|
+
start_time = time.time()
|
52
|
+
while True:
|
53
|
+
rsp = client.ModifyUser(model)
|
54
|
+
result = rsp.to_json_string()
|
55
|
+
try:
|
56
|
+
json_obj = json.loads(result)
|
57
|
+
except TypeError as e:
|
58
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
59
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
60
|
+
break
|
61
|
+
cur_time = time.time()
|
62
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
63
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
64
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
65
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
66
|
+
else:
|
67
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
68
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
69
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
|
+
|
71
|
+
|
72
|
+
def doDeleteUser(args, parsed_globals):
|
73
|
+
g_param = parse_global_arg(parsed_globals)
|
74
|
+
|
75
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
76
|
+
cred = credential.CVMRoleCredential()
|
77
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
78
|
+
cred = credential.STSAssumeRoleCredential(
|
79
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
80
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
81
|
+
)
|
82
|
+
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):
|
83
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
84
|
+
else:
|
85
|
+
cred = credential.Credential(
|
86
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
87
|
+
)
|
88
|
+
http_profile = HttpProfile(
|
89
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
90
|
+
reqMethod="POST",
|
91
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
92
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
93
|
+
)
|
94
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
95
|
+
if g_param[OptionsDefine.Language]:
|
96
|
+
profile.language = g_param[OptionsDefine.Language]
|
97
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
98
|
+
client = mod.SmhClient(cred, g_param[OptionsDefine.Region], profile)
|
99
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
100
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
+
model = models.DeleteUserRequest()
|
102
|
+
model.from_json_string(json.dumps(args))
|
103
|
+
start_time = time.time()
|
104
|
+
while True:
|
105
|
+
rsp = client.DeleteUser(model)
|
106
|
+
result = rsp.to_json_string()
|
107
|
+
try:
|
108
|
+
json_obj = json.loads(result)
|
109
|
+
except TypeError as e:
|
110
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
111
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
112
|
+
break
|
113
|
+
cur_time = time.time()
|
114
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
115
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
116
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
117
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
118
|
+
else:
|
119
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
120
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
121
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
|
+
|
123
|
+
|
20
124
|
def doDescribeOfficialInstances(args, parsed_globals):
|
21
125
|
g_param = parse_global_arg(parsed_globals)
|
22
126
|
|
@@ -121,7 +225,7 @@ def doDescribeLibraries(args, parsed_globals):
|
|
121
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
226
|
|
123
227
|
|
124
|
-
def
|
228
|
+
def doVerifySmsCode(args, parsed_globals):
|
125
229
|
g_param = parse_global_arg(parsed_globals)
|
126
230
|
|
127
231
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +254,11 @@ def doCreateLibrary(args, parsed_globals):
|
|
150
254
|
client = mod.SmhClient(cred, g_param[OptionsDefine.Region], profile)
|
151
255
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
256
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
257
|
+
model = models.VerifySmsCodeRequest()
|
154
258
|
model.from_json_string(json.dumps(args))
|
155
259
|
start_time = time.time()
|
156
260
|
while True:
|
157
|
-
rsp = client.
|
261
|
+
rsp = client.VerifySmsCode(model)
|
158
262
|
result = rsp.to_json_string()
|
159
263
|
try:
|
160
264
|
json_obj = json.loads(result)
|
@@ -225,7 +329,7 @@ def doSendSmsCode(args, parsed_globals):
|
|
225
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
330
|
|
227
331
|
|
228
|
-
def
|
332
|
+
def doDeleteLibrary(args, parsed_globals):
|
229
333
|
g_param = parse_global_arg(parsed_globals)
|
230
334
|
|
231
335
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -254,11 +358,11 @@ def doDescribeTrafficPackages(args, parsed_globals):
|
|
254
358
|
client = mod.SmhClient(cred, g_param[OptionsDefine.Region], profile)
|
255
359
|
client._sdkVersion += ("_CLI_" + __version__)
|
256
360
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.
|
361
|
+
model = models.DeleteLibraryRequest()
|
258
362
|
model.from_json_string(json.dumps(args))
|
259
363
|
start_time = time.time()
|
260
364
|
while True:
|
261
|
-
rsp = client.
|
365
|
+
rsp = client.DeleteLibrary(model)
|
262
366
|
result = rsp.to_json_string()
|
263
367
|
try:
|
264
368
|
json_obj = json.loads(result)
|
@@ -277,7 +381,7 @@ def doDescribeTrafficPackages(args, parsed_globals):
|
|
277
381
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
382
|
|
279
383
|
|
280
|
-
def
|
384
|
+
def doCreateUserLifecycle(args, parsed_globals):
|
281
385
|
g_param = parse_global_arg(parsed_globals)
|
282
386
|
|
283
387
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -306,11 +410,63 @@ def doVerifySmsCode(args, parsed_globals):
|
|
306
410
|
client = mod.SmhClient(cred, g_param[OptionsDefine.Region], profile)
|
307
411
|
client._sdkVersion += ("_CLI_" + __version__)
|
308
412
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.
|
413
|
+
model = models.CreateUserLifecycleRequest()
|
310
414
|
model.from_json_string(json.dumps(args))
|
311
415
|
start_time = time.time()
|
312
416
|
while True:
|
313
|
-
rsp = client.
|
417
|
+
rsp = client.CreateUserLifecycle(model)
|
418
|
+
result = rsp.to_json_string()
|
419
|
+
try:
|
420
|
+
json_obj = json.loads(result)
|
421
|
+
except TypeError as e:
|
422
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
423
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
424
|
+
break
|
425
|
+
cur_time = time.time()
|
426
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
427
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
428
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
429
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
430
|
+
else:
|
431
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
432
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
433
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
|
+
|
435
|
+
|
436
|
+
def doCreateLibrary(args, parsed_globals):
|
437
|
+
g_param = parse_global_arg(parsed_globals)
|
438
|
+
|
439
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
440
|
+
cred = credential.CVMRoleCredential()
|
441
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
442
|
+
cred = credential.STSAssumeRoleCredential(
|
443
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
444
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
445
|
+
)
|
446
|
+
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):
|
447
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
448
|
+
else:
|
449
|
+
cred = credential.Credential(
|
450
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
451
|
+
)
|
452
|
+
http_profile = HttpProfile(
|
453
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
454
|
+
reqMethod="POST",
|
455
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
456
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
457
|
+
)
|
458
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
459
|
+
if g_param[OptionsDefine.Language]:
|
460
|
+
profile.language = g_param[OptionsDefine.Language]
|
461
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
462
|
+
client = mod.SmhClient(cred, g_param[OptionsDefine.Region], profile)
|
463
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
464
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
+
model = models.CreateLibraryRequest()
|
466
|
+
model.from_json_string(json.dumps(args))
|
467
|
+
start_time = time.time()
|
468
|
+
while True:
|
469
|
+
rsp = client.CreateLibrary(model)
|
314
470
|
result = rsp.to_json_string()
|
315
471
|
try:
|
316
472
|
json_obj = json.loads(result)
|
@@ -433,7 +589,7 @@ def doModifyLibrary(args, parsed_globals):
|
|
433
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
590
|
|
435
591
|
|
436
|
-
def
|
592
|
+
def doCreateUser(args, parsed_globals):
|
437
593
|
g_param = parse_global_arg(parsed_globals)
|
438
594
|
|
439
595
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -462,11 +618,115 @@ def doDeleteLibrary(args, parsed_globals):
|
|
462
618
|
client = mod.SmhClient(cred, g_param[OptionsDefine.Region], profile)
|
463
619
|
client._sdkVersion += ("_CLI_" + __version__)
|
464
620
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.
|
621
|
+
model = models.CreateUserRequest()
|
466
622
|
model.from_json_string(json.dumps(args))
|
467
623
|
start_time = time.time()
|
468
624
|
while True:
|
469
|
-
rsp = client.
|
625
|
+
rsp = client.CreateUser(model)
|
626
|
+
result = rsp.to_json_string()
|
627
|
+
try:
|
628
|
+
json_obj = json.loads(result)
|
629
|
+
except TypeError as e:
|
630
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
631
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
632
|
+
break
|
633
|
+
cur_time = time.time()
|
634
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
635
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
636
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
637
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
638
|
+
else:
|
639
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
640
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
641
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
642
|
+
|
643
|
+
|
644
|
+
def doDescribeTrafficPackages(args, parsed_globals):
|
645
|
+
g_param = parse_global_arg(parsed_globals)
|
646
|
+
|
647
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
648
|
+
cred = credential.CVMRoleCredential()
|
649
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
650
|
+
cred = credential.STSAssumeRoleCredential(
|
651
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
652
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
653
|
+
)
|
654
|
+
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):
|
655
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
656
|
+
else:
|
657
|
+
cred = credential.Credential(
|
658
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
659
|
+
)
|
660
|
+
http_profile = HttpProfile(
|
661
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
662
|
+
reqMethod="POST",
|
663
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
664
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
665
|
+
)
|
666
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
667
|
+
if g_param[OptionsDefine.Language]:
|
668
|
+
profile.language = g_param[OptionsDefine.Language]
|
669
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
670
|
+
client = mod.SmhClient(cred, g_param[OptionsDefine.Region], profile)
|
671
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
672
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
+
model = models.DescribeTrafficPackagesRequest()
|
674
|
+
model.from_json_string(json.dumps(args))
|
675
|
+
start_time = time.time()
|
676
|
+
while True:
|
677
|
+
rsp = client.DescribeTrafficPackages(model)
|
678
|
+
result = rsp.to_json_string()
|
679
|
+
try:
|
680
|
+
json_obj = json.loads(result)
|
681
|
+
except TypeError as e:
|
682
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
683
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
684
|
+
break
|
685
|
+
cur_time = time.time()
|
686
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
687
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
688
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
689
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
690
|
+
else:
|
691
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
692
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
693
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
|
+
|
695
|
+
|
696
|
+
def doDescribeUserLifecycle(args, parsed_globals):
|
697
|
+
g_param = parse_global_arg(parsed_globals)
|
698
|
+
|
699
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
700
|
+
cred = credential.CVMRoleCredential()
|
701
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
702
|
+
cred = credential.STSAssumeRoleCredential(
|
703
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
704
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
705
|
+
)
|
706
|
+
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):
|
707
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
708
|
+
else:
|
709
|
+
cred = credential.Credential(
|
710
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
711
|
+
)
|
712
|
+
http_profile = HttpProfile(
|
713
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
714
|
+
reqMethod="POST",
|
715
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
716
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
717
|
+
)
|
718
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
719
|
+
if g_param[OptionsDefine.Language]:
|
720
|
+
profile.language = g_param[OptionsDefine.Language]
|
721
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
722
|
+
client = mod.SmhClient(cred, g_param[OptionsDefine.Region], profile)
|
723
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
724
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
+
model = models.DescribeUserLifecycleRequest()
|
726
|
+
model.from_json_string(json.dumps(args))
|
727
|
+
start_time = time.time()
|
728
|
+
while True:
|
729
|
+
rsp = client.DescribeUserLifecycle(model)
|
470
730
|
result = rsp.to_json_string()
|
471
731
|
try:
|
472
732
|
json_obj = json.loads(result)
|
@@ -548,15 +808,20 @@ MODELS_MAP = {
|
|
548
808
|
}
|
549
809
|
|
550
810
|
ACTION_MAP = {
|
811
|
+
"ModifyUser": doModifyUser,
|
812
|
+
"DeleteUser": doDeleteUser,
|
551
813
|
"DescribeOfficialInstances": doDescribeOfficialInstances,
|
552
814
|
"DescribeLibraries": doDescribeLibraries,
|
553
|
-
"CreateLibrary": doCreateLibrary,
|
554
|
-
"SendSmsCode": doSendSmsCode,
|
555
|
-
"DescribeTrafficPackages": doDescribeTrafficPackages,
|
556
815
|
"VerifySmsCode": doVerifySmsCode,
|
816
|
+
"SendSmsCode": doSendSmsCode,
|
817
|
+
"DeleteLibrary": doDeleteLibrary,
|
818
|
+
"CreateUserLifecycle": doCreateUserLifecycle,
|
819
|
+
"CreateLibrary": doCreateLibrary,
|
557
820
|
"DescribeOfficialOverview": doDescribeOfficialOverview,
|
558
821
|
"ModifyLibrary": doModifyLibrary,
|
559
|
-
"
|
822
|
+
"CreateUser": doCreateUser,
|
823
|
+
"DescribeTrafficPackages": doDescribeTrafficPackages,
|
824
|
+
"DescribeUserLifecycle": doDescribeUserLifecycle,
|
560
825
|
"DescribeLibrarySecret": doDescribeLibrarySecret,
|
561
826
|
|
562
827
|
}
|