tccli 3.0.1126.1__py2.py3-none-any.whl → 3.0.1128.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/asr/v20190614/api.json +7 -7
  3. tccli/services/asr/v20190614/examples.json +1 -1
  4. tccli/services/billing/v20180709/api.json +2 -2
  5. tccli/services/cam/cam_client.py +110 -57
  6. tccli/services/cam/v20190116/api.json +128 -0
  7. tccli/services/cam/v20190116/examples.json +8 -0
  8. tccli/services/cat/v20180409/api.json +10 -0
  9. tccli/services/ccc/v20200210/api.json +1 -1
  10. tccli/services/cds/v20180420/api.json +2 -2
  11. tccli/services/cls/v20201016/api.json +28 -0
  12. tccli/services/domain/v20180808/api.json +16 -16
  13. tccli/services/domain/v20180808/examples.json +9 -9
  14. tccli/services/dsgc/v20190723/api.json +10 -1
  15. tccli/services/dts/v20180330/api.json +2 -2
  16. tccli/services/emr/emr_client.py +53 -0
  17. tccli/services/emr/v20190103/api.json +354 -0
  18. tccli/services/emr/v20190103/examples.json +8 -0
  19. tccli/services/ess/v20201111/api.json +4 -4
  20. tccli/services/ess/v20201111/examples.json +0 -6
  21. tccli/services/essbasic/v20210526/api.json +6 -6
  22. tccli/services/hunyuan/hunyuan_client.py +12 -118
  23. tccli/services/hunyuan/v20230901/api.json +0 -260
  24. tccli/services/hunyuan/v20230901/examples.json +0 -58
  25. tccli/services/iotexplorer/v20190423/api.json +30 -13
  26. tccli/services/iotexplorer/v20190423/examples.json +3 -3
  27. tccli/services/mongodb/mongodb_client.py +212 -0
  28. tccli/services/mongodb/v20190725/api.json +322 -0
  29. tccli/services/mongodb/v20190725/examples.json +32 -0
  30. tccli/services/monitor/v20180724/api.json +6 -5
  31. tccli/services/monitor/v20180724/examples.json +1 -1
  32. tccli/services/tmt/v20180321/api.json +5 -4
  33. tccli/services/trtc/v20190722/api.json +1 -1
  34. tccli/services/tse/v20201207/api.json +2 -2
  35. tccli/services/tse/v20201207/examples.json +2 -2
  36. tccli/services/waf/v20180125/api.json +94 -0
  37. tccli/services/waf/v20180125/examples.json +16 -0
  38. tccli/services/waf/waf_client.py +106 -0
  39. {tccli-3.0.1126.1.dist-info → tccli-3.0.1128.1.dist-info}/METADATA +2 -2
  40. {tccli-3.0.1126.1.dist-info → tccli-3.0.1128.1.dist-info}/RECORD +43 -43
  41. {tccli-3.0.1126.1.dist-info → tccli-3.0.1128.1.dist-info}/WHEEL +0 -0
  42. {tccli-3.0.1126.1.dist-info → tccli-3.0.1128.1.dist-info}/entry_points.txt +0 -0
  43. {tccli-3.0.1126.1.dist-info → tccli-3.0.1128.1.dist-info}/license_files/LICENSE +0 -0
@@ -638,7 +638,7 @@
638
638
  "status": "online"
639
639
  },
