tccli-intl-en 3.0.1284.1__py2.py3-none-any.whl → 3.1.2.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 +1 -1
- tccli/services/ckafka/ckafka_client.py +288 -8
- tccli/services/ckafka/v20190819/api.json +494 -76
- tccli/services/ckafka/v20190819/examples.json +45 -5
- tccli/services/clb/v20180317/api.json +994 -634
- tccli/services/clb/v20180317/examples.json +19 -19
- tccli/services/cvm/v20170312/examples.json +2 -2
- tccli/services/ocr/ocr_client.py +112 -0
- tccli/services/ocr/v20181119/api.json +505 -0
- tccli/services/ocr/v20181119/examples.json +22 -0
- {tccli_intl_en-3.0.1284.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/METADATA +2 -2
- {tccli_intl_en-3.0.1284.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/RECORD +16 -16
- {tccli_intl_en-3.0.1284.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/LICENSE +0 -0
- {tccli_intl_en-3.0.1284.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/WHEEL +0 -0
- {tccli_intl_en-3.0.1284.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/entry_points.txt +0 -0
- {tccli_intl_en-3.0.1284.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/top_level.txt +0 -0
tccli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '3.
|
|
1
|
+
__version__ = '3.1.2.1'
|
|
@@ -732,6 +732,61 @@ def doDescribeUser(args, parsed_globals):
|
|
|
732
732
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
733
733
|
|
|
734
734
|
|
|
735
|
+
def doDescribeGroup(args, parsed_globals):
|
|
736
|
+
g_param = parse_global_arg(parsed_globals)
|
|
737
|
+
|
|
738
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
739
|
+
cred = credential.CVMRoleCredential()
|
|
740
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
741
|
+
cred = credential.STSAssumeRoleCredential(
|
|
742
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
743
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
744
|
+
)
|
|
745
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
746
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
747
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
748
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
749
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
750
|
+
else:
|
|
751
|
+
cred = credential.Credential(
|
|
752
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
753
|
+
)
|
|
754
|
+
http_profile = HttpProfile(
|
|
755
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
756
|
+
reqMethod="POST",
|
|
757
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
758
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
759
|
+
)
|
|
760
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
761
|
+
if g_param[OptionsDefine.Language]:
|
|
762
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
763
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
764
|
+
client = mod.CkafkaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
765
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
766
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
767
|
+
model = models.DescribeGroupRequest()
|
|
768
|
+
model.from_json_string(json.dumps(args))
|
|
769
|
+
start_time = time.time()
|
|
770
|
+
while True:
|
|
771
|
+
rsp = client.DescribeGroup(model)
|
|
772
|
+
result = rsp.to_json_string()
|
|
773
|
+
try:
|
|
774
|
+
json_obj = json.loads(result)
|
|
775
|
+
except TypeError as e:
|
|
776
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
777
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
778
|
+
break
|
|
779
|
+
cur_time = time.time()
|
|
780
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
781
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
782
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
783
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
784
|
+
else:
|
|
785
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
786
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
787
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
788
|
+
|
|
789
|
+
|
|
735
790
|
def doCreateTopicIpWhiteList(args, parsed_globals):
|
|
736
791
|
g_param = parse_global_arg(parsed_globals)
|
|
737
792
|
|
|
@@ -787,7 +842,7 @@ def doCreateTopicIpWhiteList(args, parsed_globals):
|
|
|
787
842
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
788
843
|
|
|
789
844
|
|
|
790
|
-
def
|
|
845
|
+
def doDescribeCkafkaVersion(args, parsed_globals):
|
|
791
846
|
g_param = parse_global_arg(parsed_globals)
|
|
792
847
|
|
|
793
848
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -819,11 +874,11 @@ def doDescribeGroup(args, parsed_globals):
|
|
|
819
874
|
client = mod.CkafkaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
820
875
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
821
876
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
822
|
-
model = models.
|
|
877
|
+
model = models.DescribeCkafkaVersionRequest()
|
|
823
878
|
model.from_json_string(json.dumps(args))
|
|
824
879
|
start_time = time.time()
|
|
825
880
|
while True:
|
|
826
|
-
rsp = client.
|
|
881
|
+
rsp = client.DescribeCkafkaVersion(model)
|
|
827
882
|
result = rsp.to_json_string()
|
|
828
883
|
try:
|
|
829
884
|
json_obj = json.loads(result)
|
|
@@ -897,6 +952,61 @@ def doModifyGroupOffsets(args, parsed_globals):
|
|
|
897
952
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
898
953
|
|
|
899
954
|
|
|
955
|
+
def doUpgradeBrokerVersion(args, parsed_globals):
|
|
956
|
+
g_param = parse_global_arg(parsed_globals)
|
|
957
|
+
|
|
958
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
959
|
+
cred = credential.CVMRoleCredential()
|
|
960
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
961
|
+
cred = credential.STSAssumeRoleCredential(
|
|
962
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
963
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
964
|
+
)
|
|
965
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
966
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
967
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
968
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
969
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
970
|
+
else:
|
|
971
|
+
cred = credential.Credential(
|
|
972
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
973
|
+
)
|
|
974
|
+
http_profile = HttpProfile(
|
|
975
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
976
|
+
reqMethod="POST",
|
|
977
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
978
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
979
|
+
)
|
|
980
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
981
|
+
if g_param[OptionsDefine.Language]:
|
|
982
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
983
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
984
|
+
client = mod.CkafkaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
985
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
986
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
987
|
+
model = models.UpgradeBrokerVersionRequest()
|
|
988
|
+
model.from_json_string(json.dumps(args))
|
|
989
|
+
start_time = time.time()
|
|
990
|
+
while True:
|
|
991
|
+
rsp = client.UpgradeBrokerVersion(model)
|
|
992
|
+
result = rsp.to_json_string()
|
|
993
|
+
try:
|
|
994
|
+
json_obj = json.loads(result)
|
|
995
|
+
except TypeError as e:
|
|
996
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
997
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
998
|
+
break
|
|
999
|
+
cur_time = time.time()
|
|
1000
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1001
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1002
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1003
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1004
|
+
else:
|
|
1005
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1006
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1007
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1008
|
+
|
|
1009
|
+
|
|
900
1010
|
def doDescribeInstances(args, parsed_globals):
|
|
901
1011
|
g_param = parse_global_arg(parsed_globals)
|
|
902
1012
|
|
|
@@ -1117,6 +1227,61 @@ def doCreateRoute(args, parsed_globals):
|
|
|
1117
1227
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1118
1228
|
|
|
1119
1229
|
|
|
1230
|
+
def doDeleteGroup(args, parsed_globals):
|
|
1231
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1232
|
+
|
|
1233
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1234
|
+
cred = credential.CVMRoleCredential()
|
|
1235
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1236
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1237
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1238
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1239
|
+
)
|
|
1240
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1241
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1242
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1243
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1244
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1245
|
+
else:
|
|
1246
|
+
cred = credential.Credential(
|
|
1247
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1248
|
+
)
|
|
1249
|
+
http_profile = HttpProfile(
|
|
1250
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1251
|
+
reqMethod="POST",
|
|
1252
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1253
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1254
|
+
)
|
|
1255
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1256
|
+
if g_param[OptionsDefine.Language]:
|
|
1257
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1258
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1259
|
+
client = mod.CkafkaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1260
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1261
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1262
|
+
model = models.DeleteGroupRequest()
|
|
1263
|
+
model.from_json_string(json.dumps(args))
|
|
1264
|
+
start_time = time.time()
|
|
1265
|
+
while True:
|
|
1266
|
+
rsp = client.DeleteGroup(model)
|
|
1267
|
+
result = rsp.to_json_string()
|
|
1268
|
+
try:
|
|
1269
|
+
json_obj = json.loads(result)
|
|
1270
|
+
except TypeError as e:
|
|
1271
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1272
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1273
|
+
break
|
|
1274
|
+
cur_time = time.time()
|
|
1275
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1276
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1277
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1278
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1279
|
+
else:
|
|
1280
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1281
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1282
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1283
|
+
|
|
1284
|
+
|
|
1120
1285
|
def doModifyDatahubTopic(args, parsed_globals):
|
|
1121
1286
|
g_param = parse_global_arg(parsed_globals)
|
|
1122
1287
|
|
|
@@ -1777,6 +1942,61 @@ def doDescribeTopicSubscribeGroup(args, parsed_globals):
|
|
|
1777
1942
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1778
1943
|
|
|
1779
1944
|
|
|
1945
|
+
def doModifyRoutineMaintenanceTask(args, parsed_globals):
|
|
1946
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1947
|
+
|
|
1948
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1949
|
+
cred = credential.CVMRoleCredential()
|
|
1950
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1951
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1952
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1953
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1954
|
+
)
|
|
1955
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1956
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1957
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1958
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1959
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1960
|
+
else:
|
|
1961
|
+
cred = credential.Credential(
|
|
1962
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1963
|
+
)
|
|
1964
|
+
http_profile = HttpProfile(
|
|
1965
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1966
|
+
reqMethod="POST",
|
|
1967
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1968
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1969
|
+
)
|
|
1970
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1971
|
+
if g_param[OptionsDefine.Language]:
|
|
1972
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1973
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1974
|
+
client = mod.CkafkaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1975
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1976
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1977
|
+
model = models.ModifyRoutineMaintenanceTaskRequest()
|
|
1978
|
+
model.from_json_string(json.dumps(args))
|
|
1979
|
+
start_time = time.time()
|
|
1980
|
+
while True:
|
|
1981
|
+
rsp = client.ModifyRoutineMaintenanceTask(model)
|
|
1982
|
+
result = rsp.to_json_string()
|
|
1983
|
+
try:
|
|
1984
|
+
json_obj = json.loads(result)
|
|
1985
|
+
except TypeError as e:
|
|
1986
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1987
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1988
|
+
break
|
|
1989
|
+
cur_time = time.time()
|
|
1990
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1991
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1992
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1993
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1994
|
+
else:
|
|
1995
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1996
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1997
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1998
|
+
|
|
1999
|
+
|
|
1780
2000
|
def doDeleteRouteTriggerTime(args, parsed_globals):
|
|
1781
2001
|
g_param = parse_global_arg(parsed_globals)
|
|
1782
2002
|
|
|
@@ -2107,7 +2327,7 @@ def doDeleteAcl(args, parsed_globals):
|
|
|
2107
2327
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2108
2328
|
|
|
2109
2329
|
|
|
2110
|
-
def
|
|
2330
|
+
def doInstanceScalingDown(args, parsed_globals):
|
|
2111
2331
|
g_param = parse_global_arg(parsed_globals)
|
|
2112
2332
|
|
|
2113
2333
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -2139,11 +2359,11 @@ def doDescribeAppInfo(args, parsed_globals):
|
|
|
2139
2359
|
client = mod.CkafkaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2140
2360
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
2141
2361
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2142
|
-
model = models.
|
|
2362
|
+
model = models.InstanceScalingDownRequest()
|
|
2143
2363
|
model.from_json_string(json.dumps(args))
|
|
2144
2364
|
start_time = time.time()
|
|
2145
2365
|
while True:
|
|
2146
|
-
rsp = client.
|
|
2366
|
+
rsp = client.InstanceScalingDown(model)
|
|
2147
2367
|
result = rsp.to_json_string()
|
|
2148
2368
|
try:
|
|
2149
2369
|
json_obj = json.loads(result)
|
|
@@ -2437,6 +2657,61 @@ def doBatchCreateAcl(args, parsed_globals):
|
|
|
2437
2657
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2438
2658
|
|
|
2439
2659
|
|
|
2660
|
+
def doDeleteAclRule(args, parsed_globals):
|
|
2661
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2662
|
+
|
|
2663
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2664
|
+
cred = credential.CVMRoleCredential()
|
|
2665
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2666
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2667
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2668
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2669
|
+
)
|
|
2670
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2671
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2672
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2673
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2674
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2675
|
+
else:
|
|
2676
|
+
cred = credential.Credential(
|
|
2677
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2678
|
+
)
|
|
2679
|
+
http_profile = HttpProfile(
|
|
2680
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2681
|
+
reqMethod="POST",
|
|
2682
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2683
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2684
|
+
)
|
|
2685
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2686
|
+
if g_param[OptionsDefine.Language]:
|
|
2687
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2688
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2689
|
+
client = mod.CkafkaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2690
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2691
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2692
|
+
model = models.DeleteAclRuleRequest()
|
|
2693
|
+
model.from_json_string(json.dumps(args))
|
|
2694
|
+
start_time = time.time()
|
|
2695
|
+
while True:
|
|
2696
|
+
rsp = client.DeleteAclRule(model)
|
|
2697
|
+
result = rsp.to_json_string()
|
|
2698
|
+
try:
|
|
2699
|
+
json_obj = json.loads(result)
|
|
2700
|
+
except TypeError as e:
|
|
2701
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2702
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2703
|
+
break
|
|
2704
|
+
cur_time = time.time()
|
|
2705
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2706
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2707
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2708
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2709
|
+
else:
|
|
2710
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2711
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2712
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2713
|
+
|
|
2714
|
+
|
|
2440
2715
|
def doModifyAclRule(args, parsed_globals):
|
|
2441
2716
|
g_param = parse_global_arg(parsed_globals)
|
|
2442
2717
|
|
|
@@ -3341,13 +3616,16 @@ ACTION_MAP = {
|
|
|
3341
3616
|
"DeleteRoute": doDeleteRoute,
|
|
3342
3617
|
"SendMessage": doSendMessage,
|
|
3343
3618
|
"DescribeUser": doDescribeUser,
|
|
3344
|
-
"CreateTopicIpWhiteList": doCreateTopicIpWhiteList,
|
|
3345
3619
|
"DescribeGroup": doDescribeGroup,
|
|
3620
|
+
"CreateTopicIpWhiteList": doCreateTopicIpWhiteList,
|
|
3621
|
+
"DescribeCkafkaVersion": doDescribeCkafkaVersion,
|
|
3346
3622
|
"ModifyGroupOffsets": doModifyGroupOffsets,
|
|
3623
|
+
"UpgradeBrokerVersion": doUpgradeBrokerVersion,
|
|
3347
3624
|
"DescribeInstances": doDescribeInstances,
|
|
3348
3625
|
"DescribeCvmInfo": doDescribeCvmInfo,
|
|
3349
3626
|
"DescribeDatahubTopic": doDescribeDatahubTopic,
|
|
3350
3627
|
"CreateRoute": doCreateRoute,
|
|
3628
|
+
"DeleteGroup": doDeleteGroup,
|
|
3351
3629
|
"ModifyDatahubTopic": doModifyDatahubTopic,
|
|
3352
3630
|
"FetchMessageListByOffset": doFetchMessageListByOffset,
|
|
3353
3631
|
"CreateDatahubTopic": doCreateDatahubTopic,
|
|
@@ -3360,18 +3638,20 @@ ACTION_MAP = {
|
|
|
3360
3638
|
"ModifyPassword": doModifyPassword,
|
|
3361
3639
|
"DescribeConsumerGroup": doDescribeConsumerGroup,
|
|
3362
3640
|
"DescribeTopicSubscribeGroup": doDescribeTopicSubscribeGroup,
|
|
3641
|
+
"ModifyRoutineMaintenanceTask": doModifyRoutineMaintenanceTask,
|
|
3363
3642
|
"DeleteRouteTriggerTime": doDeleteRouteTriggerTime,
|
|
3364
3643
|
"CreatePartition": doCreatePartition,
|
|
3365
3644
|
"CreateUser": doCreateUser,
|
|
3366
3645
|
"DescribeTaskStatus": doDescribeTaskStatus,
|
|
3367
3646
|
"BatchModifyGroupOffsets": doBatchModifyGroupOffsets,
|
|
3368
3647
|
"DeleteAcl": doDeleteAcl,
|
|
3369
|
-
"
|
|
3648
|
+
"InstanceScalingDown": doInstanceScalingDown,
|
|
3370
3649
|
"DescribeGroupOffsets": doDescribeGroupOffsets,
|
|
3371
3650
|
"DeleteInstancePre": doDeleteInstancePre,
|
|
3372
3651
|
"DescribeInstanceAttributes": doDescribeInstanceAttributes,
|
|
3373
3652
|
"DescribeInstancesDetail": doDescribeInstancesDetail,
|
|
3374
3653
|
"BatchCreateAcl": doBatchCreateAcl,
|
|
3654
|
+
"DeleteAclRule": doDeleteAclRule,
|
|
3375
3655
|
"ModifyAclRule": doModifyAclRule,
|
|
3376
3656
|
"DeleteUser": doDeleteUser,
|
|
3377
3657
|
"DescribeTopicSyncReplica": doDescribeTopicSyncReplica,
|