tccli 3.0.1136.1__py2.py3-none-any.whl → 3.0.1137.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/command.py +4 -1
  3. tccli/help_command.py +4 -1
  4. tccli/services/cdb/v20170320/api.json +3 -3
  5. tccli/services/cls/v20201016/api.json +93 -0
  6. tccli/services/cwp/cwp_client.py +0 -53
  7. tccli/services/cwp/v20180228/api.json +0 -43
  8. tccli/services/cwp/v20180228/examples.json +0 -8
  9. tccli/services/cynosdb/v20190107/api.json +10 -0
  10. tccli/services/dlc/v20210125/api.json +23 -23
  11. tccli/services/dlc/v20210125/examples.json +6 -6
  12. tccli/services/dts/v20211206/api.json +3 -3
  13. tccli/services/essbasic/v20210526/api.json +2 -2
  14. tccli/services/faceid/v20180301/api.json +1 -1
  15. tccli/services/ioa/ioa_client.py +159 -0
  16. tccli/services/ioa/v20220601/api.json +897 -80
  17. tccli/services/ioa/v20220601/examples.json +24 -0
  18. tccli/services/iotexplorer/iotexplorer_client.py +178 -19
  19. tccli/services/iotexplorer/v20190423/api.json +199 -0
  20. tccli/services/iotexplorer/v20190423/examples.json +24 -0
  21. tccli/services/live/v20180801/api.json +12 -6
  22. tccli/services/ocr/v20181119/api.json +2 -2
  23. tccli/services/partners/v20180321/api.json +26 -16
  24. tccli/services/tcr/v20190924/api.json +57 -35
  25. tccli/services/tcr/v20190924/examples.json +4 -4
  26. tccli/services/tcss/v20201101/api.json +123 -13
  27. tccli/services/tcss/v20201101/examples.json +3 -3
  28. tccli/services/tke/v20180525/api.json +13 -3
  29. tccli/services/tts/v20190823/api.json +2 -2
  30. tccli/services/wedata/v20210820/api.json +377 -0
  31. tccli/services/wedata/v20210820/examples.json +8 -0
  32. tccli/services/wedata/wedata_client.py +61 -8
  33. {tccli-3.0.1136.1.dist-info → tccli-3.0.1137.1.dist-info}/METADATA +2 -2
  34. {tccli-3.0.1136.1.dist-info → tccli-3.0.1137.1.dist-info}/RECORD +37 -37
  35. {tccli-3.0.1136.1.dist-info → tccli-3.0.1137.1.dist-info}/WHEEL +0 -0
  36. {tccli-3.0.1136.1.dist-info → tccli-3.0.1137.1.dist-info}/entry_points.txt +0 -0
  37. {tccli-3.0.1136.1.dist-info → tccli-3.0.1137.1.dist-info}/license_files/LICENSE +0 -0
