tccli 3.0.1174.1__py2.py3-none-any.whl → 3.0.1175.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
tccli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1174.1'
1
+ __version__ = '3.0.1175.1'
@@ -537,6 +537,58 @@ def doDescribeDatabaseAuditDownload(args, parsed_globals):
537
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
538
 
539
539
 
540
+ def doDescribeUserBindWorkloadGroup(args, parsed_globals):
541
+ g_param = parse_global_arg(parsed_globals)
542
+
543
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
544
+ cred = credential.CVMRoleCredential()
545
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
546
+ cred = credential.STSAssumeRoleCredential(
547
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
548
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
549
+ )
550
+ 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):
551
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
552
+ else:
553
+ cred = credential.Credential(
554
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
555
+ )
556
+ http_profile = HttpProfile(
557
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
558
+ reqMethod="POST",
559
+ endpoint=g_param[OptionsDefine.Endpoint],
560
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
561
+ )
562
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
563
+ if g_param[OptionsDefine.Language]:
564
+ profile.language = g_param[OptionsDefine.Language]
565
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
566
+ client = mod.CdwdorisClient(cred, g_param[OptionsDefine.Region], profile)
567
+ client._sdkVersion += ("_CLI_" + __version__)
568
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
+ model = models.DescribeUserBindWorkloadGroupRequest()
570
+ model.from_json_string(json.dumps(args))
571
+ start_time = time.time()
572
+ while True:
573
+ rsp = client.DescribeUserBindWorkloadGroup(model)
574
+ result = rsp.to_json_string()
575
+ try:
576
+ json_obj = json.loads(result)
577
+ except TypeError as e:
578
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
579
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
580
+ break
581
+ cur_time = time.time()
582
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
583
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
584
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
585
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
586
+ else:
587
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
588
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
589
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
590
+
591
+
540
592
  def doDescribeInstanceNodesInfo(args, parsed_globals):
541
593
  g_param = parse_global_arg(parsed_globals)
542
594
 
@@ -641,7 +693,7 @@ def doDescribeClusterConfigs(args, parsed_globals):
641
693
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
642
694
 
643
695
 
644
- def doDescribeUserBindWorkloadGroup(args, parsed_globals):
696
+ def doDescribeTableList(args, parsed_globals):
645
697
  g_param = parse_global_arg(parsed_globals)
646
698
 
647
699
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -670,11 +722,11 @@ def doDescribeUserBindWorkloadGroup(args, parsed_globals):
670
722
  client = mod.CdwdorisClient(cred, g_param[OptionsDefine.Region], profile)
671
723
  client._sdkVersion += ("_CLI_" + __version__)
672
724
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
673
- model = models.DescribeUserBindWorkloadGroupRequest()
725
+ model = models.DescribeTableListRequest()
674
726
  model.from_json_string(json.dumps(args))
675
727
  start_time = time.time()
676
728
  while True:
677
- rsp = client.DescribeUserBindWorkloadGroup(model)
729
+ rsp = client.DescribeTableList(model)
678
730
  result = rsp.to_json_string()
679
731
  try:
680
732
  json_obj = json.loads(result)
@@ -3054,9 +3106,10 @@ ACTION_MAP = {
3054
3106
  "DescribeRestoreTaskDetail": doDescribeRestoreTaskDetail,
3055
3107
  "CreateWorkloadGroup": doCreateWorkloadGroup,
3056
3108
  "DescribeDatabaseAuditDownload": doDescribeDatabaseAuditDownload,
3109
+ "DescribeUserBindWorkloadGroup": doDescribeUserBindWorkloadGroup,
3057
3110
  "DescribeInstanceNodesInfo": doDescribeInstanceNodesInfo,
3058
3111
  "DescribeClusterConfigs": doDescribeClusterConfigs,
3059
- "DescribeUserBindWorkloadGroup": doDescribeUserBindWorkloadGroup,
3112
+ "DescribeTableList": doDescribeTableList,
3060
3113
  "DescribeBackUpTables": doDescribeBackUpTables,
3061
3114
  "DescribeRegionZone": doDescribeRegionZone,
3062
3115
  "ModifyNodeStatus": doModifyNodeStatus,
@@ -266,6 +266,13 @@
266
266
  "output": "DescribeSqlApisResponse",
267
267
  "status": "online"
268
268
  },
