tccli-intl-en 3.0.1283.1__py2.py3-none-any.whl → 3.1.8.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/__init__.py +6 -0
- tccli/services/autoscaling/v20180419/api.json +36 -14
- 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/clb_client.py +636 -300
- tccli/services/clb/v20180317/api.json +2255 -1017
- tccli/services/clb/v20180317/examples.json +184 -124
- tccli/services/controlcenter/controlcenter_client.py +224 -0
- tccli/services/controlcenter/v20230110/api.json +528 -5
- tccli/services/controlcenter/v20230110/examples.json +32 -0
- tccli/services/cvm/v20170312/api.json +41 -41
- tccli/services/cvm/v20170312/examples.json +21 -21
- tccli/services/faceid/v20180301/api.json +31 -3
- tccli/services/kms/v20190118/api.json +80 -3
- tccli/services/kms/v20190118/examples.json +3 -3
- tccli/services/mdl/v20200326/api.json +165 -5
- tccli/services/mongodb/mongodb_client.py +1048 -96
- tccli/services/mongodb/v20190725/api.json +1765 -108
- tccli/services/mongodb/v20190725/examples.json +136 -0
- tccli/services/mps/mps_client.py +713 -209
- tccli/services/mps/v20190612/api.json +1009 -67
- tccli/services/mps/v20190612/examples.json +100 -52
- tccli/services/ocr/ocr_client.py +112 -0
- tccli/services/ocr/v20181119/api.json +550 -6
- tccli/services/ocr/v20181119/examples.json +22 -0
- tccli/services/smh/__init__.py +4 -0
- tccli/services/smh/smh_client.py +714 -0
- tccli/services/smh/v20210712/api.json +1287 -0
- tccli/services/smh/v20210712/examples.json +85 -0
- tccli/services/tdmq/tdmq_client.py +2406 -278
- tccli/services/tdmq/v20200217/api.json +11607 -3958
- tccli/services/tdmq/v20200217/examples.json +562 -264
- tccli/services/teo/v20220901/api.json +68 -4
- tccli/services/teo/v20220901/examples.json +28 -22
- tccli/services/trocket/__init__.py +4 -0
- tccli/services/trocket/trocket_client.py +2450 -0
- tccli/services/trocket/v20230308/api.json +6062 -0
- tccli/services/trocket/v20230308/examples.json +339 -0
- tccli/services/trtc/v20190722/api.json +5 -5
- tccli/services/vpc/v20170312/api.json +19 -16
- tccli/services/vpc/v20170312/examples.json +4 -4
- {tccli_intl_en-3.0.1283.1.dist-info → tccli_intl_en-3.1.8.1.dist-info}/METADATA +2 -2
- {tccli_intl_en-3.0.1283.1.dist-info → tccli_intl_en-3.1.8.1.dist-info}/RECORD +49 -41
- {tccli_intl_en-3.0.1283.1.dist-info → tccli_intl_en-3.1.8.1.dist-info}/LICENSE +0 -0
- {tccli_intl_en-3.0.1283.1.dist-info → tccli_intl_en-3.1.8.1.dist-info}/WHEEL +0 -0
- {tccli_intl_en-3.0.1283.1.dist-info → tccli_intl_en-3.1.8.1.dist-info}/entry_points.txt +0 -0
- {tccli_intl_en-3.0.1283.1.dist-info → tccli_intl_en-3.1.8.1.dist-info}/top_level.txt +0 -0
tccli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '3.
|
|
1
|
+
__version__ = '3.1.8.1'
|
tccli/services/__init__.py
CHANGED
|
@@ -313,6 +313,9 @@ SERVICE_VERSIONS = {
|
|
|
313
313
|
"ses": [
|
|
314
314
|
"2020-10-02"
|
|
315
315
|
],
|
|
316
|
+
"smh": [
|
|
317
|
+
"2021-07-12"
|
|
318
|
+
],
|
|
316
319
|
"sms": [
|
|
317
320
|
"2021-01-11",
|
|
318
321
|
"2019-07-11"
|
|
@@ -389,6 +392,9 @@ SERVICE_VERSIONS = {
|
|
|
389
392
|
"trabbit": [
|
|
390
393
|
"2023-04-18"
|
|
391
394
|
],
|
|
395
|
+
"trocket": [
|
|
396
|
+
"2023-03-08"
|
|
397
|
+
],
|
|
392
398
|
"trro": [
|
|
393
399
|
"2022-03-25"
|
|
394
400
|
],
|
|
@@ -1556,7 +1556,7 @@
|
|
|
1556
1556
|
{
|
|
1557
1557
|
"disabled": false,
|
|
1558
1558
|
"document": "Specifies the list of load balancers with a current maximum length of 100. either LoadBalancerIds or ForwardLoadBalancers can be specified at the same time.",
|
|
1559
|
-
"example": "
|
|
1559
|
+
"example": "无",
|
|
1560
1560
|
"member": "ForwardLoadBalancer",
|
|
1561
1561
|
"name": "ForwardLoadBalancers",
|
|
1562
1562
|
"required": false,
|
|
@@ -1574,7 +1574,7 @@
|
|
|
1574
1574
|
{
|
|
1575
1575
|
"disabled": false,
|
|
1576
1576
|
"document": "Termination policy, whose maximum length is currently 1. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE. Default value: OLDEST_INSTANCE.\n<li>OLDEST_INSTANCE: Terminate the oldest instance in the scaling group first.</li>\n<li>NEWEST_INSTANCE: Terminate the newest instance in the scaling group first.</li>",
|
|
1577
|
-
"example": "OLDEST_INSTANCE",
|
|
1577
|
+
"example": "[\"OLDEST_INSTANCE\"]",
|
|
1578
1578
|
"member": "string",
|
|
1579
1579
|
"name": "TerminationPolicies",
|
|
1580
1580
|
"required": false,
|
|
@@ -1610,7 +1610,7 @@
|
|
|
1610
1610
|
{
|
|
1611
1611
|
"disabled": false,
|
|
1612
1612
|
"document": "List of Tag descriptions. by specifying this parameter, you can bind tags to a scaling group and corresponding resource instances. each scaling group supports up to 30 tags. you can call the [GetTags](https://intl.cloud.tencent.com/document/product/651/72275?from_cn_redirect=1) API to retrieve existing Tag key-value pairs based on the response.",
|
|
1613
|
-
"example": "
|
|
1613
|
+
"example": "无",
|
|
1614
1614
|
"member": "Tag",
|
|
1615
1615
|
"name": "Tags",
|
|
1616
1616
|
"required": false,
|
|
@@ -1619,7 +1619,7 @@
|
|
|
1619
1619
|
{
|
|
1620
1620
|
"disabled": false,
|
|
1621
1621
|
"document": "Service settings such as unhealthy instance replacement.",
|
|
1622
|
-
"example": "
|
|
1622
|
+
"example": "无",
|
|
1623
1623
|
"member": "ServiceSettings",
|
|
1624
1624
|
"name": "ServiceSettings",
|
|
1625
1625
|
"required": false,
|
|
@@ -1673,7 +1673,7 @@
|
|
|
1673
1673
|
{
|
|
1674
1674
|
"disabled": false,
|
|
1675
1675
|
"document": "Specifies how to assign pay-as-you-go instances and spot instances.\nThis parameter is valid only when `InstanceAllocationPolicy ` is set to `SPOT_MIXED`.",
|
|
1676
|
-
"example": "
|
|
1676
|
+
"example": "无",
|
|
1677
1677
|
"member": "SpotMixedAllocationPolicy",
|
|
1678
1678
|
"name": "SpotMixedAllocationPolicy",
|
|
1679
1679
|
"required": false,
|
|
@@ -1691,7 +1691,7 @@
|
|
|
1691
1691
|
{
|
|
1692
1692
|
"disabled": false,
|
|
1693
1693
|
"document": "Instance name sequencing settings. If this parameter is not specified, the default is not enabled. When enabled, an incremental numeric sequence will be appended to the names of instances automatically created within the scaling group.",
|
|
1694
|
-
"example": "
|
|
1694
|
+
"example": "无",
|
|
1695
1695
|
"member": "InstanceNameIndexSettings",
|
|
1696
1696
|
"name": "InstanceNameIndexSettings",
|
|
1697
1697
|
"required": false,
|
|
@@ -4331,12 +4331,12 @@
|
|
|
4331
4331
|
"usage": "both"
|
|
4332
4332
|
},
|
|
4333
4333
|
"InstanceNameIndexSettings": {
|
|
4334
|
-
"document": "Instance name
|
|
4334
|
+
"document": "Instance name index settings.",
|
|
4335
4335
|
"members": [
|
|
4336
4336
|
{
|
|
4337
4337
|
"disabled": false,
|
|
4338
|
-
"document": "Whether to enable instance
|
|
4339
|
-
"example": "
|
|
4338
|
+
"document": "Whether to enable instance name index. Default value: false. Value range:.\n\n**true**: indicates that instance name index is enabled.\n**false**: indicates that instance name index is disabled.\nNote: This field may return null, indicating that no valid values can be obtained.",
|
|
4339
|
+
"example": "false",
|
|
4340
4340
|
"member": "bool",
|
|
4341
4341
|
"name": "Enabled",
|
|
4342
4342
|
"output_required": false,
|
|
@@ -4346,7 +4346,7 @@
|
|
|
4346
4346
|
},
|
|
4347
4347
|
{
|
|
4348
4348
|
"disabled": false,
|
|
4349
|
-
"document": "
|
|
4349
|
+
"document": "Begin index number. Value range: [0, 99999999].\n\nIndicates that the scale out activity will be failed when the index out of range. \nIf not specified, carries forward historical index number or 0.\nLowering the index sequence number may lead to instance name duplication within the group.\nNote: This field may return null, indicating that no valid values can be obtained.",
|
|
4350
4350
|
"example": "0",
|
|
4351
4351
|
"member": "int64",
|
|
4352
4352
|
"name": "BeginIndex",
|
|
@@ -4354,6 +4354,17 @@
|
|
|
4354
4354
|
"required": false,
|
|
4355
4355
|
"type": "int",
|
|
4356
4356
|
"value_allowed_null": true
|
|
4357
|
+
},
|
|
4358
|
+
{
|
|
4359
|
+
"disabled": false,
|
|
4360
|
+
"document": "Instance name index number digits, defaults to 0, means no specified digit count. Value range: 0-8, maximum is integer 8. when using values 1-8, the system checks whether the index number exceeds the maximum digit for this digit count.\n\nIf set to 3, index number is in the format: 000, 001, 002 ... 010, 011 ... 100 ... 999. The maximum is 999. \nAssuming set to 0, the index number is 0, 1, 2 ... 10, 11 ... 100 ... 1000 ...10000 ... 99999999. Max number is 99999999.",
|
|
4361
|
+
"example": "0",
|
|
4362
|
+
"member": "uint64",
|
|
4363
|
+
"name": "IndexLength",
|
|
4364
|
+
"output_required": false,
|
|
4365
|
+
"required": false,
|
|
4366
|
+
"type": "int",
|
|
4367
|
+
"value_allowed_null": false
|
|
4357
4368
|
}
|
|
4358
4369
|
],
|
|
4359
4370
|
"usage": "both"
|
|
@@ -7263,7 +7274,7 @@
|
|
|
7263
7274
|
{
|
|
7264
7275
|
"disabled": false,
|
|
7265
7276
|
"document": "Enables unhealthy instance replacement. If this feature is enabled, AS will replace instances that are flagged as unhealthy by Cloud Monitor. If this parameter is not specified, the value will be False by default.",
|
|
7266
|
-
"example": "
|
|
7277
|
+
"example": "false",
|
|
7267
7278
|
"member": "bool",
|
|
7268
7279
|
"name": "ReplaceMonitorUnhealthy",
|
|
7269
7280
|
"output_required": true,
|
|
@@ -7285,7 +7296,7 @@
|
|
|
7285
7296
|
{
|
|
7286
7297
|
"disabled": false,
|
|
7287
7298
|
"document": "Enable unhealthy instance replacement. If this feature is enabled, AS will replace instances that are found unhealthy in the CLB health check. If this parameter is not specified, the default value `False` will be used.",
|
|
7288
|
-
"example": "
|
|
7299
|
+
"example": "false",
|
|
7289
7300
|
"member": "bool",
|
|
7290
7301
|
"name": "ReplaceLoadBalancerUnhealthy",
|
|
7291
7302
|
"output_required": true,
|
|
@@ -7307,7 +7318,7 @@
|
|
|
7307
7318
|
{
|
|
7308
7319
|
"disabled": false,
|
|
7309
7320
|
"document": "Automatic instance Tag update. the default value is False. if this feature is enabled, tags of running instances in a scaling group will be updated as well if the scaling group tags are updated. (this feature takes effect for Tag creation and editing but not Tag deletion.) the update does not take effect immediately due to certain latency.",
|
|
7310
|
-
"example": "
|
|
7321
|
+
"example": "false",
|
|
7311
7322
|
"member": "bool",
|
|
7312
7323
|
"name": "AutoUpdateInstanceTags",
|
|
7313
7324
|
"output_required": false,
|
|
@@ -7318,13 +7329,24 @@
|
|
|
7318
7329
|
{
|
|
7319
7330
|
"disabled": false,
|
|
7320
7331
|
"document": "Expected number of instances sync minimum and maximum value. default value is False. this parameter only takes effect in scenarios where the expected number is not passed in to modify scaling group api.\n<Li>True: when modifying the maximum or minimum value, if a conflict exists with the current expected value, synchronously adjust the expected value. for example, if the input minimum value is 2 while the current expected value is 1, the expected value will be synchronously adjusted to 2.</li>.\n<Li>False: if a conflict exists between the current expected value when modifying the maximum or minimum value, an error message indicates it is not allowed to be modified.</li>.",
|
|
7321
|
-
"example": "
|
|
7332
|
+
"example": "false",
|
|
7322
7333
|
"member": "bool",
|
|
7323
7334
|
"name": "DesiredCapacitySyncWithMaxMinSize",
|
|
7324
7335
|
"output_required": true,
|
|
7325
7336
|
"required": false,
|
|
7326
7337
|
"type": "bool",
|
|
7327
7338
|
"value_allowed_null": false
|
|
7339
|
+
},
|
|
7340
|
+
{
|
|
7341
|
+
"disabled": false,
|
|
7342
|
+
"document": "Scaling in unhealthy instances first. If enabled, preferentially selects unhealthy instances during scale in. Default value: False.",
|
|
7343
|
+
"example": "false",
|
|
7344
|
+
"member": "bool",
|
|
7345
|
+
"name": "PriorityScaleInUnhealthy",
|
|
7346
|
+
"output_required": false,
|
|
7347
|
+
"required": false,
|
|
7348
|
+
"type": "bool",
|
|
7349
|
+
"value_allowed_null": false
|
|
7328
7350
|
}
|
|
7329
7351
|
],
|
|
7330
7352
|
"usage": "both"
|
|
@@ -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,
|