@@ -1,5 +1,13 @@
1
1
  {
2
2
  "actions": {
3
+ "DescribeAccountGroups": [
4
+ {
5
+ "document": "",
6
+ "input": "Path : /capi/Assets/DescribeAccountGroups\n\n<body>\n\n{\n \"Condition\":{\n \"PageNum\":0,\n \"PageSize\":10,\n \"Sort\":{\n \"Field\":\"Itime\",\n \"Order\":\"desc\"\n }\n },\n \"ParentId\":1\n}",
7
+ "output": "{\n \"Response\": {\n \"Data\": {\n \"Items\": [\n {\n \"Source\": 0,\n \"IdPath\": \"1.30\",\n \"ImportType\": \"zijian\",\n \"Id\": 30,\n \"UserTotal\": 0,\n \"IsLeaf\": false,\n \"ReadOnly\": false,\n \"ParentId\": 1,\n \"ExtraInfo\": \"\",\n \"OrgId\": \"30\",\n \"NamePath\": \"分组路径\",\n \"Description\": \"\",\n \"IdPathArr\": [\n 1,\n 30\n ],\n \"Utime\": \"2022-07-21 10:24:11\",\n \"Name\": \"用户名\",\n \"Itime\": \"2022-07-21 10:24:11\",\n \"ParentOrgId\": \"0\",\n \"MiniIamId\": \"\"\n }\n ],\n \"Page\": {\n \"PageSize\": 10,\n \"PageNum\": 0,\n \"Total\": 4,\n \"PageCount\": 1\n }\n },\n \"RequestId\": \"1658388211.551832\"\n }\n}",
8
+ "title": "查询账号列表"
9
+ }
10
+ ],
3
11
  "DescribeDevices": [
4
12
  {
5
13
  "document": "获取租户满足条件:最近登录账号包含\\'cc\\'(不区分大小写)的设备列表详情",
@@ -7,6 +15,22 @@
7
15
  "output": "{\n \"Response\": {\n \"Data\": {\n \"Items\": [\n {\n \"AccountGroupId\": 0,\n \"AccountGroupName\": \"test\",\n \"AccountName\": \"cc\",\n \"AccountUsers\": \"\",\n \"BaseBoardSn\": \"\",\n \"ComputerName\": \"DESKTOP-AL8RU6H\",\n \"ConnActiveTime\": \"2023-12-01T12:11:47.076416+08:00\",\n \"CriticalVulListCount\": 0,\n \"DeviceNewStrategyVer\": \"2023-12-01 12:11:00\",\n \"DeviceStrategyVer\": \"2023-12-01 11:10:00\",\n \"DomainName\": \"\",\n \"FirewallStatus\": 1,\n \"GroupId\": 93,\n \"GroupName\": \"未分组终端\",\n \"GroupNamePath\": \"全网终端.未分组终端\",\n \"HostId\": 0,\n \"HostName\": \"\",\n \"IOAUserName\": \"cc\",\n \"Id\": 54,\n \"IdentityNewStrategyVer\": \"\",\n \"IdentityStrategyVer\": \"\",\n \"Ip\": \"113.108.77.51\",\n \"Itime\": \"2023-12-01T09:37:38.505458+08:00\",\n \"LocalIpList\": \"192.168.0.128\",\n \"Locked\": 0,\n \"MacAddr\": \"00:0C:29:10:00:5C\",\n \"Mid\": \"75129D715480905B6A9C4569893C7634656938E2\",\n \"NGNNewStrategyVer\": \"2023-11-20 15:54:00\",\n \"NGNStrategyVer\": \"2023-11-20 15:54:00\",\n \"Name\": \"DESKTOP-AL8RU6H\",\n \"OnlineStatus\": 1,\n \"OsType\": 0,\n \"RiskCount\": 0,\n \"SerialNum\": \"VMware-56 4d 76 2d d7 24 e1 ab-43 f3 af 25 e3 10 00 5c\",\n \"StrVersion\": \"209.12.18590.201\",\n \"SysRepVersion\": \"2023.11.30.19.52.38\",\n \"Tags\": \"\",\n \"UserName\": \"cc\",\n \"Version\": \"58828322890449097\",\n \"VirusVer\": \"2.0.13712.288\",\n \"VulCount\": 0,\n \"VulCriticalList\": [],\n \"VulVersion\": \"2023.11.21.16.28.52\"\n },\n {\n \"AccountGroupId\": 0,\n \"AccountGroupName\": \"test\",\n \"AccountName\": \"cc\",\n \"AccountUsers\": \"\",\n \"BaseBoardSn\": \"\",\n \"ComputerName\": \"DESKTOP-AL8RU6H\",\n \"ConnActiveTime\": \"2023-11-29T17:53:33.715333+08:00\",\n \"CriticalVulListCount\": 0,\n \"DeviceNewStrategyVer\": \"2023-12-01 12:11:00\",\n \"DeviceStrategyVer\": \"2023-11-29 17:42:00\",\n \"DomainName\": \"\",\n \"FirewallStatus\": 1,\n \"GroupId\": 93,\n \"GroupName\": \"未分组终端\",\n \"GroupNamePath\": \"全网终端.未分组终端\",\n \"HostId\": 0,\n \"HostName\": \"\",\n \"IOAUserName\": \"cc\",\n \"Id\": 51,\n \"IdentityNewStrategyVer\": \"\",\n \"IdentityStrategyVer\": \"\",\n \"Ip\": \"113.108.77.60\",\n \"Itime\": \"2023-11-29T17:26:42.200203+08:00\",\n \"LocalIpList\": \"192.168.0.128\",\n \"Locked\": 0,\n \"MacAddr\": \"00:0C:29:10:00:5C\",\n \"Mid\": \"75129D715480905B6A9C4569893C7634656703D2\",\n \"NGNNewStrategyVer\": \"2023-11-20 15:54:00\",\n \"NGNStrategyVer\": \"2023-11-20 15:54:00\",\n \"Name\": \"DESKTOP-AL8RU6H\",\n \"OnlineStatus\": 1,\n \"OsType\": 0,\n \"RiskCount\": 0,\n \"SerialNum\": \"VMware-56 4d 76 2d d7 24 e1 ab-43 f3 af 25 e3 10 00 5c\",\n \"StrVersion\": \"107.1.18559.201\",\n \"SysRepVersion\": \"2023.11.29.12.55.06\",\n \"Tags\": \"\",\n \"UserName\": \"cc\",\n \"Version\": \"30117828019290313\",\n \"VirusVer\": \"2.0.13712.60\",\n \"VulCount\": 0,\n \"VulCriticalList\": [],\n \"VulVersion\": \"2023.11.21.16.28.52\"\n }\n ],\n \"Paging\": {\n \"PageCount\": 1,\n \"PageNum\": 1,\n \"PageSize\": 10,\n \"Total\": 2\n }\n },\n \"RequestId\": \"807938c5-9308-4c87-918d-e84a05f226a1\"\n }\n}",
8
16
  "title": "获取设备列表详情"
9
17
  }
18
+ ],
19
+ "DescribeLocalAccounts": [
20
+ {
21
+ "document": "",
22
+ "input": "POST / HTTP/1.1\nHost: ioa.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeLocalAccounts\n<公共请求参数>\n\n{\n \"Condition\": {\n \"Filters\": [\n {\n \"Field\": \"abc\",\n \"Operator\": \"abc\",\n \"Values\": [\n \"abc\"\n ]\n }\n ],\n \"FilterGroups\": [\n {\n \"Filters\": [\n {\n \"Field\": \"abc\",\n \"Operator\": \"abc\",\n \"Values\": [\n \"abc\"\n ]\n }\n ]\n }\n ],\n \"Sort\": {\n \"Field\": \"abc\",\n \"Order\": \"abc\"\n },\n \"PageSize\": 0,\n \"PageNum\": 0\n },\n \"AccountGroupId\": 0,\n \"ShowFlag\": 0\n}",
23
+ "output": "{\n \"Response\": {\n \"Data\": {\n \"Page\": {\n \"PageSize\": 1,\n \"PageNum\": 1,\n \"PageCount\": 1,\n \"Total\": 1\n },\n \"Items\": [\n {\n \"Id\": 0,\n \"UserId\": \"abc\",\n \"UserName\": \"abc\",\n \"AccountId\": 0,\n \"GroupId\": 0,\n \"GroupName\": \"abc\",\n \"NamePath\": \"abc\",\n \"Source\": 0,\n \"Status\": 0,\n \"Itime\": \"abc\",\n \"Utime\": \"abc\",\n \"ExtraInfo\": \"abc\",\n \"RiskLevel\": \"abc\",\n \"AccountGroups\": [\n {\n \"AccountGroupId\": 0\n }\n ],\n \"MobileBindNum\": 0,\n \"PcBindNum\": 0,\n \"OnlineStatus\": 0,\n \"ActiveStatus\": 0,\n \"LoginTime\": \"abc\",\n \"LogoutTime\": \"abc\"\n }\n ]\n },\n \"RequestId\": \"abc\"\n }\n}",
24
+ "title": "normal"
25
+ }
26
+ ],
27
+ "DescribeRootAccountGroup": [
28
+ {
29
+ "document": "",
30
+ "input": "POST / HTTP/1.1\nHost: ioa.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeRootAccountGroup\n<公共请求参数>\n\n{}",
31
+ "output": "{\n \"Response\": {\n \"Data\": {\n \"NamePath\": \"全网账户\",\n \"IdPathArr\": [\n 2222\n ],\n \"ExtraInfo\": \"{}\",\n \"Utime\": \"2022-10-09 14:37:05\",\n \"ParentId\": 0,\n \"OrgId\": \"0\",\n \"Source\": 0,\n \"IdPath\": \"2222\",\n \"Itime\": \"2022-10-09 14:37:05\",\n \"ParentOrgId\": \"0\",\n \"Name\": \"全网账户\",\n \"ImportEnable\": false,\n \"ImportType\": \"\",\n \"MiniIamId\": \"\",\n \"Id\": 2222,\n \"Import\": \"\",\n \"Description\": \"\"\n },\n \"RequestId\": \"e6f9be7b-af66-4a22-b867-94510cf04492\"\n }\n}",
32
+ "title": "https://ioa.test.tencentcloudapi.com/?Action=DescribeRootAccountGroup"
33
+ }
10
34
  ]
11
35
  },
12
36
  "version": "1.0"
@@ -225,7 +225,7 @@ def doDescribeDevicePackages(args, parsed_globals):
225
225
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
226
 
227
227
 
228
- def doDescribeDevice(args, parsed_globals):
228
+ def doDescribeFirmwareUpdateStatus(args, parsed_globals):
229
229
  g_param = parse_global_arg(parsed_globals)
230
230
 
231
231
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -254,11 +254,11 @@ def doDescribeDevice(args, parsed_globals):
254
254
  client = mod.IotexplorerClient(cred, g_param[OptionsDefine.Region], profile)
255
255
  client._sdkVersion += ("_CLI_" + __version__)
256
256
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
257
- model = models.DescribeDeviceRequest()
257
+ model = models.DescribeFirmwareUpdateStatusRequest()
258
258
  model.from_json_string(json.dumps(args))
259
259
  start_time = time.time()
260
260
  while True:
261
- rsp = client.DescribeDevice(model)
261
+ rsp = client.DescribeFirmwareUpdateStatus(model)
262
262
  result = rsp.to_json_string()
263
263
  try:
264
264
  json_obj = json.loads(result)
@@ -277,7 +277,7 @@ def doDescribeDevice(args, parsed_globals):
277
277
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
278
278
 
279
279
 
280
- def doGenSingleDeviceSignatureOfPublic(args, parsed_globals):
280
+ def doDescribeDevice(args, parsed_globals):
281
281
  g_param = parse_global_arg(parsed_globals)
282
282
 
283
283
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -306,11 +306,11 @@ def doGenSingleDeviceSignatureOfPublic(args, parsed_globals):
306
306
  client = mod.IotexplorerClient(cred, g_param[OptionsDefine.Region], profile)
307
307
  client._sdkVersion += ("_CLI_" + __version__)
308
308
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
309
- model = models.GenSingleDeviceSignatureOfPublicRequest()
309
+ model = models.DescribeDeviceRequest()
310
310
  model.from_json_string(json.dumps(args))
311
311
  start_time = time.time()
312
312
  while True:
313
- rsp = client.GenSingleDeviceSignatureOfPublic(model)
313
+ rsp = client.DescribeDevice(model)
314
314
  result = rsp.to_json_string()
315
315
  try:
316
316
  json_obj = json.loads(result)
@@ -2409,6 +2409,58 @@ def doListFirmwares(args, parsed_globals):
2409
2409
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2410
2410
 
2411
2411
 
2412
+ def doPublishFirmwareUpdateMessage(args, parsed_globals):
2413
+ g_param = parse_global_arg(parsed_globals)
2414
+
2415
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2416
+ cred = credential.CVMRoleCredential()
2417
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2418
+ cred = credential.STSAssumeRoleCredential(
2419
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2420
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2421
+ )
2422
+ 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):
2423
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2424
+ else:
2425
+ cred = credential.Credential(
2426
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2427
+ )
2428
+ http_profile = HttpProfile(
2429
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2430
+ reqMethod="POST",
2431
+ endpoint=g_param[OptionsDefine.Endpoint],
2432
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2433
+ )
2434
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2435
+ if g_param[OptionsDefine.Language]:
2436
+ profile.language = g_param[OptionsDefine.Language]
2437
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2438
+ client = mod.IotexplorerClient(cred, g_param[OptionsDefine.Region], profile)
2439
+ client._sdkVersion += ("_CLI_" + __version__)
2440
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2441
+ model = models.PublishFirmwareUpdateMessageRequest()
2442
+ model.from_json_string(json.dumps(args))
2443
+ start_time = time.time()
2444
+ while True:
2445
+ rsp = client.PublishFirmwareUpdateMessage(model)
2446
+ result = rsp.to_json_string()
2447
+ try:
2448
+ json_obj = json.loads(result)
2449
+ except TypeError as e:
2450
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2451
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2452
+ break
2453
+ cur_time = time.time()
2454
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2455
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2456
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2457
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2458
+ else:
2459
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2460
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2461
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2462
+
2463
+
2412
2464
  def doCreateDevice(args, parsed_globals):
