tccli 3.0.1375.1__py2.py3-none-any.whl → 3.0.1377.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.
Files changed (69) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/bi/bi_client.py +53 -0
  3. tccli/services/bi/v20220105/api.json +101 -0
  4. tccli/services/bi/v20220105/examples.json +8 -0
  5. tccli/services/cdb/v20170320/api.json +18 -8
  6. tccli/services/cdb/v20170320/examples.json +1 -1
  7. tccli/services/cdwdoris/v20211228/api.json +31 -1
  8. tccli/services/cfs/v20190719/api.json +10 -1
  9. tccli/services/chc/v20230418/examples.json +1 -1
  10. tccli/services/clb/v20180317/api.json +20 -0
  11. tccli/services/cls/v20201016/api.json +21 -21
  12. tccli/services/cls/v20201016/examples.json +1 -1
  13. tccli/services/csip/v20221121/api.json +14 -14
  14. tccli/services/ctem/v20231128/api.json +22 -3
  15. tccli/services/ctem/v20231128/examples.json +2 -2
  16. tccli/services/cwp/v20180228/api.json +39 -9
  17. tccli/services/cwp/v20180228/examples.json +6 -0
  18. tccli/services/cynosdb/v20190107/api.json +1 -1
  19. tccli/services/dc/v20180410/api.json +18 -0
  20. tccli/services/dlc/v20210125/api.json +27 -8
  21. tccli/services/dlc/v20210125/examples.json +2 -2
  22. tccli/services/dts/dts_client.py +79 -26
  23. tccli/services/dts/v20211206/api.json +34 -0
  24. tccli/services/dts/v20211206/examples.json +8 -0
  25. tccli/services/ess/ess_client.py +106 -0
  26. tccli/services/ess/v20201111/api.json +142 -7
  27. tccli/services/ess/v20201111/examples.json +16 -0
  28. tccli/services/essbasic/v20210526/api.json +8 -8
  29. tccli/services/faceid/v20180301/api.json +1 -1
  30. tccli/services/ioa/ioa_client.py +106 -0
  31. tccli/services/ioa/v20220601/api.json +545 -10
  32. tccli/services/ioa/v20220601/examples.json +20 -10
  33. tccli/services/iotexplorer/v20190423/api.json +52 -1
  34. tccli/services/iotexplorer/v20190423/examples.json +78 -6
  35. tccli/services/iss/iss_client.py +53 -0
  36. tccli/services/iss/v20230517/api.json +60 -0
  37. tccli/services/iss/v20230517/examples.json +8 -0
  38. tccli/services/live/v20180801/api.json +1 -1
  39. tccli/services/lkeap/v20240522/api.json +17 -7
  40. tccli/services/mna/v20210119/api.json +1 -1
  41. tccli/services/mongodb/v20190725/api.json +22 -10
  42. tccli/services/mps/v20190612/api.json +112 -2
  43. tccli/services/mqtt/mqtt_client.py +265 -0
  44. tccli/services/mqtt/v20240516/api.json +480 -0
  45. tccli/services/mqtt/v20240516/examples.json +40 -0
  46. tccli/services/oceanus/v20190422/api.json +5 -5
  47. tccli/services/ocr/v20181119/api.json +5 -5
  48. tccli/services/omics/v20221128/api.json +1 -1
  49. tccli/services/organization/organization_client.py +69 -16
  50. tccli/services/organization/v20210331/api.json +216 -0
  51. tccli/services/organization/v20210331/examples.json +8 -0
  52. tccli/services/partners/v20180321/api.json +7 -7
  53. tccli/services/rce/v20201103/api.json +1 -1
  54. tccli/services/smh/v20210712/api.json +43 -12
  55. tccli/services/smh/v20210712/examples.json +1 -1
  56. tccli/services/tdmq/v20200217/api.json +1 -1
  57. tccli/services/tione/v20211111/api.json +200 -20
  58. tccli/services/tione/v20211111/examples.json +1 -1
  59. tccli/services/tke/v20180525/api.json +10 -0
  60. tccli/services/tke/v20220501/api.json +20 -2
  61. tccli/services/trtc/v20190722/api.json +6 -6
  62. tccli/services/tsf/v20180326/api.json +59 -59
  63. tccli/services/tsf/v20180326/examples.json +2 -2
  64. tccli/services/vpc/v20170312/api.json +11 -2
  65. {tccli-3.0.1375.1.dist-info → tccli-3.0.1377.1.dist-info}/METADATA +2 -2
  66. {tccli-3.0.1375.1.dist-info → tccli-3.0.1377.1.dist-info}/RECORD +69 -69
  67. {tccli-3.0.1375.1.dist-info → tccli-3.0.1377.1.dist-info}/WHEEL +0 -0
  68. {tccli-3.0.1375.1.dist-info → tccli-3.0.1377.1.dist-info}/entry_points.txt +0 -0
  69. {tccli-3.0.1375.1.dist-info → tccli-3.0.1377.1.dist-info}/license_files/LICENSE +0 -0
