tccli 3.0.1282.1__py2.py3-none-any.whl → 3.0.1283.1__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
tccli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1282.1'
1
+ __version__ = '3.0.1283.1'
@@ -3220,7 +3220,7 @@
3220
3220
  },
3221
3221
  {
3222
3222
  "disabled": false,
3223
- "document": "策略方式,可取值alg表示验证码,drop表示丢弃",
3223
+ "document": "策略方式,可取值alg表示验证码,drop表示丢弃,trans表示放行",
3224
3224
  "example": "alg",
3225
3225
  "member": "string",
3226
3226
  "name": "PolicyAction",
@@ -1508,7 +1508,7 @@
1508
1508
  },
1509
1509
  {
1510
1510
  "disabled": false,
1511
- "document": "集群角色类型,默认为 \"data\"数据节点",
1511
+ "document": "集群角色类型,“DATA” 为数据节点、“COMMON” 为 ZooKeeper 节点,默认为 \"DATA\" 数据节点。",
1512
1512
  "example": "DATA",
1513
1513
  "member": "string",
1514
1514
  "name": "NodeRole",
@@ -1563,7 +1563,7 @@
1563
1563
  "example": "2",
1564
1564
  "member": "int64",
1565
1565
  "name": "TotalCount",
1566
- "required": true,
1566
+ "output_required": true,
1567
1567
  "type": "int",
1568
1568
  "value_allowed_null": false
1569
1569
  },
@@ -1573,7 +1573,7 @@
1573
1573
  "example": "无",
1574
1574
  "member": "InstanceNode",
1575
1575
  "name": "InstanceNodesList",
1576
- "required": true,
1576
+ "output_required": true,
1577
1577
  "type": "list",
1578
1578
  "value_allowed_null": true
1579
1579
  },
@@ -108,7 +108,7 @@
108
108
  {
109
109
  "document": "获取实例节点信息列表",
110
110
  "input": "https://cdwch.tencentcloudapi.com/?Action=DescribeInstanceNodes\n&InstanceId=cdwch-12345678\n&<公共请求参数>",
111
- "output": "{\n \"Response\": {\n \"RequestId\": \"f510b0e8-4bc7-44c7-a191-79e467b556c4\",\n \"TotalCount\": 2,\n \"InstanceNodesList\": [\n {\n \"Ip\": \"172.31.1.5\",\n \"Spec\": \"CVM.SA2\",\n \"Core\": 16,\n \"Memory\": 32,\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 1000,\n \"Cluster\": \"default-cluster\"\n },\n {\n \"Ip\": \"172.31.1.4\",\n \"Spec\": \"CVM.SA2\",\n \"Core\": 16,\n \"Memory\": 32,\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 1000,\n \"Cluster\": \"default-cluster\"\n }\n ]\n }\n}",
111
+ "output": "{\n \"Response\": {\n \"InstanceNodesList\": [\n {\n \"Cluster\": \"default_cluster\",\n \"Core\": 2,\n \"DiskSize\": 200,\n \"DiskType\": \"CLOUD_HSSD\",\n \"Ip\": \"10.0.0.x\",\n \"IsCHProxy\": false,\n \"Memory\": 4,\n \"NodeGroups\": [],\n \"RealResourceId\": \"ins-xxxxxxxx\",\n \"Rip\": \"9.0.x.x\",\n \"Spec\": \"S_2_4_H\",\n \"Status\": \"Running\",\n \"UUID\": \"939cd0af-b336-4e83-ad1f-1bc11ea097b\",\n \"Zone\": \"ap-chongqing-1\",\n \"ZoneDesc\": \"重庆一区\"\n },\n {\n \"Cluster\": \"default_cluster\",\n \"Core\": 2,\n \"DiskSize\": 200,\n \"DiskType\": \"CLOUD_HSSD\",\n \"Ip\": \"10.0.0.x\",\n \"IsCHProxy\": false,\n \"Memory\": 4,\n \"NodeGroups\": [],\n \"RealResourceId\": \"ins-xxxxxxxx\",\n \"Rip\": \"9.0.x.x\",\n \"Spec\": \"S_2_4_H\",\n \"Status\": \"Running\",\n \"UUID\": \"939cd0af-b336-4e83-ad1f-1bc11ea097b\",\n \"Zone\": \"ap-chongqing-1\",\n \"ZoneDesc\": \"重庆一区\"\n }\n ],\n \"RequestId\": \"xxxxxxxxxx\",\n \"TotalCount\": 2\n }\n}",
112
112
  "title": "获取实例节点信息列表"
113
113
  }
114
114
  ],
@@ -1009,63 +1009,63 @@
1009
1009
  },
1010
1010
  {
1011
1011
  "disabled": false,
1012
- "document": "文件系统已使用容量(byte)\n注意:此字段可能返回 null,表示取不到有效值。",
1012
+ "document": "文件系统已使用容量(byte",
1013
1013
  "example": "0",
1014
1014
  "member": "uint64",
1015
1015
  "name": "CapacityUsed",
1016
1016
  "output_required": true,
1017
1017
  "type": "int",
1018
- "value_allowed_null": true
1018
+ "value_allowed_null": false
1019
1019
  },