640
640
  "GetDeviceSumStatistics": {
641
- "document": "拉取设备统计汇总数据 ",
641
+ "document": "拉取设备统计汇总数据",
642
642
  "input": "GetDeviceSumStatisticsRequest",
643
643
  "name": "拉取设备统计汇总数据",
644
644
  "output": "GetDeviceSumStatisticsResponse",
@@ -8288,7 +8288,7 @@
8288
8288
  {
8289
8289
  "disabled": false,
8290
8290
  "document": "项目id",
8291
- "example": "",
8291
+ "example": "pro-d1",
8292
8292
  "member": "string",
8293
8293
  "name": "ProjectId",
8294
8294
  "required": true,
@@ -8297,7 +8297,7 @@
8297
8297
  {
8298
8298
  "disabled": false,
8299
8299
  "document": "产品id列表,长度为0则拉取项目内全部产品",
8300
- "example": "",
8300
+ "example": "",
8301
8301
  "member": "string",
8302
8302
  "name": "ProductIds",
8303
8303
  "required": false,
@@ -8312,72 +8312,80 @@
8312
8312
  {
8313
8313
  "disabled": false,
8314
8314
  "document": "激活设备总数",
8315
- "example": "",
8315
+ "example": "100",
8316
8316
  "member": "int64",
8317
8317
  "name": "ActivationCount",
8318
+ "output_required": true,
8318
8319
  "type": "int",
8319
8320
  "value_allowed_null": false
8320
8321
  },
8321
8322
  {
8322
8323
  "disabled": false,
8323
8324
  "document": "在线设备总数",
8324
- "example": "",
8325
+ "example": "100",
8325
8326
  "member": "int64",
8326
8327
  "name": "OnlineCount",
8328
+ "output_required": true,
8327
8329
  "type": "int",
8328
8330
  "value_allowed_null": false
8329
8331
  },
8330
8332
  {
8331
8333
  "disabled": false,
8332
8334
  "document": "前一天激活设备数",
8333
- "example": "",
8335
+ "example": "100",
8334
8336
  "member": "int64",
8335
8337
  "name": "ActivationBeforeDay",
8338
+ "output_required": true,
8336
8339
  "type": "int",
8337
8340
  "value_allowed_null": false
8338
8341
  },
8339
8342
  {
8340
8343
  "disabled": false,
8341
8344
  "document": "前一天活跃设备数",
8342
- "example": "",
8345
+ "example": "100",
8343
8346
  "member": "int64",
8344
8347
  "name": "ActiveBeforeDay",
8348
+ "output_required": true,
8345
8349
  "type": "int",
8346
8350
  "value_allowed_null": false
8347
8351
  },
8348
8352
  {
8349
8353
  "disabled": false,
8350
8354
  "document": "前一周激活设备数",
8351
- "example": "",
8355
+ "example": "1",
8352
8356
  "member": "int64",
8353
8357
  "name": "ActivationWeekDayCount",
8358
+ "output_required": true,
8354
8359
  "type": "int",
8355
8360
  "value_allowed_null": false
8356
8361
  },
8357
8362
  {
8358
8363
  "disabled": false,
8359
8364
  "document": "前一周活跃设备数",
8360
- "example": "",
8365
+ "example": "1",
8361
8366
  "member": "int64",
8362
8367
  "name": "ActiveWeekDayCount",
8368
+ "output_required": true,
8363
8369
  "type": "int",
8364
8370
  "value_allowed_null": false
8365
8371
  },
8366
8372
  {
8367
8373
  "disabled": false,
8368
8374
  "document": "上一周激活设备数",
8369
- "example": "",
8375
+ "example": "1",
8370
8376
  "member": "int64",
8371
8377
  "name": "ActivationBeforeWeekDayCount",
8378
+ "output_required": true,
8372
8379
  "type": "int",
8373
8380
  "value_allowed_null": false
8374
8381
  },
8375
8382
  {
8376
8383
  "disabled": false,
8377
8384
  "document": "上一周活跃设备数",
8378
- "example": "",
8385
+ "example": "1",
8379
8386
  "member": "int64",
8380
8387
  "name": "ActiveBeforeWeekDayCount",
8388
+ "output_required": true,
8381
8389
  "type": "int",
8382
8390
  "value_allowed_null": false
8383
8391
  },
@@ -8616,7 +8624,7 @@
8616
8624
  "example": "无",
8617
8625
  "member": "PositionSpaceInfo",
8618
8626
  "name": "List",
8619
- "required": true,
8627
+ "output_required": true,
8620
8628
  "type": "list",
8621
8629
  "value_allowed_null": true
8622
8630
  },
@@ -8626,7 +8634,7 @@
8626
8634
  "example": "1",
8627
8635
  "member": "int64",
8628
8636
  "name": "Total",
8629
- "required": true,
8637
+ "output_required": true,
8630
8638
  "type": "int",
8631
8639
  "value_allowed_null": true
8632
8640
  },
@@ -9035,6 +9043,15 @@
9035
9043
  "name": "ModelId",
9036
9044
  "required": false,
9037
9045
  "type": "string"
9046
+ },
9047
+ {
9048
+ "disabled": false,
9049
+ "document": "小程序APPID",
9050
+ "example": "无",
9051
+ "member": "string",
9052
+ "name": "MiniProgramAppId",
9053
+ "required": false,
9054
+ "type": "string"
9038
9055
  }