@@ -447,26 +447,28 @@
447
447
  "members": [
448
448
  {
449
449
  "disabled": false,
450
- "document": "当前账号具有的权限信息。<ul><li>0:无权限。</li><li>1:只读。</li><li>2:只写。</li><li>3:读写。</li></ul>",
450
+ "document": "当前账号具有的权限信息。<ul><li>0:无权限。</li><li>1:只读。</li><li>2:只写。</li><li>3:读写。</li></ul>\n注意:此字段可能返回 null,表示取不到有效值。",
451
451
  "example": "1",
452
452
  "member": "int64",
453
453
  "name": "Mask",
454
+ "output_required": false,
454
455
  "required": true,
455
456
  "type": "int",
456
- "value_allowed_null": false
457
+ "value_allowed_null": true
457
458
  },
458
459
  {
459
460
  "disabled": false,
460
- "document": "指具有当前账号权限的数据库名。\n<ul><li>* :表示所有数据库。</li><li>db.name:表示特定name的数据库。</li></ul>",
461
+ "document": "指具有当前账号权限的数据库名。\n<ul><li>* :表示所有数据库。</li><li>db.name:表示特定name的数据库。</li></ul>\n注意:此字段可能返回 null,表示取不到有效值。",
461
462
  "example": "\"db_test\"",
462
463
  "member": "string",
463
464
  "name": "NameSpace",
465
+ "output_required": false,
464
466
  "required": true,
465
467
  "type": "string",
466
- "value_allowed_null": false
468
+ "value_allowed_null": true
467
469
  }
468
470
  ],
469
- "usage": "in"
471
+ "usage": "both"
470
472
  },
471
473
  "BackupDownloadTask": {
472
474
  "document": "备份下载任务",
@@ -6939,7 +6941,7 @@
6939
6941
  "example": "mongo_test",
6940
6942
  "member": "string",
6941
6943
  "name": "UserName",
6942
- "required": true,
6944
+ "output_required": true,
6943
6945
  "type": "string",
6944
6946
  "value_allowed_null": false
6945
6947
  },
@@ -6949,7 +6951,7 @@
6949
6951
  "example": "无",
6950
6952
  "member": "Auth",
6951
6953
  "name": "AuthRole",
6952
- "required": true,
6954
+ "output_required": true,
6953
6955
  "type": "list",
6954
6956
  "value_allowed_null": false
6955
6957
  },
@@ -6959,7 +6961,7 @@
6959
6961
  "example": "2021-09-28 14:25:38",
6960
6962
  "member": "string",
6961
6963
  "name": "CreateTime",
6962
- "required": true,
6964
+ "output_required": true,
6963
6965
  "type": "string",
6964
6966
  "value_allowed_null": false
6965
6967
  },