269
+ "DescribeTableList": {
270
+ "document": "获取指定数据源和库下的表列表",
271
+ "input": "DescribeTableListRequest",
272
+ "name": "获取表列表",
273
+ "output": "DescribeTableListResponse",
274
+ "status": "online"
275
+ },
269
276
  "DescribeUserBindWorkloadGroup": {
270
277
  "document": "获取当前集群各用户绑定的资源信息",
271
278
  "input": "DescribeUserBindWorkloadGroupRequest",
@@ -4548,6 +4555,89 @@
4548
4555
  ],
4549
4556
  "type": "object"
4550
4557
  },
4558
+ "DescribeTableListRequest": {
4559
+ "document": "DescribeTableList请求参数结构体",
4560
+ "members": [
4561
+ {
4562
+ "disabled": false,
4563
+ "document": "资源ID,建表所用的TCHouse-D资源ID。",
4564
+ "example": "cdwdoris-bjizjxxx",
4565
+ "member": "string",
4566
+ "name": "InstanceId",
4567
+ "required": true,
4568
+ "type": "string"
4569
+ },
4570
+ {
4571
+ "disabled": false,
4572
+ "document": "需要获取表列表的库",
4573
+ "example": "demo",
4574
+ "member": "string",
4575
+ "name": "DbName",
4576
+ "required": true,
4577
+ "type": "string"
4578
+ },
4579
+ {
4580
+ "disabled": false,
4581
+ "document": "使用该用户进行操作,该用户需要有对应的权限。如果该TCHouse-D集群使用CAM用户注册内核账户,则不需要填写",
4582
+ "example": "user",
4583
+ "member": "string",
4584
+ "name": "UserName",
4585
+ "required": false,
4586
+ "type": "string"
4587
+ },
4588
+ {
4589
+ "disabled": false,
4590
+ "document": "用户对应的密码。如果该TCHouse-D集群使用CAM用户注册内核账户,则不需要填写",
4591
+ "example": "***",
4592
+ "member": "string",
4593
+ "name": "PassWord",
4594
+ "required": false,
4595
+ "type": "string"
4596
+ },
4597
+ {
4598
+ "disabled": false,
4599
+ "document": "查询库所在的数据源,不填则默认为内部数据源(internal)。",
4600
+ "example": "internal",
4601
+ "member": "string",
4602
+ "name": "CatalogName",
4603
+ "required": false,
4604
+ "type": "string"
4605
+ }
4606
+ ],
4607
+ "type": "object"
4608
+ },
4609
+ "DescribeTableListResponse": {
4610
+ "document": "DescribeTableList返回参数结构体",
4611
+ "members": [
4612
+ {
4613
+ "disabled": false,
4614
+ "document": "表名列表\n注意:此字段可能返回 null,表示取不到有效值。",
4615
+ "example": "[\"test1\",\"test2\"]",
4616
+ "member": "string",
4617
+ "name": "TableNames",
4618
+ "output_required": false,
4619
+ "type": "list",
4620
+ "value_allowed_null": true
4621
+ },
4622
+ {
4623
+ "disabled": false,
4624
+ "document": "错误信息\n注意:此字段可能返回 null,表示取不到有效值。",
4625
+ "example": "无",
4626
+ "member": "string",
4627
+ "name": "Message",
4628
+ "output_required": false,
4629
+ "type": "string",
4630
+ "value_allowed_null": true
4631
+ },
4632
+ {
4633
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
4634
+ "member": "string",
4635
+ "name": "RequestId",
4636
+ "type": "string"
4637
+ }
4638
+ ],
4639
+ "type": "object"
4640
+ },
4551
4641
  "DescribeUserBindWorkloadGroupRequest": {
4552
4642
  "document": "DescribeUserBindWorkloadGroup请求参数结构体",
4553
4643
  "members": [
@@ -310,6 +310,14 @@
310
310
  "title": "查询ck集群信息"
311
311
  }
312
312
  ],
313
+ "DescribeTableList": [
314
+ {
315
+ "document": "获取internal数据源和demo库下的表列表",
316
+ "input": "POST / HTTP/1.1\nHost: cdwdoris.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeTableList\n<公共请求参数>\n\n{\n \"InstanceId\": \"cdwdoris-bjizjxxx\",\n \"DbName\": \"demo\"\n}",
317
+ "output": "{\n \"Response\": {\n \"Message\": \"\",\n \"RequestId\": \"28caf1f1-9192-477c-94d4-e910b87ca0fc\",\n \"TableNames\": [\n \"test\",\n \"table\"\n ]\n }\n}",
318
+ "title": "获取表列表"
319
+ }
320
+ ],
313
321
  "DescribeUserBindWorkloadGroup": [
314
322
  {
315
323
  "document": "",
@@ -3699,6 +3699,15 @@
3699
3699
  "name": "Product",
3700
3700
  "required": false,
3701
3701
  "type": "string"
3702
+ },
3703
+ {
3704
+ "disabled": false,
3705
+ "document": "会话统计的维度信息,可以多个维度。",
3706
+ "example": "无",
3707
+ "member": "StatDimension",
3708
+ "name": "StatDimensions",
3709
+ "required": false,
3710
+ "type": "list"
3702
3711
  }
3703
3712
  ],
