tccli 3.0.1219.1__py2.py3-none-any.whl → 3.0.1221.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/autoscaling/v20180419/api.json +1 -1
- tccli/services/cdb/v20170320/api.json +5 -5
- tccli/services/cdb/v20170320/examples.json +2 -2
- tccli/services/cdn/v20180606/api.json +3 -3
- tccli/services/cdwch/cdwch_client.py +53 -0
- tccli/services/cdwch/v20200915/api.json +100 -0
- tccli/services/cdwch/v20200915/examples.json +8 -0
- tccli/services/cdwdoris/v20211228/api.json +40 -0
- tccli/services/cfg/cfg_client.py +57 -4
- tccli/services/cfg/v20210820/api.json +113 -0
- tccli/services/cfg/v20210820/examples.json +8 -0
- tccli/services/cls/v20201016/api.json +14 -0
- tccli/services/cynosdb/v20190107/api.json +22 -2
- tccli/services/ess/v20201111/api.json +10 -1
- tccli/services/essbasic/v20210526/api.json +21 -3
- tccli/services/lke/lke_client.py +53 -0
- tccli/services/lke/v20231130/api.json +114 -0
- tccli/services/lke/v20231130/examples.json +8 -0
- tccli/services/market/v20191010/api.json +3 -3
- tccli/services/mps/mps_client.py +53 -0
- tccli/services/mps/v20190612/api.json +144 -0
- tccli/services/mps/v20190612/examples.json +8 -0
- tccli/services/ocr/v20181119/api.json +10 -0
- tccli/services/svp/v20240125/api.json +4 -4
- tccli/services/thpc/v20230321/api.json +2 -2
- tccli/services/trtc/v20190722/api.json +1 -1
- tccli/services/tse/v20201207/api.json +115 -98
- tccli/services/tse/v20201207/examples.json +44 -44
- tccli/services/vpc/v20170312/api.json +13 -16
- tccli/services/vpc/v20170312/examples.json +1 -1
- tccli/services/wedata/v20210820/api.json +47 -2
- tccli/services/wedata/v20210820/examples.json +1 -1
- {tccli-3.0.1219.1.dist-info → tccli-3.0.1221.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1219.1.dist-info → tccli-3.0.1221.1.dist-info}/RECORD +38 -38
- {tccli-3.0.1219.1.dist-info → tccli-3.0.1221.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1219.1.dist-info → tccli-3.0.1221.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1219.1.dist-info → tccli-3.0.1221.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '3.0.
|
1
|
+
__version__ = '3.0.1221.1'
|
@@ -7304,7 +7304,7 @@
|
|
7304
7304
|
},
|
7305
7305
|
{
|
7306
7306
|
"disabled": false,
|
7307
|
-
"document": "
|
7307
|
+
"document": "刷新模式。取值范围:\n<li>ROLLING_UPDATE_RESET:重装系统进行滚动更新</li>\n<li>ROLLING_UPDATE_REPLACE:新建实例替换进行滚动更新,该模式暂不支持回滚接口</li>",
|
7308
7308
|
"example": "ROLLING_UPDATE_RESET",
|
7309
7309
|
"member": "string",
|
7310
7310
|
"name": "RefreshMode",
|
@@ -127,7 +127,7 @@
|
|
127
127
|
"status": "online"
|
128
128
|
},
|
129
129
|
"CreateCdbProxy": {
|
130
|
-
"document": "
|
130
|
+
"document": "本接口(CreateCdbProxy)用于主实例创建数据库代理。",
|
131
131
|
"input": "CreateCdbProxyRequest",
|
132
132
|
"name": "创建数据库代理",
|
133
133
|
"output": "CreateCdbProxyResponse",
|
@@ -5158,8 +5158,8 @@
|
|
5158
5158
|
},
|
5159
5159
|
{
|
5160
5160
|
"disabled": false,
|
5161
|
-
"document": "
|
5162
|
-
"example": "{
|
5161
|
+
"document": "节点规格配置。\n示例中参数说明:\nNodeCount:节点个数。\nRegion:节点地域。\nZone:节点可用区。\nCpu:单个代理节点核数(单位:核)。\nMem:单个代理节点内存数(单位:MB)。\n备注:\n1. 数据库代理支持的节点规格为:2C4000MB、4C8000MB、8C16000MB。\n2. 上述参数项(如节点个数、可用区等)均为必填,在调用接口时如未填写完整,可能会创建失败。",
|
5162
|
+
"example": "{\"NodeCount\": 2,\"Region\": \"ap-guangzhou\",\"Zone\": \"ap-guangzhou-1\",\"Cpu\": 2,\"Mem\": 4000}",
|
5163
5163
|
"member": "ProxyNodeCustom",
|
5164
5164
|
"name": "ProxyNodeCustom",
|
5165
5165
|
"required": true,
|
@@ -5177,7 +5177,7 @@
|
|
5177
5177
|
{
|
5178
5178
|
"disabled": false,
|
5179
5179
|
"document": "描述",
|
5180
|
-
"example": "
|
5180
|
+
"example": "andy_proxy",
|
5181
5181
|
"member": "string",
|
5182
5182
|
"name": "Desc",
|
5183
5183
|
"required": false,
|
@@ -5210,7 +5210,7 @@
|
|
5210
5210
|
{
|
5211
5211
|
"disabled": false,
|
5212
5212
|
"document": "异步任务ID\n注意:此字段可能返回 null,表示取不到有效值。",
|
5213
|
-
"example": "
|
5213
|
+
"example": "a6040589-3b098df5-b551d9e5-81c6bfdc",
|
5214
5214
|
"member": "string",
|
5215
5215
|
"name": "AsyncRequestId",
|
5216
5216
|
"output_required": true,
|
@@ -159,8 +159,8 @@
|
|
159
159
|
"CreateCdbProxy": [
|
160
160
|
{
|
161
161
|
"document": "主实例创建数据库代理",
|
162
|
-
"input": "POST / HTTP/1.1\nHost: cdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateCdbProxy\n<公共请求参数>\n\n{\n \"InstanceId\": \"cdb-aykuksx3\",\n \"UniqVpcId\": \"vpc-ixw3ll2d\",\n \"UniqSubnetId\": \"subnet-0z3r56vq\",\n \"Desc\": \"
|
163
|
-
"output": "{\n \"Response\": {\n \"RequestId\": \"
|
162
|
+
"input": "POST / HTTP/1.1\nHost: cdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateCdbProxy\n<公共请求参数>\n\n{\n \"InstanceId\": \"cdb-aykuksx3\",\n \"UniqVpcId\": \"vpc-ixw3ll2d\",\n \"UniqSubnetId\": \"subnet-0z3r56vq\",\n \"Desc\": \"andy_proxy\",\n \"ProxyNodeCustom\": [\n {\n \"NodeCount\": 2,\n \"Region\": \"ap-guangzhou\",\n \"Zone\": \"ap-guangzhou-1\",\n \"Cpu\": 1,\n \"Mem\": 1\n }\n ]\n}",
|
163
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"6EF60BEC-0242-43AF-BB20-270359FB54A7\",\n \"AsyncRequestId\": \"7EF78BEC-0111-43AF-BB11-111112FB54A7\"\n }\n}",
|
164
164
|
"title": "创建数据库代理"
|
165
165
|
}
|
166
166
|
],
|
@@ -302,9 +302,9 @@
|
|
302
302
|
"status": "online"
|
303
303
|
},
|
304
304
|
"DescribeTopData": {
|
305
|
-
"document": "DescribeTopData 通过入参 Metric 和 Filter 组合不同,可以查询以下排序数据:\n\n+ 依据总流量、总请求数对访问 IP 排序,从大至小返回 TOP 100 IP\n+ 依据总流量、总请求数对访问 Refer 排序,从大至小返回 TOP 100 Refer\n+ 依据总流量、总请求数对访问 设备 排序,从大至小返回 设备类型\n+ 依据总流量、总请求数对访问 操作系统 排序,从大至小返回 操作系统\n+ 依据总流量、总请求数对访问 浏览器 排序,从大至小返回 浏览器\n\n注意:\n+ 仅支持 90 天内数据查询,且从2021年09月20
|
305
|
+
"document": "DescribeTopData 通过入参 Metric 和 Filter 组合不同,可以查询以下排序数据:\n\n+ 依据总流量、总请求数对访问 IP 排序,从大至小返回 TOP 100 IP\n+ 依据总流量、总请求数对访问 Refer 排序,从大至小返回 TOP 100 Refer\n+ 依据总流量、总请求数对访问 设备 排序,从大至小返回 设备类型\n+ 依据总流量、总请求数对访问 操作系统 排序,从大至小返回 操作系统\n+ 依据总流量、总请求数对访问 浏览器 排序,从大至小返回 浏览器\n\n注意:\n+ 仅支持 90 天内数据查询,且从2021年09月20日开始有数据",
|
306
306
|
"input": "DescribeTopDataRequest",
|
307
|
-
"name": "TOP
|
307
|
+
"name": "TOP 新版数据查询",
|
308
308
|
"output": "DescribeTopDataResponse",
|
309
309
|
"status": "online"
|
310
310
|
},
|
@@ -7712,7 +7712,7 @@
|
|
7712
7712
|
"example": "[]",
|
7713
7713
|
"member": "TopDataMore",
|
7714
7714
|
"name": "Data",
|
7715
|
-
"
|
7715
|
+
"output_required": true,
|
7716
7716
|
"type": "list",
|
7717
7717
|
"value_allowed_null": false
|
7718
7718
|
},
|
@@ -849,6 +849,58 @@ def doModifyClusterConfigs(args, parsed_globals):
|
|
849
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
850
|
|
851
851
|
|
852
|
+
def doScaleCNOutUpInstance(args, parsed_globals):
|
853
|
+
g_param = parse_global_arg(parsed_globals)
|
854
|
+
|
855
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
856
|
+
cred = credential.CVMRoleCredential()
|
857
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
858
|
+
cred = credential.STSAssumeRoleCredential(
|
859
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
860
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
861
|
+
)
|
862
|
+
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):
|
863
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
864
|
+
else:
|
865
|
+
cred = credential.Credential(
|
866
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
867
|
+
)
|
868
|
+
http_profile = HttpProfile(
|
869
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
870
|
+
reqMethod="POST",
|
871
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
872
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
873
|
+
)
|
874
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
875
|
+
if g_param[OptionsDefine.Language]:
|
876
|
+
profile.language = g_param[OptionsDefine.Language]
|
877
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
878
|
+
client = mod.CdwchClient(cred, g_param[OptionsDefine.Region], profile)
|
879
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
880
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
+
model = models.ScaleCNOutUpInstanceRequest()
|
882
|
+
model.from_json_string(json.dumps(args))
|
883
|
+
start_time = time.time()
|
884
|
+
while True:
|
885
|
+
rsp = client.ScaleCNOutUpInstance(model)
|
886
|
+
result = rsp.to_json_string()
|
887
|
+
try:
|
888
|
+
json_obj = json.loads(result)
|
889
|
+
except TypeError as e:
|
890
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
891
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
892
|
+
break
|
893
|
+
cur_time = time.time()
|
894
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
895
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
896
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
897
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
898
|
+
else:
|
899
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
900
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
901
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
|
+
|
903
|
+
|
852
904
|
def doDescribeInstanceShards(args, parsed_globals):
|
853
905
|
g_param = parse_global_arg(parsed_globals)
|
854
906
|
|
@@ -1448,6 +1500,7 @@ ACTION_MAP = {
|
|
1448
1500
|
"DescribeInstanceState": doDescribeInstanceState,
|
1449
1501
|
"DescribeClusterConfigs": doDescribeClusterConfigs,
|
1450
1502
|
"ModifyClusterConfigs": doModifyClusterConfigs,
|
1503
|
+
"ScaleCNOutUpInstance": doScaleCNOutUpInstance,
|
1451
1504
|
"DescribeInstanceShards": doDescribeInstanceShards,
|
1452
1505
|
"DescribeCkSqlApis": doDescribeCkSqlApis,
|
1453
1506
|
"DescribeSpec": doDescribeSpec,
|
@@ -175,6 +175,13 @@
|
|
175
175
|
"output": "ResizeDiskResponse",
|
176
176
|
"status": "online"
|
177
177
|
},
|
178
|
+
"ScaleCNOutUpInstance": {
|
179
|
+
"document": "open-api接口提供弹性伸缩云原生集群能力",
|
180
|
+
"input": "ScaleCNOutUpInstanceRequest",
|
181
|
+
"name": "通过接口弹性伸缩云原生集群(openapi)",
|
182
|
+
"output": "ScaleCNOutUpInstanceResponse",
|
183
|
+
"status": "online"
|
184
|
+
},
|
178
185
|
"ScaleOutInstance": {
|
179
186
|
"document": "调整clickhouse节点数量",
|
180
187
|
"input": "ScaleOutInstanceRequest",
|
@@ -3663,6 +3670,99 @@
|
|
3663
3670
|
],
|
3664
3671
|
"usage": "out"
|
3665
3672
|
},
|
3673
|
+
"ScaleCNOutUpInstanceRequest": {
|
3674
|
+
"document": "ScaleCNOutUpInstance请求参数结构体",
|
3675
|
+
"members": [
|
3676
|
+
{
|
3677
|
+
"disabled": false,
|
3678
|
+
"document": "实例唯一ID",
|
3679
|
+
"example": "clickhouse-cn-xxx",
|
3680
|
+
"member": "string",
|
3681
|
+
"name": "InstanceId",
|
3682
|
+
"required": true,
|
3683
|
+
"type": "string"
|
3684
|
+
},
|
3685
|
+
{
|
3686
|
+
"disabled": false,
|
3687
|
+
"document": "warehouse名称",
|
3688
|
+
"example": "xxxx",
|
3689
|
+
"member": "string",
|
3690
|
+
"name": "VirtualCluster",
|
3691
|
+
"required": true,
|
3692
|
+
"type": "string"
|
3693
|
+
},
|
3694
|
+
{
|
3695
|
+
"disabled": false,
|
3696
|
+
"document": "子网id",
|
3697
|
+
"example": "subnet-xxx",
|
3698
|
+
"member": "string",
|
3699
|
+
"name": "UserSubnetID",
|
3700
|
+
"required": true,
|
3701
|
+
"type": "string"
|
3702
|
+
},
|
3703
|
+
{
|
3704
|
+
"disabled": false,
|
3705
|
+
"document": "新的warehouse的个数",
|
3706
|
+
"example": "1",
|
3707
|
+
"member": "int64",
|
3708
|
+
"name": "NewCount",
|
3709
|
+
"required": true,
|
3710
|
+
"type": "int"
|
3711
|
+
},
|
3712
|
+
{
|
3713
|
+
"disabled": false,
|
3714
|
+
"document": "集群的规格2X-Small、X-Small、Small",
|
3715
|
+
"example": "2X-Small",
|
3716
|
+
"member": "string",
|
3717
|
+
"name": "NewSpecName",
|
3718
|
+
"required": true,
|
3719
|
+
"type": "string"
|
3720
|
+
}
|
3721
|
+
],
|
3722
|
+
"type": "object"
|
3723
|
+
},
|
3724
|
+
"ScaleCNOutUpInstanceResponse": {
|
3725
|
+
"document": "ScaleCNOutUpInstance返回参数结构体",
|
3726
|
+
"members": [
|
3727
|
+
{
|
3728
|
+
"disabled": false,
|
3729
|
+
"document": "流程ID\n注意:此字段可能返回 null,表示取不到有效值。",
|
3730
|
+
"example": "123",
|
3731
|
+
"member": "string",
|
3732
|
+
"name": "FlowId",
|
3733
|
+
"output_required": true,
|
3734
|
+
"type": "string",
|
3735
|
+
"value_allowed_null": true
|
3736
|
+
},
|
3737
|
+
{
|
3738
|
+
"disabled": false,
|
3739
|
+
"document": "实例ID\n注意:此字段可能返回 null,表示取不到有效值。",
|
3740
|
+
"example": "clickhouse-cn-xxx",
|
3741
|
+
"member": "string",
|
3742
|
+
"name": "InstanceId",
|
3743
|
+
"output_required": true,
|
3744
|
+
"type": "string",
|
3745
|
+
"value_allowed_null": true
|
3746
|
+
},
|
3747
|
+
{
|
3748
|
+
"disabled": false,
|
3749
|
+
"document": "错误信息\n注意:此字段可能返回 null,表示取不到有效值。",
|
3750
|
+
"example": "xxx",
|
3751
|
+
"member": "string",
|
3752
|
+
"name": "ErrorMsg",
|
3753
|
+
"output_required": true,
|
3754
|
+
"type": "string",
|
3755
|
+
"value_allowed_null": true
|
3756
|
+
},
|
3757
|
+
{
|
3758
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
3759
|
+
"member": "string",
|
3760
|
+
"name": "RequestId",
|
3761
|
+
"type": "string"
|
3762
|
+
}
|
3763
|
+
],
|
3764
|
+
"type": "object"
|
3765
|
+
},
|
3666
3766
|
"ScaleOutInstanceRequest": {
|
3667
3767
|
"document": "ScaleOutInstance请求参数结构体",
|
3668
3768
|
"members": [
|
@@ -200,6 +200,14 @@
|
|
200
200
|
"title": "示例"
|
201
201
|
}
|
202
202
|
],
|
203
|
+
"ScaleCNOutUpInstance": [
|
204
|
+
{
|
205
|
+
"document": "",
|
206
|
+
"input": "POST / HTTP/1.1\nHost: cdwch.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ScaleCNOutUpInstance\n<公共请求参数>\n\n{\n \"InstanceId\": \"clickhouse-cn-xxxxxx\",\n \"VirtualCluster\": \"warehouse3\",\n \"UserSubnetID\": \"subnet-xxxxxxx\",\n \"NewCount\": 2,\n \"NewSpecName\": \"2X-Small\"\n}",
|
207
|
+
"output": "{\n \"Response\": {\n \"InstanceId\": \"clickhouse-cn-xxxxxx\",\n \"FlowId\": \"\",\n \"RequestId\": \"01111\",\n \"ErrorMsg\": \"addddd\"\n }\n}",
|
208
|
+
"title": "示例"
|
209
|
+
}
|
210
|
+
],
|
203
211
|
"ScaleOutInstance": [
|
204
212
|
{
|
205
213
|
"document": "ck水平扩容实例",
|
@@ -2583,6 +2583,36 @@
|
|
2583
2583
|
"type": "list",
|
2584
2584
|
"value_allowed_null": false
|
2585
2585
|
},
|
2586
|
+
{
|
2587
|
+
"disabled": false,
|
2588
|
+
"document": "msg\n注意:此字段可能返回 null,表示取不到有效值。",
|
2589
|
+
"example": "msg",
|
2590
|
+
"member": "string",
|
2591
|
+
"name": "Msg",
|
2592
|
+
"output_required": false,
|
2593
|
+
"type": "string",
|
2594
|
+
"value_allowed_null": true
|
2595
|
+
},
|
2596
|
+
{
|
2597
|
+
"disabled": false,
|
2598
|
+
"document": "未知version\n注意:此字段可能返回 null,表示取不到有效值。",
|
2599
|
+
"example": "true",
|
2600
|
+
"member": "bool",
|
2601
|
+
"name": "IsUnknownVersion",
|
2602
|
+
"output_required": false,
|
2603
|
+
"type": "bool",
|
2604
|
+
"value_allowed_null": true
|
2605
|
+
},
|
2606
|
+
{
|
2607
|
+
"disabled": false,
|
2608
|
+
"document": "错误信息\n注意:此字段可能返回 null,表示取不到有效值。",
|
2609
|
+
"example": "xxx",
|
2610
|
+
"member": "string",
|
2611
|
+
"name": "ErrorMsg",
|
2612
|
+
"output_required": false,
|
2613
|
+
"type": "string",
|
2614
|
+
"value_allowed_null": true
|
2615
|
+
},
|
2586
2616
|
{
|
2587
2617
|
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
2588
2618
|
"member": "string",
|
@@ -3292,6 +3322,16 @@
|
|
3292
3322
|
"type": "object",
|
3293
3323
|
"value_allowed_null": false
|
3294
3324
|
},
|
3325
|
+
{
|
3326
|
+
"disabled": false,
|
3327
|
+
"document": "记录列表\n注意:此字段可能返回 null,表示取不到有效值。",
|
3328
|
+
"example": "[]",
|
3329
|
+
"member": "DataBaseAuditRecord",
|
3330
|
+
"name": "Records",
|
3331
|
+
"output_required": false,
|
3332
|
+
"type": "list",
|
3333
|
+
"value_allowed_null": true
|
3334
|
+
},
|
3295
3335
|
{
|
3296
3336
|
"disabled": false,
|
3297
3337
|
"document": "错误信息\n注意:此字段可能返回 null,表示取不到有效值。",
|
tccli/services/cfg/cfg_client.py
CHANGED
@@ -121,7 +121,7 @@ def doCreateTaskFromTemplate(args, parsed_globals):
|
|
121
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
122
|
|
123
123
|
|
124
|
-
def
|
124
|
+
def doCreateTaskFromMultiAction(args, parsed_globals):
|
125
125
|
g_param = parse_global_arg(parsed_globals)
|
126
126
|
|
127
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +150,11 @@ def doDescribeTemplate(args, parsed_globals):
|
|
150
150
|
client = mod.CfgClient(cred, g_param[OptionsDefine.Region], profile)
|
151
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
153
|
+
model = models.CreateTaskFromMultiActionRequest()
|
154
154
|
model.from_json_string(json.dumps(args))
|
155
155
|
start_time = time.time()
|
156
156
|
while True:
|
157
|
-
rsp = client.
|
157
|
+
rsp = client.CreateTaskFromMultiAction(model)
|
158
158
|
result = rsp.to_json_string()
|
159
159
|
try:
|
160
160
|
json_obj = json.loads(result)
|
@@ -849,6 +849,58 @@ def doDeleteTask(args, parsed_globals):
|
|
849
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
850
|
|
851
851
|
|
852
|
+
def doDescribeTemplate(args, parsed_globals):
|
853
|
+
g_param = parse_global_arg(parsed_globals)
|
854
|
+
|
855
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
856
|
+
cred = credential.CVMRoleCredential()
|
857
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
858
|
+
cred = credential.STSAssumeRoleCredential(
|
859
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
860
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
861
|
+
)
|
862
|
+
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):
|
863
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
864
|
+
else:
|
865
|
+
cred = credential.Credential(
|
866
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
867
|
+
)
|
868
|
+
http_profile = HttpProfile(
|
869
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
870
|
+
reqMethod="POST",
|
871
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
872
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
873
|
+
)
|
874
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
875
|
+
if g_param[OptionsDefine.Language]:
|
876
|
+
profile.language = g_param[OptionsDefine.Language]
|
877
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
878
|
+
client = mod.CfgClient(cred, g_param[OptionsDefine.Region], profile)
|
879
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
880
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
+
model = models.DescribeTemplateRequest()
|
882
|
+
model.from_json_string(json.dumps(args))
|
883
|
+
start_time = time.time()
|
884
|
+
while True:
|
885
|
+
rsp = client.DescribeTemplate(model)
|
886
|
+
result = rsp.to_json_string()
|
887
|
+
try:
|
888
|
+
json_obj = json.loads(result)
|
889
|
+
except TypeError as e:
|
890
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
891
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
892
|
+
break
|
893
|
+
cur_time = time.time()
|
894
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
895
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
896
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
897
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
898
|
+
else:
|
899
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
900
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
901
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
|
+
|
903
|
+
|
852
904
|
CLIENT_MAP = {
|
853
905
|
"v20210820": cfg_client_v20210820,
|
854
906
|
|
@@ -862,7 +914,7 @@ MODELS_MAP = {
|
|
862
914
|
ACTION_MAP = {
|
863
915
|
"DescribeObjectTypeList": doDescribeObjectTypeList,
|
864
916
|
"CreateTaskFromTemplate": doCreateTaskFromTemplate,
|
865
|
-
"
|
917
|
+
"CreateTaskFromMultiAction": doCreateTaskFromMultiAction,
|
866
918
|
"ExecuteTaskInstance": doExecuteTaskInstance,
|
867
919
|
"ModifyTaskRunStatus": doModifyTaskRunStatus,
|
868
920
|
"DescribeActionLibraryList": doDescribeActionLibraryList,
|
@@ -876,6 +928,7 @@ ACTION_MAP = {
|
|
876
928
|
"DescribeTemplateList": doDescribeTemplateList,
|
877
929
|
"ExecuteTask": doExecuteTask,
|
878
930
|
"DeleteTask": doDeleteTask,
|
931
|
+
"DescribeTemplate": doDescribeTemplate,
|
879
932
|
|
880
933
|
}
|
881
934
|
|
@@ -7,6 +7,13 @@
|
|
7
7
|
"output": "CreateTaskFromActionResponse",
|
8
8
|
"status": "online"
|
9
9
|
},
|
10
|
+
"CreateTaskFromMultiAction": {
|
11
|
+
"document": "以多个动作创建演练",
|
12
|
+
"input": "CreateTaskFromMultiActionRequest",
|
13
|
+
"name": "快速创建多个动作的演练",
|
14
|
+
"output": "CreateTaskFromMultiActionResponse",
|
15
|
+
"status": "online"
|
16
|
+
},
|
10
17
|
"CreateTaskFromTemplate": {
|
11
18
|
"document": "从经验库创建演练",
|
12
19
|
"input": "CreateTaskFromTemplateRequest",
|
@@ -614,6 +621,79 @@
|
|
614
621
|
],
|
615
622
|
"type": "object"
|
616
623
|
},
|
624
|
+
"CreateTaskFromMultiActionRequest": {
|
625
|
+
"document": "CreateTaskFromMultiAction请求参数结构体",
|
626
|
+
"members": [
|
627
|
+
{
|
628
|
+
"disabled": false,
|
629
|
+
"document": "参与演练的实例ID",
|
630
|
+
"example": "[\"ins-87b12frpq\"]",
|
631
|
+
"member": "string",
|
632
|
+
"name": "TaskInstances",
|
633
|
+
"required": true,
|
634
|
+
"type": "list"
|
635
|
+
},
|
636
|
+
{
|
637
|
+
"disabled": false,
|
638
|
+
"document": "演练名称,不填则默认取动作名称",
|
639
|
+
"example": "演练名称",
|
640
|
+
"member": "string",
|
641
|
+
"name": "TaskTitle",
|
642
|
+
"required": false,
|
643
|
+
"type": "string"
|
644
|
+
},
|
645
|
+
{
|
646
|
+
"disabled": false,
|
647
|
+
"document": "演练描述,不填则默认取动作描述",
|
648
|
+
"example": "演练描述",
|
649
|
+
"member": "string",
|
650
|
+
"name": "TaskDescription",
|
651
|
+
"required": false,
|
652
|
+
"type": "string"
|
653
|
+
},
|
654
|
+
{
|
655
|
+
"disabled": false,
|
656
|
+
"document": "演练自动暂停时间,单位分钟, 不填则默认为60",
|
657
|
+
"example": "60",
|
658
|
+
"member": "uint64",
|
659
|
+
"name": "TaskPauseDuration",
|
660
|
+
"required": false,
|
661
|
+
"type": "int"
|
662
|
+
},
|
663
|
+
{
|
664
|
+
"disabled": false,
|
665
|
+
"document": "演练动作组配置",
|
666
|
+
"example": "[{ \"TaskActionId\": 0, \"TaskActionGeneralConfiguration\": \"abc\", \"TaskActionCustomConfiguration\": \"abc\" }]",
|
667
|
+
"member": "TaskGroupForAction",
|
668
|
+
"name": "TaskAction",
|
669
|
+
"required": false,
|
670
|
+
"type": "list"
|
671
|
+
}
|
672
|
+
],
|
673
|
+
"type": "object"
|
674
|
+
},
|
675
|
+
"CreateTaskFromMultiActionResponse": {
|
676
|
+
"document": "CreateTaskFromMultiAction返回参数结构体",
|
677
|
+
"members": [
|
678
|
+
{
|
679
|
+
"disabled": false,
|
680
|
+
"document": "创建成功的演练ID",
|
681
|
+
"example": "50",
|
682
|
+
"member": "uint64",
|
683
|
+
"name": "TaskId",
|
684
|
+
"output_required": true,
|
685
|
+
"type": "int",
|
686
|
+
"value_allowed_null": false
|
687
|
+
},
|
688
|
+
{
|
689
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
690
|
+
"member": "string",
|
691
|
+
"name": "RequestId",
|
692
|
+
"type": "string"
|
693
|
+
}
|
694
|
+
],
|
695
|
+
"type": "object"
|
696
|
+
},
|
617
697
|
"CreateTaskFromTemplateRequest": {
|
618
698
|
"document": "CreateTaskFromTemplate请求参数结构体",
|
619
699
|
"members": [
|
@@ -2847,6 +2927,39 @@
|
|
2847
2927
|
],
|
2848
2928
|
"usage": "in"
|
2849
2929
|
},
|
2930
|
+
"TaskGroupForAction": {
|
2931
|
+
"document": "演练动作组简易配置",
|
2932
|
+
"members": [
|
2933
|
+
{
|
2934
|
+
"disabled": false,
|
2935
|
+
"document": "动作ID",
|
2936
|
+
"example": "1",
|
2937
|
+
"member": "int64",
|
2938
|
+
"name": "TaskActionId",
|
2939
|
+
"required": false,
|
2940
|
+
"type": "int"
|
2941
|
+
},
|
2942
|
+
{
|
2943
|
+
"disabled": false,
|
2944
|
+
"document": "{\"ActionTimeout\":1800}",
|
2945
|
+
"example": "动作通用参数",
|
2946
|
+
"member": "string",
|
2947
|
+
"name": "TaskActionGeneralConfiguration",
|
2948
|
+
"required": false,
|
2949
|
+
"type": "string"
|
2950
|
+
},
|
2951
|
+
{
|
2952
|
+
"disabled": false,
|
2953
|
+
"document": "{\"ip\": \"0.0.0.0\"}",
|
2954
|
+
"example": "动作特有参数",
|
2955
|
+
"member": "string",
|
2956
|
+
"name": "TaskActionCustomConfiguration",
|
2957
|
+
"required": false,
|
2958
|
+
"type": "string"
|
2959
|
+
}
|
2960
|
+
],
|
2961
|
+
"usage": "in"
|
2962
|
+
},
|
2850
2963
|
"TaskGroupInstance": {
|
2851
2964
|
"document": "任务分组动作实例",
|
2852
2965
|
"members": [
|
@@ -8,6 +8,14 @@
|
|
8
8
|
"title": "从动作创建演练"
|
9
9
|
}
|
10
10
|
],
|
11
|
+
"CreateTaskFromMultiAction": [
|
12
|
+
{
|
13
|
+
"document": "",
|
14
|
+
"input": "POST / HTTP/1.1\nHost: cfg.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateTaskFromMultiAction\n<公共请求参数>\n\n{\n \"TaskInstances\": [\n \"abc\"\n ],\n \"TaskTitle\": \"abc\",\n \"TaskDescription\": \"abc\",\n \"TaskPauseDuration\": 1,\n \"TaskAction\": [\n {\n \"TaskActionId\": 0,\n \"TaskActionGeneralConfiguration\": \"abc\",\n \"TaskActionCustomConfiguration\": \"abc\"\n }\n ]\n}",
|
15
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"f0aee8ac-2ed3-4a7f-a25b-f0d7d228dd30\",\n \"TaskId\": 50\n }\n}",
|
16
|
+
"title": "示例"
|
17
|
+
}
|
18
|
+
],
|
11
19
|
"CreateTaskFromTemplate": [
|
12
20
|
{
|
13
21
|
"document": "通过预创建好的经验模板生成常规化的演练持续使用",
|