@@ -6969,7 +6971,7 @@
6969
6971
  "example": "2021-09-28 14:25:38",
6970
6972
  "member": "string",
6971
6973
  "name": "UpdateTime",
6972
- "required": true,
6974
+ "output_required": true,
6973
6975
  "type": "string",
6974
6976
  "value_allowed_null": false
6975
6977
  },
@@ -6979,7 +6981,17 @@
6979
6981
  "example": "mongodb测试账号",
6980
6982
  "member": "string",
6981
6983
  "name": "UserDesc",
6982
- "required": true,
6984
+ "output_required": true,
6985
+ "type": "string",
6986
+ "value_allowed_null": false
6987
+ },
6988
+ {
6989
+ "disabled": false,
6990
+ "document": "控制台密码更新时间",
6991
+ "example": "2021-09-28 14:25:38",
6992
+ "member": "string",
6993
+ "name": "ConsolePassUpdateTime",
6994
+ "output_required": false,
6983
6995
  "type": "string",
6984
6996
  "value_allowed_null": false
6985
6997
  }
@@ -28223,6 +28223,17 @@
28223
28223
  "required": false,
28224
28224
  "type": "object",
28225
28225
  "value_allowed_null": true
28226
+ },
28227
+ {
28228
+ "disabled": false,
28229
+ "document": "字幕参数\n注意:此字段可能返回 null,表示取不到有效值。",
28230
+ "example": "无",
28231
+ "member": "SubtitleTemplate",
28232
+ "name": "SubtitleTemplate",
28233
+ "output_required": false,
28234
+ "required": false,
28235
+ "type": "object",
28236
+ "value_allowed_null": true
28226
28237
  }
28227
28238
  ],
28228
28239
  "usage": "both"
@@ -31188,7 +31199,7 @@
31188
31199
  {
31189
31200
  "disabled": false,
31190
31201
  "document": "要压制到视频中的字幕文件地址。\n注意:此字段可能返回 null,表示取不到有效值。",
31191
- "example": "https://test-123xxxx456.cos.ap-nanjing.myqcloud.com/xxxxx/subtitle/1.srt",
31202
+ "example": "https://test-13xxxx46.cos.ap-nanjing.myqcloud.com/xxxxx/subtitle/1.srt",
31192
31203
  "member": "string",
31193
31204
  "name": "Path",
31194
31205
  "output_required": false,
@@ -31207,6 +31218,17 @@
31207
31218
  "type": "int",
31208
31219
  "value_allowed_null": true
31209
31220
  },