3704
3713
  "type": "object"
@@ -3712,10 +3721,20 @@
3712
3721
  "example": "无",
3713
3722
  "member": "MySqlProcess",
3714
3723
  "name": "ProcessList",
3715
- "required": true,
3724
+ "output_required": true,
3716
3725
  "type": "list",
3717
3726
  "value_allowed_null": false
3718
3727
  },
3728
+ {
3729
+ "disabled": false,
3730
+ "document": "sql会话统计信息。\n注意:此字段可能返回 null,表示取不到有效值。",
3731
+ "example": "无",
3732
+ "member": "StatisticInfo",
3733
+ "name": "Statistics",
3734
+ "output_required": false,
3735
+ "type": "list",
3736
+ "value_allowed_null": true
3737
+ },
3719
3738
  {
3720
3739
  "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
3721
3740
  "member": "string",
@@ -8828,6 +8847,102 @@
8828
8847
  ],
8829
8848
  "usage": "out"
8830
8849
  },
8850
+ "StatDimension": {
8851
+ "document": "会话统计的维度信息,可以多个维度",
8852
+ "members": [
8853
+ {
8854
+ "disabled": false,
8855
+ "document": "维度名称,目前仅支持:SqlTag。",
8856
+ "example": "SqlTag",
8857
+ "member": "string",
8858
+ "name": "Dimension",
8859
+ "required": true,
8860
+ "type": "string"
8861
+ },
8862
+ {
8863
+ "disabled": false,
8864
+ "document": "SQL 标签过滤与统计信息\n示例:\n\n示例 1:[p=position] 统计包含 p=position 标签的 SQL 会话。\n示例 2:[p] 统计包含 p 标签的 SQL 会话。\n示例 3:[p=position, c=idCard] 统计同时包含 p=position 标签和 c=idCard 标签的 SQL 会话。",
8865
+ "example": "p=postion1",
8866
+ "member": "string",
8867
+ "name": "Data",
8868
+ "required": false,
8869
+ "type": "list"
8870
+ }
8871
+ ],
8872
+ "usage": "in"
8873
+ },
8874
+ "StatisticDataInfo": {
8875
+ "document": "统计分析维度下的统计数据详情",
8876
+ "members": [
8877
+ {
8878
+ "disabled": false,
8879
+ "document": "统计维度的值。\n注意:此字段可能返回 null,表示取不到有效值。",
8880
+ "example": "p=dbbrain,kk=cc",
8881
+ "member": "string",
8882
+ "name": "Name",
8883
+ "output_required": false,
8884
+ "type": "string",
8885
+ "value_allowed_null": true
8886
+ },
8887
+ {
8888
+ "disabled": false,
8889
+ "document": "平均时间。\n注意:此字段可能返回 null,表示取不到有效值。",
8890
+ "example": "23.1",
8891
+ "member": "float",
8892
+ "name": "TimeAvg",
8893
+ "output_required": false,
8894
+ "type": "float",
8895
+ "value_allowed_null": true
8896
+ },
8897
+ {
8898
+ "disabled": false,
8899
+ "document": "总时间。\n注意:此字段可能返回 null,表示取不到有效值。",
8900
+ "example": "238.2",
8901
+ "member": "float",
8902
+ "name": "TimeSum",
8903
+ "output_required": false,
8904
+ "type": "float",
8905
+ "value_allowed_null": true
8906
+ },
8907
+ {
8908
+ "disabled": false,
8909
+ "document": "数量。\n注意:此字段可能返回 null,表示取不到有效值。",
8910
+ "example": "2",
8911
+ "member": "int64",
8912
+ "name": "Count",
8913
+ "output_required": false,
8914
+ "type": "int",
8915
+ "value_allowed_null": true
8916
+ }
8917
+ ],
8918
+ "usage": "out"
8919
+ },
8920
+ "StatisticInfo": {
8921
+ "document": "sql会话统计信息",
8922
+ "members": [
8923
+ {
8924
+ "disabled": false,
8925
+ "document": "统计分析的维度。\n注意:此字段可能返回 null,表示取不到有效值。",
8926
+ "example": "SqlTag",
8927
+ "member": "string",
8928
+ "name": "Dimension",
8929
+ "output_required": true,
8930
+ "type": "string",
8931
+ "value_allowed_null": true
8932
+ },
8933
+ {
8934
+ "disabled": false,
8935
+ "document": "统计分析的维度下的统计数据详情。\n注意:此字段可能返回 null,表示取不到有效值。",
8936
+ "example": "无",
8937
+ "member": "StatisticDataInfo",
8938
+ "name": "Data",
8939
+ "output_required": false,
8940
+ "type": "list",
8941
+ "value_allowed_null": true
8942
+ }
8943
+ ],
8944
+ "usage": "out"
8945
+ },
8831
8946
  "Table": {
8832
8947
  "document": "表结构。",
8833
8948
  "members": [
@@ -268,7 +268,7 @@
268
268
  {
269
269
  "document": "",
270
270
  "input": "https://dbbrain.tencentcloudapi.com/?Action=DescribeMySqlProcessList\n&Product=mysql\n&InstanceId=cdb-test\n&User=root\n&<公共请求参数>",
271
- "output": "{\n \"Response\": {\n \"RequestId\": \"24665720-8c93-11eb-bee6-e98cea0e6794\",\n \"ProcessList\": [\n {\n \"Host\": \"127.0.0.1:42036\",\n \"State\": \"\",\n \"Command\": \"Sleep\",\n \"Time\": \"1179\",\n \"ID\": \"171588317\",\n \"User\": \"root\",\n \"Info\": \"\",\n \"DB\": \"test\"\n }\n ]\n }\n}",
271
+ "output": "{\n \"Response\": {\n \"ProcessList\": [\n {\n \"Command\": \"Query\",\n \"DB\": \"\",\n \"Host\": \"100.98.212.252:29285\",\n \"ID\": \"2075425\",\n \"Info\": \"/* p = 2342 , f=abd */ select sleep(1000)\",\n \"State\": \"User sleep\",\n \"Time\": \"103\",\n \"User\": \"root\"\n }\n ],\n \"RequestId\": \"7d0d84f2-d4c0-4349-b5a3-cd70b6efbdfe\",\n \"Statistics\": [\n {\n \"Data\": [\n {\n \"Count\": 1,\n \"Name\": \"f=abd,p=2342\",\n \"TimeAvg\": 103,\n \"TimeSum\": 103\n }\n ],\n \"Dimension\": \"SqlTag\"\n }\n ]\n }\n}",
272
272
  "title": "查询实时线程列表。"
273
273
  }
274
274
  ],
@@ -744,6 +744,7 @@
744
744
  "example": "eb-xxxxxxxx",
745
745
  "member": "string",
746
746
  "name": "EventBusId",
747
+ "output_required": true,
747
748
  "type": "string",
748
749
  "value_allowed_null": false
749
750
  },