2413
2465
  g_param = parse_global_arg(parsed_globals)
2414
2466
 
@@ -2773,7 +2825,7 @@ def doDescribeLoRaFrequency(args, parsed_globals):
2773
2825
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2774
2826
 
2775
2827
 
2776
- def doModifyTopicPolicy(args, parsed_globals):
2828
+ def doModifyPositionSpace(args, parsed_globals):
2777
2829
  g_param = parse_global_arg(parsed_globals)
2778
2830
 
2779
2831
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2802,11 +2854,11 @@ def doModifyTopicPolicy(args, parsed_globals):
2802
2854
  client = mod.IotexplorerClient(cred, g_param[OptionsDefine.Region], profile)
2803
2855
  client._sdkVersion += ("_CLI_" + __version__)
2804
2856
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2805
- model = models.ModifyTopicPolicyRequest()
2857
+ model = models.ModifyPositionSpaceRequest()
2806
2858
  model.from_json_string(json.dumps(args))
2807
2859
  start_time = time.time()
2808
2860
  while True:
2809
- rsp = client.ModifyTopicPolicy(model)
2861
+ rsp = client.ModifyPositionSpace(model)
2810
2862
  result = rsp.to_json_string()
2811
2863
  try:
2812
2864
  json_obj = json.loads(result)