31221
+ {
31222
+ "disabled": false,
31223
+ "document": "要压制到视频中的字幕文件的输入信息,目前仅支持存储在COS的字幕文件\n注意:此字段可能返回 null,表示取不到有效值。",
31224
+ "example": "无",
31225
+ "member": "MediaInputInfo",
31226
+ "name": "SubtitleFileInput",
31227
+ "output_required": false,
31228
+ "required": false,
31229
+ "type": "object",
31230
+ "value_allowed_null": true
31231
+ },
31210
31232
  {
31211
31233
  "disabled": false,
31212
31234
  "document": "字体类型,支持:\n<li>hei.ttf:黑体</li>\n<li>song.ttf:宋体</li>\n<li>kai.ttf(推荐)或 simkai.ttf:楷体</li>\n<li>msyh.ttf:微软雅黑</li>\n<li>msyhbd.ttf:微软雅黑加粗</li>\n<li>hkjgt.ttf:华康金刚体</li>\n<li>dhttx.ttf:典黑体特细</li>\n<li>xqgdzt.ttf:喜鹊古字典体</li>\n<li>qpcyt.ttf:巧拼超圆体</li>\n<li>arial.ttf:仅支持英文</li>\n<li>dinalternate.ttf:DIN Alternate Bold</li>\n<li>helveticalt.ttf:Helvetica</li>\n<li>helveticains.ttf:Helvetica Inserat</li>\n<li>trajanpro.ttf:TrajanPro-Bold</li>\n<li>korean.ttf:韩语</li>\n<li>japanese.ttf:日语</li>\n<li>thai.ttf:泰语</li>\n默认:hei.ttf 黑体。注意:楷体推荐使用kai.ttf\n注意:此字段可能返回 null,表示取不到有效值。",
@@ -31243,7 +31265,7 @@
31243
31265
  {
31244
31266
  "disabled": false,
31245
31267
  "document": "文字透明度,取值范围:(0, 1]\n<li>0:完全透明</li>\n<li>1:完全不透明</li>\n默认值:1。\n注意:此字段可能返回 null,表示取不到有效值。",
31246
- "example": "1",
31268
+ "example": "1.0",
31247
31269
  "member": "float",
31248
31270
  "name": "FontAlpha",
31249
31271
  "output_required": false,
@@ -31316,6 +31338,94 @@
31316
31338
  "required": false,
31317
31339
  "type": "float",
31318
31340
  "value_allowed_null": true
31341
+ },
31342
+ {
31343
+ "disabled": false,
31344
+ "document": "描边宽度\n注意:此字段可能返回 null,表示取不到有效值。",
31345
+ "example": "1.0",
31346
+ "member": "float",
31347
+ "name": "OutlineWidth",
31348
+ "output_required": false,
31349
+ "required": false,
31350
+ "type": "float",
31351
+ "value_allowed_null": true
31352
+ },
31353
+ {
31354
+ "disabled": false,
31355
+ "document": "描边颜色。6位16进制RGB\n注意:此字段可能返回 null,表示取不到有效值。",
31356
+ "example": "0x000000",
31357
+ "member": "string",
31358
+ "name": "OutlineColor",
31359
+ "output_required": false,
31360
+ "required": false,
31361
+ "type": "string",
31362
+ "value_allowed_null": true
31363
+ },
31364
+ {
31365
+ "disabled": false,
31366
+ "document": "描边透明度。(0,1] 正浮点数\n注意:此字段可能返回 null,表示取不到有效值。",
31367
+ "example": "0.8",
31368
+ "member": "float",
31369
+ "name": "OutlineAlpha",
31370
+ "output_required": false,
31371
+ "required": false,
31372
+ "type": "float",
31373
+ "value_allowed_null": true
31374
+ },
31375
+ {
31376
+ "disabled": false,
31377
+ "document": "阴影宽度。浮点数 [0, 1000]\n注意:此字段可能返回 null,表示取不到有效值。",
31378
+ "example": "1.0",
31379
+ "member": "float",
31380
+ "name": "ShadowWidth",
31381
+ "output_required": false,
31382
+ "required": false,
31383
+ "type": "float",
31384
+ "value_allowed_null": true
31385
+ },
31386
+ {
31387
+ "disabled": false,
31388
+ "document": "阴影颜色。6位16进制RGB\n注意:此字段可能返回 null,表示取不到有效值。",
31389
+ "example": "0x000000",
31390
+ "member": "string",
31391
+ "name": "ShadowColor",
31392
+ "output_required": false,
31393
+ "required": false,
31394
+ "type": "string",
31395
+ "value_allowed_null": true
31396
+ },
31397
+ {
31398
+ "disabled": false,
31399
+ "document": "阴影透明度。(0,1] 正浮点数\n注意:此字段可能返回 null,表示取不到有效值。",
31400
+ "example": "0.9",
31401
+ "member": "float",
31402
+ "name": "ShadowAlpha",
31403
+ "output_required": false,
31404
+ "required": false,
31405
+ "type": "float",
31406
+ "value_allowed_null": true
31407
+ },
31408
+ {
31409
+ "disabled": false,
31410
+ "document": "行间距。正整数 [0, 1000]\n注意:此字段可能返回 null,表示取不到有效值。",
31411
+ "example": "5",
31412
+ "member": "int64",
31413
+ "name": "LineSpacing",
31414
+ "output_required": false,
31415
+ "required": false,
31416
+ "type": "int",
31417
+ "value_allowed_null": true
31418
+ },
31419
+ {
31420
+ "disabled": false,
31421
+ "document": "对齐方式,,取值:top: 顶部对齐,字幕顶部按位置固定,底部随行数变化。bottom: 底部对齐,字幕底部按位置固定,顶部随行数变化。\n注意:此字段可能返回 null,表示取不到有效值。",
31422
+ "example": "bottom",
31423
+ "member": "string",
31424
+ "name": "Alignment",
31425
+ "output_required": false,
31426
+ "required": false,
31427
+ "type": "string",
31428
+ "value_allowed_null": true
31319
31429
  }
31320
31430
  ],