@@ -12188,6 +12188,16 @@
12188
12188
  "output_required": false,
12189
12189
  "type": "string",
12190
12190
  "value_allowed_null": false
12191
+ },
12192
+ {
12193
+ "disabled": false,
12194
+ "document": "企业批量注册的唯一 Id, 此 Id 可以用在[创建企业批量认证链接-单链接](https://qian.tencent.com/developers/companyApis/organizations/CreateBatchOrganizationAuthorizationUrl)。",
12195
+ "example": "yDCHoUU08m4mnpUxHGGHPv9FScKQsvHb",
12196
+ "member": "string",
12197
+ "name": "SubTaskId",
12198
+ "output_required": false,
12199
+ "type": "string",
12200
+ "value_allowed_null": false
12191
12201
  }
12192
12202
  ],
12193
12203
  "usage": "out"
@@ -1079,7 +1079,7 @@
1079
1079
  "example": "iVBORw0KGgoAA......",
1080
1080
  "member": "string",
1081
1081
  "name": "FaceInput",
1082
- "required": true,
1082
+ "required": false,
1083
1083
  "type": "string"
1084
1084
  },
1085
1085
  {
@@ -1088,8 +1088,26 @@
1088
1088
  "example": "true",
1089
1089
  "member": "int64",
1090
1090
  "name": "FaceInputType",
1091
- "required": true,
1091
+ "required": false,
1092
1092
  "type": "int"
1093
+ },
1094
+ {
1095
+ "disabled": false,
1096
+ "document": "是否需要对请求信息进行全包体加密; 支持的加密算法:AES-256-CBC、SM4-GCM; 有加密需求的用户可使用此参数,详情请点击左侧链接。",
1097
+ "example": "无",
1098
+ "member": "Encryption",
1099
+ "name": "Encryption",
1100
+ "required": false,
1101
+ "type": "object"
1102
+ },
1103
+ {
1104
+ "disabled": false,
1105
+ "document": "加密后的密文; 加密前的数据格式如下:{\"FaceInput\":\"AAAAA\",\"FaceInputType\":1}",
1106
+ "example": "无",
1107
+ "member": "string",
1108
+ "name": "EncryptedBody",
1109
+ "required": false,
1110
+ "type": "string"
1093
1111
  }