1020
1020
  {
1021
1021
  "disabled": false,
1022
- "document": "已使用COS归档存储容量(byte)\n注意:此字段可能返回 null,表示取不到有效值。",
1022
+ "document": "已使用COS归档存储容量(byte",
1023
1023
  "example": "0",
1024
1024
  "member": "uint64",
1025
1025
  "name": "ArchiveCapacityUsed",
1026
1026
  "output_required": true,
1027
1027
  "type": "int",
1028
- "value_allowed_null": true
1028
+ "value_allowed_null": false
1029
1029
  },
1030
1030
  {
1031
1031
  "disabled": false,
1032
- "document": "已使用COS标准存储容量(byte)\n注意:此字段可能返回 null,表示取不到有效值。",
1032
+ "document": "已使用COS标准存储容量(byte",
1033
1033
  "example": "0",
1034
1034
  "member": "uint64",
1035
1035
  "name": "StandardCapacityUsed",
1036
1036
  "output_required": true,
1037
1037
  "type": "int",
1038
- "value_allowed_null": true
1038
+ "value_allowed_null": false
1039
1039
  },
1040
1040
  {
1041
1041
  "disabled": false,
1042
- "document": "已使用COS低频存储容量(byte)\n注意:此字段可能返回 null,表示取不到有效值。",
1042
+ "document": "已使用COS低频存储容量(byte",
1043
1043
  "example": "0",
1044
1044
  "member": "uint64",
1045
1045
  "name": "DegradeCapacityUsed",
1046
1046
  "output_required": true,
1047
1047
  "type": "int",
1048
- "value_allowed_null": true
1048
+ "value_allowed_null": false
1049
1049
  },
1050
1050
  {
1051
1051
  "disabled": false,
1052
- "document": "已使用COS深度归档存储容量(byte)\n注意:此字段可能返回 null,表示取不到有效值。",
1052
+ "document": "已使用COS深度归档存储容量(byte",
1053
1053
  "example": "0",
1054
1054
  "member": "uint64",
1055
1055
  "name": "DeepArchiveCapacityUsed",
1056
1056
  "output_required": true,
1057
1057
  "type": "int",
1058
- "value_allowed_null": true
1058
+ "value_allowed_null": false
1059
1059
  },
1060
1060
  {
1061
1061
  "disabled": false,
1062
- "document": "已使用COS智能分层存储容量(byte)\n注意:此字段可能返回 null,表示取不到有效值。",
1062
+ "document": "已使用COS智能分层存储容量(byte",
1063
1063
  "example": "0",
1064
1064
  "member": "uint64",
1065
1065
  "name": "IntelligentCapacityUsed",
1066
1066
  "output_required": true,
1067
1067
  "type": "int",
1068
- "value_allowed_null": true
1068
+ "value_allowed_null": false
1069
1069
  },
1070
1070
  {
1071
1071
  "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
@@ -197,7 +197,7 @@
197
197
  "status": "online"
198
198
  },