31321
31431
  "usage": "both"
@@ -17,6 +17,58 @@ from tencentcloud.mqtt.v20240516 import models as models_v20240516
17
17
  from jmespath import search
18
18
  import time
19
19
 
20
+ def doCreateDeviceIdentity(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.MqttClient(cred, g_param[OptionsDefine.Region], profile)
47
+ client._sdkVersion += ("_CLI_" + __version__)
48
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
49
+ model = models.CreateDeviceIdentityRequest()
50
+ model.from_json_string(json.dumps(args))
51
+ start_time = time.time()
52
+ while True:
53
+ rsp = client.CreateDeviceIdentity(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
+
20
72
  def doDescribeUserList(args, parsed_globals):
21
73
  g_param = parse_global_arg(parsed_globals)
22
74
 
@@ -1161,6 +1213,58 @@ def doActivateCaCertificate(args, parsed_globals):
1161
1213
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1162
1214
 
1163
1215
 
1216
+ def doDeleteDeviceIdentity(args, parsed_globals):
1217
+ g_param = parse_global_arg(parsed_globals)
1218
+
1219
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1220
+ cred = credential.CVMRoleCredential()
1221
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1222
+ cred = credential.STSAssumeRoleCredential(
1223
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1224
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1225
+ )
1226
+ 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):
1227
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1228
+ else:
1229
+ cred = credential.Credential(
1230
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1231
+ )
1232
+ http_profile = HttpProfile(
1233
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1234
+ reqMethod="POST",
1235
+ endpoint=g_param[OptionsDefine.Endpoint],
1236
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1237
+ )
1238
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1239
+ if g_param[OptionsDefine.Language]:
1240
+ profile.language = g_param[OptionsDefine.Language]
1241
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1242
+ client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
1243
+ client._sdkVersion += ("_CLI_" + __version__)
1244
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1245
+ model = models.DeleteDeviceIdentityRequest()
1246
+ model.from_json_string(json.dumps(args))
1247
+ start_time = time.time()
1248
+ while True:
1249
+ rsp = client.DeleteDeviceIdentity(model)
1250
+ result = rsp.to_json_string()
1251
+ try:
1252
+ json_obj = json.loads(result)
1253
+ except TypeError as e:
1254
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1255
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1256
+ break
1257
+ cur_time = time.time()
1258
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1259
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1260
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1261
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1262
+ else:
1263
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1264
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1265
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1266
+
1267
+
1164
1268
  def doDescribeMessageByTopic(args, parsed_globals):
1165
1269
  g_param = parse_global_arg(parsed_globals)
1166
1270
 
@@ -1733,6 +1837,58 @@ def doDescribeMessageDetails(args, parsed_globals):
1733
1837
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1734
1838
 
1735
1839
 
1840
+ def doDescribeDeviceIdentity(args, parsed_globals):
1841
+ g_param = parse_global_arg(parsed_globals)
1842
+
1843
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1844
+ cred = credential.CVMRoleCredential()
1845
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1846
+ cred = credential.STSAssumeRoleCredential(
1847
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1848
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1849
+ )
1850
+ 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):
1851
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1852
+ else:
1853
+ cred = credential.Credential(
1854
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1855
+ )
1856
+ http_profile = HttpProfile(
1857
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1858
+ reqMethod="POST",
1859
+ endpoint=g_param[OptionsDefine.Endpoint],
1860
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1861
+ )
1862
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1863
+ if g_param[OptionsDefine.Language]:
1864
+ profile.language = g_param[OptionsDefine.Language]
1865
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1866
+ client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
1867
+ client._sdkVersion += ("_CLI_" + __version__)
1868
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1869
+ model = models.DescribeDeviceIdentityRequest()
1870
+ model.from_json_string(json.dumps(args))
1871
+ start_time = time.time()
1872
+ while True:
1873
+ rsp = client.DescribeDeviceIdentity(model)
1874
+ result = rsp.to_json_string()
1875
+ try:
1876
+ json_obj = json.loads(result)
1877
+ except TypeError as e:
1878
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1879
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1880
+ break
1881
+ cur_time = time.time()
1882
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1883
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1884
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1885
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1886
+ else:
1887
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1888
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1889
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1890
+
1891
+
1736
1892
  def doDeleteTopic(args, parsed_globals):