1094
1112
  ],
1095
1113
  "type": "object"
@@ -87,13 +87,19 @@
87
87
  "document": "疑似高风险攻击",
88
88
  "input": "POST / HTTP/1.1\nHost: faceid.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DetectAIFakeFaces\n<公共请求参数>\n\n{\n \"FaceInputType\": 1,\n \"FaceInput\": \"VBORw0KGgoAAAANSUhEUgAAAkYAAAI9CAYAAADfOLduAAABQ2lDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSCwoyGFhYGDIzSspCnJ3UoiIjFJgf87AziDBwMcgwqCQmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsgsz5I1BWZcn/xff7Y4dPvimWmY6lEAV0pqcTKQ/gPEyckFRSUMDIwJQLZyeUkBiN0CZIsUAR0FZM8AsdMh7DUgdhKEfQCsJiTIGci+AmQLJGckpgDZT4BsnSQk8XQkNtReEOD0CFBwNTI3LiTgVpJBSWpFCYh2zi+oLMpMzyhRcASGUKqCZ16yno6CkYGRMQMDKLwhqj/fAIcjoxgHQqzwKgODhTyQ8RQhlniBgWH3OgYG4Z8IMWUDBgYeoGn7/AsSixLhDmD8xlKcZmwEYXNvZ2Bgnfb//+dwBgZ2TQaGv9f///+9/f//v8sYGJhvMTAc+AYADqxgzYM88zoAAAA4ZVhJZk1NACoAAAAIAAGHaQAEAAAAAQAAABoAAAAAAAKgAgAEAAAAAQAAAkagAwAEAAAAAQAAAj0AAAAAi/M5dAAAQABJREFUeAHsvWd35EiSbYsIRlCkViW6pmq6Wry71vz/fzEf3n2fpufd\"\n}",
89
89
  "output": "{\n \"Response\": {\n \"AttackRiskDetailList\": [\n {\n \"Type\": \"SuspectedWatermark\"\n }\n ],\n \"AttackRiskLevel\": \"High\",\n \"RequestId\": \"2dd93e6f-5121-4bac-8c64-d6ad646663d2\"\n }\n}",
90
- "title": "示例"
90
+ "title": " 不加密请求示例"
91
91
  },
92
92
  {
93
93
  "document": "图片解码失败",
94
94
  "input": "POST / HTTP/1.1\nHost: faceid.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DetectAIFakeFaces\n<公共请求参数>\n\n{\n \"FaceInputType\": 2,\n \"FaceInput\": \"AAAAHGZ0eXBtcDQyAAAAAWlzb21tcDQxbXA0MgAADXNtb292AAAAbG12aGQAAAAA2qNvttqjb7cAAB9AAACYFgABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAJ/XRyYWsAAABcdGtoZAAAAAHao2+22qNvtwAAAAEAAAAAAACYFgAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAADwAAAAtAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAmBYAAAAUAAEAAAAACXVtZGlhAAAAIG1kaGQAAAAA2qNvttqjb7cAAAJYAAALaFXEAAAAAAAxaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAENvcmUgTWVkaWEgVmlkZW8AAAAJHG1pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQ\"\n}",
95
95
  "output": "{\n \"Response\": {\n \"Error\": {\n \"Code\": \"FailedOperation.ImageDecodeFailed\",\n \"Message\": \"图片解码失败。\"\n },\n \"RequestId\": \"0e77ad29-ad65-4901-9efc-b49a6e0a357b\"\n }\n}",
96
96
  "title": "异常示例"
97
+ },
98
+ {
99
+ "document": "全包体加密请求示例",
100
+ "input": "POST / HTTP/1.1\nHost: faceid.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DetectAIGCContent\n<公共请求参数>\n\n{\n \"Encryption\": {\n \"Algorithm\": \"AES-256-CBC\",\n \"EncryptList\": [\n \"EncryptionBody\"\n ],\n \"CiphertextBlob\": \"qwRTgn+52FAvnfrGL1oPBsXG4FLBd42YRw\",\n \"Iv\": \"vqfsaEOpGJESA==\"\n },\n \"EncryptedBody\": \"v32onREKL6bk6WHOGFEjE2M6kvqybGCVTjlm\"\n}",
101
+ "output": "{\n \"Response\": {\n \"AttackRiskDetailList\": [\n {\n \"Type\": \"SuspectedWatermark\"\n }\n ],\n \"AttackRiskLevel\": \"High\",\n \"RequestId\": \"2dd93e6f-5121-4bac-8c64-d6ad646663d2\"\n }\n}",
102
+ "title": "全包体加密请求示例"
97
103
  }