9039
9056
  ],
9040
9057
  "type": "object"
@@ -773,8 +773,8 @@
773
773
  "GetDeviceSumStatistics": [
774
774
  {
775
775
  "document": "",
776
- "input": "https://iotexplorer.tencentcloudapi.com/?Action=GetDeviceSumStatistics\r\n&ProjectId=prj-zunfat46\r\n&ProductIds=[4GDIU5HTEN]\r\n&<公共请求参数>",
777
- "output": "{\n \"Response\": {\n \"ActivationBeforeWeekDayCount\": 100,\n \"ActiveBeforeWeekDayCount\": 60,\n \"RequestId\": \"6b6e765c-1625-49e6-9743-452e6ce15caa\"\n }\n}",
776
+ "input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetDeviceSumStatistics\n<公共请求参数>\n\n{\n \"ProjectId\": \"abc\",\n \"ProductIds\": [\n \"abc\"\n ]\n}",
777
+ "output": "{\n \"Response\": {\n \"ActivationCount\": 1,\n \"OnlineCount\": 1,\n \"ActiveBeforeDay\": 20,\n \"ActivationBeforeDay\": 10,\n \"ActivationWeekDayCount\": 80,\n \"ActiveWeekDayCount\": 40,\n \"ActivationBeforeWeekDayCount\": 100,\n \"ActiveBeforeWeekDayCount\": 60,\n \"RequestId\": \"6b6e765c-1625-49e6-9743-452e6ce15caa\"\n }\n}",
778
778
  "title": "拉取设备统计汇总数据示例"
779
779
  }
780
780
  ],
@@ -812,7 +812,7 @@
812
812
  {
813
813
  "document": "",
814
814
  "input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetPositionSpaceList\n<公共请求参数>\n\n{\n \"ProjectId\": \"prj-projectid\",\n \"Offset\": 0,\n \"Limit\": 20\n}",
815
- "output": "{\n \"Response\": {\n \"Total\": 1,\n \"List\": [\n {\n \"UpdateTime\": 1598863974,\n \"Description\": \"desc\",\n \"ProjectId\": \"prj\",\n \"AuthorizeType\": 0,\n \"SpaceId\": \"id\",\n \"ProductIdList\": [\n \"ProductId\"\n ],\n \"CreateTime\": 1598863974,\n \"SpaceName\": \"name\",\n \"Icon\": \"icon\",\n \"Zoom\": 0\n }\n ],\n \"RequestId\": \"xx\"\n }\n}",
815
+ "output": "{\n \"Response\": {\n \"Total\": 1,\n \"List\": [\n {\n \"UpdateTime\": 1598863974,\n \"Description\": \"desc\",\n \"ProjectId\": \"prj\",\n \"AuthorizeType\": 0,\n \"SpaceId\": \"id\",\n \"ProductIdList\": [\n \"ProductId\"\n ],\n \"CreateTime\": 1598863974,\n \"SpaceName\": \"name\",\n \"Icon\": \"icon\",\n \"Zoom\": 0\n }\n ],\n \"RequestId\": \"1qaz-efg4-65777777\"\n }\n}",
816
816
  "title": "获取位置空间列表"
817
817
  }
818
818
  ],
@@ -695,6 +695,58 @@ def doIsolateDBInstance(args, parsed_globals):
695
695
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
696
696
 
697
697
 
