tccli 3.0.1292.2__py2.py3-none-any.whl → 3.0.1293.2__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 +3 -0
- tccli/services/advisor/v20200721/api.json +36 -36
- tccli/services/advisor/v20200721/examples.json +2 -2
- tccli/services/batch/v20170312/api.json +4 -4
- tccli/services/cam/v20190116/api.json +18 -18
- tccli/services/cdwpg/v20201230/api.json +114 -107
- tccli/services/cdwpg/v20201230/examples.json +3 -3
- tccli/services/chc/__init__.py +4 -0
- tccli/services/chc/chc_client.py +2062 -0
- tccli/services/chc/v20230418/api.json +5728 -0
- tccli/services/chc/v20230418/examples.json +293 -0
- tccli/services/ckafka/v20190819/api.json +34 -34
- tccli/services/ckafka/v20190819/examples.json +1 -1
- tccli/services/cls/v20201016/api.json +198 -198
- tccli/services/cls/v20201016/examples.json +1 -1
- tccli/services/dbbrain/dbbrain_client.py +240 -28
- tccli/services/dbbrain/v20191016/api.json +5 -5
- tccli/services/dbbrain/v20210527/api.json +473 -10
- tccli/services/dbbrain/v20210527/examples.json +32 -0
- tccli/services/domain/v20180808/api.json +2 -2
- tccli/services/ecdn/ecdn_client.py +7 -431
- tccli/services/ecdn/v20191012/api.json +0 -574
- tccli/services/ecdn/v20191012/examples.json +0 -64
- tccli/services/ess/v20201111/api.json +12 -3
- tccli/services/essbasic/v20210526/api.json +9 -0
- tccli/services/gs/gs_client.py +1778 -29
- tccli/services/gs/v20191118/api.json +2618 -163
- tccli/services/gs/v20191118/examples.json +264 -0
- tccli/services/hai/v20230812/api.json +22 -22
- tccli/services/lke/v20231130/api.json +14 -14
- tccli/services/lke/v20231130/examples.json +2 -2
- tccli/services/mmps/v20200710/api.json +12 -12
- tccli/services/mqtt/v20240516/api.json +13 -13
- tccli/services/mqtt/v20240516/examples.json +1 -1
- tccli/services/tchd/v20230306/api.json +5 -5
- tccli/services/tcr/v20190924/api.json +22 -22
- tccli/services/tdmq/v20200217/api.json +1 -1
- tccli/services/thpc/v20220401/api.json +3 -3
- tccli/services/thpc/v20230321/api.json +45 -33
- tccli/services/tione/v20211111/api.json +40 -1
- tccli/services/tke/v20180525/api.json +29 -29
- tccli/services/vpc/v20170312/api.json +1 -1
- tccli/services/wedata/v20210820/api.json +61 -1
- tccli/services/wedata/v20210820/examples.json +2 -8
- {tccli-3.0.1292.2.dist-info → tccli-3.0.1293.2.dist-info}/METADATA +2 -2
- {tccli-3.0.1292.2.dist-info → tccli-3.0.1293.2.dist-info}/RECORD +50 -46
- {tccli-3.0.1292.2.dist-info → tccli-3.0.1293.2.dist-info}/WHEEL +0 -0
- {tccli-3.0.1292.2.dist-info → tccli-3.0.1293.2.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1292.2.dist-info → tccli-3.0.1293.2.dist-info}/license_files/LICENSE +0 -0
@@ -17,58 +17,6 @@ from tencentcloud.ecdn.v20191012 import models as models_v20191012
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
-
def doAddEcdnDomain(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.EcdnClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
-
model = models.AddEcdnDomainRequest()
|
50
|
-
model.from_json_string(json.dumps(args))
|
51
|
-
start_time = time.time()
|
52
|
-
while True:
|
53
|
-
rsp = client.AddEcdnDomain(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
20
|
def doDescribeIpStatus(args, parsed_globals):
|
73
21
|
g_param = parse_global_arg(parsed_globals)
|
74
22
|
|
@@ -121,214 +69,6 @@ def doDescribeIpStatus(args, parsed_globals):
|
|
121
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
70
|
|
123
71
|
|
124
|
-
def doPurgePathCache(args, parsed_globals):
|
125
|
-
g_param = parse_global_arg(parsed_globals)
|
126
|
-
|
127
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
128
|
-
cred = credential.CVMRoleCredential()
|
129
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
130
|
-
cred = credential.STSAssumeRoleCredential(
|
131
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
132
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
133
|
-
)
|
134
|
-
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):
|
135
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
136
|
-
else:
|
137
|
-
cred = credential.Credential(
|
138
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
139
|
-
)
|
140
|
-
http_profile = HttpProfile(
|
141
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
142
|
-
reqMethod="POST",
|
143
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
144
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
145
|
-
)
|
146
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
147
|
-
if g_param[OptionsDefine.Language]:
|
148
|
-
profile.language = g_param[OptionsDefine.Language]
|
149
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
150
|
-
client = mod.EcdnClient(cred, g_param[OptionsDefine.Region], profile)
|
151
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
152
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.PurgePathCacheRequest()
|
154
|
-
model.from_json_string(json.dumps(args))
|
155
|
-
start_time = time.time()
|
156
|
-
while True:
|
157
|
-
rsp = client.PurgePathCache(model)
|
158
|
-
result = rsp.to_json_string()
|
159
|
-
try:
|
160
|
-
json_obj = json.loads(result)
|
161
|
-
except TypeError as e:
|
162
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
163
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
164
|
-
break
|
165
|
-
cur_time = time.time()
|
166
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
167
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
168
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
169
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
170
|
-
else:
|
171
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
172
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
173
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
|
-
|
175
|
-
|
176
|
-
def doStartEcdnDomain(args, parsed_globals):
|
177
|
-
g_param = parse_global_arg(parsed_globals)
|
178
|
-
|
179
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
180
|
-
cred = credential.CVMRoleCredential()
|
181
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
182
|
-
cred = credential.STSAssumeRoleCredential(
|
183
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
184
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
185
|
-
)
|
186
|
-
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):
|
187
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
188
|
-
else:
|
189
|
-
cred = credential.Credential(
|
190
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
191
|
-
)
|
192
|
-
http_profile = HttpProfile(
|
193
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
194
|
-
reqMethod="POST",
|
195
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
196
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
197
|
-
)
|
198
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
199
|
-
if g_param[OptionsDefine.Language]:
|
200
|
-
profile.language = g_param[OptionsDefine.Language]
|
201
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
202
|
-
client = mod.EcdnClient(cred, g_param[OptionsDefine.Region], profile)
|
203
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
204
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
-
model = models.StartEcdnDomainRequest()
|
206
|
-
model.from_json_string(json.dumps(args))
|
207
|
-
start_time = time.time()
|
208
|
-
while True:
|
209
|
-
rsp = client.StartEcdnDomain(model)
|
210
|
-
result = rsp.to_json_string()
|
211
|
-
try:
|
212
|
-
json_obj = json.loads(result)
|
213
|
-
except TypeError as e:
|
214
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
215
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
216
|
-
break
|
217
|
-
cur_time = time.time()
|
218
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
219
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
220
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
221
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
222
|
-
else:
|
223
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
224
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
225
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
|
-
|
227
|
-
|
228
|
-
def doDescribeEcdnDomainStatistics(args, parsed_globals):
|
229
|
-
g_param = parse_global_arg(parsed_globals)
|
230
|
-
|
231
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
232
|
-
cred = credential.CVMRoleCredential()
|
233
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
234
|
-
cred = credential.STSAssumeRoleCredential(
|
235
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
236
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
237
|
-
)
|
238
|
-
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):
|
239
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
240
|
-
else:
|
241
|
-
cred = credential.Credential(
|
242
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
243
|
-
)
|
244
|
-
http_profile = HttpProfile(
|
245
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
246
|
-
reqMethod="POST",
|
247
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
248
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
249
|
-
)
|
250
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
251
|
-
if g_param[OptionsDefine.Language]:
|
252
|
-
profile.language = g_param[OptionsDefine.Language]
|
253
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
254
|
-
client = mod.EcdnClient(cred, g_param[OptionsDefine.Region], profile)
|
255
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
256
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.DescribeEcdnDomainStatisticsRequest()
|
258
|
-
model.from_json_string(json.dumps(args))
|
259
|
-
start_time = time.time()
|
260
|
-
while True:
|
261
|
-
rsp = client.DescribeEcdnDomainStatistics(model)
|
262
|
-
result = rsp.to_json_string()
|
263
|
-
try:
|
264
|
-
json_obj = json.loads(result)
|
265
|
-
except TypeError as e:
|
266
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
267
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
268
|
-
break
|
269
|
-
cur_time = time.time()
|
270
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
271
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
272
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
273
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
274
|
-
else:
|
275
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
276
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
277
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
|
-
|
279
|
-
|
280
|
-
def doDeleteEcdnDomain(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.EcdnClient(cred, g_param[OptionsDefine.Region], profile)
|
307
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
308
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.DeleteEcdnDomainRequest()
|
310
|
-
model.from_json_string(json.dumps(args))
|
311
|
-
start_time = time.time()
|
312
|
-
while True:
|
313
|
-
rsp = client.DeleteEcdnDomain(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
72
|
def doDescribePurgeTasks(args, parsed_globals):
|
333
73
|
g_param = parse_global_arg(parsed_globals)
|
334
74
|
|
@@ -485,58 +225,6 @@ def doDescribeDomainsConfig(args, parsed_globals):
|
|
485
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
226
|
|
487
227
|
|
488
|
-
def doDescribePurgeQuota(args, parsed_globals):
|
489
|
-
g_param = parse_global_arg(parsed_globals)
|
490
|
-
|
491
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
492
|
-
cred = credential.CVMRoleCredential()
|
493
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
494
|
-
cred = credential.STSAssumeRoleCredential(
|
495
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
496
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
497
|
-
)
|
498
|
-
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):
|
499
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
500
|
-
else:
|
501
|
-
cred = credential.Credential(
|
502
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
503
|
-
)
|
504
|
-
http_profile = HttpProfile(
|
505
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
506
|
-
reqMethod="POST",
|
507
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
508
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
509
|
-
)
|
510
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
511
|
-
if g_param[OptionsDefine.Language]:
|
512
|
-
profile.language = g_param[OptionsDefine.Language]
|
513
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
514
|
-
client = mod.EcdnClient(cred, g_param[OptionsDefine.Region], profile)
|
515
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
516
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
-
model = models.DescribePurgeQuotaRequest()
|
518
|
-
model.from_json_string(json.dumps(args))
|
519
|
-
start_time = time.time()
|
520
|
-
while True:
|
521
|
-
rsp = client.DescribePurgeQuota(model)
|
522
|
-
result = rsp.to_json_string()
|
523
|
-
try:
|
524
|
-
json_obj = json.loads(result)
|
525
|
-
except TypeError as e:
|
526
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
527
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
528
|
-
break
|
529
|
-
cur_time = time.time()
|
530
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
531
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
532
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
533
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
534
|
-
else:
|
535
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
536
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
537
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
|
-
|
539
|
-
|
540
228
|
def doPurgeUrlsCache(args, parsed_globals):
|
541
229
|
g_param = parse_global_arg(parsed_globals)
|
542
230
|
|
@@ -589,58 +277,6 @@ def doPurgeUrlsCache(args, parsed_globals):
|
|
589
277
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
278
|
|
591
279
|
|
592
|
-
def doUpdateDomainConfig(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.EcdnClient(cred, g_param[OptionsDefine.Region], profile)
|
619
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
620
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
-
model = models.UpdateDomainConfigRequest()
|
622
|
-
model.from_json_string(json.dumps(args))
|
623
|
-
start_time = time.time()
|
624
|
-
while True:
|
625
|
-
rsp = client.UpdateDomainConfig(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
|
-
|
644
280
|
def doDescribeDomains(args, parsed_globals):
|
645
281
|
g_param = parse_global_arg(parsed_globals)
|
646
282
|
|
@@ -693,59 +329,7 @@ def doDescribeDomains(args, parsed_globals):
|
|
693
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
330
|
|
695
331
|
|
696
|
-
def
|
697
|
-
g_param = parse_global_arg(parsed_globals)
|
698
|
-
|
699
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
700
|
-
cred = credential.CVMRoleCredential()
|
701
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
702
|
-
cred = credential.STSAssumeRoleCredential(
|
703
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
704
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
705
|
-
)
|
706
|
-
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):
|
707
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
708
|
-
else:
|
709
|
-
cred = credential.Credential(
|
710
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
711
|
-
)
|
712
|
-
http_profile = HttpProfile(
|
713
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
714
|
-
reqMethod="POST",
|
715
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
716
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
717
|
-
)
|
718
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
719
|
-
if g_param[OptionsDefine.Language]:
|
720
|
-
profile.language = g_param[OptionsDefine.Language]
|
721
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
722
|
-
client = mod.EcdnClient(cred, g_param[OptionsDefine.Region], profile)
|
723
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
724
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
-
model = models.CreateVerifyRecordRequest()
|
726
|
-
model.from_json_string(json.dumps(args))
|
727
|
-
start_time = time.time()
|
728
|
-
while True:
|
729
|
-
rsp = client.CreateVerifyRecord(model)
|
730
|
-
result = rsp.to_json_string()
|
731
|
-
try:
|
732
|
-
json_obj = json.loads(result)
|
733
|
-
except TypeError as e:
|
734
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
735
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
736
|
-
break
|
737
|
-
cur_time = time.time()
|
738
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
739
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
740
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
741
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
742
|
-
else:
|
743
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
744
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
745
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
|
-
|
747
|
-
|
748
|
-
def doStopEcdnDomain(args, parsed_globals):
|
332
|
+
def doDescribeEcdnStatistics(args, parsed_globals):
|
749
333
|
g_param = parse_global_arg(parsed_globals)
|
750
334
|
|
751
335
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -774,11 +358,11 @@ def doStopEcdnDomain(args, parsed_globals):
|
|
774
358
|
client = mod.EcdnClient(cred, g_param[OptionsDefine.Region], profile)
|
775
359
|
client._sdkVersion += ("_CLI_" + __version__)
|
776
360
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
-
model = models.
|
361
|
+
model = models.DescribeEcdnStatisticsRequest()
|
778
362
|
model.from_json_string(json.dumps(args))
|
779
363
|
start_time = time.time()
|
780
364
|
while True:
|
781
|
-
rsp = client.
|
365
|
+
rsp = client.DescribeEcdnStatistics(model)
|
782
366
|
result = rsp.to_json_string()
|
783
367
|
try:
|
784
368
|
json_obj = json.loads(result)
|
@@ -797,7 +381,7 @@ def doStopEcdnDomain(args, parsed_globals):
|
|
797
381
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
382
|
|
799
383
|
|
800
|
-
def
|
384
|
+
def doDescribeEcdnDomainStatistics(args, parsed_globals):
|
801
385
|
g_param = parse_global_arg(parsed_globals)
|
802
386
|
|
803
387
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -826,11 +410,11 @@ def doDescribeEcdnStatistics(args, parsed_globals):
|
|
826
410
|
client = mod.EcdnClient(cred, g_param[OptionsDefine.Region], profile)
|
827
411
|
client._sdkVersion += ("_CLI_" + __version__)
|
828
412
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.
|
413
|
+
model = models.DescribeEcdnDomainStatisticsRequest()
|
830
414
|
model.from_json_string(json.dumps(args))
|
831
415
|
start_time = time.time()
|
832
416
|
while True:
|
833
|
-
rsp = client.
|
417
|
+
rsp = client.DescribeEcdnDomainStatistics(model)
|
834
418
|
result = rsp.to_json_string()
|
835
419
|
try:
|
836
420
|
json_obj = json.loads(result)
|
@@ -860,22 +444,14 @@ MODELS_MAP = {
|
|
860
444
|
}
|
861
445
|
|
862
446
|
ACTION_MAP = {
|
863
|
-
"AddEcdnDomain": doAddEcdnDomain,
|
864
447
|
"DescribeIpStatus": doDescribeIpStatus,
|
865
|
-
"PurgePathCache": doPurgePathCache,
|
866
|
-
"StartEcdnDomain": doStartEcdnDomain,
|
867
|
-
"DescribeEcdnDomainStatistics": doDescribeEcdnDomainStatistics,
|
868
|
-
"DeleteEcdnDomain": doDeleteEcdnDomain,
|
869
448
|
"DescribePurgeTasks": doDescribePurgeTasks,
|
870
449
|
"DescribeEcdnDomainLogs": doDescribeEcdnDomainLogs,
|
871
450
|
"DescribeDomainsConfig": doDescribeDomainsConfig,
|
872
|
-
"DescribePurgeQuota": doDescribePurgeQuota,
|
873
451
|
"PurgeUrlsCache": doPurgeUrlsCache,
|
874
|
-
"UpdateDomainConfig": doUpdateDomainConfig,
|
875
452
|
"DescribeDomains": doDescribeDomains,
|
876
|
-
"CreateVerifyRecord": doCreateVerifyRecord,
|
877
|
-
"StopEcdnDomain": doStopEcdnDomain,
|
878
453
|
"DescribeEcdnStatistics": doDescribeEcdnStatistics,
|
454
|
+
"DescribeEcdnDomainStatistics": doDescribeEcdnDomainStatistics,
|
879
455
|
|
880
456
|
}
|
881
457
|
|