98
104
  ],
99
105
  "DetectAuth": [
@@ -8,7 +8,7 @@
8
8
  "status": "online"
9
9
  },
10
10
  "ChatCompletions": {
11
- "document": "腾讯混元大模型是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口支持流式或非流式调用,当使用流式调用时为 SSE 协议。\n\n 1. 本接口暂不支持返回图片内容。\n 2. 默认每种模型单账号限制并发数为 5 路,如您有提高并发限制的需求请 [联系我们](https://cloud.tencent.com/act/event/Online_service) 。\n 3. 请使用 SDK 调用本接口,每种开发语言的 SDK Git 仓库 examples/hunyuan/v20230901/ 目录下有提供示例供参考。SDK 链接在文档下方 “**开发者资源 - SDK**” 部分提供。\n 4. 我们推荐您使用 API Explorer,方便快速地在线调试接口和下载各语言的示例代码,[点击打开](https://console.cloud.tencent.com/api/explorer?Product=hunyuan&Version=2023-09-01&Action=ChatCompletions)。",
11
+ "document": "腾讯混元大模型是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口支持流式或非流式调用,当使用流式调用时为 SSE 协议。\n\n 1. 本接口暂不支持返回图片内容。\n 2. 默认该接口下单账号限制并发数为 5 路,如您有提高并发限制的需求请 [购买](https://buy.cloud.tencent.com/hunyuan) 。\n 3. 请使用 SDK 调用本接口,每种开发语言的 SDK Git 仓库 examples/hunyuan/v20230901/ 目录下有提供示例供参考。SDK 链接在文档下方 “**开发者资源 - SDK**” 部分提供。\n 4. 我们推荐您使用 API Explorer,方便快速地在线调试接口和下载各语言的示例代码,[点击打开](https://console.cloud.tencent.com/api/explorer?Product=hunyuan&Version=2023-09-01&Action=ChatCompletions)。",
12
12
  "input": "ChatCompletionsRequest",
13
13
  "name": "hunyuan",
14
14
  "output": "ChatCompletionsResponse",
@@ -8,7 +8,7 @@
8
8
  "status": "online"
9
9
  },