1737
1893
  g_param = parse_global_arg(parsed_globals)
1738
1894
 
@@ -2409,6 +2565,58 @@ def doModifyInsPublicEndpoint(args, parsed_globals):
2409
2565
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2410
2566
 
2411
2567
 
2568
+ def doModifyDeviceIdentity(args, parsed_globals):
2569
+ g_param = parse_global_arg(parsed_globals)
2570
+
2571
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2572
+ cred = credential.CVMRoleCredential()
2573
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2574
+ cred = credential.STSAssumeRoleCredential(
2575
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2576
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2577
+ )
2578
+ 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):
2579
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2580
+ else:
2581
+ cred = credential.Credential(
2582
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2583
+ )
2584
+ http_profile = HttpProfile(
2585
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2586
+ reqMethod="POST",
2587
+ endpoint=g_param[OptionsDefine.Endpoint],
2588
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2589
+ )
2590
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2591
+ if g_param[OptionsDefine.Language]:
2592
+ profile.language = g_param[OptionsDefine.Language]
2593
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2594
+ client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
2595
+ client._sdkVersion += ("_CLI_" + __version__)
2596
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2597
+ model = models.ModifyDeviceIdentityRequest()
2598
+ model.from_json_string(json.dumps(args))
2599
+ start_time = time.time()
2600
+ while True:
2601
+ rsp = client.ModifyDeviceIdentity(model)
2602
+ result = rsp.to_json_string()
2603
+ try:
2604
+ json_obj = json.loads(result)
2605
+ except TypeError as e:
2606
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2607
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2608
+ break
2609
+ cur_time = time.time()
2610
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2611
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2612
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2613
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2614
+ else:
2615
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2616
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2617
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2618
+
2619
+
2412
2620
  def doUpdateAuthorizationPolicyPriority(args, parsed_globals):
2413
2621
  g_param = parse_global_arg(parsed_globals)
2414
2622
 
@@ -2825,6 +3033,58 @@ def doCreateHttpAuthenticator(args, parsed_globals):
2825
3033
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2826
3034
 
2827
3035
 