@@ -3293,6 +3345,58 @@ def doDeleteProject(args, parsed_globals):
3293
3345
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3294
3346
 
3295
3347
 
3348
+ def doDescribeCloudStorageAIServiceTask(args, parsed_globals):
3349
+ g_param = parse_global_arg(parsed_globals)
3350
+
3351
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3352
+ cred = credential.CVMRoleCredential()
3353
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3354
+ cred = credential.STSAssumeRoleCredential(
3355
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3356
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3357
+ )
3358
+ 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):
3359
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3360
+ else:
3361
+ cred = credential.Credential(
3362
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3363
+ )
3364
+ http_profile = HttpProfile(
3365
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3366
+ reqMethod="POST",
3367
+ endpoint=g_param[OptionsDefine.Endpoint],
3368
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3369
+ )
3370
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3371
+ if g_param[OptionsDefine.Language]:
3372
+ profile.language = g_param[OptionsDefine.Language]
3373
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3374
+ client = mod.IotexplorerClient(cred, g_param[OptionsDefine.Region], profile)
3375
+ client._sdkVersion += ("_CLI_" + __version__)
3376
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
3377
+ model = models.DescribeCloudStorageAIServiceTaskRequest()
3378
+ model.from_json_string(json.dumps(args))
3379
+ start_time = time.time()
3380
+ while True:
3381
+ rsp = client.DescribeCloudStorageAIServiceTask(model)
3382
+ result = rsp.to_json_string()
3383
+ try:
3384
+ json_obj = json.loads(result)
3385
+ except TypeError as e:
3386
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
3387
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3388
+ break
3389
+ cur_time = time.time()
3390
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3391
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3392
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3393
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3394
+ else:
3395
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3396
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3397
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3398
+
3399
+
3296
3400
  def doDescribeTopicRule(args, parsed_globals):
