tccli 3.0.1228.1__py2.py3-none-any.whl → 3.0.1230.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 +1 -1
- tccli/services/aiart/aiart_client.py +57 -4
- tccli/services/aiart/v20221229/api.json +101 -3
- tccli/services/aiart/v20221229/examples.json +8 -0
- tccli/services/batch/v20170312/api.json +15 -8
- tccli/services/cam/v20190116/api.json +25 -25
- tccli/services/cam/v20190116/examples.json +8 -8
- tccli/services/cdb/v20170320/api.json +8 -8
- tccli/services/cfw/v20190904/api.json +1 -1
- tccli/services/ckafka/v20190819/api.json +1 -1
- tccli/services/ckafka/v20190819/examples.json +14 -14
- tccli/services/clb/v20180317/api.json +1 -1
- tccli/services/cloudaudit/v20190319/api.json +15 -15
- tccli/services/cloudaudit/v20190319/examples.json +3 -3
- tccli/services/config/v20220802/api.json +70 -68
- tccli/services/config/v20220802/examples.json +6 -6
- tccli/services/cwp/v20180228/api.json +1 -1
- tccli/services/cynosdb/cynosdb_client.py +175 -16
- tccli/services/cynosdb/v20190107/api.json +292 -18
- tccli/services/cynosdb/v20190107/examples.json +30 -0
- tccli/services/dbbrain/v20210527/api.json +3 -1
- tccli/services/emr/emr_client.py +110 -4
- tccli/services/emr/v20190103/api.json +645 -0
- tccli/services/emr/v20190103/examples.json +16 -0
- tccli/services/essbasic/v20210526/api.json +10 -0
- tccli/services/facefusion/v20181201/api.json +12 -6
- tccli/services/hai/v20230812/api.json +6 -6
- tccli/services/hai/v20230812/examples.json +2 -2
- tccli/services/iotexplorer/v20190423/api.json +10 -0
- tccli/services/ivld/v20210903/api.json +25 -25
- tccli/services/ivld/v20210903/examples.json +1 -1
- tccli/services/lcic/v20220817/api.json +2 -2
- tccli/services/lke/v20231130/api.json +4 -4
- tccli/services/mps/v20190612/api.json +54 -1
- tccli/services/mqtt/mqtt_client.py +118 -12
- tccli/services/mqtt/v20240516/api.json +312 -33
- tccli/services/mqtt/v20240516/examples.json +23 -13
- tccli/services/ocr/v20181119/api.json +119 -30
- tccli/services/ocr/v20181119/examples.json +6 -6
- tccli/services/postgres/v20170312/api.json +221 -219
- tccli/services/postgres/v20170312/examples.json +36 -36
- tccli/services/pts/v20210728/api.json +22 -12
- tccli/services/redis/v20180412/api.json +14 -14
- tccli/services/scf/v20180416/api.json +12 -0
- tccli/services/ssl/v20191205/api.json +246 -173
- tccli/services/ssl/v20191205/examples.json +69 -69
- tccli/services/sts/v20180813/api.json +17 -11
- tccli/services/sts/v20180813/examples.json +6 -6
- tccli/services/tcr/v20190924/api.json +17 -17
- tccli/services/tdmq/tdmq_client.py +4 -57
- tccli/services/tdmq/v20200217/api.json +121 -202
- tccli/services/tdmq/v20200217/examples.json +29 -49
- tccli/services/trtc/v20190722/api.json +5 -9
- tccli/services/vclm/v20240523/api.json +28 -18
- tccli/services/vclm/v20240523/examples.json +2 -2
- tccli/services/vod/v20180717/api.json +18 -18
- tccli/services/vpc/v20170312/api.json +658 -163
- tccli/services/vpc/v20170312/examples.json +70 -14
- tccli/services/vpc/vpc_client.py +475 -104
- {tccli-3.0.1228.1.dist-info → tccli-3.0.1230.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1228.1.dist-info → tccli-3.0.1230.1.dist-info}/RECORD +64 -64
- {tccli-3.0.1228.1.dist-info → tccli-3.0.1230.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1228.1.dist-info → tccli-3.0.1230.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1228.1.dist-info → tccli-3.0.1230.1.dist-info}/license_files/LICENSE +0 -0
@@ -18,24 +18,24 @@
|
|
18
18
|
],
|
19
19
|
"ListConfigRules": [
|
20
20
|
{
|
21
|
-
"document": "",
|
22
|
-
"input": "POST / HTTP/1.1\nHost: config.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ListConfigRules\n<公共请求参数>\n\n{\n \"Offset\": 0,\n \"Limit\": 10,\n \"OrderType\": \"\",\n \"RiskLevel\": [],\n \"State\": \"ACTIVE\",\n \"ComplianceResult\": [],\n \"RuleName\": \"\"\n}",
|
23
|
-
"output": "{\n \"Response\": {\n \"RequestId\": \"
|
21
|
+
"document": "获取规则列表",
|
22
|
+
"input": "POST / HTTP/1.1\nHost: config.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ListConfigRules\n<公共请求参数>\n\n{\n \"Offset\": 0,\n \"Limit\": 10,\n \"OrderType\": \"desc\",\n \"RiskLevel\": [\n 1\n ],\n \"State\": \"ACTIVE\",\n \"ComplianceResult\": [\n \"COMPLIANT\"\n ],\n \"RuleName\": \"CAM\"\n}",
|
23
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"107f8d51-7095-4a6f-b374-a8aa7743584b\",\n \"Items\": [\n {\n \"AccountGroupId\": \"ca-324234\",\n \"AccountGroupName\": \"账号组\",\n \"Annotation\": null,\n \"CompliancePackId\": \"\",\n \"CompliancePackName\": null,\n \"ComplianceResult\": \"NON_COMPLIANT\",\n \"ConfigRuleId\": \"cr-HQxxxxxxxhR0BxxxxGodh\",\n \"ConfigRuleInvokedTime\": null,\n \"CreateTime\": \"2024-11-15 14:21:47\",\n \"Description\": \"CAM用户下不存在已禁用的 AccessKey,则符合规则。\",\n \"ExcludeResourceIdsScope\": [],\n \"Identifier\": \"cam-user-invalid-ak-check\",\n \"IdentifierType\": \"SYSTEM\",\n \"InputParameter\": [],\n \"Labels\": [\n \"用户\",\n \"密钥\"\n ],\n \"ManageInputParameter\": [],\n \"ManageTriggerType\": [\n \"ConfigurationItemChangeNotification\"\n ],\n \"RegionsScope\": [],\n \"ResourceType\": [\n \"QCS::CAM::User\"\n ],\n \"RiskLevel\": 3,\n \"RuleName\": \"CAM用户下不存在已禁用的访问密钥AccessKey\",\n \"RuleOwnerId\": 84935363164,\n \"ServiceFunction\": null,\n \"SourceCondition\": [],\n \"Status\": \"ACTIVE\",\n \"TagsScope\": [],\n \"TriggerType\": [\n {\n \"MaximumExecutionFrequency\": null,\n \"MessageType\": \"ConfigurationItemChangeNotification\"\n }\n ]\n }\n ],\n \"Total\": 1\n }\n}",
|
24
24
|
"title": "获取规则列表"
|
25
25
|
}
|
26
26
|
],
|
27
27
|
"ListDiscoveredResources": [
|
28
28
|
{
|
29
29
|
"document": "",
|
30
|
-
"input": "POST / HTTP/1.1\nHost: config.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ListDiscoveredResources\n<公共请求参数>\n\n{\n \"OrderType\": \"
|
31
|
-
"output": "{\n \"Response\": {\n \"Items\": [\n {\n \"ResourceStatus\": \"
|
30
|
+
"input": "POST / HTTP/1.1\nHost: config.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ListDiscoveredResources\n<公共请求参数>\n\n{\n \"OrderType\": \"desc\",\n \"NextToken\": \"C3IptlTj6hTlW0WKVO3NI\",\n \"MaxResults\": 10,\n \"Filters\": [\n {\n \"Values\": [\n \"ins-234234\"\n ],\n \"Name\": \"resourceName\"\n }\n ],\n \"Tags\": [\n {\n \"TagKey\": \"开发部\",\n \"TagValue\": \"运营部\"\n }\n ]\n}",
|
31
|
+
"output": "{\n \"Response\": {\n \"Items\": [\n {\n \"ResourceStatus\": \"Running\",\n \"Tags\": [\n {\n \"TagKey\": \"开发部\",\n \"TagValue\": \"运营部\"\n }\n ],\n \"ResourceType\": \"cvm\",\n \"ResourceId\": \"ins-234er\",\n \"ResourceCreateTime\": \"2022-10-10 12:56:37\",\n \"ResourceRegion\": \"ap-guangzhou\",\n \"ResourceName\": \"云服务器\",\n \"ResourceZone\": \"ap-guangzhou-1\",\n \"ResourceDelete\": 1,\n \"ComplianceResult\": \"COMPLIANT\"\n }\n ],\n \"NextToken\": \"C3IptlTj6hTlW0WKVO3NI\",\n \"RequestId\": \"4006b9ea-9b33-4b80-8496-6917c900b122\"\n }\n}",
|
32
32
|
"title": "获取资源列表"
|
33
33
|
}
|
34
34
|
],
|
35
35
|
"PutEvaluations": [
|
36
36
|
{
|
37
37
|
"document": "上报自定义规则评估结果",
|
38
|
-
"input": "POST / HTTP/1.1\nHost: config.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: PutEvaluations\n<公共请求参数>\n\n
|
38
|
+
"input": "POST / HTTP/1.1\nHost: config.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: PutEvaluations\n<公共请求参数>\n\n{\n \"ResultToken\": \"Wm9yZlY3WmlKa3cxaW1oQlu-H3WA6JZnH46cUAn2DWG****\",\n \"Evaluations\": [\n {\n \"ComplianceResourceId\": \"disk-26itbqha\",\n \"ComplianceResourceType\": \"QCS::CBS::Disk\",\n \"ComplianceRegion\": \"ap-guangzhou\",\n \"ComplianceType\": \"NON_COMPLIANT\",\n \"Annotation\": {\n \"Configuration\": \"1\",\n \"DesiredValue\": \"2\",\n \"Operator\": \"equal\",\n \"Property\": \"age\"\n }\n }\n ]\n}",
|
39
39
|
"output": "{\n \"Response\": {\n \"RequestId\": \"d947eba9-f908-4d2e-9b3d-63bde43abd1a\"\n }\n}",
|
40
40
|
"title": "上报自定义规则评估结果"
|
41
41
|
}
|
@@ -22481,7 +22481,7 @@
|
|
22481
22481
|
{
|
22482
22482
|
"disabled": false,
|
22483
22483
|
"document": "基线信息列表",
|
22484
|
-
"example": "[ { \"Name\": \"基线名
|
22484
|
+
"example": "[ { \"Name\": \"基线名A\", \"Level\": 1, \"RuleCount\": 11, \"HostCount\": 12, \"Status\": 0, \"CategoryId\": 2, \"LastScanTime\": \"2024-11-04 03:43:26\", \"MaxStatus\": 2, \"BaselineFailCount\": 29 } ]",
|
22485
22485
|
"member": "BaselineInfo",
|
22486
22486
|
"name": "BaselineList",
|
22487
22487
|
"output_required": true,
|
@@ -69,7 +69,7 @@ def doResumeServerless(args, parsed_globals):
|
|
69
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
70
|
|
71
71
|
|
72
|
-
def
|
72
|
+
def doDescribeBackupConfig(args, parsed_globals):
|
73
73
|
g_param = parse_global_arg(parsed_globals)
|
74
74
|
|
75
75
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -98,11 +98,11 @@ def doDescribeInstanceSpecs(args, parsed_globals):
|
|
98
98
|
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
99
99
|
client._sdkVersion += ("_CLI_" + __version__)
|
100
100
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.
|
101
|
+
model = models.DescribeBackupConfigRequest()
|
102
102
|
model.from_json_string(json.dumps(args))
|
103
103
|
start_time = time.time()
|
104
104
|
while True:
|
105
|
-
rsp = client.
|
105
|
+
rsp = client.DescribeBackupConfig(model)
|
106
106
|
result = rsp.to_json_string()
|
107
107
|
try:
|
108
108
|
json_obj = json.loads(result)
|
@@ -797,6 +797,58 @@ def doRenewClusters(args, parsed_globals):
|
|
797
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
798
|
|
799
799
|
|
800
|
+
def doCloseProxyEndPoint(args, parsed_globals):
|
801
|
+
g_param = parse_global_arg(parsed_globals)
|
802
|
+
|
803
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
804
|
+
cred = credential.CVMRoleCredential()
|
805
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
806
|
+
cred = credential.STSAssumeRoleCredential(
|
807
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
808
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
809
|
+
)
|
810
|
+
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):
|
811
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
812
|
+
else:
|
813
|
+
cred = credential.Credential(
|
814
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
815
|
+
)
|
816
|
+
http_profile = HttpProfile(
|
817
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
818
|
+
reqMethod="POST",
|
819
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
820
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
821
|
+
)
|
822
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
823
|
+
if g_param[OptionsDefine.Language]:
|
824
|
+
profile.language = g_param[OptionsDefine.Language]
|
825
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
826
|
+
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
827
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
828
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
+
model = models.CloseProxyEndPointRequest()
|
830
|
+
model.from_json_string(json.dumps(args))
|
831
|
+
start_time = time.time()
|
832
|
+
while True:
|
833
|
+
rsp = client.CloseProxyEndPoint(model)
|
834
|
+
result = rsp.to_json_string()
|
835
|
+
try:
|
836
|
+
json_obj = json.loads(result)
|
837
|
+
except TypeError as e:
|
838
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
839
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
840
|
+
break
|
841
|
+
cur_time = time.time()
|
842
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
843
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
844
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
845
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
846
|
+
else:
|
847
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
848
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
849
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
|
+
|
851
|
+
|
800
852
|
def doCloseProxy(args, parsed_globals):
|
801
853
|
g_param = parse_global_arg(parsed_globals)
|
802
854
|
|
@@ -849,7 +901,7 @@ def doCloseProxy(args, parsed_globals):
|
|
849
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
902
|
|
851
903
|
|
852
|
-
def
|
904
|
+
def doDescribeProxySpecs(args, parsed_globals):
|
853
905
|
g_param = parse_global_arg(parsed_globals)
|
854
906
|
|
855
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -878,11 +930,11 @@ def doExportResourcePackageDeductDetails(args, parsed_globals):
|
|
878
930
|
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
879
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
880
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
-
model = models.
|
933
|
+
model = models.DescribeProxySpecsRequest()
|
882
934
|
model.from_json_string(json.dumps(args))
|
883
935
|
start_time = time.time()
|
884
936
|
while True:
|
885
|
-
rsp = client.
|
937
|
+
rsp = client.DescribeProxySpecs(model)
|
886
938
|
result = rsp.to_json_string()
|
887
939
|
try:
|
888
940
|
json_obj = json.loads(result)
|
@@ -1057,7 +1109,7 @@ def doDescribeTasks(args, parsed_globals):
|
|
1057
1109
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1110
|
|
1059
1111
|
|
1060
|
-
def
|
1112
|
+
def doDescribeInstanceSpecs(args, parsed_globals):
|
1061
1113
|
g_param = parse_global_arg(parsed_globals)
|
1062
1114
|
|
1063
1115
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1086,11 +1138,11 @@ def doDescribeBackupConfig(args, parsed_globals):
|
|
1086
1138
|
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
1139
|
client._sdkVersion += ("_CLI_" + __version__)
|
1088
1140
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.
|
1141
|
+
model = models.DescribeInstanceSpecsRequest()
|
1090
1142
|
model.from_json_string(json.dumps(args))
|
1091
1143
|
start_time = time.time()
|
1092
1144
|
while True:
|
1093
|
-
rsp = client.
|
1145
|
+
rsp = client.DescribeInstanceSpecs(model)
|
1094
1146
|
result = rsp.to_json_string()
|
1095
1147
|
try:
|
1096
1148
|
json_obj = json.loads(result)
|
@@ -1213,6 +1265,58 @@ def doDescribeResourcesByDealName(args, parsed_globals):
|
|
1213
1265
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1266
|
|
1215
1267
|
|
1268
|
+
def doExportResourcePackageDeductDetails(args, parsed_globals):
|
1269
|
+
g_param = parse_global_arg(parsed_globals)
|
1270
|
+
|
1271
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1272
|
+
cred = credential.CVMRoleCredential()
|
1273
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1274
|
+
cred = credential.STSAssumeRoleCredential(
|
1275
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1276
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1277
|
+
)
|
1278
|
+
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):
|
1279
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1280
|
+
else:
|
1281
|
+
cred = credential.Credential(
|
1282
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1283
|
+
)
|
1284
|
+
http_profile = HttpProfile(
|
1285
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1286
|
+
reqMethod="POST",
|
1287
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1288
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1289
|
+
)
|
1290
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1291
|
+
if g_param[OptionsDefine.Language]:
|
1292
|
+
profile.language = g_param[OptionsDefine.Language]
|
1293
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1294
|
+
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
1295
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1296
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1297
|
+
model = models.ExportResourcePackageDeductDetailsRequest()
|
1298
|
+
model.from_json_string(json.dumps(args))
|
1299
|
+
start_time = time.time()
|
1300
|
+
while True:
|
1301
|
+
rsp = client.ExportResourcePackageDeductDetails(model)
|
1302
|
+
result = rsp.to_json_string()
|
1303
|
+
try:
|
1304
|
+
json_obj = json.loads(result)
|
1305
|
+
except TypeError as e:
|
1306
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1307
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1308
|
+
break
|
1309
|
+
cur_time = time.time()
|
1310
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1311
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1312
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1313
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1314
|
+
else:
|
1315
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1316
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1317
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
|
+
|
1319
|
+
|
1216
1320
|
def doModifyClusterStorage(args, parsed_globals):
|
1217
1321
|
g_param = parse_global_arg(parsed_globals)
|
1218
1322
|
|
@@ -2565,7 +2669,7 @@ def doIsolateCluster(args, parsed_globals):
|
|
2565
2669
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2566
2670
|
|
2567
2671
|
|
2568
|
-
def
|
2672
|
+
def doDescribeInstancesWithinSameCluster(args, parsed_globals):
|
2569
2673
|
g_param = parse_global_arg(parsed_globals)
|
2570
2674
|
|
2571
2675
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2594,11 +2698,11 @@ def doDescribeProxySpecs(args, parsed_globals):
|
|
2594
2698
|
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
2595
2699
|
client._sdkVersion += ("_CLI_" + __version__)
|
2596
2700
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2597
|
-
model = models.
|
2701
|
+
model = models.DescribeInstancesWithinSameClusterRequest()
|
2598
2702
|
model.from_json_string(json.dumps(args))
|
2599
2703
|
start_time = time.time()
|
2600
2704
|
while True:
|
2601
|
-
rsp = client.
|
2705
|
+
rsp = client.DescribeInstancesWithinSameCluster(model)
|
2602
2706
|
result = rsp.to_json_string()
|
2603
2707
|
try:
|
2604
2708
|
json_obj = json.loads(result)
|
@@ -4645,6 +4749,58 @@ def doBindClusterResourcePackages(args, parsed_globals):
|
|
4645
4749
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4646
4750
|
|
4647
4751
|
|
4752
|
+
def doDescribeServerlessInstanceSpecs(args, parsed_globals):
|
4753
|
+
g_param = parse_global_arg(parsed_globals)
|
4754
|
+
|
4755
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
4756
|
+
cred = credential.CVMRoleCredential()
|
4757
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
4758
|
+
cred = credential.STSAssumeRoleCredential(
|
4759
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
4760
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
4761
|
+
)
|
4762
|
+
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):
|
4763
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
4764
|
+
else:
|
4765
|
+
cred = credential.Credential(
|
4766
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
4767
|
+
)
|
4768
|
+
http_profile = HttpProfile(
|
4769
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
4770
|
+
reqMethod="POST",
|
4771
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
4772
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
4773
|
+
)
|
4774
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
4775
|
+
if g_param[OptionsDefine.Language]:
|
4776
|
+
profile.language = g_param[OptionsDefine.Language]
|
4777
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
4778
|
+
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
4779
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
4780
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4781
|
+
model = models.DescribeServerlessInstanceSpecsRequest()
|
4782
|
+
model.from_json_string(json.dumps(args))
|
4783
|
+
start_time = time.time()
|
4784
|
+
while True:
|
4785
|
+
rsp = client.DescribeServerlessInstanceSpecs(model)
|
4786
|
+
result = rsp.to_json_string()
|
4787
|
+
try:
|
4788
|
+
json_obj = json.loads(result)
|
4789
|
+
except TypeError as e:
|
4790
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
4791
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
4792
|
+
break
|
4793
|
+
cur_time = time.time()
|
4794
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
4795
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
4796
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
4797
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
4798
|
+
else:
|
4799
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
4800
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
4801
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4802
|
+
|
4803
|
+
|
4648
4804
|
def doDescribeAuditLogs(args, parsed_globals):
|
4649
4805
|
g_param = parse_global_arg(parsed_globals)
|
4650
4806
|
|
@@ -7881,7 +8037,7 @@ MODELS_MAP = {
|
|
7881
8037
|
|
7882
8038
|
ACTION_MAP = {
|
7883
8039
|
"ResumeServerless": doResumeServerless,
|
7884
|
-
"
|
8040
|
+
"DescribeBackupConfig": doDescribeBackupConfig,
|
7885
8041
|
"ModifyBinlogConfig": doModifyBinlogConfig,
|
7886
8042
|
"CreateProxyEndPoint": doCreateProxyEndPoint,
|
7887
8043
|
"ModifyResourcePackageClusters": doModifyResourcePackageClusters,
|
@@ -7895,14 +8051,16 @@ ACTION_MAP = {
|
|
7895
8051
|
"DescribeSupportProxyVersion": doDescribeSupportProxyVersion,
|
7896
8052
|
"CreateAuditLogFile": doCreateAuditLogFile,
|
7897
8053
|
"RenewClusters": doRenewClusters,
|
8054
|
+
"CloseProxyEndPoint": doCloseProxyEndPoint,
|
7898
8055
|
"CloseProxy": doCloseProxy,
|
7899
|
-
"
|
8056
|
+
"DescribeProxySpecs": doDescribeProxySpecs,
|
7900
8057
|
"InquirePriceModify": doInquirePriceModify,
|
7901
8058
|
"DescribeClusterDetail": doDescribeClusterDetail,
|
7902
8059
|
"DescribeTasks": doDescribeTasks,
|
7903
|
-
"
|
8060
|
+
"DescribeInstanceSpecs": doDescribeInstanceSpecs,
|
7904
8061
|
"DescribeBinlogDownloadUrl": doDescribeBinlogDownloadUrl,
|
7905
8062
|
"DescribeResourcesByDealName": doDescribeResourcesByDealName,
|
8063
|
+
"ExportResourcePackageDeductDetails": doExportResourcePackageDeductDetails,
|
7906
8064
|
"ModifyClusterStorage": doModifyClusterStorage,
|
7907
8065
|
"ActivateInstance": doActivateInstance,
|
7908
8066
|
"DescribeProxyNodes": doDescribeProxyNodes,
|
@@ -7929,7 +8087,7 @@ ACTION_MAP = {
|
|
7929
8087
|
"CreateBackup": doCreateBackup,
|
7930
8088
|
"OfflineInstance": doOfflineInstance,
|
7931
8089
|
"IsolateCluster": doIsolateCluster,
|
7932
|
-
"
|
8090
|
+
"DescribeInstancesWithinSameCluster": doDescribeInstancesWithinSameCluster,
|
7933
8091
|
"RestartInstance": doRestartInstance,
|
7934
8092
|
"UpgradeProxy": doUpgradeProxy,
|
7935
8093
|
"DescribeClusters": doDescribeClusters,
|
@@ -7969,6 +8127,7 @@ ACTION_MAP = {
|
|
7969
8127
|
"ModifyInstanceParam": doModifyInstanceParam,
|
7970
8128
|
"DescribeInstanceCLSLogDelivery": doDescribeInstanceCLSLogDelivery,
|
7971
8129
|
"BindClusterResourcePackages": doBindClusterResourcePackages,
|
8130
|
+
"DescribeServerlessInstanceSpecs": doDescribeServerlessInstanceSpecs,
|
7972
8131
|
"DescribeAuditLogs": doDescribeAuditLogs,
|
7973
8132
|
"UnbindClusterResourcePackages": doUnbindClusterResourcePackages,
|
7974
8133
|
"DescribeProxies": doDescribeProxies,
|