tccli 3.0.1284.1__py2.py3-none-any.whl → 3.0.1286.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tccli/__init__.py +1 -1
- tccli/services/autoscaling/v20180419/api.json +88 -86
- tccli/services/bh/bh_client.py +53 -0
- tccli/services/bh/v20230418/api.json +199 -0
- tccli/services/bh/v20230418/examples.json +8 -0
- tccli/services/cdwch/v20200915/api.json +19 -9
- tccli/services/cdwch/v20200915/examples.json +1 -1
- tccli/services/cfg/v20210820/api.json +43 -19
- tccli/services/cfg/v20210820/examples.json +8 -2
- tccli/services/clb/v20180317/api.json +1 -1
- tccli/services/cmq/v20190304/api.json +92 -92
- tccli/services/cynosdb/v20190107/api.json +379 -379
- tccli/services/dlc/dlc_client.py +61 -8
- tccli/services/dlc/v20210125/api.json +254 -3
- tccli/services/dlc/v20210125/examples.json +11 -3
- tccli/services/domain/v20180808/api.json +157 -157
- tccli/services/dsgc/v20190723/api.json +2 -2
- tccli/services/dts/v20180330/api.json +3 -3
- tccli/services/dts/v20211206/api.json +336 -330
- tccli/services/emr/emr_client.py +53 -0
- tccli/services/emr/v20190103/api.json +247 -0
- tccli/services/emr/v20190103/examples.json +8 -0
- tccli/services/es/v20180416/api.json +10 -0
- tccli/services/es/v20180416/examples.json +1 -1
- tccli/services/fmu/fmu_client.py +8 -167
- tccli/services/fmu/v20191213/api.json +0 -292
- tccli/services/fmu/v20191213/examples.json +0 -24
- tccli/services/iotcloud/v20210408/api.json +27 -27
- tccli/services/iotcloud/v20210408/examples.json +6 -6
- tccli/services/iotexplorer/iotexplorer_client.py +0 -106
- tccli/services/iotexplorer/v20190423/api.json +0 -274
- tccli/services/iotexplorer/v20190423/examples.json +0 -16
- tccli/services/iss/v20230517/api.json +547 -537
- tccli/services/iss/v20230517/examples.json +2 -2
- tccli/services/kms/v20190118/api.json +20 -0
- tccli/services/lcic/lcic_client.py +114 -8
- tccli/services/lcic/v20220817/api.json +108 -0
- tccli/services/lcic/v20220817/examples.json +16 -0
- tccli/services/mongodb/mongodb_client.py +57 -4
- tccli/services/mongodb/v20190725/api.json +63 -0
- tccli/services/mongodb/v20190725/examples.json +14 -0
- tccli/services/monitor/v20180724/api.json +29 -29
- tccli/services/monitor/v20180724/examples.json +8 -8
- tccli/services/rum/v20210622/api.json +2 -2
- tccli/services/svp/svp_client.py +57 -4
- tccli/services/svp/v20240125/api.json +319 -0
- tccli/services/svp/v20240125/examples.json +8 -0
- tccli/services/tiw/tiw_client.py +91 -1416
- tccli/services/tiw/v20190919/api.json +351 -2897
- tccli/services/tiw/v20190919/examples.json +6 -206
- tccli/services/trtc/v20190722/api.json +16 -5
- tccli/services/tsf/tsf_client.py +53 -0
- tccli/services/tsf/v20180326/api.json +48 -4
- tccli/services/tsf/v20180326/examples.json +8 -0
- tccli/services/vpc/v20170312/api.json +54 -0
- tccli/services/vpc/v20170312/examples.json +8 -0
- tccli/services/vpc/vpc_client.py +53 -0
- tccli/services/wedata/v20210820/api.json +383 -0
- tccli/services/wedata/v20210820/examples.json +8 -0
- tccli/services/wedata/wedata_client.py +53 -0
- {tccli-3.0.1284.1.dist-info → tccli-3.0.1286.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1284.1.dist-info → tccli-3.0.1286.1.dist-info}/RECORD +65 -65
- {tccli-3.0.1284.1.dist-info → tccli-3.0.1286.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1284.1.dist-info → tccli-3.0.1286.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1284.1.dist-info → tccli-3.0.1286.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/tiw/tiw_client.py
CHANGED
@@ -17,1203 +17,7 @@ from tencentcloud.tiw.v20190919 import models as models_v20190919
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
-
def
|
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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
-
model = models.DescribeWhiteboardBucketConfigRequest()
|
50
|
-
model.from_json_string(json.dumps(args))
|
51
|
-
start_time = time.time()
|
52
|
-
while True:
|
53
|
-
rsp = client.DescribeWhiteboardBucketConfig(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
|
-
def doSetOnlineRecordCallback(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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
99
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
100
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.SetOnlineRecordCallbackRequest()
|
102
|
-
model.from_json_string(json.dumps(args))
|
103
|
-
start_time = time.time()
|
104
|
-
while True:
|
105
|
-
rsp = client.SetOnlineRecordCallback(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
|
-
|
124
|
-
def doDescribeBoardSDKLog(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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
151
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
152
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.DescribeBoardSDKLogRequest()
|
154
|
-
model.from_json_string(json.dumps(args))
|
155
|
-
start_time = time.time()
|
156
|
-
while True:
|
157
|
-
rsp = client.DescribeBoardSDKLog(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 doDescribeUserList(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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
203
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
204
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
-
model = models.DescribeUserListRequest()
|
206
|
-
model.from_json_string(json.dumps(args))
|
207
|
-
start_time = time.time()
|
208
|
-
while True:
|
209
|
-
rsp = client.DescribeUserList(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 doSetVideoGenerationTaskCallback(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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
255
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
256
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.SetVideoGenerationTaskCallbackRequest()
|
258
|
-
model.from_json_string(json.dumps(args))
|
259
|
-
start_time = time.time()
|
260
|
-
while True:
|
261
|
-
rsp = client.SetVideoGenerationTaskCallback(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 doDescribeRecordSearch(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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
307
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
308
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.DescribeRecordSearchRequest()
|
310
|
-
model.from_json_string(json.dumps(args))
|
311
|
-
start_time = time.time()
|
312
|
-
while True:
|
313
|
-
rsp = client.DescribeRecordSearch(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 doDescribePostpaidUsage(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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
359
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
360
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
-
model = models.DescribePostpaidUsageRequest()
|
362
|
-
model.from_json_string(json.dumps(args))
|
363
|
-
start_time = time.time()
|
364
|
-
while True:
|
365
|
-
rsp = client.DescribePostpaidUsage(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
|
-
|
384
|
-
def doCreatePPTCheckTask(args, parsed_globals):
|
385
|
-
g_param = parse_global_arg(parsed_globals)
|
386
|
-
|
387
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
388
|
-
cred = credential.CVMRoleCredential()
|
389
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
390
|
-
cred = credential.STSAssumeRoleCredential(
|
391
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
392
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
393
|
-
)
|
394
|
-
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):
|
395
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
396
|
-
else:
|
397
|
-
cred = credential.Credential(
|
398
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
399
|
-
)
|
400
|
-
http_profile = HttpProfile(
|
401
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
402
|
-
reqMethod="POST",
|
403
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
404
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
405
|
-
)
|
406
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
407
|
-
if g_param[OptionsDefine.Language]:
|
408
|
-
profile.language = g_param[OptionsDefine.Language]
|
409
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
410
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
411
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
412
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
413
|
-
model = models.CreatePPTCheckTaskRequest()
|
414
|
-
model.from_json_string(json.dumps(args))
|
415
|
-
start_time = time.time()
|
416
|
-
while True:
|
417
|
-
rsp = client.CreatePPTCheckTask(model)
|
418
|
-
result = rsp.to_json_string()
|
419
|
-
try:
|
420
|
-
json_obj = json.loads(result)
|
421
|
-
except TypeError as e:
|
422
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
423
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
424
|
-
break
|
425
|
-
cur_time = time.time()
|
426
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
427
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
428
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
429
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
430
|
-
else:
|
431
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
432
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
433
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
|
-
|
435
|
-
|
436
|
-
def doSetOnlineRecordCallbackKey(args, parsed_globals):
|
437
|
-
g_param = parse_global_arg(parsed_globals)
|
438
|
-
|
439
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
440
|
-
cred = credential.CVMRoleCredential()
|
441
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
442
|
-
cred = credential.STSAssumeRoleCredential(
|
443
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
444
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
445
|
-
)
|
446
|
-
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):
|
447
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
448
|
-
else:
|
449
|
-
cred = credential.Credential(
|
450
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
451
|
-
)
|
452
|
-
http_profile = HttpProfile(
|
453
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
454
|
-
reqMethod="POST",
|
455
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
456
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
457
|
-
)
|
458
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
459
|
-
if g_param[OptionsDefine.Language]:
|
460
|
-
profile.language = g_param[OptionsDefine.Language]
|
461
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
462
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
463
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
464
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.SetOnlineRecordCallbackKeyRequest()
|
466
|
-
model.from_json_string(json.dumps(args))
|
467
|
-
start_time = time.time()
|
468
|
-
while True:
|
469
|
-
rsp = client.SetOnlineRecordCallbackKey(model)
|
470
|
-
result = rsp.to_json_string()
|
471
|
-
try:
|
472
|
-
json_obj = json.loads(result)
|
473
|
-
except TypeError as e:
|
474
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
475
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
476
|
-
break
|
477
|
-
cur_time = time.time()
|
478
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
479
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
480
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
481
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
482
|
-
else:
|
483
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
484
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
485
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
|
-
|
487
|
-
|
488
|
-
def doDescribeWhiteboardApplicationConfig(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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
515
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
516
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
-
model = models.DescribeWhiteboardApplicationConfigRequest()
|
518
|
-
model.from_json_string(json.dumps(args))
|
519
|
-
start_time = time.time()
|
520
|
-
while True:
|
521
|
-
rsp = client.DescribeWhiteboardApplicationConfig(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
|
-
def doSetTranscodeCallback(args, parsed_globals):
|
541
|
-
g_param = parse_global_arg(parsed_globals)
|
542
|
-
|
543
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
544
|
-
cred = credential.CVMRoleCredential()
|
545
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
546
|
-
cred = credential.STSAssumeRoleCredential(
|
547
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
548
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
549
|
-
)
|
550
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
551
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
552
|
-
else:
|
553
|
-
cred = credential.Credential(
|
554
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
555
|
-
)
|
556
|
-
http_profile = HttpProfile(
|
557
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
558
|
-
reqMethod="POST",
|
559
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
560
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
561
|
-
)
|
562
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
563
|
-
if g_param[OptionsDefine.Language]:
|
564
|
-
profile.language = g_param[OptionsDefine.Language]
|
565
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
566
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
567
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
568
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
-
model = models.SetTranscodeCallbackRequest()
|
570
|
-
model.from_json_string(json.dumps(args))
|
571
|
-
start_time = time.time()
|
572
|
-
while True:
|
573
|
-
rsp = client.SetTranscodeCallback(model)
|
574
|
-
result = rsp.to_json_string()
|
575
|
-
try:
|
576
|
-
json_obj = json.loads(result)
|
577
|
-
except TypeError as e:
|
578
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
579
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
580
|
-
break
|
581
|
-
cur_time = time.time()
|
582
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
583
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
584
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
585
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
586
|
-
else:
|
587
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
588
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
589
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
|
-
|
591
|
-
|
592
|
-
def doResumeOnlineRecord(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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
619
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
620
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
-
model = models.ResumeOnlineRecordRequest()
|
622
|
-
model.from_json_string(json.dumps(args))
|
623
|
-
start_time = time.time()
|
624
|
-
while True:
|
625
|
-
rsp = client.ResumeOnlineRecord(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
|
-
def doDescribePPTCheckCallback(args, parsed_globals):
|
645
|
-
g_param = parse_global_arg(parsed_globals)
|
646
|
-
|
647
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
648
|
-
cred = credential.CVMRoleCredential()
|
649
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
650
|
-
cred = credential.STSAssumeRoleCredential(
|
651
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
652
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
653
|
-
)
|
654
|
-
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):
|
655
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
656
|
-
else:
|
657
|
-
cred = credential.Credential(
|
658
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
659
|
-
)
|
660
|
-
http_profile = HttpProfile(
|
661
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
662
|
-
reqMethod="POST",
|
663
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
664
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
665
|
-
)
|
666
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
667
|
-
if g_param[OptionsDefine.Language]:
|
668
|
-
profile.language = g_param[OptionsDefine.Language]
|
669
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
670
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
671
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
672
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
-
model = models.DescribePPTCheckCallbackRequest()
|
674
|
-
model.from_json_string(json.dumps(args))
|
675
|
-
start_time = time.time()
|
676
|
-
while True:
|
677
|
-
rsp = client.DescribePPTCheckCallback(model)
|
678
|
-
result = rsp.to_json_string()
|
679
|
-
try:
|
680
|
-
json_obj = json.loads(result)
|
681
|
-
except TypeError as e:
|
682
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
683
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
684
|
-
break
|
685
|
-
cur_time = time.time()
|
686
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
687
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
688
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
689
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
690
|
-
else:
|
691
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
692
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
693
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
|
-
|
695
|
-
|
696
|
-
def doSetWarningCallback(args, parsed_globals):
|
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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
723
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
724
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
-
model = models.SetWarningCallbackRequest()
|
726
|
-
model.from_json_string(json.dumps(args))
|
727
|
-
start_time = time.time()
|
728
|
-
while True:
|
729
|
-
rsp = client.SetWarningCallback(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 doSetTranscodeCallbackKey(args, parsed_globals):
|
749
|
-
g_param = parse_global_arg(parsed_globals)
|
750
|
-
|
751
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
752
|
-
cred = credential.CVMRoleCredential()
|
753
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
754
|
-
cred = credential.STSAssumeRoleCredential(
|
755
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
756
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
757
|
-
)
|
758
|
-
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):
|
759
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
760
|
-
else:
|
761
|
-
cred = credential.Credential(
|
762
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
763
|
-
)
|
764
|
-
http_profile = HttpProfile(
|
765
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
766
|
-
reqMethod="POST",
|
767
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
768
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
769
|
-
)
|
770
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
771
|
-
if g_param[OptionsDefine.Language]:
|
772
|
-
profile.language = g_param[OptionsDefine.Language]
|
773
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
774
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
775
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
776
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
-
model = models.SetTranscodeCallbackKeyRequest()
|
778
|
-
model.from_json_string(json.dumps(args))
|
779
|
-
start_time = time.time()
|
780
|
-
while True:
|
781
|
-
rsp = client.SetTranscodeCallbackKey(model)
|
782
|
-
result = rsp.to_json_string()
|
783
|
-
try:
|
784
|
-
json_obj = json.loads(result)
|
785
|
-
except TypeError as e:
|
786
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
787
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
788
|
-
break
|
789
|
-
cur_time = time.time()
|
790
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
791
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
792
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
793
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
794
|
-
else:
|
795
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
796
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
797
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
|
-
|
799
|
-
|
800
|
-
def doSetPPTCheckCallbackKey(args, parsed_globals):
|
801
|
-
g_param = parse_global_arg(parsed_globals)
|
802
|
-
|
803
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
804
|
-
cred = credential.CVMRoleCredential()
|
805
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
806
|
-
cred = credential.STSAssumeRoleCredential(
|
807
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
808
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
809
|
-
)
|
810
|
-
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):
|
811
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
812
|
-
else:
|
813
|
-
cred = credential.Credential(
|
814
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
815
|
-
)
|
816
|
-
http_profile = HttpProfile(
|
817
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
818
|
-
reqMethod="POST",
|
819
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
820
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
821
|
-
)
|
822
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
823
|
-
if g_param[OptionsDefine.Language]:
|
824
|
-
profile.language = g_param[OptionsDefine.Language]
|
825
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
826
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
827
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
828
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.SetPPTCheckCallbackKeyRequest()
|
830
|
-
model.from_json_string(json.dumps(args))
|
831
|
-
start_time = time.time()
|
832
|
-
while True:
|
833
|
-
rsp = client.SetPPTCheckCallbackKey(model)
|
834
|
-
result = rsp.to_json_string()
|
835
|
-
try:
|
836
|
-
json_obj = json.loads(result)
|
837
|
-
except TypeError as e:
|
838
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
839
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
840
|
-
break
|
841
|
-
cur_time = time.time()
|
842
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
843
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
844
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
845
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
846
|
-
else:
|
847
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
848
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
849
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
|
-
|
851
|
-
|
852
|
-
def doApplyTiwTrial(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.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
879
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
880
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
-
model = models.ApplyTiwTrialRequest()
|
882
|
-
model.from_json_string(json.dumps(args))
|
883
|
-
start_time = time.time()
|
884
|
-
while True:
|
885
|
-
rsp = client.ApplyTiwTrial(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
|
-
|
904
|
-
def doSetPPTCheckCallback(args, parsed_globals):
|
905
|
-
g_param = parse_global_arg(parsed_globals)
|
906
|
-
|
907
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
908
|
-
cred = credential.CVMRoleCredential()
|
909
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
910
|
-
cred = credential.STSAssumeRoleCredential(
|
911
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
912
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
913
|
-
)
|
914
|
-
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):
|
915
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
916
|
-
else:
|
917
|
-
cred = credential.Credential(
|
918
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
919
|
-
)
|
920
|
-
http_profile = HttpProfile(
|
921
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
922
|
-
reqMethod="POST",
|
923
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
924
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
925
|
-
)
|
926
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
927
|
-
if g_param[OptionsDefine.Language]:
|
928
|
-
profile.language = g_param[OptionsDefine.Language]
|
929
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
930
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
931
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
932
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
-
model = models.SetPPTCheckCallbackRequest()
|
934
|
-
model.from_json_string(json.dumps(args))
|
935
|
-
start_time = time.time()
|
936
|
-
while True:
|
937
|
-
rsp = client.SetPPTCheckCallback(model)
|
938
|
-
result = rsp.to_json_string()
|
939
|
-
try:
|
940
|
-
json_obj = json.loads(result)
|
941
|
-
except TypeError as e:
|
942
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
943
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
944
|
-
break
|
945
|
-
cur_time = time.time()
|
946
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
947
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
948
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
949
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
950
|
-
else:
|
951
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
952
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
953
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
|
-
|
955
|
-
|
956
|
-
def doDescribeTranscodeByUrl(args, parsed_globals):
|
957
|
-
g_param = parse_global_arg(parsed_globals)
|
958
|
-
|
959
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
960
|
-
cred = credential.CVMRoleCredential()
|
961
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
962
|
-
cred = credential.STSAssumeRoleCredential(
|
963
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
964
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
965
|
-
)
|
966
|
-
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):
|
967
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
968
|
-
else:
|
969
|
-
cred = credential.Credential(
|
970
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
971
|
-
)
|
972
|
-
http_profile = HttpProfile(
|
973
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
974
|
-
reqMethod="POST",
|
975
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
976
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
977
|
-
)
|
978
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
979
|
-
if g_param[OptionsDefine.Language]:
|
980
|
-
profile.language = g_param[OptionsDefine.Language]
|
981
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
982
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
983
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
984
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
-
model = models.DescribeTranscodeByUrlRequest()
|
986
|
-
model.from_json_string(json.dumps(args))
|
987
|
-
start_time = time.time()
|
988
|
-
while True:
|
989
|
-
rsp = client.DescribeTranscodeByUrl(model)
|
990
|
-
result = rsp.to_json_string()
|
991
|
-
try:
|
992
|
-
json_obj = json.loads(result)
|
993
|
-
except TypeError as e:
|
994
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
995
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
996
|
-
break
|
997
|
-
cur_time = time.time()
|
998
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
999
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1000
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1001
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1002
|
-
else:
|
1003
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1004
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1005
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
|
-
|
1007
|
-
|
1008
|
-
def doDescribeTranscodeSearch(args, parsed_globals):
|
1009
|
-
g_param = parse_global_arg(parsed_globals)
|
1010
|
-
|
1011
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1012
|
-
cred = credential.CVMRoleCredential()
|
1013
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1014
|
-
cred = credential.STSAssumeRoleCredential(
|
1015
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1016
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1017
|
-
)
|
1018
|
-
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):
|
1019
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1020
|
-
else:
|
1021
|
-
cred = credential.Credential(
|
1022
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1023
|
-
)
|
1024
|
-
http_profile = HttpProfile(
|
1025
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1026
|
-
reqMethod="POST",
|
1027
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1028
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1029
|
-
)
|
1030
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1031
|
-
if g_param[OptionsDefine.Language]:
|
1032
|
-
profile.language = g_param[OptionsDefine.Language]
|
1033
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1034
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1036
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
-
model = models.DescribeTranscodeSearchRequest()
|
1038
|
-
model.from_json_string(json.dumps(args))
|
1039
|
-
start_time = time.time()
|
1040
|
-
while True:
|
1041
|
-
rsp = client.DescribeTranscodeSearch(model)
|
1042
|
-
result = rsp.to_json_string()
|
1043
|
-
try:
|
1044
|
-
json_obj = json.loads(result)
|
1045
|
-
except TypeError as e:
|
1046
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1047
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1048
|
-
break
|
1049
|
-
cur_time = time.time()
|
1050
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1051
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1052
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1053
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1054
|
-
else:
|
1055
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1056
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1057
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
|
-
|
1059
|
-
|
1060
|
-
def doModifyApplication(args, parsed_globals):
|
1061
|
-
g_param = parse_global_arg(parsed_globals)
|
1062
|
-
|
1063
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1064
|
-
cred = credential.CVMRoleCredential()
|
1065
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1066
|
-
cred = credential.STSAssumeRoleCredential(
|
1067
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1068
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1069
|
-
)
|
1070
|
-
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):
|
1071
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1072
|
-
else:
|
1073
|
-
cred = credential.Credential(
|
1074
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1075
|
-
)
|
1076
|
-
http_profile = HttpProfile(
|
1077
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1078
|
-
reqMethod="POST",
|
1079
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1080
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1081
|
-
)
|
1082
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1083
|
-
if g_param[OptionsDefine.Language]:
|
1084
|
-
profile.language = g_param[OptionsDefine.Language]
|
1085
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1086
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1088
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.ModifyApplicationRequest()
|
1090
|
-
model.from_json_string(json.dumps(args))
|
1091
|
-
start_time = time.time()
|
1092
|
-
while True:
|
1093
|
-
rsp = client.ModifyApplication(model)
|
1094
|
-
result = rsp.to_json_string()
|
1095
|
-
try:
|
1096
|
-
json_obj = json.loads(result)
|
1097
|
-
except TypeError as e:
|
1098
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1099
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1100
|
-
break
|
1101
|
-
cur_time = time.time()
|
1102
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1103
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1104
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1105
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1106
|
-
else:
|
1107
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1108
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1109
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1110
|
-
|
1111
|
-
|
1112
|
-
def doDescribeUserResources(args, parsed_globals):
|
1113
|
-
g_param = parse_global_arg(parsed_globals)
|
1114
|
-
|
1115
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1116
|
-
cred = credential.CVMRoleCredential()
|
1117
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1118
|
-
cred = credential.STSAssumeRoleCredential(
|
1119
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1120
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1121
|
-
)
|
1122
|
-
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):
|
1123
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1124
|
-
else:
|
1125
|
-
cred = credential.Credential(
|
1126
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1127
|
-
)
|
1128
|
-
http_profile = HttpProfile(
|
1129
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1130
|
-
reqMethod="POST",
|
1131
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1132
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1133
|
-
)
|
1134
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1135
|
-
if g_param[OptionsDefine.Language]:
|
1136
|
-
profile.language = g_param[OptionsDefine.Language]
|
1137
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1138
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1140
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
-
model = models.DescribeUserResourcesRequest()
|
1142
|
-
model.from_json_string(json.dumps(args))
|
1143
|
-
start_time = time.time()
|
1144
|
-
while True:
|
1145
|
-
rsp = client.DescribeUserResources(model)
|
1146
|
-
result = rsp.to_json_string()
|
1147
|
-
try:
|
1148
|
-
json_obj = json.loads(result)
|
1149
|
-
except TypeError as e:
|
1150
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1151
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1152
|
-
break
|
1153
|
-
cur_time = time.time()
|
1154
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1155
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1156
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1157
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1158
|
-
else:
|
1159
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1160
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1161
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1162
|
-
|
1163
|
-
|
1164
|
-
def doDescribeOnlineRecord(args, parsed_globals):
|
1165
|
-
g_param = parse_global_arg(parsed_globals)
|
1166
|
-
|
1167
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1168
|
-
cred = credential.CVMRoleCredential()
|
1169
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1170
|
-
cred = credential.STSAssumeRoleCredential(
|
1171
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1172
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1173
|
-
)
|
1174
|
-
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):
|
1175
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1176
|
-
else:
|
1177
|
-
cred = credential.Credential(
|
1178
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1179
|
-
)
|
1180
|
-
http_profile = HttpProfile(
|
1181
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1182
|
-
reqMethod="POST",
|
1183
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1184
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1185
|
-
)
|
1186
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1187
|
-
if g_param[OptionsDefine.Language]:
|
1188
|
-
profile.language = g_param[OptionsDefine.Language]
|
1189
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1190
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1191
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1192
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1193
|
-
model = models.DescribeOnlineRecordRequest()
|
1194
|
-
model.from_json_string(json.dumps(args))
|
1195
|
-
start_time = time.time()
|
1196
|
-
while True:
|
1197
|
-
rsp = client.DescribeOnlineRecord(model)
|
1198
|
-
result = rsp.to_json_string()
|
1199
|
-
try:
|
1200
|
-
json_obj = json.loads(result)
|
1201
|
-
except TypeError as e:
|
1202
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1203
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1204
|
-
break
|
1205
|
-
cur_time = time.time()
|
1206
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1207
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1208
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1209
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1210
|
-
else:
|
1211
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1212
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1213
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
|
-
|
1215
|
-
|
1216
|
-
def doModifyAutoRenewFlag(args, parsed_globals):
|
20
|
+
def doSetOnlineRecordCallback(args, parsed_globals):
|
1217
21
|
g_param = parse_global_arg(parsed_globals)
|
1218
22
|
|
1219
23
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1242,11 +46,11 @@ def doModifyAutoRenewFlag(args, parsed_globals):
|
|
1242
46
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
47
|
client._sdkVersion += ("_CLI_" + __version__)
|
1244
48
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
-
model = models.
|
49
|
+
model = models.SetOnlineRecordCallbackRequest()
|
1246
50
|
model.from_json_string(json.dumps(args))
|
1247
51
|
start_time = time.time()
|
1248
52
|
while True:
|
1249
|
-
rsp = client.
|
53
|
+
rsp = client.SetOnlineRecordCallback(model)
|
1250
54
|
result = rsp.to_json_string()
|
1251
55
|
try:
|
1252
56
|
json_obj = json.loads(result)
|
@@ -1265,7 +69,7 @@ def doModifyAutoRenewFlag(args, parsed_globals):
|
|
1265
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
70
|
|
1267
71
|
|
1268
|
-
def
|
72
|
+
def doSetVideoGenerationTaskCallback(args, parsed_globals):
|
1269
73
|
g_param = parse_global_arg(parsed_globals)
|
1270
74
|
|
1271
75
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1294,11 +98,11 @@ def doDescribeOnlineRecordCallback(args, parsed_globals):
|
|
1294
98
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1295
99
|
client._sdkVersion += ("_CLI_" + __version__)
|
1296
100
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1297
|
-
model = models.
|
101
|
+
model = models.SetVideoGenerationTaskCallbackRequest()
|
1298
102
|
model.from_json_string(json.dumps(args))
|
1299
103
|
start_time = time.time()
|
1300
104
|
while True:
|
1301
|
-
rsp = client.
|
105
|
+
rsp = client.SetVideoGenerationTaskCallback(model)
|
1302
106
|
result = rsp.to_json_string()
|
1303
107
|
try:
|
1304
108
|
json_obj = json.loads(result)
|
@@ -1317,7 +121,7 @@ def doDescribeOnlineRecordCallback(args, parsed_globals):
|
|
1317
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
122
|
|
1319
123
|
|
1320
|
-
def
|
124
|
+
def doCreateVideoGenerationTask(args, parsed_globals):
|
1321
125
|
g_param = parse_global_arg(parsed_globals)
|
1322
126
|
|
1323
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1346,11 +150,11 @@ def doDescribeApplicationUsage(args, parsed_globals):
|
|
1346
150
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1347
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
1348
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1349
|
-
model = models.
|
153
|
+
model = models.CreateVideoGenerationTaskRequest()
|
1350
154
|
model.from_json_string(json.dumps(args))
|
1351
155
|
start_time = time.time()
|
1352
156
|
while True:
|
1353
|
-
rsp = client.
|
157
|
+
rsp = client.CreateVideoGenerationTask(model)
|
1354
158
|
result = rsp.to_json_string()
|
1355
159
|
try:
|
1356
160
|
json_obj = json.loads(result)
|
@@ -1369,7 +173,7 @@ def doDescribeApplicationUsage(args, parsed_globals):
|
|
1369
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1370
174
|
|
1371
175
|
|
1372
|
-
def
|
176
|
+
def doSetOnlineRecordCallbackKey(args, parsed_globals):
|
1373
177
|
g_param = parse_global_arg(parsed_globals)
|
1374
178
|
|
1375
179
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1398,11 +202,11 @@ def doCreateApplication(args, parsed_globals):
|
|
1398
202
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
203
|
client._sdkVersion += ("_CLI_" + __version__)
|
1400
204
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
-
model = models.
|
205
|
+
model = models.SetOnlineRecordCallbackKeyRequest()
|
1402
206
|
model.from_json_string(json.dumps(args))
|
1403
207
|
start_time = time.time()
|
1404
208
|
while True:
|
1405
|
-
rsp = client.
|
209
|
+
rsp = client.SetOnlineRecordCallbackKey(model)
|
1406
210
|
result = rsp.to_json_string()
|
1407
211
|
try:
|
1408
212
|
json_obj = json.loads(result)
|
@@ -1421,7 +225,7 @@ def doCreateApplication(args, parsed_globals):
|
|
1421
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
226
|
|
1423
227
|
|
1424
|
-
def
|
228
|
+
def doSetTranscodeCallback(args, parsed_globals):
|
1425
229
|
g_param = parse_global_arg(parsed_globals)
|
1426
230
|
|
1427
231
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1450,11 +254,11 @@ def doDescribeAPIService(args, parsed_globals):
|
|
1450
254
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1451
255
|
client._sdkVersion += ("_CLI_" + __version__)
|
1452
256
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1453
|
-
model = models.
|
257
|
+
model = models.SetTranscodeCallbackRequest()
|
1454
258
|
model.from_json_string(json.dumps(args))
|
1455
259
|
start_time = time.time()
|
1456
260
|
while True:
|
1457
|
-
rsp = client.
|
261
|
+
rsp = client.SetTranscodeCallback(model)
|
1458
262
|
result = rsp.to_json_string()
|
1459
263
|
try:
|
1460
264
|
json_obj = json.loads(result)
|
@@ -1473,7 +277,7 @@ def doDescribeAPIService(args, parsed_globals):
|
|
1473
277
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1474
278
|
|
1475
279
|
|
1476
|
-
def
|
280
|
+
def doResumeOnlineRecord(args, parsed_globals):
|
1477
281
|
g_param = parse_global_arg(parsed_globals)
|
1478
282
|
|
1479
283
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1502,11 +306,11 @@ def doDescribeWhiteboardPushCallback(args, parsed_globals):
|
|
1502
306
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1503
307
|
client._sdkVersion += ("_CLI_" + __version__)
|
1504
308
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1505
|
-
model = models.
|
309
|
+
model = models.ResumeOnlineRecordRequest()
|
1506
310
|
model.from_json_string(json.dumps(args))
|
1507
311
|
start_time = time.time()
|
1508
312
|
while True:
|
1509
|
-
rsp = client.
|
313
|
+
rsp = client.ResumeOnlineRecord(model)
|
1510
314
|
result = rsp.to_json_string()
|
1511
315
|
try:
|
1512
316
|
json_obj = json.loads(result)
|
@@ -1525,7 +329,7 @@ def doDescribeWhiteboardPushCallback(args, parsed_globals):
|
|
1525
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1526
330
|
|
1527
331
|
|
1528
|
-
def
|
332
|
+
def doDescribePPTCheckCallback(args, parsed_globals):
|
1529
333
|
g_param = parse_global_arg(parsed_globals)
|
1530
334
|
|
1531
335
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1554,11 +358,11 @@ def doDescribeApplicationInfos(args, parsed_globals):
|
|
1554
358
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1555
359
|
client._sdkVersion += ("_CLI_" + __version__)
|
1556
360
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1557
|
-
model = models.
|
361
|
+
model = models.DescribePPTCheckCallbackRequest()
|
1558
362
|
model.from_json_string(json.dumps(args))
|
1559
363
|
start_time = time.time()
|
1560
364
|
while True:
|
1561
|
-
rsp = client.
|
365
|
+
rsp = client.DescribePPTCheckCallback(model)
|
1562
366
|
result = rsp.to_json_string()
|
1563
367
|
try:
|
1564
368
|
json_obj = json.loads(result)
|
@@ -1577,7 +381,7 @@ def doDescribeApplicationInfos(args, parsed_globals):
|
|
1577
381
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1578
382
|
|
1579
383
|
|
1580
|
-
def
|
384
|
+
def doSetWarningCallback(args, parsed_globals):
|
1581
385
|
g_param = parse_global_arg(parsed_globals)
|
1582
386
|
|
1583
387
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1606,11 +410,11 @@ def doDescribeWarningCallback(args, parsed_globals):
|
|
1606
410
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1607
411
|
client._sdkVersion += ("_CLI_" + __version__)
|
1608
412
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1609
|
-
model = models.
|
413
|
+
model = models.SetWarningCallbackRequest()
|
1610
414
|
model.from_json_string(json.dumps(args))
|
1611
415
|
start_time = time.time()
|
1612
416
|
while True:
|
1613
|
-
rsp = client.
|
417
|
+
rsp = client.SetWarningCallback(model)
|
1614
418
|
result = rsp.to_json_string()
|
1615
419
|
try:
|
1616
420
|
json_obj = json.loads(result)
|
@@ -1629,7 +433,7 @@ def doDescribeWarningCallback(args, parsed_globals):
|
|
1629
433
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1630
434
|
|
1631
435
|
|
1632
|
-
def
|
436
|
+
def doSetTranscodeCallbackKey(args, parsed_globals):
|
1633
437
|
g_param = parse_global_arg(parsed_globals)
|
1634
438
|
|
1635
439
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1658,11 +462,11 @@ def doDescribeTIWRoomDailyUsage(args, parsed_globals):
|
|
1658
462
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1659
463
|
client._sdkVersion += ("_CLI_" + __version__)
|
1660
464
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1661
|
-
model = models.
|
465
|
+
model = models.SetTranscodeCallbackKeyRequest()
|
1662
466
|
model.from_json_string(json.dumps(args))
|
1663
467
|
start_time = time.time()
|
1664
468
|
while True:
|
1665
|
-
rsp = client.
|
469
|
+
rsp = client.SetTranscodeCallbackKey(model)
|
1666
470
|
result = rsp.to_json_string()
|
1667
471
|
try:
|
1668
472
|
json_obj = json.loads(result)
|
@@ -1681,7 +485,7 @@ def doDescribeTIWRoomDailyUsage(args, parsed_globals):
|
|
1681
485
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1682
486
|
|
1683
487
|
|
1684
|
-
def
|
488
|
+
def doSetPPTCheckCallbackKey(args, parsed_globals):
|
1685
489
|
g_param = parse_global_arg(parsed_globals)
|
1686
490
|
|
1687
491
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1710,11 +514,11 @@ def doCreateTranscode(args, parsed_globals):
|
|
1710
514
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1711
515
|
client._sdkVersion += ("_CLI_" + __version__)
|
1712
516
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1713
|
-
model = models.
|
517
|
+
model = models.SetPPTCheckCallbackKeyRequest()
|
1714
518
|
model.from_json_string(json.dumps(args))
|
1715
519
|
start_time = time.time()
|
1716
520
|
while True:
|
1717
|
-
rsp = client.
|
521
|
+
rsp = client.SetPPTCheckCallbackKey(model)
|
1718
522
|
result = rsp.to_json_string()
|
1719
523
|
try:
|
1720
524
|
json_obj = json.loads(result)
|
@@ -1733,7 +537,7 @@ def doCreateTranscode(args, parsed_globals):
|
|
1733
537
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1734
538
|
|
1735
539
|
|
1736
|
-
def
|
540
|
+
def doCreateSnapshotTask(args, parsed_globals):
|
1737
541
|
g_param = parse_global_arg(parsed_globals)
|
1738
542
|
|
1739
543
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1762,11 +566,11 @@ def doDescribeVideoGenerationTaskCallback(args, parsed_globals):
|
|
1762
566
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1763
567
|
client._sdkVersion += ("_CLI_" + __version__)
|
1764
568
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1765
|
-
model = models.
|
569
|
+
model = models.CreateSnapshotTaskRequest()
|
1766
570
|
model.from_json_string(json.dumps(args))
|
1767
571
|
start_time = time.time()
|
1768
572
|
while True:
|
1769
|
-
rsp = client.
|
573
|
+
rsp = client.CreateSnapshotTask(model)
|
1770
574
|
result = rsp.to_json_string()
|
1771
575
|
try:
|
1772
576
|
json_obj = json.loads(result)
|
@@ -1785,7 +589,7 @@ def doDescribeVideoGenerationTaskCallback(args, parsed_globals):
|
|
1785
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1786
590
|
|
1787
591
|
|
1788
|
-
def
|
592
|
+
def doSetPPTCheckCallback(args, parsed_globals):
|
1789
593
|
g_param = parse_global_arg(parsed_globals)
|
1790
594
|
|
1791
595
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1814,11 +618,11 @@ def doModifyWhiteboardApplicationConfig(args, parsed_globals):
|
|
1814
618
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1815
619
|
client._sdkVersion += ("_CLI_" + __version__)
|
1816
620
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1817
|
-
model = models.
|
621
|
+
model = models.SetPPTCheckCallbackRequest()
|
1818
622
|
model.from_json_string(json.dumps(args))
|
1819
623
|
start_time = time.time()
|
1820
624
|
while True:
|
1821
|
-
rsp = client.
|
625
|
+
rsp = client.SetPPTCheckCallback(model)
|
1822
626
|
result = rsp.to_json_string()
|
1823
627
|
try:
|
1824
628
|
json_obj = json.loads(result)
|
@@ -1837,7 +641,7 @@ def doModifyWhiteboardApplicationConfig(args, parsed_globals):
|
|
1837
641
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1838
642
|
|
1839
643
|
|
1840
|
-
def
|
644
|
+
def doDescribeTranscodeByUrl(args, parsed_globals):
|
1841
645
|
g_param = parse_global_arg(parsed_globals)
|
1842
646
|
|
1843
647
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1866,11 +670,11 @@ def doSetWhiteboardPushCallback(args, parsed_globals):
|
|
1866
670
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1867
671
|
client._sdkVersion += ("_CLI_" + __version__)
|
1868
672
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1869
|
-
model = models.
|
673
|
+
model = models.DescribeTranscodeByUrlRequest()
|
1870
674
|
model.from_json_string(json.dumps(args))
|
1871
675
|
start_time = time.time()
|
1872
676
|
while True:
|
1873
|
-
rsp = client.
|
677
|
+
rsp = client.DescribeTranscodeByUrl(model)
|
1874
678
|
result = rsp.to_json_string()
|
1875
679
|
try:
|
1876
680
|
json_obj = json.loads(result)
|
@@ -1889,7 +693,7 @@ def doSetWhiteboardPushCallback(args, parsed_globals):
|
|
1889
693
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1890
694
|
|
1891
695
|
|
1892
|
-
def
|
696
|
+
def doDescribeOnlineRecord(args, parsed_globals):
|
1893
697
|
g_param = parse_global_arg(parsed_globals)
|
1894
698
|
|
1895
699
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1918,11 +722,11 @@ def doStartOnlineRecord(args, parsed_globals):
|
|
1918
722
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1919
723
|
client._sdkVersion += ("_CLI_" + __version__)
|
1920
724
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1921
|
-
model = models.
|
725
|
+
model = models.DescribeOnlineRecordRequest()
|
1922
726
|
model.from_json_string(json.dumps(args))
|
1923
727
|
start_time = time.time()
|
1924
728
|
while True:
|
1925
|
-
rsp = client.
|
729
|
+
rsp = client.DescribeOnlineRecord(model)
|
1926
730
|
result = rsp.to_json_string()
|
1927
731
|
try:
|
1928
732
|
json_obj = json.loads(result)
|
@@ -1941,7 +745,7 @@ def doStartOnlineRecord(args, parsed_globals):
|
|
1941
745
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1942
746
|
|
1943
747
|
|
1944
|
-
def
|
748
|
+
def doDescribeOnlineRecordCallback(args, parsed_globals):
|
1945
749
|
g_param = parse_global_arg(parsed_globals)
|
1946
750
|
|
1947
751
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1970,11 +774,11 @@ def doCreateVideoGenerationTask(args, parsed_globals):
|
|
1970
774
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
1971
775
|
client._sdkVersion += ("_CLI_" + __version__)
|
1972
776
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1973
|
-
model = models.
|
777
|
+
model = models.DescribeOnlineRecordCallbackRequest()
|
1974
778
|
model.from_json_string(json.dumps(args))
|
1975
779
|
start_time = time.time()
|
1976
780
|
while True:
|
1977
|
-
rsp = client.
|
781
|
+
rsp = client.DescribeOnlineRecordCallback(model)
|
1978
782
|
result = rsp.to_json_string()
|
1979
783
|
try:
|
1980
784
|
json_obj = json.loads(result)
|
@@ -1993,7 +797,7 @@ def doCreateVideoGenerationTask(args, parsed_globals):
|
|
1993
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1994
798
|
|
1995
799
|
|
1996
|
-
def
|
800
|
+
def doDescribeWhiteboardPushCallback(args, parsed_globals):
|
1997
801
|
g_param = parse_global_arg(parsed_globals)
|
1998
802
|
|
1999
803
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2022,11 +826,11 @@ def doDescribeTranscode(args, parsed_globals):
|
|
2022
826
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2023
827
|
client._sdkVersion += ("_CLI_" + __version__)
|
2024
828
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2025
|
-
model = models.
|
829
|
+
model = models.DescribeWhiteboardPushCallbackRequest()
|
2026
830
|
model.from_json_string(json.dumps(args))
|
2027
831
|
start_time = time.time()
|
2028
832
|
while True:
|
2029
|
-
rsp = client.
|
833
|
+
rsp = client.DescribeWhiteboardPushCallback(model)
|
2030
834
|
result = rsp.to_json_string()
|
2031
835
|
try:
|
2032
836
|
json_obj = json.loads(result)
|
@@ -2045,7 +849,7 @@ def doDescribeTranscode(args, parsed_globals):
|
|
2045
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2046
850
|
|
2047
851
|
|
2048
|
-
def
|
852
|
+
def doStartWhiteboardPush(args, parsed_globals):
|
2049
853
|
g_param = parse_global_arg(parsed_globals)
|
2050
854
|
|
2051
855
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2074,11 +878,11 @@ def doStopOnlineRecord(args, parsed_globals):
|
|
2074
878
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2075
879
|
client._sdkVersion += ("_CLI_" + __version__)
|
2076
880
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2077
|
-
model = models.
|
881
|
+
model = models.StartWhiteboardPushRequest()
|
2078
882
|
model.from_json_string(json.dumps(args))
|
2079
883
|
start_time = time.time()
|
2080
884
|
while True:
|
2081
|
-
rsp = client.
|
885
|
+
rsp = client.StartWhiteboardPush(model)
|
2082
886
|
result = rsp.to_json_string()
|
2083
887
|
try:
|
2084
888
|
json_obj = json.loads(result)
|
@@ -2097,7 +901,7 @@ def doStopOnlineRecord(args, parsed_globals):
|
|
2097
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2098
902
|
|
2099
903
|
|
2100
|
-
def
|
904
|
+
def doStartOnlineRecord(args, parsed_globals):
|
2101
905
|
g_param = parse_global_arg(parsed_globals)
|
2102
906
|
|
2103
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2126,11 +930,11 @@ def doDescribeUsageSummary(args, parsed_globals):
|
|
2126
930
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2127
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
2128
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2129
|
-
model = models.
|
933
|
+
model = models.StartOnlineRecordRequest()
|
2130
934
|
model.from_json_string(json.dumps(args))
|
2131
935
|
start_time = time.time()
|
2132
936
|
while True:
|
2133
|
-
rsp = client.
|
937
|
+
rsp = client.StartOnlineRecord(model)
|
2134
938
|
result = rsp.to_json_string()
|
2135
939
|
try:
|
2136
940
|
json_obj = json.loads(result)
|
@@ -2149,7 +953,7 @@ def doDescribeUsageSummary(args, parsed_globals):
|
|
2149
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2150
954
|
|
2151
955
|
|
2152
|
-
def
|
956
|
+
def doCreateTranscode(args, parsed_globals):
|
2153
957
|
g_param = parse_global_arg(parsed_globals)
|
2154
958
|
|
2155
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2178,11 +982,11 @@ def doSetWhiteboardPushCallbackKey(args, parsed_globals):
|
|
2178
982
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2179
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
2180
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2181
|
-
model = models.
|
985
|
+
model = models.CreateTranscodeRequest()
|
2182
986
|
model.from_json_string(json.dumps(args))
|
2183
987
|
start_time = time.time()
|
2184
988
|
while True:
|
2185
|
-
rsp = client.
|
989
|
+
rsp = client.CreateTranscode(model)
|
2186
990
|
result = rsp.to_json_string()
|
2187
991
|
try:
|
2188
992
|
json_obj = json.loads(result)
|
@@ -2201,7 +1005,7 @@ def doSetWhiteboardPushCallbackKey(args, parsed_globals):
|
|
2201
1005
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2202
1006
|
|
2203
1007
|
|
2204
|
-
def
|
1008
|
+
def doDescribeVideoGenerationTaskCallback(args, parsed_globals):
|
2205
1009
|
g_param = parse_global_arg(parsed_globals)
|
2206
1010
|
|
2207
1011
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2230,11 +1034,11 @@ def doDescribeWhiteboardPushSearch(args, parsed_globals):
|
|
2230
1034
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2231
1035
|
client._sdkVersion += ("_CLI_" + __version__)
|
2232
1036
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2233
|
-
model = models.
|
1037
|
+
model = models.DescribeVideoGenerationTaskCallbackRequest()
|
2234
1038
|
model.from_json_string(json.dumps(args))
|
2235
1039
|
start_time = time.time()
|
2236
1040
|
while True:
|
2237
|
-
rsp = client.
|
1041
|
+
rsp = client.DescribeVideoGenerationTaskCallback(model)
|
2238
1042
|
result = rsp.to_json_string()
|
2239
1043
|
try:
|
2240
1044
|
json_obj = json.loads(result)
|
@@ -2253,7 +1057,7 @@ def doDescribeWhiteboardPushSearch(args, parsed_globals):
|
|
2253
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2254
1058
|
|
2255
1059
|
|
2256
|
-
def
|
1060
|
+
def doSetWhiteboardPushCallback(args, parsed_globals):
|
2257
1061
|
g_param = parse_global_arg(parsed_globals)
|
2258
1062
|
|
2259
1063
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2282,11 +1086,11 @@ def doDescribeUserStatus(args, parsed_globals):
|
|
2282
1086
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2283
1087
|
client._sdkVersion += ("_CLI_" + __version__)
|
2284
1088
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2285
|
-
model = models.
|
1089
|
+
model = models.SetWhiteboardPushCallbackRequest()
|
2286
1090
|
model.from_json_string(json.dumps(args))
|
2287
1091
|
start_time = time.time()
|
2288
1092
|
while True:
|
2289
|
-
rsp = client.
|
1093
|
+
rsp = client.SetWhiteboardPushCallback(model)
|
2290
1094
|
result = rsp.to_json_string()
|
2291
1095
|
try:
|
2292
1096
|
json_obj = json.loads(result)
|
@@ -2305,7 +1109,7 @@ def doDescribeUserStatus(args, parsed_globals):
|
|
2305
1109
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2306
1110
|
|
2307
1111
|
|
2308
|
-
def
|
1112
|
+
def doDescribeWarningCallback(args, parsed_globals):
|
2309
1113
|
g_param = parse_global_arg(parsed_globals)
|
2310
1114
|
|
2311
1115
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2334,11 +1138,11 @@ def doCreateSnapshotTask(args, parsed_globals):
|
|
2334
1138
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2335
1139
|
client._sdkVersion += ("_CLI_" + __version__)
|
2336
1140
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2337
|
-
model = models.
|
1141
|
+
model = models.DescribeWarningCallbackRequest()
|
2338
1142
|
model.from_json_string(json.dumps(args))
|
2339
1143
|
start_time = time.time()
|
2340
1144
|
while True:
|
2341
|
-
rsp = client.
|
1145
|
+
rsp = client.DescribeWarningCallback(model)
|
2342
1146
|
result = rsp.to_json_string()
|
2343
1147
|
try:
|
2344
1148
|
json_obj = json.loads(result)
|
@@ -2357,7 +1161,7 @@ def doCreateSnapshotTask(args, parsed_globals):
|
|
2357
1161
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2358
1162
|
|
2359
1163
|
|
2360
|
-
def
|
1164
|
+
def doCreatePPTCheckTask(args, parsed_globals):
|
2361
1165
|
g_param = parse_global_arg(parsed_globals)
|
2362
1166
|
|
2363
1167
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2386,11 +1190,11 @@ def doDescribeRunningTasks(args, parsed_globals):
|
|
2386
1190
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2387
1191
|
client._sdkVersion += ("_CLI_" + __version__)
|
2388
1192
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2389
|
-
model = models.
|
1193
|
+
model = models.CreatePPTCheckTaskRequest()
|
2390
1194
|
model.from_json_string(json.dumps(args))
|
2391
1195
|
start_time = time.time()
|
2392
1196
|
while True:
|
2393
|
-
rsp = client.
|
1197
|
+
rsp = client.CreatePPTCheckTask(model)
|
2394
1198
|
result = rsp.to_json_string()
|
2395
1199
|
try:
|
2396
1200
|
json_obj = json.loads(result)
|
@@ -2409,7 +1213,7 @@ def doDescribeRunningTasks(args, parsed_globals):
|
|
2409
1213
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2410
1214
|
|
2411
1215
|
|
2412
|
-
def
|
1216
|
+
def doStopOnlineRecord(args, parsed_globals):
|
2413
1217
|
g_param = parse_global_arg(parsed_globals)
|
2414
1218
|
|
2415
1219
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2438,11 +1242,11 @@ def doDescribeTIWDailyUsage(args, parsed_globals):
|
|
2438
1242
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2439
1243
|
client._sdkVersion += ("_CLI_" + __version__)
|
2440
1244
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2441
|
-
model = models.
|
1245
|
+
model = models.StopOnlineRecordRequest()
|
2442
1246
|
model.from_json_string(json.dumps(args))
|
2443
1247
|
start_time = time.time()
|
2444
1248
|
while True:
|
2445
|
-
rsp = client.
|
1249
|
+
rsp = client.StopOnlineRecord(model)
|
2446
1250
|
result = rsp.to_json_string()
|
2447
1251
|
try:
|
2448
1252
|
json_obj = json.loads(result)
|
@@ -2461,7 +1265,7 @@ def doDescribeTIWDailyUsage(args, parsed_globals):
|
|
2461
1265
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
1266
|
|
2463
1267
|
|
2464
|
-
def
|
1268
|
+
def doSetWhiteboardPushCallbackKey(args, parsed_globals):
|
2465
1269
|
g_param = parse_global_arg(parsed_globals)
|
2466
1270
|
|
2467
1271
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2490,11 +1294,11 @@ def doStopWhiteboardPush(args, parsed_globals):
|
|
2490
1294
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
1295
|
client._sdkVersion += ("_CLI_" + __version__)
|
2492
1296
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
-
model = models.
|
1297
|
+
model = models.SetWhiteboardPushCallbackKeyRequest()
|
2494
1298
|
model.from_json_string(json.dumps(args))
|
2495
1299
|
start_time = time.time()
|
2496
1300
|
while True:
|
2497
|
-
rsp = client.
|
1301
|
+
rsp = client.SetWhiteboardPushCallbackKey(model)
|
2498
1302
|
result = rsp.to_json_string()
|
2499
1303
|
try:
|
2500
1304
|
json_obj = json.loads(result)
|
@@ -2513,7 +1317,7 @@ def doStopWhiteboardPush(args, parsed_globals):
|
|
2513
1317
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2514
1318
|
|
2515
1319
|
|
2516
|
-
def
|
1320
|
+
def doDescribeTranscode(args, parsed_globals):
|
2517
1321
|
g_param = parse_global_arg(parsed_globals)
|
2518
1322
|
|
2519
1323
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2542,11 +1346,11 @@ def doDescribeIMApplications(args, parsed_globals):
|
|
2542
1346
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2543
1347
|
client._sdkVersion += ("_CLI_" + __version__)
|
2544
1348
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2545
|
-
model = models.
|
1349
|
+
model = models.DescribeTranscodeRequest()
|
2546
1350
|
model.from_json_string(json.dumps(args))
|
2547
1351
|
start_time = time.time()
|
2548
1352
|
while True:
|
2549
|
-
rsp = client.
|
1353
|
+
rsp = client.DescribeTranscode(model)
|
2550
1354
|
result = rsp.to_json_string()
|
2551
1355
|
try:
|
2552
1356
|
json_obj = json.loads(result)
|
@@ -2565,7 +1369,7 @@ def doDescribeIMApplications(args, parsed_globals):
|
|
2565
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2566
1370
|
|
2567
1371
|
|
2568
|
-
def
|
1372
|
+
def doDescribeRunningTasks(args, parsed_globals):
|
2569
1373
|
g_param = parse_global_arg(parsed_globals)
|
2570
1374
|
|
2571
1375
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2594,11 +1398,11 @@ def doDescribeQualityMetrics(args, parsed_globals):
|
|
2594
1398
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2595
1399
|
client._sdkVersion += ("_CLI_" + __version__)
|
2596
1400
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2597
|
-
model = models.
|
1401
|
+
model = models.DescribeRunningTasksRequest()
|
2598
1402
|
model.from_json_string(json.dumps(args))
|
2599
1403
|
start_time = time.time()
|
2600
1404
|
while True:
|
2601
|
-
rsp = client.
|
1405
|
+
rsp = client.DescribeRunningTasks(model)
|
2602
1406
|
result = rsp.to_json_string()
|
2603
1407
|
try:
|
2604
1408
|
json_obj = json.loads(result)
|
@@ -2617,7 +1421,7 @@ def doDescribeQualityMetrics(args, parsed_globals):
|
|
2617
1421
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2618
1422
|
|
2619
1423
|
|
2620
|
-
def
|
1424
|
+
def doStopWhiteboardPush(args, parsed_globals):
|
2621
1425
|
g_param = parse_global_arg(parsed_globals)
|
2622
1426
|
|
2623
1427
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2646,11 +1450,11 @@ def doStartWhiteboardPush(args, parsed_globals):
|
|
2646
1450
|
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2647
1451
|
client._sdkVersion += ("_CLI_" + __version__)
|
2648
1452
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2649
|
-
model = models.
|
1453
|
+
model = models.StopWhiteboardPushRequest()
|
2650
1454
|
model.from_json_string(json.dumps(args))
|
2651
1455
|
start_time = time.time()
|
2652
1456
|
while True:
|
2653
|
-
rsp = client.
|
1457
|
+
rsp = client.StopWhiteboardPush(model)
|
2654
1458
|
result = rsp.to_json_string()
|
2655
1459
|
try:
|
2656
1460
|
json_obj = json.loads(result)
|
@@ -2773,58 +1577,6 @@ def doDescribeTranscodeCallback(args, parsed_globals):
|
|
2773
1577
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2774
1578
|
|
2775
1579
|
|
2776
|
-
def doDescribeRoomList(args, parsed_globals):
|
2777
|
-
g_param = parse_global_arg(parsed_globals)
|
2778
|
-
|
2779
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2780
|
-
cred = credential.CVMRoleCredential()
|
2781
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2782
|
-
cred = credential.STSAssumeRoleCredential(
|
2783
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2784
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2785
|
-
)
|
2786
|
-
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):
|
2787
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2788
|
-
else:
|
2789
|
-
cred = credential.Credential(
|
2790
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2791
|
-
)
|
2792
|
-
http_profile = HttpProfile(
|
2793
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2794
|
-
reqMethod="POST",
|
2795
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
2796
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2797
|
-
)
|
2798
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2799
|
-
if g_param[OptionsDefine.Language]:
|
2800
|
-
profile.language = g_param[OptionsDefine.Language]
|
2801
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2802
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
2803
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
2804
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2805
|
-
model = models.DescribeRoomListRequest()
|
2806
|
-
model.from_json_string(json.dumps(args))
|
2807
|
-
start_time = time.time()
|
2808
|
-
while True:
|
2809
|
-
rsp = client.DescribeRoomList(model)
|
2810
|
-
result = rsp.to_json_string()
|
2811
|
-
try:
|
2812
|
-
json_obj = json.loads(result)
|
2813
|
-
except TypeError as e:
|
2814
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2815
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2816
|
-
break
|
2817
|
-
cur_time = time.time()
|
2818
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2819
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2820
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2821
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2822
|
-
else:
|
2823
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2824
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2825
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2826
|
-
|
2827
|
-
|
2828
1580
|
def doSetVideoGenerationTaskCallbackKey(args, parsed_globals):
|
2829
1581
|
g_param = parse_global_arg(parsed_globals)
|
2830
1582
|
|
@@ -3085,58 +1837,6 @@ def doDescribeSnapshotTask(args, parsed_globals):
|
|
3085
1837
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3086
1838
|
|
3087
1839
|
|
3088
|
-
def doModifyWhiteboardBucketConfig(args, parsed_globals):
|
3089
|
-
g_param = parse_global_arg(parsed_globals)
|
3090
|
-
|
3091
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3092
|
-
cred = credential.CVMRoleCredential()
|
3093
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3094
|
-
cred = credential.STSAssumeRoleCredential(
|
3095
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3096
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3097
|
-
)
|
3098
|
-
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):
|
3099
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3100
|
-
else:
|
3101
|
-
cred = credential.Credential(
|
3102
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3103
|
-
)
|
3104
|
-
http_profile = HttpProfile(
|
3105
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3106
|
-
reqMethod="POST",
|
3107
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
3108
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3109
|
-
)
|
3110
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3111
|
-
if g_param[OptionsDefine.Language]:
|
3112
|
-
profile.language = g_param[OptionsDefine.Language]
|
3113
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3114
|
-
client = mod.TiwClient(cred, g_param[OptionsDefine.Region], profile)
|
3115
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
3116
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3117
|
-
model = models.ModifyWhiteboardBucketConfigRequest()
|
3118
|
-
model.from_json_string(json.dumps(args))
|
3119
|
-
start_time = time.time()
|
3120
|
-
while True:
|
3121
|
-
rsp = client.ModifyWhiteboardBucketConfig(model)
|
3122
|
-
result = rsp.to_json_string()
|
3123
|
-
try:
|
3124
|
-
json_obj = json.loads(result)
|
3125
|
-
except TypeError as e:
|
3126
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3127
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3128
|
-
break
|
3129
|
-
cur_time = time.time()
|
3130
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3131
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3132
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3133
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3134
|
-
else:
|
3135
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3136
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3137
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3138
|
-
|
3139
|
-
|
3140
1840
|
CLIENT_MAP = {
|
3141
1841
|
"v20190919": tiw_client_v20190919,
|
3142
1842
|
|
@@ -3148,66 +1848,41 @@ MODELS_MAP = {
|
|
3148
1848
|
}
|
3149
1849
|
|
3150
1850
|
ACTION_MAP = {
|
3151
|
-
"DescribeWhiteboardBucketConfig": doDescribeWhiteboardBucketConfig,
|
3152
1851
|
"SetOnlineRecordCallback": doSetOnlineRecordCallback,
|
3153
|
-
"DescribeBoardSDKLog": doDescribeBoardSDKLog,
|
3154
|
-
"DescribeUserList": doDescribeUserList,
|
3155
1852
|
"SetVideoGenerationTaskCallback": doSetVideoGenerationTaskCallback,
|
3156
|
-
"
|
3157
|
-
"DescribePostpaidUsage": doDescribePostpaidUsage,
|
3158
|
-
"CreatePPTCheckTask": doCreatePPTCheckTask,
|
1853
|
+
"CreateVideoGenerationTask": doCreateVideoGenerationTask,
|
3159
1854
|
"SetOnlineRecordCallbackKey": doSetOnlineRecordCallbackKey,
|
3160
|
-
"DescribeWhiteboardApplicationConfig": doDescribeWhiteboardApplicationConfig,
|
3161
1855
|
"SetTranscodeCallback": doSetTranscodeCallback,
|
3162
1856
|
"ResumeOnlineRecord": doResumeOnlineRecord,
|
3163
1857
|
"DescribePPTCheckCallback": doDescribePPTCheckCallback,
|
3164
1858
|
"SetWarningCallback": doSetWarningCallback,
|
3165
1859
|
"SetTranscodeCallbackKey": doSetTranscodeCallbackKey,
|
3166
1860
|
"SetPPTCheckCallbackKey": doSetPPTCheckCallbackKey,
|
3167
|
-
"
|
1861
|
+
"CreateSnapshotTask": doCreateSnapshotTask,
|
3168
1862
|
"SetPPTCheckCallback": doSetPPTCheckCallback,
|
3169
1863
|
"DescribeTranscodeByUrl": doDescribeTranscodeByUrl,
|
3170
|
-
"DescribeTranscodeSearch": doDescribeTranscodeSearch,
|
3171
|
-
"ModifyApplication": doModifyApplication,
|
3172
|
-
"DescribeUserResources": doDescribeUserResources,
|
3173
1864
|
"DescribeOnlineRecord": doDescribeOnlineRecord,
|
3174
|
-
"ModifyAutoRenewFlag": doModifyAutoRenewFlag,
|
3175
1865
|
"DescribeOnlineRecordCallback": doDescribeOnlineRecordCallback,
|
3176
|
-
"DescribeApplicationUsage": doDescribeApplicationUsage,
|
3177
|
-
"CreateApplication": doCreateApplication,
|
3178
|
-
"DescribeAPIService": doDescribeAPIService,
|
3179
1866
|
"DescribeWhiteboardPushCallback": doDescribeWhiteboardPushCallback,
|
3180
|
-
"
|
3181
|
-
"
|
3182
|
-
"DescribeTIWRoomDailyUsage": doDescribeTIWRoomDailyUsage,
|
1867
|
+
"StartWhiteboardPush": doStartWhiteboardPush,
|
1868
|
+
"StartOnlineRecord": doStartOnlineRecord,
|
3183
1869
|
"CreateTranscode": doCreateTranscode,
|
3184
1870
|
"DescribeVideoGenerationTaskCallback": doDescribeVideoGenerationTaskCallback,
|
3185
|
-
"ModifyWhiteboardApplicationConfig": doModifyWhiteboardApplicationConfig,
|
3186
1871
|
"SetWhiteboardPushCallback": doSetWhiteboardPushCallback,
|
3187
|
-
"
|
3188
|
-
"
|
3189
|
-
"DescribeTranscode": doDescribeTranscode,
|
1872
|
+
"DescribeWarningCallback": doDescribeWarningCallback,
|
1873
|
+
"CreatePPTCheckTask": doCreatePPTCheckTask,
|
3190
1874
|
"StopOnlineRecord": doStopOnlineRecord,
|
3191
|
-
"DescribeUsageSummary": doDescribeUsageSummary,
|
3192
1875
|
"SetWhiteboardPushCallbackKey": doSetWhiteboardPushCallbackKey,
|
3193
|
-
"
|
3194
|
-
"DescribeUserStatus": doDescribeUserStatus,
|
3195
|
-
"CreateSnapshotTask": doCreateSnapshotTask,
|
1876
|
+
"DescribeTranscode": doDescribeTranscode,
|
3196
1877
|
"DescribeRunningTasks": doDescribeRunningTasks,
|
3197
|
-
"DescribeTIWDailyUsage": doDescribeTIWDailyUsage,
|
3198
1878
|
"StopWhiteboardPush": doStopWhiteboardPush,
|
3199
|
-
"DescribeIMApplications": doDescribeIMApplications,
|
3200
|
-
"DescribeQualityMetrics": doDescribeQualityMetrics,
|
3201
|
-
"StartWhiteboardPush": doStartWhiteboardPush,
|
3202
1879
|
"PauseOnlineRecord": doPauseOnlineRecord,
|
3203
1880
|
"DescribeTranscodeCallback": doDescribeTranscodeCallback,
|
3204
|
-
"DescribeRoomList": doDescribeRoomList,
|
3205
1881
|
"SetVideoGenerationTaskCallbackKey": doSetVideoGenerationTaskCallbackKey,
|
3206
1882
|
"DescribeWhiteboardPush": doDescribeWhiteboardPush,
|
3207
1883
|
"DescribeVideoGenerationTask": doDescribeVideoGenerationTask,
|
3208
1884
|
"DescribePPTCheck": doDescribePPTCheck,
|
3209
1885
|
"DescribeSnapshotTask": doDescribeSnapshotTask,
|
3210
|
-
"ModifyWhiteboardBucketConfig": doModifyWhiteboardBucketConfig,
|
3211
1886
|
|
3212
1887
|
}
|
3213
1888
|
|