698
+ def doSetBackupRules(args, parsed_globals):
699
+ g_param = parse_global_arg(parsed_globals)
700
+
701
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
702
+ cred = credential.CVMRoleCredential()
703
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
704
+ cred = credential.STSAssumeRoleCredential(
705
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
706
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
707
+ )
708
+ 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):
709
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
710
+ else:
711
+ cred = credential.Credential(
712
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
713
+ )
714
+ http_profile = HttpProfile(
715
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
716
+ reqMethod="POST",
717
+ endpoint=g_param[OptionsDefine.Endpoint],
718
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
719
+ )
720
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
721
+ if g_param[OptionsDefine.Language]:
722
+ profile.language = g_param[OptionsDefine.Language]
723
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
724
+ client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
725
+ client._sdkVersion += ("_CLI_" + __version__)
726
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
727
+ model = models.SetBackupRulesRequest()
728
+ model.from_json_string(json.dumps(args))
729
+ start_time = time.time()
730
+ while True:
731
+ rsp = client.SetBackupRules(model)
732
+ result = rsp.to_json_string()
733
+ try:
734
+ json_obj = json.loads(result)
735
+ except TypeError as e:
736
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
737
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
738
+ break
739
+ cur_time = time.time()
740
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
741
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
742
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
743
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
744
+ else:
745
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
746
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
747
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
748
+
749
+
698
750
  def doInquirePriceModifyDBInstanceSpec(args, parsed_globals):
699
751
  g_param = parse_global_arg(parsed_globals)
700
752
 
@@ -747,6 +799,58 @@ def doInquirePriceModifyDBInstanceSpec(args, parsed_globals):
747
799
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
748
800
 
749
801
 
802
+ def doDescribeBackupRules(args, parsed_globals):
803
+ g_param = parse_global_arg(parsed_globals)
804
+
805
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
806
+ cred = credential.CVMRoleCredential()
807
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
808
+ cred = credential.STSAssumeRoleCredential(
809
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
810
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
811
+ )
812
+ 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):
813
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
814
+ else:
815
+ cred = credential.Credential(
816
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
817
+ )
818
+ http_profile = HttpProfile(
819
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
820
+ reqMethod="POST",
821
+ endpoint=g_param[OptionsDefine.Endpoint],
822
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
823
+ )
824
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
825
+ if g_param[OptionsDefine.Language]:
826
+ profile.language = g_param[OptionsDefine.Language]
827
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
828
+ client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
829
+ client._sdkVersion += ("_CLI_" + __version__)
830
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
831
+ model = models.DescribeBackupRulesRequest()
832
+ model.from_json_string(json.dumps(args))
833
+ start_time = time.time()
834
+ while True:
835
+ rsp = client.DescribeBackupRules(model)
836
+ result = rsp.to_json_string()
837
+ try:
838
+ json_obj = json.loads(result)
839
+ except TypeError as e:
840
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
841
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
842
+ break
843
+ cur_time = time.time()
844
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
845
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
846
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
847
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
848
+ else:
849
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
850
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
851
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
852
+
853
+
750
854
  def doDescribeAsyncRequestInfo(args, parsed_globals):
751
855
  g_param = parse_global_arg(parsed_globals)
752
856
 
@@ -1787,6 +1891,58 @@ def doAssignProject(args, parsed_globals):
1787
1891
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1788
1892
 
1789
1893
 
1894
+ def doDescribeTransparentDataEncryptionStatus(args, parsed_globals):
1895
+ g_param = parse_global_arg(parsed_globals)
1896
+
1897
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1898
+ cred = credential.CVMRoleCredential()
1899
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1900
+ cred = credential.STSAssumeRoleCredential(
1901
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1902
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1903
+ )
1904
+ 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):
1905
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1906
+ else:
1907
+ cred = credential.Credential(
1908
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1909
+ )
1910
+ http_profile = HttpProfile(
1911
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1912
+ reqMethod="POST",
1913
+ endpoint=g_param[OptionsDefine.Endpoint],
1914
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1915
+ )
1916
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1917
+ if g_param[OptionsDefine.Language]:
1918
+ profile.language = g_param[OptionsDefine.Language]
1919
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1920
+ client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
1921
+ client._sdkVersion += ("_CLI_" + __version__)
1922
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1923
+ model = models.DescribeTransparentDataEncryptionStatusRequest()
1924
+ model.from_json_string(json.dumps(args))
1925
+ start_time = time.time()
1926
+ while True:
1927
+ rsp = client.DescribeTransparentDataEncryptionStatus(model)
1928
+ result = rsp.to_json_string()
1929
+ try:
1930
+ json_obj = json.loads(result)
1931
+ except TypeError as e:
1932
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1933
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1934
+ break
1935
+ cur_time = time.time()
1936
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1937
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1938
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1939
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1940
+ else:
1941
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1942
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1943
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1944
+
1945
+
1790
1946
  def doDescribeAccountUsers(args, parsed_globals):
