tccli-intl-en 3.0.1270.1__py2.py3-none-any.whl → 3.0.1271.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 +2 -1
- tccli/services/ccc/ccc_client.py +65 -12
- tccli/services/ccc/v20200210/api.json +112 -15
- tccli/services/ccc/v20200210/examples.json +8 -0
- tccli/services/clb/v20180317/api.json +29 -14
- tccli/services/cynosdb/cynosdb_client.py +114 -8
- tccli/services/cynosdb/v20190107/api.json +718 -54
- tccli/services/cynosdb/v20190107/examples.json +20 -4
- tccli/services/dlc/dlc_client.py +175 -16
- tccli/services/dlc/v20210125/api.json +282 -6
- tccli/services/dlc/v20210125/examples.json +24 -0
- tccli/services/faceid/v20180301/examples.json +1 -1
- tccli/services/mdl/v20200326/api.json +104 -0
- tccli/services/monitor/monitor_client.py +273 -8
- tccli/services/monitor/v20180724/api.json +649 -0
- tccli/services/monitor/v20180724/examples.json +40 -0
- tccli/services/mps/v20190612/api.json +179 -30
- tccli/services/mps/v20190612/examples.json +8 -8
- tccli/services/quota/v20241204/api.json +13 -2
- tccli/services/quota/v20241204/examples.json +4 -3
- tccli/services/redis/v20180412/api.json +225 -113
- tccli/services/redis/v20180412/examples.json +19 -19
- tccli/services/wedata/v20250806/api.json +13644 -0
- tccli/services/wedata/v20250806/examples.json +621 -0
- tccli/services/wedata/wedata_client.py +4663 -789
- {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1271.1.dist-info}/METADATA +2 -2
- {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1271.1.dist-info}/RECORD +32 -30
- {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1271.1.dist-info}/LICENSE +0 -0
- {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1271.1.dist-info}/WHEEL +0 -0
- {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1271.1.dist-info}/entry_points.txt +0 -0
- {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1271.1.dist-info}/top_level.txt +0 -0
|
@@ -329,6 +329,58 @@ def doModifyPrometheusAlertPolicy(args, parsed_globals):
|
|
|
329
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
330
330
|
|
|
331
331
|
|
|
332
|
+
def doDescribePrometheusAlertGroups(args, parsed_globals):
|
|
333
|
+
g_param = parse_global_arg(parsed_globals)
|
|
334
|
+
|
|
335
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
336
|
+
cred = credential.CVMRoleCredential()
|
|
337
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
338
|
+
cred = credential.STSAssumeRoleCredential(
|
|
339
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
340
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
341
|
+
)
|
|
342
|
+
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):
|
|
343
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
344
|
+
else:
|
|
345
|
+
cred = credential.Credential(
|
|
346
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
347
|
+
)
|
|
348
|
+
http_profile = HttpProfile(
|
|
349
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
350
|
+
reqMethod="POST",
|
|
351
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
352
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
353
|
+
)
|
|
354
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
355
|
+
if g_param[OptionsDefine.Language]:
|
|
356
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
357
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
358
|
+
client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
|
|
359
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
360
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
361
|
+
model = models.DescribePrometheusAlertGroupsRequest()
|
|
362
|
+
model.from_json_string(json.dumps(args))
|
|
363
|
+
start_time = time.time()
|
|
364
|
+
while True:
|
|
365
|
+
rsp = client.DescribePrometheusAlertGroups(model)
|
|
366
|
+
result = rsp.to_json_string()
|
|
367
|
+
try:
|
|
368
|
+
json_obj = json.loads(result)
|
|
369
|
+
except TypeError as e:
|
|
370
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
371
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
372
|
+
break
|
|
373
|
+
cur_time = time.time()
|
|
374
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
375
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
376
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
377
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
378
|
+
else:
|
|
379
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
380
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
381
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
382
|
+
|
|
383
|
+
|
|
332
384
|
def doDescribePrometheusInstanceUsage(args, parsed_globals):
|
|
333
385
|
g_param = parse_global_arg(parsed_globals)
|
|
334
386
|
|
|
@@ -485,6 +537,110 @@ def doBindingPolicyObject(args, parsed_globals):
|
|
|
485
537
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
486
538
|
|
|
487
539
|
|
|
540
|
+
def doDeletePrometheusAlertGroups(args, parsed_globals):
|
|
541
|
+
g_param = parse_global_arg(parsed_globals)
|
|
542
|
+
|
|
543
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
544
|
+
cred = credential.CVMRoleCredential()
|
|
545
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
546
|
+
cred = credential.STSAssumeRoleCredential(
|
|
547
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
548
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
549
|
+
)
|
|
550
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
551
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
552
|
+
else:
|
|
553
|
+
cred = credential.Credential(
|
|
554
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
555
|
+
)
|
|
556
|
+
http_profile = HttpProfile(
|
|
557
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
558
|
+
reqMethod="POST",
|
|
559
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
560
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
561
|
+
)
|
|
562
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
563
|
+
if g_param[OptionsDefine.Language]:
|
|
564
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
565
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
566
|
+
client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
|
|
567
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
568
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
569
|
+
model = models.DeletePrometheusAlertGroupsRequest()
|
|
570
|
+
model.from_json_string(json.dumps(args))
|
|
571
|
+
start_time = time.time()
|
|
572
|
+
while True:
|
|
573
|
+
rsp = client.DeletePrometheusAlertGroups(model)
|
|
574
|
+
result = rsp.to_json_string()
|
|
575
|
+
try:
|
|
576
|
+
json_obj = json.loads(result)
|
|
577
|
+
except TypeError as e:
|
|
578
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
579
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
580
|
+
break
|
|
581
|
+
cur_time = time.time()
|
|
582
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
583
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
584
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
585
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
586
|
+
else:
|
|
587
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
588
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
589
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
def doDescribePolicyGroupInfo(args, parsed_globals):
|
|
593
|
+
g_param = parse_global_arg(parsed_globals)
|
|
594
|
+
|
|
595
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
596
|
+
cred = credential.CVMRoleCredential()
|
|
597
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
598
|
+
cred = credential.STSAssumeRoleCredential(
|
|
599
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
600
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
601
|
+
)
|
|
602
|
+
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):
|
|
603
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
604
|
+
else:
|
|
605
|
+
cred = credential.Credential(
|
|
606
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
607
|
+
)
|
|
608
|
+
http_profile = HttpProfile(
|
|
609
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
610
|
+
reqMethod="POST",
|
|
611
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
612
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
613
|
+
)
|
|
614
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
615
|
+
if g_param[OptionsDefine.Language]:
|
|
616
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
617
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
618
|
+
client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
|
|
619
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
620
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
621
|
+
model = models.DescribePolicyGroupInfoRequest()
|
|
622
|
+
model.from_json_string(json.dumps(args))
|
|
623
|
+
start_time = time.time()
|
|
624
|
+
while True:
|
|
625
|
+
rsp = client.DescribePolicyGroupInfo(model)
|
|
626
|
+
result = rsp.to_json_string()
|
|
627
|
+
try:
|
|
628
|
+
json_obj = json.loads(result)
|
|
629
|
+
except TypeError as e:
|
|
630
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
631
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
632
|
+
break
|
|
633
|
+
cur_time = time.time()
|
|
634
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
635
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
636
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
637
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
638
|
+
else:
|
|
639
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
640
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
641
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
642
|
+
|
|
643
|
+
|
|
488
644
|
def doCreateGrafanaInstance(args, parsed_globals):
|
|
489
645
|
g_param = parse_global_arg(parsed_globals)
|
|
490
646
|
|
|
@@ -4489,7 +4645,7 @@ def doDescribeDNSConfig(args, parsed_globals):
|
|
|
4489
4645
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
4490
4646
|
|
|
4491
4647
|
|
|
4492
|
-
def
|
|
4648
|
+
def doCreatePrometheusAlertGroup(args, parsed_globals):
|
|
4493
4649
|
g_param = parse_global_arg(parsed_globals)
|
|
4494
4650
|
|
|
4495
4651
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -4518,11 +4674,63 @@ def doModifyPrometheusGlobalNotification(args, parsed_globals):
|
|
|
4518
4674
|
client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
|
|
4519
4675
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
4520
4676
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
4521
|
-
model = models.
|
|
4677
|
+
model = models.CreatePrometheusAlertGroupRequest()
|
|
4522
4678
|
model.from_json_string(json.dumps(args))
|
|
4523
4679
|
start_time = time.time()
|
|
4524
4680
|
while True:
|
|
4525
|
-
rsp = client.
|
|
4681
|
+
rsp = client.CreatePrometheusAlertGroup(model)
|
|
4682
|
+
result = rsp.to_json_string()
|
|
4683
|
+
try:
|
|
4684
|
+
json_obj = json.loads(result)
|
|
4685
|
+
except TypeError as e:
|
|
4686
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
4687
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
4688
|
+
break
|
|
4689
|
+
cur_time = time.time()
|
|
4690
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
4691
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
4692
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
4693
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
4694
|
+
else:
|
|
4695
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
4696
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
4697
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
4698
|
+
|
|
4699
|
+
|
|
4700
|
+
def doUpdatePrometheusAlertGroupState(args, parsed_globals):
|
|
4701
|
+
g_param = parse_global_arg(parsed_globals)
|
|
4702
|
+
|
|
4703
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
4704
|
+
cred = credential.CVMRoleCredential()
|
|
4705
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
4706
|
+
cred = credential.STSAssumeRoleCredential(
|
|
4707
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
4708
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
4709
|
+
)
|
|
4710
|
+
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):
|
|
4711
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
4712
|
+
else:
|
|
4713
|
+
cred = credential.Credential(
|
|
4714
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
4715
|
+
)
|
|
4716
|
+
http_profile = HttpProfile(
|
|
4717
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
4718
|
+
reqMethod="POST",
|
|
4719
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
4720
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
4721
|
+
)
|
|
4722
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
4723
|
+
if g_param[OptionsDefine.Language]:
|
|
4724
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
4725
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
4726
|
+
client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
|
|
4727
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
4728
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
4729
|
+
model = models.UpdatePrometheusAlertGroupStateRequest()
|
|
4730
|
+
model.from_json_string(json.dumps(args))
|
|
4731
|
+
start_time = time.time()
|
|
4732
|
+
while True:
|
|
4733
|
+
rsp = client.UpdatePrometheusAlertGroupState(model)
|
|
4526
4734
|
result = rsp.to_json_string()
|
|
4527
4735
|
try:
|
|
4528
4736
|
json_obj = json.loads(result)
|
|
@@ -4853,6 +5061,58 @@ def doUpdateGrafanaConfig(args, parsed_globals):
|
|
|
4853
5061
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
4854
5062
|
|
|
4855
5063
|
|
|
5064
|
+
def doUpdatePrometheusAlertGroup(args, parsed_globals):
|
|
5065
|
+
g_param = parse_global_arg(parsed_globals)
|
|
5066
|
+
|
|
5067
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
5068
|
+
cred = credential.CVMRoleCredential()
|
|
5069
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
5070
|
+
cred = credential.STSAssumeRoleCredential(
|
|
5071
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
5072
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
5073
|
+
)
|
|
5074
|
+
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):
|
|
5075
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
5076
|
+
else:
|
|
5077
|
+
cred = credential.Credential(
|
|
5078
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
5079
|
+
)
|
|
5080
|
+
http_profile = HttpProfile(
|
|
5081
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
5082
|
+
reqMethod="POST",
|
|
5083
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
5084
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
5085
|
+
)
|
|
5086
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
5087
|
+
if g_param[OptionsDefine.Language]:
|
|
5088
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
5089
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
5090
|
+
client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
|
|
5091
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
5092
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
5093
|
+
model = models.UpdatePrometheusAlertGroupRequest()
|
|
5094
|
+
model.from_json_string(json.dumps(args))
|
|
5095
|
+
start_time = time.time()
|
|
5096
|
+
while True:
|
|
5097
|
+
rsp = client.UpdatePrometheusAlertGroup(model)
|
|
5098
|
+
result = rsp.to_json_string()
|
|
5099
|
+
try:
|
|
5100
|
+
json_obj = json.loads(result)
|
|
5101
|
+
except TypeError as e:
|
|
5102
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
5103
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
5104
|
+
break
|
|
5105
|
+
cur_time = time.time()
|
|
5106
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
5107
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
5108
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
5109
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
5110
|
+
else:
|
|
5111
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
5112
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
5113
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
5114
|
+
|
|
5115
|
+
|
|
4856
5116
|
def doDescribeGrafanaNotificationChannels(args, parsed_globals):
|
|
4857
5117
|
g_param = parse_global_arg(parsed_globals)
|
|
4858
5118
|
|
|
@@ -6517,7 +6777,7 @@ def doDescribePrometheusConfig(args, parsed_globals):
|
|
|
6517
6777
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
6518
6778
|
|
|
6519
6779
|
|
|
6520
|
-
def
|
|
6780
|
+
def doModifyPrometheusGlobalNotification(args, parsed_globals):
|
|
6521
6781
|
g_param = parse_global_arg(parsed_globals)
|
|
6522
6782
|
|
|
6523
6783
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -6546,11 +6806,11 @@ def doDescribePolicyGroupInfo(args, parsed_globals):
|
|
|
6546
6806
|
client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
|
|
6547
6807
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
6548
6808
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
6549
|
-
model = models.
|
|
6809
|
+
model = models.ModifyPrometheusGlobalNotificationRequest()
|
|
6550
6810
|
model.from_json_string(json.dumps(args))
|
|
6551
6811
|
start_time = time.time()
|
|
6552
6812
|
while True:
|
|
6553
|
-
rsp = client.
|
|
6813
|
+
rsp = client.ModifyPrometheusGlobalNotification(model)
|
|
6554
6814
|
result = rsp.to_json_string()
|
|
6555
6815
|
try:
|
|
6556
6816
|
json_obj = json.loads(result)
|
|
@@ -7522,9 +7782,12 @@ ACTION_MAP = {
|
|
|
7522
7782
|
"DescribeBindingPolicyObjectList": doDescribeBindingPolicyObjectList,
|
|
7523
7783
|
"UpdateAlertRule": doUpdateAlertRule,
|
|
7524
7784
|
"ModifyPrometheusAlertPolicy": doModifyPrometheusAlertPolicy,
|
|
7785
|
+
"DescribePrometheusAlertGroups": doDescribePrometheusAlertGroups,
|
|
7525
7786
|
"DescribePrometheusInstanceUsage": doDescribePrometheusInstanceUsage,
|
|
7526
7787
|
"ModifyAlarmReceivers": doModifyAlarmReceivers,
|
|
7527
7788
|
"BindingPolicyObject": doBindingPolicyObject,
|
|
7789
|
+
"DeletePrometheusAlertGroups": doDeletePrometheusAlertGroups,
|
|
7790
|
+
"DescribePolicyGroupInfo": doDescribePolicyGroupInfo,
|
|
7528
7791
|
"CreateGrafanaInstance": doCreateGrafanaInstance,
|
|
7529
7792
|
"DescribeBasicAlarmList": doDescribeBasicAlarmList,
|
|
7530
7793
|
"DescribePrometheusRecordRuleYaml": doDescribePrometheusRecordRuleYaml,
|
|
@@ -7602,13 +7865,15 @@ ACTION_MAP = {
|
|
|
7602
7865
|
"UpgradeGrafanaDashboard": doUpgradeGrafanaDashboard,
|
|
7603
7866
|
"DescribeAlarmNotices": doDescribeAlarmNotices,
|
|
7604
7867
|
"DescribeDNSConfig": doDescribeDNSConfig,
|
|
7605
|
-
"
|
|
7868
|
+
"CreatePrometheusAlertGroup": doCreatePrometheusAlertGroup,
|
|
7869
|
+
"UpdatePrometheusAlertGroupState": doUpdatePrometheusAlertGroupState,
|
|
7606
7870
|
"DescribePrometheusAgentInstances": doDescribePrometheusAgentInstances,
|
|
7607
7871
|
"DeletePrometheusRecordRuleYaml": doDeletePrometheusRecordRuleYaml,
|
|
7608
7872
|
"DescribePrometheusInstances": doDescribePrometheusInstances,
|
|
7609
7873
|
"DescribeGrafanaInstances": doDescribeGrafanaInstances,
|
|
7610
7874
|
"ModifyPrometheusRecordRuleYaml": doModifyPrometheusRecordRuleYaml,
|
|
7611
7875
|
"UpdateGrafanaConfig": doUpdateGrafanaConfig,
|
|
7876
|
+
"UpdatePrometheusAlertGroup": doUpdatePrometheusAlertGroup,
|
|
7612
7877
|
"DescribeGrafanaNotificationChannels": doDescribeGrafanaNotificationChannels,
|
|
7613
7878
|
"ModifyPrometheusAgentExternalLabels": doModifyPrometheusAgentExternalLabels,
|
|
7614
7879
|
"ModifyPolicyGroup": doModifyPolicyGroup,
|
|
@@ -7641,7 +7906,7 @@ ACTION_MAP = {
|
|
|
7641
7906
|
"DescribeServiceDiscovery": doDescribeServiceDiscovery,
|
|
7642
7907
|
"RunPrometheusInstance": doRunPrometheusInstance,
|
|
7643
7908
|
"DescribePrometheusConfig": doDescribePrometheusConfig,
|
|
7644
|
-
"
|
|
7909
|
+
"ModifyPrometheusGlobalNotification": doModifyPrometheusGlobalNotification,
|
|
7645
7910
|
"UpdateExporterIntegration": doUpdateExporterIntegration,
|
|
7646
7911
|
"DescribeAllNamespaces": doDescribeAllNamespaces,
|
|
7647
7912
|
"CreateServiceDiscovery": doCreateServiceDiscovery,
|