3297
3401
  g_param = parse_global_arg(parsed_globals)
3298
3402
 
@@ -4437,7 +4541,7 @@ def doAssignTWeCallLicense(args, parsed_globals):
4437
4541
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4438
4542
 
4439
4543
 
4440
- def doModifyPositionSpace(args, parsed_globals):
4544
+ def doModifyTopicPolicy(args, parsed_globals):
4441
4545
  g_param = parse_global_arg(parsed_globals)
4442
4546
 
4443
4547
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -4466,11 +4570,11 @@ def doModifyPositionSpace(args, parsed_globals):
4466
4570
  client = mod.IotexplorerClient(cred, g_param[OptionsDefine.Region], profile)
4467
4571
  client._sdkVersion += ("_CLI_" + __version__)
4468
4572
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
4469
- model = models.ModifyPositionSpaceRequest()
4573
+ model = models.ModifyTopicPolicyRequest()
4470
4574
  model.from_json_string(json.dumps(args))
4471
4575
  start_time = time.time()
4472
4576
  while True:
4473
- rsp = client.ModifyPositionSpace(model)
4577
+ rsp = client.ModifyTopicPolicy(model)
4474
4578
  result = rsp.to_json_string()
4475
4579
  try:
4476
4580
  json_obj = json.loads(result)
@@ -5477,6 +5581,58 @@ def doDeleteDevices(args, parsed_globals):
5477
5581
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5478
5582
 
5479
5583
 
5584
+ def doCheckFirmwareUpdate(args, parsed_globals):
5585
+ g_param = parse_global_arg(parsed_globals)
5586
+
5587
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
5588
+ cred = credential.CVMRoleCredential()
5589
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
5590
+ cred = credential.STSAssumeRoleCredential(
5591
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
5592
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
5593
+ )
5594
+ 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):
5595
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
5596
+ else:
5597
+ cred = credential.Credential(
5598
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
5599
+ )
5600
+ http_profile = HttpProfile(
5601
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
5602
+ reqMethod="POST",
5603
+ endpoint=g_param[OptionsDefine.Endpoint],
5604
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
5605
+ )
5606
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
5607
+ if g_param[OptionsDefine.Language]:
5608
+ profile.language = g_param[OptionsDefine.Language]
5609
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
5610
+ client = mod.IotexplorerClient(cred, g_param[OptionsDefine.Region], profile)
5611
+ client._sdkVersion += ("_CLI_" + __version__)
5612
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
5613
+ model = models.CheckFirmwareUpdateRequest()
5614
+ model.from_json_string(json.dumps(args))
5615
+ start_time = time.time()
5616
+ while True:
5617
+ rsp = client.CheckFirmwareUpdate(model)
5618
+ result = rsp.to_json_string()
5619
+ try:
5620
+ json_obj = json.loads(result)
5621
+ except TypeError as e:
5622
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
5623
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
5624
+ break
5625
+ cur_time = time.time()
5626
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
5627
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
5628
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
5629
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
5630
+ else:
5631
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
5632
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
5633
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5634
+
5635
+
5480
5636
  def doGetGatewaySubDeviceList(args, parsed_globals):
5481
5637
  g_param = parse_global_arg(parsed_globals)
5482
5638
 
@@ -6309,7 +6465,7 @@ def doListTopicPolicy(args, parsed_globals):
6309
6465
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
6310
6466
 
6311
6467
 
6312
- def doDescribeCloudStorageAIServiceTask(args, parsed_globals):
6468
+ def doGenSingleDeviceSignatureOfPublic(args, parsed_globals):
6313
6469
  g_param = parse_global_arg(parsed_globals)
6314
6470
 
6315
6471
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -6338,11 +6494,11 @@ def doDescribeCloudStorageAIServiceTask(args, parsed_globals):
6338
6494
  client = mod.IotexplorerClient(cred, g_param[OptionsDefine.Region], profile)
6339
6495
  client._sdkVersion += ("_CLI_" + __version__)
6340
6496
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
6341
- model = models.DescribeCloudStorageAIServiceTaskRequest()
6497
+ model = models.GenSingleDeviceSignatureOfPublicRequest()
6342
6498
  model.from_json_string(json.dumps(args))
6343
6499
  start_time = time.time()
6344
6500
  while True:
6345
- rsp = client.DescribeCloudStorageAIServiceTask(model)
6501
+ rsp = client.GenSingleDeviceSignatureOfPublic(model)
6346
6502
  result = rsp.to_json_string()
6347
6503
  try:
6348
6504
  json_obj = json.loads(result)
@@ -7208,8 +7364,8 @@ ACTION_MAP = {
7208
7364
  "GetCOSURL": doGetCOSURL,
7209
7365
  "ModifyStudioProduct": doModifyStudioProduct,
7210
7366
  "DescribeDevicePackages": doDescribeDevicePackages,
7367
+ "DescribeFirmwareUpdateStatus": doDescribeFirmwareUpdateStatus,
7211
7368
  "DescribeDevice": doDescribeDevice,
7212
- "GenSingleDeviceSignatureOfPublic": doGenSingleDeviceSignatureOfPublic,
7213
7369
  "DescribeTopicPolicy": doDescribeTopicPolicy,
7214
7370
  "ModifyProductCloudStorageAIService": doModifyProductCloudStorageAIService,
7215
7371
  "GetProjectList": doGetProjectList,
@@ -7250,6 +7406,7 @@ ACTION_MAP = {
7250
7406
  "ModifyTopicRule": doModifyTopicRule,
7251
7407
  "InheritCloudStorageUser": doInheritCloudStorageUser,
7252
7408
  "ListFirmwares": doListFirmwares,
7409
+ "PublishFirmwareUpdateMessage": doPublishFirmwareUpdateMessage,
7253
7410
  "CreateDevice": doCreateDevice,
7254
7411
  "DeleteFenceBind": doDeleteFenceBind,
7255
7412
  "DescribeFenceEventList": doDescribeFenceEventList,
@@ -7257,7 +7414,7 @@ ACTION_MAP = {
7257
7414
  "GetPositionSpaceList": doGetPositionSpaceList,
7258
7415
  "ResetCloudStorage": doResetCloudStorage,
7259
7416
  "DescribeLoRaFrequency": doDescribeLoRaFrequency,
7260
- "ModifyTopicPolicy": doModifyTopicPolicy,
7417
+ "ModifyPositionSpace": doModifyPositionSpace,
7261
7418
  "DescribeCloudStorageTime": doDescribeCloudStorageTime,
7262
7419
  "GetTopicRuleList": doGetTopicRuleList,
7263
7420
  "DescribeCloudStorageThumbnail": doDescribeCloudStorageThumbnail,
@@ -7267,6 +7424,7 @@ ACTION_MAP = {
7267
7424
  "DescribeCloudStorageStreamData": doDescribeCloudStorageStreamData,
7268
7425
  "GetDeviceSumStatistics": doGetDeviceSumStatistics,
7269
7426
  "DeleteProject": doDeleteProject,
7427
+ "DescribeCloudStorageAIServiceTask": doDescribeCloudStorageAIServiceTask,
7270
7428
  "DescribeTopicRule": doDescribeTopicRule,
7271
7429
  "PublishBroadcastMessage": doPublishBroadcastMessage,
7272
7430
  "UnbindProducts": doUnbindProducts,
@@ -7289,7 +7447,7 @@ ACTION_MAP = {
7289
7447
  "RemoveUserByRoomIdFromTRTC": doRemoveUserByRoomIdFromTRTC,
7290
7448
  "SearchPositionSpace": doSearchPositionSpace,
7291
7449
  "AssignTWeCallLicense": doAssignTWeCallLicense,
7292
- "ModifyPositionSpace": doModifyPositionSpace,
7450
+ "ModifyTopicPolicy": doModifyTopicPolicy,
7293
7451
  "DescribeSpaceFenceEventList": doDescribeSpaceFenceEventList,
7294
7452
  "UpdateFirmware": doUpdateFirmware,
7295
7453
  "GetTWeCallActiveStatus": doGetTWeCallActiveStatus,
@@ -7309,6 +7467,7 @@ ACTION_MAP = {
7309
7467
  "UpdateDeviceTWeCallAuthorizeStatus": doUpdateDeviceTWeCallAuthorizeStatus,
7310
7468
  "DeleteCloudStorageEvent": doDeleteCloudStorageEvent,
7311
7469
  "DeleteDevices": doDeleteDevices,
7470
+ "CheckFirmwareUpdate": doCheckFirmwareUpdate,
7312
7471
  "GetGatewaySubDeviceList": doGetGatewaySubDeviceList,
7313
7472
  "GenerateCloudStorageAIServiceTaskFileURL": doGenerateCloudStorageAIServiceTaskFileURL,
7314
7473
  "DescribeCloudStorageOrder": doDescribeCloudStorageOrder,
@@ -7325,7 +7484,7 @@ ACTION_MAP = {
7325
7484
  "DeleteTopicPolicy": doDeleteTopicPolicy,
7326
7485
  "GetDeviceList": doGetDeviceList,
7327
7486
  "ListTopicPolicy": doListTopicPolicy,
7328
- "DescribeCloudStorageAIServiceTask": doDescribeCloudStorageAIServiceTask,
7487
+ "GenSingleDeviceSignatureOfPublic": doGenSingleDeviceSignatureOfPublic,
7329
7488
  "DescribeInstance": doDescribeInstance,
7330
7489
  "ModifyLoRaFrequency": doModifyLoRaFrequency,
7331
7490
  "GetAuthMiniProgramAppList": doGetAuthMiniProgramAppList,
@@ -56,6 +56,13 @@
56
56
  "output": "CancelAssignTWeCallLicenseResponse",
57
57
  "status": "online"
58
58
  },
59
+ "CheckFirmwareUpdate": {
60
+ "document": "本接口(CheckFirmwareUpdate)用于查询设备可升级固件版本",
61
+ "input": "CheckFirmwareUpdateRequest",
62
+ "name": "查询设备可升级固件版本",
63
+ "output": "CheckFirmwareUpdateResponse",
64
+ "status": "online"
65
+ },
59
66
  "ControlDeviceData": {
60
67
  "document": "根据设备产品ID、设备名称,设置控制设备的属性数据。",
61
68
  "input": "ControlDeviceDataRequest",
@@ -455,6 +462,13 @@
455
462
  "output": "DescribeFirmwareTaskResponse",
456
463
  "status": "online"
457
464
  },
465
+ "DescribeFirmwareUpdateStatus": {
466
+ "document": "本接口(DescribeFirmwareUpdateStatus)用于查询设备固件升级状态及进度。",
467
+ "input": "DescribeFirmwareUpdateStatusRequest",
468
+ "name": "查询设备固件升级状态",
469
+ "output": "DescribeFirmwareUpdateStatusResponse",
470
+ "status": "online"
471
+ },
458
472
  "DescribeGatewayBindDevices": {
459
473
  "document": "获取网关绑定的子设备列表",
460
474
  "input": "DescribeGatewayBindDevicesRequest",
@@ -854,6 +868,13 @@
854
868
  "output": "PublishBroadcastMessageResponse",
855
869
  "status": "online"
856
870
  },
871
+ "PublishFirmwareUpdateMessage": {
872
+ "document": "本接口(PublishFirmwareUpdateMessage)用于用户确认升级后,云端向设备发起固件升级请求。",
873
+ "input": "PublishFirmwareUpdateMessageRequest",
874
+ "name": "确认固件升级任务",
875
+ "output": "PublishFirmwareUpdateMessageResponse",
876
+ "status": "online"
877
+ },
857
878
  "PublishMessage": {
858
879
  "document": "本接口(PublishMessage)用于使用自定义透传协议进行设备远控",
859
880
  "input": "PublishMessageRequest",
@@ -1740,6 +1761,62 @@
1740
1761
  ],
1741
1762
  "type": "object"
1742
1763
  },
1764
+ "CheckFirmwareUpdateRequest": {
1765
+ "document": "CheckFirmwareUpdate请求参数结构体",
1766
+ "members": [
1767
+ {
1768
+ "disabled": false,
1769
+ "document": "产品ID。",
1770
+ "example": "R7NHIV278R",
1771
+ "member": "string",
1772
+ "name": "ProductId",
1773
+ "required": true,
1774
+ "type": "string"
1775
+ },
1776
+ {
1777
+ "disabled": false,
1778
+ "document": "设备名称。",
1779
+ "example": "dev1",
1780
+ "member": "string",
1781
+ "name": "DeviceName",
1782
+ "required": true,
1783
+ "type": "string"
1784
+ }
1785
+ ],
1786
+ "type": "object"
1787
+ },
1788
+ "CheckFirmwareUpdateResponse": {
1789
+ "document": "CheckFirmwareUpdate返回参数结构体",
1790
+ "members": [
1791
+ {
1792
+ "disabled": false,
1793
+ "document": "设备当前固件版本。\n注意:此字段可能返回 null,表示取不到有效值。",
1794
+ "example": "1.1",
1795
+ "member": "string",
1796
+ "name": "CurrentVersion",
1797
+ "output_required": false,
1798
+ "type": "string",
1799
+ "value_allowed_null": true
1800
+ },
1801
+ {
1802
+ "disabled": false,
1803
+ "document": "固件可升级版本。\n注意:此字段可能返回 null,表示取不到有效值。",
1804
+ "example": "1.1",
1805
+ "member": "string",
1806
+ "name": "DstVersion",
1807
+ "output_required": false,
1808
+ "type": "string",
1809
+ "value_allowed_null": true
1810
+ },
1811
+ {
1812
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
1813
+ "member": "string",
1814
+ "name": "RequestId",
1815
+ "type": "string"
1816
+ }
1817
+ ],
1818
+ "type": "object"
1819
+ },
1743
1820
  "CloudStorageAIServiceTask": {
1744
1821
  "document": "云存 AI 服务任务信息",
1745
1822
  "members": [
@@ -5960,6 +6037,82 @@
5960
6037
  ],
5961
6038
  "type": "object"
5962
6039
  },
6040
+ "DescribeFirmwareUpdateStatusRequest": {
6041
+ "document": "DescribeFirmwareUpdateStatus请求参数结构体",
6042
+ "members": [
6043
+ {
6044
+ "disabled": false,
6045
+ "document": "产品 ID。",
6046
+ "example": "无",
6047
+ "member": "string",
6048
+ "name": "ProductId",
6049
+ "required": true,
6050
+ "type": "string"
6051
+ },
6052
+ {
6053
+ "disabled": false,
6054
+ "document": "设备名。",
6055
+ "example": "无",
6056
+ "member": "string",
6057
+ "name": "DeviceName",
6058
+ "required": true,
6059
+ "type": "string"
6060
+ }
6061
+ ],
6062
+ "type": "object"
6063
+ },
6064
+ "DescribeFirmwareUpdateStatusResponse": {
6065
+ "document": "DescribeFirmwareUpdateStatus返回参数结构体",
6066
+ "members": [
6067
+ {
6068
+ "disabled": false,
6069
+ "document": "升级任务源版本。\n注意:此字段可能返回 null,表示取不到有效值。",
6070
+ "example": "无",
6071
+ "member": "string",
6072
+ "name": "OriVersion",
6073
+ "output_required": false,
6074
+ "type": "string",
6075
+ "value_allowed_null": true
6076
+ },
6077
+ {
6078
+ "disabled": false,
6079
+ "document": "升级任务目标版本。\n注意:此字段可能返回 null,表示取不到有效值。",
6080
+ "example": "无",
6081
+ "member": "string",
6082
+ "name": "DstVersion",
6083
+ "output_required": false,
6084
+ "type": "string",
6085
+ "value_allowed_null": true
6086
+ },
6087
+ {
6088
+ "disabled": false,
6089
+ "document": "升级状态:\n\n- 0:设备离线。\n- 1:待处理。\n- 2:消息下发成功。\n- 3:下载中。\n- 4:烧录中。\n- 5:失败。\n- 6:升级完成。\n- 7:正在处理中。\n- 8:等待用户确认。\n- 20:下载完成。\n",
6090
+ "example": "无",
6091
+ "member": "int64",
6092
+ "name": "Status",
6093
+ "output_required": false,
6094
+ "type": "int",
6095
+ "value_allowed_null": false
6096
+ },
6097
+ {
6098
+ "disabled": false,
6099
+ "document": "进度\n注意:此字段可能返回 null,表示取不到有效值。",
6100
+ "example": "无",
6101
+ "member": "int64",
6102
+ "name": "Percent",
6103
+ "output_required": false,
6104
+ "type": "int",
6105
+ "value_allowed_null": true
6106
+ },
6107
+ {
6108
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
6109
+ "member": "string",
6110
+ "name": "RequestId",
6111
+ "type": "string"
6112
+ }
6113
+ ],
6114
+ "type": "object"
6115
+ },
5963
6116
  "DescribeGatewayBindDevicesRequest": {
5964
6117
  "document": "DescribeGatewayBindDevices请求参数结构体",
5965
6118
  "members": [
@@ -11826,6 +11979,52 @@
11826
11979
  ],
11827
11980
  "type": "object"
11828
11981
  },
11982
+ "PublishFirmwareUpdateMessageRequest": {
11983
+ "document": "PublishFirmwareUpdateMessage请求参数结构体",
11984
+ "members": [
11985
+ {
11986
+ "disabled": false,
11987
+ "document": "产品 ID。",
11988
+ "example": "无",
11989
+ "member": "string",
11990
+ "name": "ProductID",
11991
+ "required": true,
11992
+ "type": "string"
11993
+ },
11994
+ {
11995
+ "disabled": false,
11996
+ "document": "设备名称。",
11997
+ "example": "无",
11998
+ "member": "string",
11999
+ "name": "DeviceName",
12000
+ "required": false,
12001
+ "type": "string"
12002
+ }
12003
+ ],
12004
+ "type": "object"
12005
+ },
12006
+ "PublishFirmwareUpdateMessageResponse": {
12007
+ "document": "PublishFirmwareUpdateMessage返回参数结构体",
12008
+ "members": [
12009
+ {
12010
+ "disabled": false,
12011
+ "document": "请求状态\n注意:此字段可能返回 null,表示取不到有效值。",
12012
+ "example": "无",
12013
+ "member": "string",
12014
+ "name": "Status",
12015
+ "output_required": false,
12016
+ "type": "string",
12017
+ "value_allowed_null": true
12018
+ },
12019
+ {
12020
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
12021
+ "member": "string",
12022
+ "name": "RequestId",
12023
+ "type": "string"
12024
+ }
12025
+ ],
12026
+ "type": "object"
12027
+ },
11829
12028
  "PublishMessageRequest": {
11830
12029
  "document": "PublishMessage请求参数结构体",
11831
12030
  "members": [