10
10
  "ImageModeration": {
11
- "document": "本接口(Image Moderation, IM)用于提交图片文件进行同步智能审核任务。使用前请您使用腾讯云主账号登录控制台 [开通图片内容安全服务](https://console.cloud.tencent.com/cms) 并调整好对应的业务配置。\n### 接口使用说明:\n- 前往“[内容安全控制台-图片内容安全](https://console.cloud.tencent.com/cms)”开启使用图片内容安全服务,首次开通服务的用户可免费领用试用套餐包,包含**3000张图片**识别额度,有效期为15天。\n- 该接口为收费接口,计费方式敬请参见 [腾讯云图片内容安全定价](https://cloud.tencent.com/product/ims/pricing)。\n\n### 接口功能说明:\n- 支持对图片文件或链接进行检测,通过深度学习技术,识别可能令人反感、不安全或不适宜的违规图片内容;\n- 支持对GIF图/长图进行截帧或拆分检测;\n- 支持识别多种违规场景,包括:低俗、违法违规、色情、广告等场景;\n- 支持多种物体检测(实体、广告台标、二维码等)及图片中文本的OCR文本识别;\n- 支持根据不同的业务场景配置自定义的审核策略;\n- 支持用户自定义选择图片风险库,打击自定义识别类型的违规图片(目前仅支持黑名单配置);\n- 支持在审核图片内容时同时关联账号或设备信息,可识别违规风险账号或设备。\n\n### 接口调用说明:\n- 图片文件大小限制:**Base64编码内容应小于10MB**;**URL资源应小于30MB**\n- 图片默认尺寸支持:**长和宽 需>50分辨率且<10000分辨率,并且图片长宽比<90:1;**\n- 图片文件分辨率支持:建议**分辨率大于256x256**,否则可能会影响识别效果;\n- 图片文件支持格式:PNG、JPG、JPEG、BMP、GIF、WEBP格式;\n- 图片文件链接支持的传输协议:HTTP、HTTPS;\n- 若传入图片文件的访问链接,则需要注意**图片下载时间限制为3秒**,为保障被检测图片的稳定性和可靠性,建议您使用腾讯云COS存储或者CDN缓存等;\n\n\n<div class=\"rno-api-explorer\" style=\"margin-bottom:20px\">\n <div class=\"rno-api-explorer-inner\">\n <div class=\"rno-api-explorer-hd\">\n <div class=\"rno-api-explorer-title\">\n 关于版本迭代的描述\n </div>\n </div>\n <div class=\"rno-api-explorer-body\">\n <div class=\"rno-api-explorer-cont\">\n <p>当前页面版本为图片内容安全2020版本,2020.11.3日前接入的图片内容安全接口为2019版本,在此时间前接入的用户可直接访问以下链接进行维护操作:<a href=\"https://cloud.tencent.com/document/product/1125/38206\" target=\"_blank\">图片内容安全-2019版本</a></p>\n <p>2020版本相对2019版本进行了升级,支持更灵活的多场景业务策略配置以及更丰富的识别回调信息,满足不同业务的识别需求,建议按照2020版本接入指引进行接口升级;同时,2019版本也会持续维护直至用户不再使用为止。</p>\n </div>\n </div>\n </div>\n</div>",
11
+ "document": "本接口(Image Moderation, IM)用于提交图片文件进行同步智能审核任务。使用前请您使用腾讯云主账号登录控制台 [开通图片内容安全服务](https://console.cloud.tencent.com/cms) 并调整好对应的业务配置。\n### 接口使用说明:\n- 前往“[内容安全控制台-图片内容安全](https://console.cloud.tencent.com/cms)”开启使用图片内容安全服务,首次开通服务的用户可免费领用试用套餐包,包含**3000张图片**识别额度,有效期为15天。\n- 该接口为收费接口,计费方式敬请参见 [腾讯云图片内容安全定价](https://cloud.tencent.com/product/ims/pricing)。\n\n### 接口功能说明:\n- 支持对图片文件或链接进行检测,通过深度学习技术,识别可能令人反感、不安全或不适宜的违规图片内容;\n- 支持对长图进行拆分检测;\n- 支持识别多种违规场景,包括:低俗、违法违规、色情、广告等场景;\n- 支持多种物体检测(实体、广告台标、二维码等)及图片中文本的OCR文本识别;\n- 支持根据不同的业务场景配置自定义的审核策略;\n- 支持用户自定义选择图片风险库,打击自定义识别类型的违规图片(目前仅支持黑名单配置);\n- 支持在审核图片内容时同时关联账号或设备信息,可识别违规风险账号或设备。\n\n### 接口调用说明:\n- 图片文件大小限制:**Base64编码内容应小于10MB**;**URL资源应小于30MB**\n- 图片默认尺寸支持:**长和宽 需>50分辨率且<10000分辨率,并且图片长宽比<90:1;**\n- 图片文件分辨率支持:建议**分辨率大于256x256**,否则可能会影响识别效果;\n- 图片文件支持格式:PNG、JPG、JPEG、BMP、GIF、WEBP格式;\n- 图片文件链接支持的传输协议:HTTP、HTTPS;\n- 若传入图片文件的访问链接,则需要注意**图片下载时间限制为3秒**,为保障被检测图片的稳定性和可靠性,建议您使用腾讯云COS存储或者CDN缓存等;\n\n\n<div class=\"rno-api-explorer\" style=\"margin-bottom:20px\">\n <div class=\"rno-api-explorer-inner\">\n <div class=\"rno-api-explorer-hd\">\n <div class=\"rno-api-explorer-title\">\n 关于版本迭代的描述\n </div>\n </div>\n <div class=\"rno-api-explorer-body\">\n <div class=\"rno-api-explorer-cont\">\n <p>当前页面版本为图片内容安全2020版本,2020.11.3日前接入的图片内容安全接口为2019版本,在此时间前接入的用户可直接访问以下链接进行维护操作:<a href=\"https://cloud.tencent.com/document/product/1125/38206\" target=\"_blank\">图片内容安全-2019版本</a></p>\n <p>2020版本相对2019版本进行了升级,支持更灵活的多场景业务策略配置以及更丰富的识别回调信息,满足不同业务的识别需求,建议按照2020版本接入指引进行接口升级;同时,2019版本也会持续维护直至用户不再使用为止。</p>\n </div>\n </div>\n </div>\n</div>",
12
12
  "input": "ImageModerationRequest",
13
13
  "name": "图片同步检测",
14
14
  "output": "ImageModerationResponse",
@@ -249,7 +249,7 @@
249
249
  },