199
199
  "EnableTransparentDataEncryption": {
200
- "document": "本接口(EnableTransparentDataEncryption)用于开启云数据库 MongoDB 的透明加密能力。",
200
+ "document": "本接口(EnableTransparentDataEncryption)用于开启云数据库 MongoDB 的透明加密能力。",
201
201
  "input": "EnableTransparentDataEncryptionRequest",
202
202
  "name": "开启实例数据透明加密",
203
203
  "output": "EnableTransparentDataEncryptionResponse",
@@ -3416,7 +3416,7 @@
3416
3416
  {
3417
3417
  "disabled": false,
3418
3418
  "document": "密钥 ID。若不设置该参数,不指定具体的密钥 ID,由腾讯云自动生成密钥。",
3419
- "example": "AKIDnRsa6OfiW8**********************",
3419
+ "example": "AKID********************************",
3420
3420
  "member": "string",
3421
3421
  "name": "KeyId",
3422
3422
  "required": false,
@@ -227,8 +227,8 @@
227
227
  "EnableTransparentDataEncryption": [
228
228
  {
229
229
  "document": "",
230
- "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: EnableTransparentDataEncryption\n<公共请求参数>\n\n{\n \"InstanceId\": \"cmgo-igjysqkr\",\n \"KmsRegion\": \"ap-guangzhou\",\n \"KeyId\": \"myEncryptionkey\"\n}",
231
- "output": "{\n \"Response\": {\n \"FlowId\": 0,\n \"RequestId\": \"a8dce7a4-d488-49c9-8d24-33cf623f5992\"\n }\n}",
230
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: EnableTransparentDataEncryption\n<公共请求参数>\n\n{\n \"InstanceId\": \"cmgo-igjy****\",\n \"KmsRegion\": \"ap-guangzhou\",\n \"KeyId\": \"AKID********************************\"\n}",
231
+ "output": "{\n \"Response\": {\n \"FlowId\": 17316505316,\n \"RequestId\": \"a8dce7a4-d488-49c9-8d24-33cf623f5992\"\n }\n}",
232
232
  "title": "开启实例数据透明加密"
233
233
  }
234
234
  ],
@@ -2097,6 +2097,58 @@ def doDeleteAuthorizationPolicy(args, parsed_globals):
2097
2097
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2098
2098
 
2099
2099
 
2100
+ def doModifyHttpAuthenticator(args, parsed_globals):
2101
+ g_param = parse_global_arg(parsed_globals)
2102
+
2103
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2104
+ cred = credential.CVMRoleCredential()
2105
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2106
+ cred = credential.STSAssumeRoleCredential(
2107
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2108
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2109
+ )
2110
+ 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):
2111
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2112
+ else:
2113
+ cred = credential.Credential(
2114
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2115
+ )
2116
+ http_profile = HttpProfile(
2117
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2118
+ reqMethod="POST",
2119
+ endpoint=g_param[OptionsDefine.Endpoint],
2120
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2121
+ )
2122
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2123
+ if g_param[OptionsDefine.Language]:
2124
+ profile.language = g_param[OptionsDefine.Language]
2125
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2126
+ client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
2127
+ client._sdkVersion += ("_CLI_" + __version__)
2128
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2129
+ model = models.ModifyHttpAuthenticatorRequest()
2130
+ model.from_json_string(json.dumps(args))
2131
+ start_time = time.time()
2132
+ while True:
2133
+ rsp = client.ModifyHttpAuthenticator(model)
2134
+ result = rsp.to_json_string()
2135
+ try:
2136
+ json_obj = json.loads(result)
2137
+ except TypeError as e:
2138
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2139
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2140
+ break
2141
+ cur_time = time.time()
2142
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2143
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2144
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2145
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2146
+ else:
2147
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2148
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2149
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2150
+
2151
+
2100
2152
  def doDescribeTopic(args, parsed_globals):
2101
2153
  g_param = parse_global_arg(parsed_globals)
2102
2154
 
@@ -2617,6 +2669,58 @@ def doModifyInstance(args, parsed_globals):
2617
2669
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2618
2670
 
2619
2671
 
2672
+ def doCreateHttpAuthenticator(args, parsed_globals):
2673
+ g_param = parse_global_arg(parsed_globals)
2674
+
2675
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2676
+ cred = credential.CVMRoleCredential()
2677
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2678
+ cred = credential.STSAssumeRoleCredential(
2679
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2680
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2681
+ )
2682
+ 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):
2683
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2684
+ else:
2685
+ cred = credential.Credential(
2686
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2687
+ )
2688
+ http_profile = HttpProfile(
2689
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2690
+ reqMethod="POST",
2691
+ endpoint=g_param[OptionsDefine.Endpoint],
2692
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2693
+ )
2694
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2695
+ if g_param[OptionsDefine.Language]:
2696
+ profile.language = g_param[OptionsDefine.Language]
2697
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2698
+ client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
2699
+ client._sdkVersion += ("_CLI_" + __version__)
2700
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2701
+ model = models.CreateHttpAuthenticatorRequest()
2702
+ model.from_json_string(json.dumps(args))
2703
+ start_time = time.time()
2704
+ while True:
2705
+ rsp = client.CreateHttpAuthenticator(model)
2706
+ result = rsp.to_json_string()
2707
+ try:
2708
+ json_obj = json.loads(result)
2709
+ except TypeError as e:
2710
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2711
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2712
+ break
2713
+ cur_time = time.time()
2714
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2715
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2716
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2717
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2718
+ else:
2719
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2720
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2721
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2722
+
2723
+
2620
2724
  CLIENT_MAP = {
2621
2725
  "v20240516": mqtt_client_v20240516,
2622
2726
 
@@ -2668,6 +2772,7 @@ ACTION_MAP = {
2668
2772
  "DescribeInstanceList": doDescribeInstanceList,
2669
2773
  "ModifyAuthorizationPolicy": doModifyAuthorizationPolicy,
2670
2774
  "DeleteAuthorizationPolicy": doDeleteAuthorizationPolicy,
2775
+ "ModifyHttpAuthenticator": doModifyHttpAuthenticator,
2671
2776
  "DescribeTopic": doDescribeTopic,
2672
2777
  "RegisterCaCertificate": doRegisterCaCertificate,
2673
2778
  "ModifyInsPublicEndpoint": doModifyInsPublicEndpoint,
@@ -2678,6 +2783,7 @@ ACTION_MAP = {
2678
2783
  "DescribeTopicList": doDescribeTopicList,
2679
2784
  "CreateAuthorizationPolicy": doCreateAuthorizationPolicy,
2680
2785
  "ModifyInstance": doModifyInstance,
2786
+ "CreateHttpAuthenticator": doCreateHttpAuthenticator,
2681
2787
 
2682
2788
  }
2683
2789