3036
+ def doDescribeDeviceIdentities(args, parsed_globals):
3037
+ g_param = parse_global_arg(parsed_globals)
3038
+
3039
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3040
+ cred = credential.CVMRoleCredential()
3041
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3042
+ cred = credential.STSAssumeRoleCredential(
3043
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3044
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3045
+ )
3046
+ 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):
3047
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3048
+ else:
3049
+ cred = credential.Credential(
3050
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3051
+ )
3052
+ http_profile = HttpProfile(
3053
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3054
+ reqMethod="POST",
3055
+ endpoint=g_param[OptionsDefine.Endpoint],
3056
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3057
+ )
3058
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3059
+ if g_param[OptionsDefine.Language]:
3060
+ profile.language = g_param[OptionsDefine.Language]
3061
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3062
+ client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
3063
+ client._sdkVersion += ("_CLI_" + __version__)
3064
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
3065
+ model = models.DescribeDeviceIdentitiesRequest()
3066
+ model.from_json_string(json.dumps(args))
3067
+ start_time = time.time()
3068
+ while True:
3069
+ rsp = client.DescribeDeviceIdentities(model)
3070
+ result = rsp.to_json_string()
3071
+ try:
3072
+ json_obj = json.loads(result)
3073
+ except TypeError as e:
3074
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
3075
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3076
+ break
3077
+ cur_time = time.time()
3078
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3079
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3080
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3081
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3082
+ else:
3083
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3084
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3085
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3086
+
3087
+
2828
3088
  CLIENT_MAP = {
2829
3089
  "v20240516": mqtt_client_v20240516,
2830
3090
 
@@ -2836,6 +3096,7 @@ MODELS_MAP = {
2836
3096
  }
2837
3097
 
2838
3098
  ACTION_MAP = {
3099
+ "CreateDeviceIdentity": doCreateDeviceIdentity,
2839
3100
  "DescribeUserList": doDescribeUserList,
2840
3101
  "CreateInsPublicEndpoint": doCreateInsPublicEndpoint,
2841
3102
  "ModifyTopic": doModifyTopic,
@@ -2858,6 +3119,7 @@ ACTION_MAP = {
2858
3119
  "DescribeProductSKUList": doDescribeProductSKUList,
2859
3120
  "DescribeCaCertificates": doDescribeCaCertificates,
2860
3121
  "ActivateCaCertificate": doActivateCaCertificate,
3122
+ "DeleteDeviceIdentity": doDeleteDeviceIdentity,
2861
3123
  "DescribeMessageByTopic": doDescribeMessageByTopic,
2862
3124
  "DeleteDeviceCertificate": doDeleteDeviceCertificate,
2863
3125
  "ApplyRegistrationCode": doApplyRegistrationCode,
@@ -2869,6 +3131,7 @@ ACTION_MAP = {
2869
3131
  "DescribeSharedSubscriptionLag": doDescribeSharedSubscriptionLag,
2870
3132
  "DescribeInstance": doDescribeInstance,
2871
3133
  "DescribeMessageDetails": doDescribeMessageDetails,
3134
+ "DescribeDeviceIdentity": doDescribeDeviceIdentity,
2872
3135
  "DeleteTopic": doDeleteTopic,
2873
3136
  "DeleteUser": doDeleteUser,
2874
3137
  "DescribeCaCertificate": doDescribeCaCertificate,
@@ -2882,6 +3145,7 @@ ACTION_MAP = {
2882
3145
  "DescribeTopic": doDescribeTopic,
2883
3146
  "RegisterCaCertificate": doRegisterCaCertificate,
2884
3147
  "ModifyInsPublicEndpoint": doModifyInsPublicEndpoint,
3148
+ "ModifyDeviceIdentity": doModifyDeviceIdentity,
2885
3149
  "UpdateAuthorizationPolicyPriority": doUpdateAuthorizationPolicyPriority,
2886
3150
  "DescribeAuthorizationPolicies": doDescribeAuthorizationPolicies,
2887
3151
  "CreateUser": doCreateUser,
@@ -2890,6 +3154,7 @@ ACTION_MAP = {
2890
3154
  "CreateAuthorizationPolicy": doCreateAuthorizationPolicy,
2891
3155
  "ModifyInstance": doModifyInstance,
2892
3156
  "CreateHttpAuthenticator": doCreateHttpAuthenticator,
3157
+ "DescribeDeviceIdentities": doDescribeDeviceIdentities,
2893
3158
 
2894
3159
  }
2895
3160