250
250
  {
251
251
  "disabled": false,
252
- "document": "该字段表示待检测图片文件的访问链接。图片支持PNG、JPG、JPEG、BMP、GIF、WEBP格式,且**大小不得超过5MB**,建议**分辨率不低于256x256**。**图片下载时间限制为3秒,超时将进行一次重试,若再次失败,则会返回下载超时**。由于网络安全策略,**送审带重定向的链接**可能引起下载失败,请尽量避免使用返回302或其他非200状态码的HTTP链接,会导致接口返回 ResourceUnavailable.ImageDownloadError 错误。<br>备注:该字段与FileContent必须选择输入其中一个。",
252
+ "document": "该字段表示待检测图片文件的访问链接。图片支持PNG、JPG、JPEG、BMP、GIF、WEBP格式,且**大小不得超过30MB**,建议**分辨率不低于256x256**。**图片下载时间限制为3秒,超时将进行一次重试,若再次失败,则会返回下载超时**。由于网络安全策略,**送审带重定向的链接**可能引起下载失败,请尽量避免使用返回302或其他非200状态码的HTTP链接,会导致接口返回 ResourceUnavailable.ImageDownloadError 错误。<br>备注:该字段与FileContent必须选择输入其中一个。",
253
253
  "example": "https://xxx.jpg",
254
254
  "member": "string",
255
255
  "name": "FileUrl",
@@ -1882,6 +1882,15 @@
1882
1882
  "name": "TableResultType",
1883
1883
  "required": false,
1884
1884
  "type": "string"
1885
+ },
1886
+ {
1887
+ "disabled": false,
1888
+ "document": "智能文档解析返回结果的格式\n0:只返回全文MD;\n1:只返回每一页的OCR原始Json;\n2:只返回每一页的MD,\n3:返回全文MD + 每一页的OCR原始Json;\n4:返回全文MD + 每一页的MD,\n默认值为3(返回全文MD + 每一页的OCR原始Json)\n\n",
1889
+ "example": "3",
1890
+ "member": "string",
1891
+ "name": "ResultType",
1892
+ "required": false,
1893
+ "type": "string"
1885
1894
  }
1886
1895
  ],
1887
1896
  "usage": "in"
@@ -3033,6 +3033,58 @@ def doDescribeInstanceParams(args, parsed_globals):
3033
3033
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3034
3034
 
3035
3035
 
3036
+ def doModifyDatabasePrivilege(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.SqlserverClient(cred, g_param[OptionsDefine.Region], profile)
3063
+ client._sdkVersion += ("_CLI_" + __version__)
3064
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
3065
+ model = models.ModifyDatabasePrivilegeRequest()
3066
+ model.from_json_string(json.dumps(args))
3067
+ start_time = time.time()
3068
+ while True:
3069
+ rsp = client.ModifyDatabasePrivilege(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
+
3036
3088
  def doCompleteExpansion(args, parsed_globals):
3037
3089
  g_param = parse_global_arg(parsed_globals)
3038
3090
 
@@ -7730,6 +7782,7 @@ ACTION_MAP = {
7730
7782
  "DescribeRegions": doDescribeRegions,
7731
7783
  "DescribeRestoreTask": doDescribeRestoreTask,
7732
7784
  "DescribeInstanceParams": doDescribeInstanceParams,
7785
+ "ModifyDatabasePrivilege": doModifyDatabasePrivilege,
7733
7786
  "CompleteExpansion": doCompleteExpansion,
7734
7787
  "DescribeBackupStatistical": doDescribeBackupStatistical,
7735
7788
  "CreateDB": doCreateDB,