tccli 3.0.1097.1__py2.py3-none-any.whl → 3.0.1098.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/examples/apm/v20210622/DescribeGeneralApmApplicationConfig.md +103 -0
- tccli/examples/apm/v20210622/DescribeTagValues.md +27 -0
- tccli/examples/apm/v20210622/ModifyGeneralApmApplicationConfig.md +29 -0
- tccli/examples/ess/v20201111/CreateBatchSignUrl.md +28 -0
- tccli/examples/essbasic/v20210526/ChannelCreateBatchSignUrl.md +28 -0
- tccli/examples/iotexplorer/v20190423/DescribeDeviceFirmwares.md +33 -0
- tccli/services/apm/apm_client.py +159 -0
- tccli/services/apm/v20210622/api.json +456 -0
- tccli/services/apm/v20210622/examples.json +24 -0
- tccli/services/cloudstudio/v20230508/api.json +1 -1
- tccli/services/cynosdb/v20190107/api.json +2 -0
- tccli/services/ess/v20201111/api.json +50 -2
- tccli/services/ess/v20201111/examples.json +6 -0
- tccli/services/essbasic/v20210526/api.json +50 -2
- tccli/services/essbasic/v20210526/examples.json +6 -0
- tccli/services/ims/v20201229/api.json +55 -55
- tccli/services/iotexplorer/iotexplorer_client.py +53 -0
- tccli/services/iotexplorer/v20190423/api.json +89 -0
- tccli/services/iotexplorer/v20190423/examples.json +8 -0
- tccli/services/iss/v20230517/api.json +36 -0
- tccli/services/lke/lke_client.py +8 -114
- tccli/services/lke/v20231130/api.json +2 -166
- tccli/services/lke/v20231130/examples.json +0 -16
- tccli/services/tdid/v20210519/api.json +2 -2
- tccli/services/teo/v20220901/api.json +14 -14
- tccli/services/tione/v20211111/api.json +28 -0
- {tccli-3.0.1097.1.dist-info → tccli-3.0.1098.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1097.1.dist-info → tccli-3.0.1098.1.dist-info}/RECORD +32 -28
- {tccli-3.0.1097.1.dist-info → tccli-3.0.1098.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1097.1.dist-info → tccli-3.0.1098.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1097.1.dist-info → tccli-3.0.1098.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '3.0.
|
1
|
+
__version__ = '3.0.1098.1'
|
@@ -0,0 +1,103 @@
|
|
1
|
+
**Example 1: 查询应用配置信息**
|
2
|
+
|
3
|
+
查询指定实例下应用的配置信息
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli apm DescribeGeneralApmApplicationConfig --cli-unfold-argument \
|
9
|
+
--InstanceId apm-6xYKFXYxo \
|
10
|
+
--ServiceName java-order-service
|
11
|
+
```
|
12
|
+
|
13
|
+
Output:
|
14
|
+
```
|
15
|
+
{
|
16
|
+
"Response": {
|
17
|
+
"ApmApplicationConfigView": {
|
18
|
+
"InstanceKey": "apm-059oXBfTL",
|
19
|
+
"ServiceName": "profile-service",
|
20
|
+
"OperationNameFilter": "",
|
21
|
+
"ExceptionFilter": "",
|
22
|
+
"ErrorCodeFilter": "",
|
23
|
+
"EventEnable": false,
|
24
|
+
"UrlConvergenceSwitch": 1,
|
25
|
+
"UrlConvergenceThreshold": 500,
|
26
|
+
"UrlConvergence": "RPCServer/market.MarketService2/(.*?)",
|
27
|
+
"UrlExclude": "",
|
28
|
+
"IsRelatedLog": 0,
|
29
|
+
"LogSource": "CLS",
|
30
|
+
"LogSet": "",
|
31
|
+
"LogTopicID": "",
|
32
|
+
"SnapshotEnable": true,
|
33
|
+
"SnapshotTimeout": 2000,
|
34
|
+
"AgentEnable": true,
|
35
|
+
"InstrumentList": [
|
36
|
+
{
|
37
|
+
"Name": "dubbo",
|
38
|
+
"Enable": true
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"Name": "googlehttpclient",
|
42
|
+
"Enable": true
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"Name": "grpc",
|
46
|
+
"Enable": true
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"Name": "httpclient3",
|
50
|
+
"Enable": true
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"Name": "httpclient4",
|
54
|
+
"Enable": true
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"Name": "hystrix",
|
58
|
+
"Enable": true
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"Name": "lettuce",
|
62
|
+
"Enable": true
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"Name": "mongodb",
|
66
|
+
"Enable": true
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"Name": "mybatis",
|
70
|
+
"Enable": true
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"Name": "mysql",
|
74
|
+
"Enable": true
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"Name": "okhttp",
|
78
|
+
"Enable": true
|
79
|
+
},
|
80
|
+
{
|
81
|
+
"Name": "redis",
|
82
|
+
"Enable": true
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"Name": "rxjava",
|
86
|
+
"Enable": true
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"Name": "spring-webmvc",
|
90
|
+
"Enable": true
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"Name": "tomcat",
|
94
|
+
"Enable": true
|
95
|
+
}
|
96
|
+
],
|
97
|
+
"TraceSquash": true
|
98
|
+
},
|
99
|
+
"RequestId": "test-test-test0980990"
|
100
|
+
}
|
101
|
+
}
|
102
|
+
```
|
103
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
**Example 1: 查询维度数据**
|
2
|
+
|
3
|
+
根据维度列名和过滤条件,查询维度值
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli apm DescribeTagValues --cli-unfold-argument \
|
9
|
+
--Filters.0.Key service.instance \
|
10
|
+
--Filters.0.Type = \
|
11
|
+
--Filters.0.Value 127.0.0.1 \
|
12
|
+
--TagKey servier.name
|
13
|
+
```
|
14
|
+
|
15
|
+
Output:
|
16
|
+
```
|
17
|
+
{
|
18
|
+
"Response": {
|
19
|
+
"RequestId": "apz12zicapy-eqixuc-uehq346v59c62",
|
20
|
+
"Values": [
|
21
|
+
"sso-api",
|
22
|
+
"auth-api"
|
23
|
+
]
|
24
|
+
}
|
25
|
+
}
|
26
|
+
```
|
27
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
**Example 1: 修改应用配置信息**
|
2
|
+
|
3
|
+
客户希望可以通过Api批量修改应用的配置信息
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli apm ModifyGeneralApmApplicationConfig --cli-unfold-argument \
|
9
|
+
--Tags.0.Key UrlConvergence \
|
10
|
+
--Tags.0.Value RPCServer/market.MarketServiceleetcode9(.*?) \
|
11
|
+
--Tags.1.Key UrlConvergenceThreshold \
|
12
|
+
--Tags.1.Value 600 \
|
13
|
+
--Tags.2.Key UrlConvergenceSwitch \
|
14
|
+
--Tags.2.Value 1 \
|
15
|
+
--Tags.3.Key AgentEnable \
|
16
|
+
--Tags.3.Value true \
|
17
|
+
--ServiceNames stock-service profile-service28 profile-service08 \
|
18
|
+
--InstanceId apm-059oXBfTL
|
19
|
+
```
|
20
|
+
|
21
|
+
Output:
|
22
|
+
```
|
23
|
+
{
|
24
|
+
"Response": {
|
25
|
+
"RequestId": "test-test-test0980990"
|
26
|
+
}
|
27
|
+
}
|
28
|
+
```
|
29
|
+
|
@@ -92,3 +92,31 @@ Output:
|
|
92
92
|
}
|
93
93
|
```
|
94
94
|
|
95
|
+
**Example 4: 生成动态签署人批量领取链接**
|
96
|
+
|
97
|
+
按照合同发起时候返回的合同信息生成批量签署链接,通过FlowIds参数对用户可以批签的合同进行限制,并指定批量领取的动态签署方。
|
98
|
+
|
99
|
+
Input:
|
100
|
+
|
101
|
+
```
|
102
|
+
tccli ess CreateBatchSignUrl --cli-unfold-argument \
|
103
|
+
--Operator.UserId yDRCLUUgygq2******uO4zjEwg0vjoimj \
|
104
|
+
--FlowIds yDwFdUUckpsw******yQ0af8bHosXQtb yDR1AUUgygj******uO4zjE8gTG7xvgH \
|
105
|
+
--FlowBatchUrlInfo.FlowBatchApproverInfos.0.FlowId yDwFdUUckpsw******yQ0af8bHosXQtb \
|
106
|
+
--FlowBatchUrlInfo.FlowBatchApproverInfos.0.RecipientId yDC5SUUckp******sumxxsjT3EEMVG \
|
107
|
+
--FlowBatchUrlInfo.FlowBatchApproverInfos.1.FlowId yDR1AUUgygj******uO4zjE8gTG7xvgH \
|
108
|
+
--FlowBatchUrlInfo.FlowBatchApproverInfos.1.RecipientId yDC5SUUckp*****sumxEeTQ3Xcn0B
|
109
|
+
```
|
110
|
+
|
111
|
+
Output:
|
112
|
+
```
|
113
|
+
{
|
114
|
+
"Response": {
|
115
|
+
"ExpiredTime": 1714533495,
|
116
|
+
"MiniAppPath": "pages/guide/index?shortKey=yDC5tUf****tMb93lb5",
|
117
|
+
"RequestId": "s1713928695416440124",
|
118
|
+
"SignUrl": "https://test.essurl.cn/uBS****do7"
|
119
|
+
}
|
120
|
+
}
|
121
|
+
```
|
122
|
+
|
@@ -97,3 +97,31 @@ Output:
|
|
97
97
|
}
|
98
98
|
```
|
99
99
|
|
100
|
+
**Example 4: 生成动态签署人批量领取链接**
|
101
|
+
|
102
|
+
按照合同发起时候返回的合同信息生成批量签署链接,通过FlowIds参数对用户可以批签的合同进行限制,并指定批量领取的动态签署方。
|
103
|
+
|
104
|
+
Input:
|
105
|
+
|
106
|
+
```
|
107
|
+
tccli essbasic ChannelCreateBatchSignUrl --cli-unfold-argument \
|
108
|
+
--Agent.ProxyOperator.OpenId test_open_id \
|
109
|
+
--Agent.ProxyOrganizationOpenId test_org_open_id \
|
110
|
+
--Agent.AppId yDxbWUyKQ*******4zjEB8mxCcDjAyF \
|
111
|
+
--FlowIds yDwFdUUckpsw******yQ0af8bHosXQtb yDR1AUUgygj******uO4zjE8gTG7xvgH \
|
112
|
+
--FlowBatchUrlInfo.FlowBatchApproverInfos.0.FlowId yDC5yUUckpwexoz4UuoHfkT1DMEDQSG5 \
|
113
|
+
--FlowBatchUrlInfo.FlowBatchApproverInfos.0.RecipientId yDC5yUUckpwexozwUuoHfkTwB00zdfLo
|
114
|
+
```
|
115
|
+
|
116
|
+
Output:
|
117
|
+
```
|
118
|
+
{
|
119
|
+
"Response": {
|
120
|
+
"ExpiredTime": 1684899114,
|
121
|
+
"RequestId": "5beb5f54-cf3d-4c26-a4ee-a97c85196a3e",
|
122
|
+
"SignUrl": "https://ess.url.cn/FuP**Swc",
|
123
|
+
"MiniAppPath": "pages/guide/index?shortKey=FuP3**wc"
|
124
|
+
}
|
125
|
+
}
|
126
|
+
```
|
127
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
**Example 1: 获取设备固件信息**
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli iotexplorer DescribeDeviceFirmwares --cli-unfold-argument \
|
9
|
+
--ProductId xx \
|
10
|
+
--DeviceName xx
|
11
|
+
```
|
12
|
+
|
13
|
+
Output:
|
14
|
+
```
|
15
|
+
{
|
16
|
+
"Response": {
|
17
|
+
"RequestId": "ef9ec631-7337-481b-a6c3-59a34b5f8502",
|
18
|
+
"Firmwares": [
|
19
|
+
{
|
20
|
+
"UpdateTime": 1653893719,
|
21
|
+
"FwType": "mcu",
|
22
|
+
"Version": "mm_3.0"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"UpdateTime": 1653893651,
|
26
|
+
"FwType": "module",
|
27
|
+
"Version": "module_v1.0.3"
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
}
|
32
|
+
```
|
33
|
+
|
tccli/services/apm/apm_client.py
CHANGED
@@ -69,6 +69,58 @@ def doModifyApmInstance(args, parsed_globals):
|
|
69
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
70
|
|
71
71
|
|
72
|
+
def doDescribeTagValues(args, parsed_globals):
|
73
|
+
g_param = parse_global_arg(parsed_globals)
|
74
|
+
|
75
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
76
|
+
cred = credential.CVMRoleCredential()
|
77
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
78
|
+
cred = credential.STSAssumeRoleCredential(
|
79
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
80
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
81
|
+
)
|
82
|
+
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):
|
83
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
84
|
+
else:
|
85
|
+
cred = credential.Credential(
|
86
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
87
|
+
)
|
88
|
+
http_profile = HttpProfile(
|
89
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
90
|
+
reqMethod="POST",
|
91
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
92
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
93
|
+
)
|
94
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
95
|
+
if g_param[OptionsDefine.Language]:
|
96
|
+
profile.language = g_param[OptionsDefine.Language]
|
97
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
98
|
+
client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
|
99
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
100
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
+
model = models.DescribeTagValuesRequest()
|
102
|
+
model.from_json_string(json.dumps(args))
|
103
|
+
start_time = time.time()
|
104
|
+
while True:
|
105
|
+
rsp = client.DescribeTagValues(model)
|
106
|
+
result = rsp.to_json_string()
|
107
|
+
try:
|
108
|
+
json_obj = json.loads(result)
|
109
|
+
except TypeError as e:
|
110
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
111
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
112
|
+
break
|
113
|
+
cur_time = time.time()
|
114
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
115
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
116
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
117
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
118
|
+
else:
|
119
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
120
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
121
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
|
+
|
123
|
+
|
72
124
|
def doDescribeGeneralSpanList(args, parsed_globals):
|
73
125
|
g_param = parse_global_arg(parsed_globals)
|
74
126
|
|
@@ -225,6 +277,110 @@ def doDescribeApmAgent(args, parsed_globals):
|
|
225
277
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
278
|
|
227
279
|
|
280
|
+
def doDescribeGeneralApmApplicationConfig(args, parsed_globals):
|
281
|
+
g_param = parse_global_arg(parsed_globals)
|
282
|
+
|
283
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
284
|
+
cred = credential.CVMRoleCredential()
|
285
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
286
|
+
cred = credential.STSAssumeRoleCredential(
|
287
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
288
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
289
|
+
)
|
290
|
+
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):
|
291
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
292
|
+
else:
|
293
|
+
cred = credential.Credential(
|
294
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
295
|
+
)
|
296
|
+
http_profile = HttpProfile(
|
297
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
298
|
+
reqMethod="POST",
|
299
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
300
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
301
|
+
)
|
302
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
303
|
+
if g_param[OptionsDefine.Language]:
|
304
|
+
profile.language = g_param[OptionsDefine.Language]
|
305
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
306
|
+
client = mod.ApmClient(cred, g_param[OptionsDefine.Region], profile)
|
307
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
308
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
+
model = models.DescribeGeneralApmApplicationConfigRequest()
|
310
|
+
model.from_json_string(json.dumps(args))
|
311
|
+
start_time = time.time()
|
312
|
+
while True:
|
313
|
+
rsp = client.DescribeGeneralApmApplicationConfig(model)
|
314
|
+
result = rsp.to_json_string()
|
315
|
+
try:
|
316
|
+
json_obj = json.loads(result)
|
317
|
+
except TypeError as e:
|
318
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
319
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
320
|
+
break
|
321
|
+
cur_time = time.time()
|
322
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
323
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
324
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
325
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
326
|
+
else:
|
327
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
328
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
329
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
330
|
+
|
331
|
+
|
332
|
+
def doModifyGeneralApmApplicationConfig(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.ApmClient(cred, g_param[OptionsDefine.Region], profile)
|
359
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
360
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
+
model = models.ModifyGeneralApmApplicationConfigRequest()
|
362
|
+
model.from_json_string(json.dumps(args))
|
363
|
+
start_time = time.time()
|
364
|
+
while True:
|
365
|
+
rsp = client.ModifyGeneralApmApplicationConfig(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
|
+
|
228
384
|
def doDescribeGeneralMetricData(args, parsed_globals):
|
229
385
|
g_param = parse_global_arg(parsed_globals)
|
230
386
|
|
@@ -497,9 +653,12 @@ MODELS_MAP = {
|
|
497
653
|
|
498
654
|
ACTION_MAP = {
|
499
655
|
"ModifyApmInstance": doModifyApmInstance,
|
656
|
+
"DescribeTagValues": doDescribeTagValues,
|
500
657
|
"DescribeGeneralSpanList": doDescribeGeneralSpanList,
|
501
658
|
"DescribeApmInstances": doDescribeApmInstances,
|
502
659
|
"DescribeApmAgent": doDescribeApmAgent,
|
660
|
+
"DescribeGeneralApmApplicationConfig": doDescribeGeneralApmApplicationConfig,
|
661
|
+
"ModifyGeneralApmApplicationConfig": doModifyGeneralApmApplicationConfig,
|
503
662
|
"DescribeGeneralMetricData": doDescribeGeneralMetricData,
|
504
663
|
"DescribeMetricRecords": doDescribeMetricRecords,
|
505
664
|
"TerminateApmInstance": doTerminateApmInstance,
|