1791
1947
  g_param = parse_global_arg(parsed_globals)
1792
1948
 
@@ -2099,6 +2255,58 @@ def doKillOps(args, parsed_globals):
2099
2255
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2100
2256
 
2101
2257
 
2258
+ def doEnableTransparentDataEncryption(args, parsed_globals):
2259
+ g_param = parse_global_arg(parsed_globals)
2260
+
2261
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2262
+ cred = credential.CVMRoleCredential()
2263
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2264
+ cred = credential.STSAssumeRoleCredential(
2265
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2266
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2267
+ )
2268
+ 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):
2269
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2270
+ else:
2271
+ cred = credential.Credential(
2272
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2273
+ )
2274
+ http_profile = HttpProfile(
2275
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2276
+ reqMethod="POST",
2277
+ endpoint=g_param[OptionsDefine.Endpoint],
2278
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2279
+ )
2280
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2281
+ if g_param[OptionsDefine.Language]:
2282
+ profile.language = g_param[OptionsDefine.Language]
2283
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2284
+ client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
2285
+ client._sdkVersion += ("_CLI_" + __version__)
2286
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2287
+ model = models.EnableTransparentDataEncryptionRequest()
2288
+ model.from_json_string(json.dumps(args))
2289
+ start_time = time.time()
2290
+ while True:
2291
+ rsp = client.EnableTransparentDataEncryption(model)
2292
+ result = rsp.to_json_string()
2293
+ try:
2294
+ json_obj = json.loads(result)
2295
+ except TypeError as e:
2296
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2297
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2298
+ break
2299
+ cur_time = time.time()
2300
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2301
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2302
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2303
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2304
+ else:
2305
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2306
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2307
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2308
+
2309
+
2102
2310
  def doCreateBackupDBInstance(args, parsed_globals):
2103
2311
  g_param = parse_global_arg(parsed_globals)
2104
2312
 
@@ -2333,7 +2541,9 @@ ACTION_MAP = {
2333
2541
  "SetAutoRenew": doSetAutoRenew,
2334
2542
  "DescribeDBBackups": doDescribeDBBackups,
2335
2543
  "IsolateDBInstance": doIsolateDBInstance,
2544
+ "SetBackupRules": doSetBackupRules,
2336
2545
  "InquirePriceModifyDBInstanceSpec": doInquirePriceModifyDBInstanceSpec,
2546
+ "DescribeBackupRules": doDescribeBackupRules,
2337
2547
  "DescribeAsyncRequestInfo": doDescribeAsyncRequestInfo,
2338
2548
  "CreateAccountUser": doCreateAccountUser,
2339
2549
  "CreateDBInstanceHour": doCreateDBInstanceHour,
@@ -2354,12 +2564,14 @@ ACTION_MAP = {
2354
2564
  "DescribeBackupDownloadTask": doDescribeBackupDownloadTask,
2355
2565
  "InquirePriceCreateDBInstances": doInquirePriceCreateDBInstances,
2356
2566
  "AssignProject": doAssignProject,
2567
+ "DescribeTransparentDataEncryptionStatus": doDescribeTransparentDataEncryptionStatus,
2357
2568
  "DescribeAccountUsers": doDescribeAccountUsers,
2358
2569
  "DescribeSlowLog": doDescribeSlowLog,
2359
2570
  "SetInstanceMaintenance": doSetInstanceMaintenance,
2360
2571
  "RenameInstance": doRenameInstance,
2361
2572
  "UpgradeDBInstance": doUpgradeDBInstance,
2362
2573
  "KillOps": doKillOps,
2574
+ "EnableTransparentDataEncryption": doEnableTransparentDataEncryption,
2363
2575
  "CreateBackupDBInstance": doCreateBackupDBInstance,
2364
2576
  "InquirePriceRenewDBInstances": doInquirePriceRenewDBInstances,
2365
2577
  "DeleteAccountUser": doDeleteAccountUser,