tccli 3.0.1181.1__py2.py3-none-any.whl → 3.0.1183.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/__init__.py +3 -0
- tccli/services/ams/v20201229/api.json +20 -0
- tccli/services/ams/v20201229/examples.json +1 -1
- tccli/services/asr/asr_client.py +229 -17
- tccli/services/asr/v20190614/api.json +379 -0
- tccli/services/asr/v20190614/examples.json +32 -0
- tccli/services/batch/v20170312/api.json +1 -1
- tccli/services/bi/v20220105/api.json +10 -0
- tccli/services/cdb/cdb_client.py +106 -0
- tccli/services/cdb/v20170320/api.json +185 -0
- tccli/services/cdb/v20170320/examples.json +17 -1
- tccli/services/cdwdoris/v20211228/api.json +70 -8
- tccli/services/cdwdoris/v20211228/examples.json +2 -2
- tccli/services/cfg/v20210820/api.json +134 -11
- tccli/services/cfw/cfw_client.py +53 -0
- tccli/services/cfw/v20190904/api.json +44 -0
- tccli/services/cfw/v20190904/examples.json +8 -0
- tccli/services/ckafka/v20190819/api.json +46 -16
- tccli/services/ckafka/v20190819/examples.json +8 -8
- tccli/services/clb/v20180317/api.json +99 -2
- tccli/services/cls/v20201016/api.json +1 -1
- tccli/services/controlcenter/__init__.py +4 -0
- tccli/services/controlcenter/controlcenter_client.py +195 -0
- tccli/services/controlcenter/v20230110/api.json +82 -0
- tccli/services/controlcenter/v20230110/examples.json +13 -0
- tccli/services/csip/v20221121/api.json +308 -1
- tccli/services/cvm/v20170312/api.json +20 -20
- tccli/services/cvm/v20170312/examples.json +1 -1
- tccli/services/cwp/v20180228/api.json +3 -3
- tccli/services/cwp/v20180228/examples.json +1 -1
- tccli/services/cynosdb/cynosdb_client.py +110 -4
- tccli/services/cynosdb/v20190107/api.json +296 -11
- tccli/services/cynosdb/v20190107/examples.json +19 -3
- tccli/services/dasb/v20191018/api.json +20 -1
- tccli/services/dbbrain/v20210527/api.json +15 -15
- tccli/services/dc/v20180410/api.json +117 -73
- tccli/services/dc/v20180410/examples.json +11 -11
- tccli/services/dcdb/dcdb_client.py +53 -0
- tccli/services/dcdb/v20180411/api.json +54 -0
- tccli/services/dcdb/v20180411/examples.json +8 -0
- tccli/services/emr/emr_client.py +53 -0
- tccli/services/emr/v20190103/api.json +52 -0
- tccli/services/emr/v20190103/examples.json +8 -0
- tccli/services/es/es_client.py +53 -0
- tccli/services/es/v20180416/api.json +64 -1
- tccli/services/es/v20180416/examples.json +8 -0
- tccli/services/ess/v20201111/api.json +1 -1
- tccli/services/essbasic/v20210526/api.json +9 -9
- tccli/services/hunyuan/hunyuan_client.py +106 -0
- tccli/services/hunyuan/v20230901/api.json +236 -1
- tccli/services/hunyuan/v20230901/examples.json +16 -0
- tccli/services/ims/v20201229/api.json +1 -1
- tccli/services/iotexplorer/v20190423/api.json +2 -2
- tccli/services/iss/v20230517/api.json +18 -0
- tccli/services/iss/v20230517/examples.json +3 -3
- tccli/services/lke/v20231130/api.json +141 -2
- tccli/services/mariadb/mariadb_client.py +57 -4
- tccli/services/mariadb/v20170312/api.json +54 -0
- tccli/services/mariadb/v20170312/examples.json +8 -0
- tccli/services/oceanus/v20190422/api.json +10 -0
- tccli/services/ocr/v20181119/api.json +7 -7
- tccli/services/organization/organization_client.py +53 -0
- tccli/services/organization/v20210331/api.json +43 -0
- tccli/services/organization/v20210331/examples.json +8 -0
- tccli/services/postgres/v20170312/api.json +3 -0
- tccli/services/redis/v20180412/api.json +16 -16
- tccli/services/scf/v20180416/api.json +26 -16
- tccli/services/ses/v20201002/api.json +148 -11
- tccli/services/sms/v20190711/api.json +49 -49
- tccli/services/sms/v20190711/examples.json +2 -2
- tccli/services/ssl/v20191205/api.json +3 -3
- tccli/services/ssl/v20191205/examples.json +2 -2
- tccli/services/tdmq/v20200217/api.json +180 -93
- tccli/services/tdmq/v20200217/examples.json +8 -8
- tccli/services/tke/v20180525/api.json +14 -2
- tccli/services/tke/v20180525/examples.json +3 -3
- tccli/services/tms/tms_client.py +0 -53
- tccli/services/tms/v20201229/api.json +2 -46
- tccli/services/tms/v20201229/examples.json +0 -8
- tccli/services/tmt/v20180321/api.json +4 -4
- tccli/services/trocket/v20230308/api.json +62 -12
- tccli/services/vpc/v20170312/api.json +23 -0
- tccli/services/wedata/v20210820/api.json +1909 -175
- tccli/services/wedata/v20210820/examples.json +62 -0
- tccli/services/wedata/wedata_client.py +387 -16
- {tccli-3.0.1181.1.dist-info → tccli-3.0.1183.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1181.1.dist-info → tccli-3.0.1183.1.dist-info}/RECORD +91 -87
- {tccli-3.0.1181.1.dist-info → tccli-3.0.1183.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1181.1.dist-info → tccli-3.0.1183.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1181.1.dist-info → tccli-3.0.1183.1.dist-info}/license_files/LICENSE +0 -0
@@ -2757,6 +2757,15 @@
|
|
2757
2757
|
"name": "SnatEnable",
|
2758
2758
|
"required": false,
|
2759
2759
|
"type": "bool"
|
2760
|
+
},
|
2761
|
+
{
|
2762
|
+
"disabled": false,
|
2763
|
+
"document": "全端口段监听器的结束端口",
|
2764
|
+
"example": "[600]",
|
2765
|
+
"member": "int64",
|
2766
|
+
"name": "FullEndPorts",
|
2767
|
+
"required": false,
|
2768
|
+
"type": "list"
|
2760
2769
|
}
|
2761
2770
|
],
|
2762
2771
|
"type": "object"
|
@@ -7574,7 +7583,7 @@
|
|
7574
7583
|
},
|
7575
7584
|
{
|
7576
7585
|
"disabled": false,
|
7577
|
-
"document": "性能容量型规格。<ul><li> clb.c2.medium:标准型规格 </li><li> clb.c3.small:高阶型1规格 </li><li> clb.c3.medium:高阶型2规格 </li><li> clb.c4.small:超强型1规格 </li><li> clb.c4.medium:超强型2规格 </li><li> clb.c4.large:超强型3规格 </li><li> clb.c4.xlarge:超强型4规格 </li><li
|
7586
|
+
"document": "性能容量型规格。<ul><li> clb.c1.small:简约型规格 </li><li> clb.c2.medium:标准型规格 </li><li> clb.c3.small:高阶型1规格 </li><li> clb.c3.medium:高阶型2规格 </li><li> clb.c4.small:超强型1规格 </li><li> clb.c4.medium:超强型2规格 </li><li> clb.c4.large:超强型3规格 </li><li> clb.c4.xlarge:超强型4规格 </li><li>\"\":非性能容量型实例</li></ul>\n注意:此字段可能返回 null,表示取不到有效值。",
|
7578
7587
|
"example": " null",
|
7579
7588
|
"member": "string",
|
7580
7589
|
"name": "SlaType",
|
@@ -7725,6 +7734,17 @@
|
|
7725
7734
|
"required": false,
|
7726
7735
|
"type": "string",
|
7727
7736
|
"value_allowed_null": true
|
7737
|
+
},
|
7738
|
+
{
|
7739
|
+
"disabled": false,
|
7740
|
+
"document": "实例类型是否为独占型。1:独占型实例。0:非独占型实例。\n注意:此字段可能返回 null,表示取不到有效值。",
|
7741
|
+
"example": "0",
|
7742
|
+
"member": "uint64",
|
7743
|
+
"name": "Exclusive",
|
7744
|
+
"output_required": false,
|
7745
|
+
"required": false,
|
7746
|
+
"type": "int",
|
7747
|
+
"value_allowed_null": true
|
7728
7748
|
}
|
7729
7749
|
],
|
7730
7750
|
"usage": "both"
|
@@ -7754,7 +7774,7 @@
|
|
7754
7774
|
},
|
7755
7775
|
{
|
7756
7776
|
"disabled": false,
|
7757
|
-
"document": "负载均衡实例的网络类型:\
|
7777
|
+
"document": "负载均衡实例的网络类型:\nOPEN:公网属性,INTERNAL:内网属性。\n注意:此字段可能返回 null,表示取不到有效值。",
|
7758
7778
|
"example": "OPEN",
|
7759
7779
|
"member": "string",
|
7760
7780
|
"name": "LoadBalancerType",
|
@@ -8121,6 +8141,36 @@
|
|
8121
8141
|
"output_required": true,
|
8122
8142
|
"type": "string",
|
8123
8143
|
"value_allowed_null": true
|
8144
|
+
},
|
8145
|
+
{
|
8146
|
+
"disabled": false,
|
8147
|
+
"document": "负载均衡的属性\n注意:此字段可能返回 null,表示取不到有效值。",
|
8148
|
+
"example": "DeleteProtect",
|
8149
|
+
"member": "string",
|
8150
|
+
"name": "AttributeFlags",
|
8151
|
+
"output_required": false,
|
8152
|
+
"type": "list",
|
8153
|
+
"value_allowed_null": true
|
8154
|
+
},
|
8155
|
+
{
|
8156
|
+
"disabled": false,
|
8157
|
+
"document": "负载均衡实例的规格类型信息<ul><li> clb.c1.small:简约型规格 </li><li>clb.c2.medium:标准型规格 </li><li> clb.c3.small:高阶型1规格 </li><li> clb.c3.medium:高阶型2规格 </li><li> clb.c4.small:超强型1规格 </li><li> clb.c4.medium:超强型2规格 </li><li> clb.c4.large:超强型3规格 </li><li> clb.c4.xlarge:超强型4规格 </li><li>\"\":非性能容量型实例</li></ul>\n\n注意:此字段可能返回 null,表示取不到有效值。",
|
8158
|
+
"example": "clb.c2.medium",
|
8159
|
+
"member": "string",
|
8160
|
+
"name": "SlaType",
|
8161
|
+
"output_required": false,
|
8162
|
+
"type": "string",
|
8163
|
+
"value_allowed_null": true
|
8164
|
+
},
|
8165
|
+
{
|
8166
|
+
"disabled": false,
|
8167
|
+
"document": "0:表示非独占型实例,1:表示独占型态实例。\n注意:此字段可能返回 null,表示取不到有效值。",
|
8168
|
+
"example": "1",
|
8169
|
+
"member": "uint64",
|
8170
|
+
"name": "Exclusive",
|
8171
|
+
"output_required": false,
|
8172
|
+
"type": "int",
|
8173
|
+
"value_allowed_null": true
|
8124
8174
|
}
|
8125
8175
|
],
|
8126
8176
|
"usage": "out"
|
@@ -9112,6 +9162,15 @@
|
|
9112
9162
|
"name": "TrpcFunc",
|
9113
9163
|
"required": false,
|
9114
9164
|
"type": "string"
|
9165
|
+
},
|
9166
|
+
{
|
9167
|
+
"disabled": false,
|
9168
|
+
"document": "OAuth配置信息。",
|
9169
|
+
"example": "无",
|
9170
|
+
"member": "OAuth",
|
9171
|
+
"name": "OAuth",
|
9172
|
+
"required": false,
|
9173
|
+
"type": "object"
|
9115
9174
|
}
|
9116
9175
|
],
|
9117
9176
|
"type": "object"
|
@@ -9433,6 +9492,34 @@
|
|
9433
9492
|
],
|
9434
9493
|
"usage": "in"
|
9435
9494
|
},
|
9495
|
+
"OAuth": {
|
9496
|
+
"document": "OAuth配置信息。",
|
9497
|
+
"members": [
|
9498
|
+
{
|
9499
|
+
"disabled": false,
|
9500
|
+
"document": "开启或关闭鉴权。\nTrue: 开启;\nFalse: 关闭\n注意:此字段可能返回 null,表示取不到有效值。",
|
9501
|
+
"example": "True",
|
9502
|
+
"member": "bool",
|
9503
|
+
"name": "OAuthEnable",
|
9504
|
+
"output_required": false,
|
9505
|
+
"required": false,
|
9506
|
+
"type": "bool",
|
9507
|
+
"value_allowed_null": true
|
9508
|
+
},
|
9509
|
+
{
|
9510
|
+
"disabled": false,
|
9511
|
+
"document": "IAP全部故障后,拒绝请求还是放行。BYPASS:通过,\nREJECT: 拒绝\n注意:此字段可能返回 null,表示取不到有效值。",
|
9512
|
+
"example": "BYPASS",
|
9513
|
+
"member": "string",
|
9514
|
+
"name": "OAuthFailureStatus",
|
9515
|
+
"output_required": false,
|
9516
|
+
"required": false,
|
9517
|
+
"type": "string",
|
9518
|
+
"value_allowed_null": true
|
9519
|
+
}
|
9520
|
+
],
|
9521
|
+
"usage": "both"
|
9522
|
+
},
|
9436
9523
|
"Price": {
|
9437
9524
|
"document": "表示负载均衡的价格",
|
9438
9525
|
"members": [
|
@@ -10457,6 +10544,16 @@
|
|
10457
10544
|
"output_required": true,
|
10458
10545
|
"type": "list",
|
10459
10546
|
"value_allowed_null": true
|
10547
|
+
},
|
10548
|
+
{
|
10549
|
+
"disabled": false,
|
10550
|
+
"document": "OAuth配置状态信息。\n注意:此字段可能返回 null,表示取不到有效值。",
|
10551
|
+
"example": "无",
|
10552
|
+
"member": "OAuth",
|
10553
|
+
"name": "OAuth",
|
10554
|
+
"output_required": false,
|
10555
|
+
"type": "object",
|
10556
|
+
"value_allowed_null": true
|
10460
10557
|
}
|
10461
10558
|
],
|
10462
10559
|
"usage": "out"
|
@@ -2479,7 +2479,7 @@
|
|
2479
2479
|
},
|
2480
2480
|
{
|
2481
2481
|
"disabled": false,
|
2482
|
-
"document": "
|
2482
|
+
"document": "允许访问的资源列表,目前仅支持一个Resource",
|
2483
2483
|
"example": "当Type为1时:['qcs::cls::uin/100001127589:dashboard/dashboard-1223fa03--44f9-f118-69a8-21aa33ea5aa1']; 当Type为2时:['qcs::cls:ap-guangzhou:uin/10000000001:topic/c1306921-2180-3e45-9azb-31d12217871e6']",
|
2484
2484
|
"member": "string",
|
2485
2485
|
"name": "Resources",
|
@@ -0,0 +1,195 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
import os
|
3
|
+
import sys
|
4
|
+
import six
|
5
|
+
import json
|
6
|
+
import tccli.options_define as OptionsDefine
|
7
|
+
import tccli.format_output as FormatOutput
|
8
|
+
from tccli import __version__
|
9
|
+
from tccli.utils import Utils
|
10
|
+
from tccli.exceptions import ConfigurationError, ClientError, ParamError
|
11
|
+
from tencentcloud.common import credential
|
12
|
+
from tencentcloud.common.profile.http_profile import HttpProfile
|
13
|
+
from tencentcloud.common.profile.client_profile import ClientProfile
|
14
|
+
from tencentcloud.controlcenter.v20230110 import controlcenter_client as controlcenter_client_v20230110
|
15
|
+
from tencentcloud.controlcenter.v20230110 import models as models_v20230110
|
16
|
+
|
17
|
+
from jmespath import search
|
18
|
+
import time
|
19
|
+
|
20
|
+
def doBatchApplyAccountBaselines(args, parsed_globals):
|
21
|
+
g_param = parse_global_arg(parsed_globals)
|
22
|
+
|
23
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
24
|
+
cred = credential.CVMRoleCredential()
|
25
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
26
|
+
cred = credential.STSAssumeRoleCredential(
|
27
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
28
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
29
|
+
)
|
30
|
+
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):
|
31
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
32
|
+
else:
|
33
|
+
cred = credential.Credential(
|
34
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
35
|
+
)
|
36
|
+
http_profile = HttpProfile(
|
37
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
38
|
+
reqMethod="POST",
|
39
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
40
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
41
|
+
)
|
42
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
43
|
+
if g_param[OptionsDefine.Language]:
|
44
|
+
profile.language = g_param[OptionsDefine.Language]
|
45
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
46
|
+
client = mod.ControlcenterClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
+
model = models.BatchApplyAccountBaselinesRequest()
|
50
|
+
model.from_json_string(json.dumps(args))
|
51
|
+
start_time = time.time()
|
52
|
+
while True:
|
53
|
+
rsp = client.BatchApplyAccountBaselines(model)
|
54
|
+
result = rsp.to_json_string()
|
55
|
+
try:
|
56
|
+
json_obj = json.loads(result)
|
57
|
+
except TypeError as e:
|
58
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
59
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
60
|
+
break
|
61
|
+
cur_time = time.time()
|
62
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
63
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
64
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
65
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
66
|
+
else:
|
67
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
68
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
69
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
|
+
|
71
|
+
|
72
|
+
CLIENT_MAP = {
|
73
|
+
"v20230110": controlcenter_client_v20230110,
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
MODELS_MAP = {
|
78
|
+
"v20230110": models_v20230110,
|
79
|
+
|
80
|
+
}
|
81
|
+
|
82
|
+
ACTION_MAP = {
|
83
|
+
"BatchApplyAccountBaselines": doBatchApplyAccountBaselines,
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
AVAILABLE_VERSION_LIST = [
|
88
|
+
"v20230110",
|
89
|
+
|
90
|
+
]
|
91
|
+
|
92
|
+
|
93
|
+
def action_caller():
|
94
|
+
return ACTION_MAP
|
95
|
+
|
96
|
+
|
97
|
+
def parse_global_arg(parsed_globals):
|
98
|
+
g_param = parsed_globals
|
99
|
+
|
100
|
+
is_exist_profile = True
|
101
|
+
if not parsed_globals["profile"]:
|
102
|
+
is_exist_profile = False
|
103
|
+
g_param["profile"] = os.environ.get("TCCLI_PROFILE", "default")
|
104
|
+
|
105
|
+
configure_path = os.path.join(os.path.expanduser("~"), ".tccli")
|
106
|
+
is_conf_exist, conf_path = Utils.file_existed(configure_path, g_param["profile"] + ".configure")
|
107
|
+
is_cred_exist, cred_path = Utils.file_existed(configure_path, g_param["profile"] + ".credential")
|
108
|
+
|
109
|
+
conf = {}
|
110
|
+
cred = {}
|
111
|
+
|
112
|
+
if is_conf_exist:
|
113
|
+
conf = Utils.load_json_msg(conf_path)
|
114
|
+
if is_cred_exist:
|
115
|
+
cred = Utils.load_json_msg(cred_path)
|
116
|
+
|
117
|
+
if not (isinstance(conf, dict) and isinstance(cred, dict)):
|
118
|
+
raise ConfigurationError(
|
119
|
+
"file: %s or %s is not json format"
|
120
|
+
% (g_param["profile"] + ".configure", g_param["profile"] + ".credential"))
|
121
|
+
|
122
|
+
if OptionsDefine.Token not in cred:
|
123
|
+
cred[OptionsDefine.Token] = None
|
124
|
+
|
125
|
+
if not is_exist_profile:
|
126
|
+
if os.environ.get(OptionsDefine.ENV_SECRET_ID) and os.environ.get(OptionsDefine.ENV_SECRET_KEY):
|
127
|
+
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
128
|
+
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
129
|
+
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
130
|
+
|
131
|
+
if os.environ.get(OptionsDefine.ENV_REGION):
|
132
|
+
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
133
|
+
|
134
|
+
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
135
|
+
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
136
|
+
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
137
|
+
|
138
|
+
for param in g_param.keys():
|
139
|
+
if g_param[param] is None:
|
140
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.Token]:
|
141
|
+
if param in cred:
|
142
|
+
g_param[param] = cred[param]
|
143
|
+
elif not (g_param[OptionsDefine.UseCVMRole.replace('-', '_')]
|
144
|
+
or os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN)):
|
145
|
+
raise ConfigurationError("%s is invalid" % param)
|
146
|
+
elif param in [OptionsDefine.Region, OptionsDefine.Output, OptionsDefine.Language]:
|
147
|
+
if param in conf[OptionsDefine.SysParam]:
|
148
|
+
g_param[param] = conf[OptionsDefine.SysParam][param]
|
149
|
+
elif param != OptionsDefine.Language:
|
150
|
+
raise ConfigurationError("%s is invalid" % param)
|
151
|
+
elif param.replace('_', '-') in [OptionsDefine.RoleArn, OptionsDefine.RoleSessionName]:
|
152
|
+
if param.replace('_', '-') in cred:
|
153
|
+
g_param[param] = cred[param.replace('_', '-')]
|
154
|
+
|
155
|
+
try:
|
156
|
+
if g_param[OptionsDefine.ServiceVersion]:
|
157
|
+
g_param[OptionsDefine.Version] = "v" + g_param[OptionsDefine.ServiceVersion].replace('-', '')
|
158
|
+
else:
|
159
|
+
version = conf["controlcenter"][OptionsDefine.Version]
|
160
|
+
g_param[OptionsDefine.Version] = "v" + version.replace('-', '')
|
161
|
+
|
162
|
+
if g_param[OptionsDefine.Endpoint] is None:
|
163
|
+
g_param[OptionsDefine.Endpoint] = conf["controlcenter"][OptionsDefine.Endpoint]
|
164
|
+
g_param["sts_cred_endpoint"] = conf.get("sts", {}).get("endpoint")
|
165
|
+
except Exception as err:
|
166
|
+
raise ConfigurationError("config file:%s error, %s" % (conf_path, str(err)))
|
167
|
+
|
168
|
+
if g_param[OptionsDefine.Version] not in AVAILABLE_VERSION_LIST:
|
169
|
+
raise Exception("available versions: %s" % " ".join(AVAILABLE_VERSION_LIST))
|
170
|
+
|
171
|
+
if g_param[OptionsDefine.Waiter]:
|
172
|
+
param = eval(g_param[OptionsDefine.Waiter])
|
173
|
+
if 'expr' not in param:
|
174
|
+
raise Exception('`expr` in `--waiter` must be defined')
|
175
|
+
if 'to' not in param:
|
176
|
+
raise Exception('`to` in `--waiter` must be defined')
|
177
|
+
if 'timeout' not in param:
|
178
|
+
if 'waiter' in conf and 'timeout' in conf['waiter']:
|
179
|
+
param['timeout'] = conf['waiter']['timeout']
|
180
|
+
else:
|
181
|
+
param['timeout'] = 180
|
182
|
+
if 'interval' not in param:
|
183
|
+
if 'waiter' in conf and 'interval' in conf['waiter']:
|
184
|
+
param['interval'] = conf['waiter']['interval']
|
185
|
+
else:
|
186
|
+
param['interval'] = 5
|
187
|
+
param['interval'] = min(param['interval'], param['timeout'])
|
188
|
+
g_param['OptionsDefine.WaiterInfo'] = param
|
189
|
+
|
190
|
+
if six.PY2:
|
191
|
+
for key, value in g_param.items():
|
192
|
+
if isinstance(value, six.text_type):
|
193
|
+
g_param[key] = value.encode('utf-8')
|
194
|
+
return g_param
|
195
|
+
|
@@ -0,0 +1,82 @@
|
|
1
|
+
{
|
2
|
+
"actions": {
|
3
|
+
"BatchApplyAccountBaselines": {
|
4
|
+
"document": "批量对存量账号应用基线",
|
5
|
+
"input": "BatchApplyAccountBaselinesRequest",
|
6
|
+
"name": "批量对存量账号应用基线",
|
7
|
+
"output": "BatchApplyAccountBaselinesResponse",
|
8
|
+
"status": "online"
|
9
|
+
}
|
10
|
+
},
|
11
|
+
"metadata": {
|
12
|
+
"apiVersion": "2023-01-10",
|
13
|
+
"api_brief": "通过控制中心API,通过API完成控制中心中产品能力的查看和设置",
|
14
|
+
"serviceNameCN": "控制中心",
|
15
|
+
"serviceShortName": "controlcenter"
|
16
|
+
},
|
17
|
+
"objects": {
|
18
|
+
"BaselineConfigItem": {
|
19
|
+
"document": "账号工厂基线配置项",
|
20
|
+
"members": [
|
21
|
+
{
|
22
|
+
"disabled": false,
|
23
|
+
"document": "账号工厂基线项唯一标识,只能包含英文字母、数字和@、,._[]-:()()【】+=,。,长度2-128个字符。\n注意:此字段可能返回 null,表示取不到有效值。",
|
24
|
+
"example": "ACS-BP_ACCOUNT_FACTORY_ACCOUNT_CONTACT",
|
25
|
+
"member": "string",
|
26
|
+
"name": "Identifier",
|
27
|
+
"required": false,
|
28
|
+
"type": "string",
|
29
|
+
"value_allowed_null": true
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"disabled": false,
|
33
|
+
"document": "账号工厂基线项配置,不同基线项配置参数不同。\n注意:此字段可能返回 null,表示取不到有效值。",
|
34
|
+
"example": "{\\\"Contacts\\\":[{\\\"Name\\\":\\\"dest\\\",\\\"Email\\\":\\\"ia@22.com\\\",\\\"Mobile\\\":\\\"12345678910\\\",\\\"Position\\\":\\\"Technical Director\\\"}]}",
|
35
|
+
"member": "string",
|
36
|
+
"name": "Configuration",
|
37
|
+
"required": false,
|
38
|
+
"type": "string",
|
39
|
+
"value_allowed_null": true
|
40
|
+
}
|
41
|
+
],
|
42
|
+
"usage": "both"
|
43
|
+
},
|
44
|
+
"BatchApplyAccountBaselinesRequest": {
|
45
|
+
"document": "BatchApplyAccountBaselines请求参数结构体",
|
46
|
+
"members": [
|
47
|
+
{
|
48
|
+
"disabled": false,
|
49
|
+
"document": "成员账号uin,也是被应用基线的账号uin。",
|
50
|
+
"example": "[124254533, 13894929458]",
|
51
|
+
"member": "int64",
|
52
|
+
"name": "MemberUinList",
|
53
|
+
"required": true,
|
54
|
+
"type": "list"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"disabled": false,
|
58
|
+
"document": "基线项配置信息列表。",
|
59
|
+
"example": "[{\"Identifier\":\"ACS-BP_ACCOUNT_FACTORY_ACCOUNT_CONTACT\",\"Configuration\":\"{\\\"Contacts\\\":[{\\\"Name\\\":\\\"dest\\\",\\\"Email\\\":\\\"ia@22.com\\\",\\\"Mobile\\\":\\\"12345678910\\\",\\\"Position\\\":\\\"Technical Director\\\"}]}\"}]",
|
60
|
+
"member": "BaselineConfigItem",
|
61
|
+
"name": "BaselineConfigItems",
|
62
|
+
"required": true,
|
63
|
+
"type": "list"
|
64
|
+
}
|
65
|
+
],
|
66
|
+
"type": "object"
|
67
|
+
},
|
68
|
+
"BatchApplyAccountBaselinesResponse": {
|
69
|
+
"document": "BatchApplyAccountBaselines返回参数结构体",
|
70
|
+
"members": [
|
71
|
+
{
|
72
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
73
|
+
"member": "string",
|
74
|
+
"name": "RequestId",
|
75
|
+
"type": "string"
|
76
|
+
}
|
77
|
+
],
|
78
|
+
"type": "object"
|
79
|
+
}
|
80
|
+
},
|
81
|
+
"version": "1.0"
|
82
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"actions": {
|
3
|
+
"BatchApplyAccountBaselines": [
|
4
|
+
{
|
5
|
+
"document": "批量对存量账号应用基线",
|
6
|
+
"input": "POST / HTTP/1.1\nHost: controlcenter.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: BatchApplyAccountBaselines\n<公共请求参数>\n\n{\n \"MemberUinList\": [\n 13436673356\n ],\n \"BaselineConfigItems\": [\n {\n \"Identifier\": \"ACS-BP_ACCOUNT_FACTORY_ACCOUNT_CONTACT\",\n \"Configuration\": \"{\\\"Contacts\\\":[{\\\"Name\\\":\\\"dest\\\",\\\"Email\\\":\\\"ia@22.com\\\",\\\"Mobile\\\":\\\"12345678910\\\",\\\"Position\\\":\\\"Technical Director\\\"}]}\"\n }\n ]\n}",
|
7
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"e2f35fb3-3c8c-431e-b318-b4746cfe076c\"\n }\n}",
|
8
|
+
"title": "批量对存量账号应用基线"
|
9
|
+
}
|
10
|
+
]
|
11
|
+
},
|
12
|
+
"version": "1.0"
|
13
|
+
}
|