tccli 3.0.1391.1__py2.py3-none-any.whl → 3.0.1414.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.
Potentially problematic release.
This version of tccli might be problematic. Click here for more details.
- tccli/__init__.py +1 -1
- tccli/services/__init__.py +2 -1
- tccli/services/ai3d/v20250513/api.json +22 -4
- tccli/services/aiart/aiart_client.py +173 -67
- tccli/services/aiart/v20221229/api.json +193 -0
- tccli/services/aiart/v20221229/examples.json +16 -0
- tccli/services/apm/apm_client.py +53 -0
- tccli/services/apm/v20210622/api.json +354 -0
- tccli/services/apm/v20210622/examples.json +8 -0
- tccli/services/asr/v20190614/api.json +3 -3
- tccli/services/autoscaling/v20180419/api.json +24 -2
- tccli/services/batch/v20170312/api.json +1 -1
- tccli/services/bda/bda_client.py +15 -704
- tccli/services/bda/v20200324/api.json +107 -1819
- tccli/services/bda/v20200324/examples.json +0 -176
- tccli/services/billing/billing_client.py +326 -8
- tccli/services/billing/v20180709/api.json +2200 -255
- tccli/services/billing/v20180709/examples.json +48 -0
- tccli/services/cam/v20190116/api.json +4 -4
- tccli/services/captcha/v20190722/api.json +3 -3
- tccli/services/cat/v20180409/api.json +7 -7
- tccli/services/ccc/ccc_client.py +235 -76
- tccli/services/ccc/v20200210/api.json +502 -18
- tccli/services/ccc/v20200210/examples.json +24 -0
- tccli/services/cdb/cdb_client.py +106 -0
- tccli/services/cdb/v20170320/api.json +257 -44
- tccli/services/cdb/v20170320/examples.json +22 -6
- tccli/services/cdn/cdn_client.py +4 -163
- tccli/services/cdn/v20180606/api.json +61 -310
- tccli/services/cdn/v20180606/examples.json +1 -25
- tccli/services/cdwdoris/v20211228/api.json +51 -12
- tccli/services/cdwpg/v20201230/api.json +11 -1
- tccli/services/cdwpg/v20201230/examples.json +1 -1
- tccli/services/cfg/v20210820/api.json +11 -1
- tccli/services/cfs/cfs_client.py +41 -94
- tccli/services/cfs/v20190719/api.json +171 -55
- tccli/services/cfs/v20190719/examples.json +1 -9
- tccli/services/cfw/v20190904/api.json +122 -10
- tccli/services/ckafka/ckafka_client.py +188 -29
- tccli/services/ckafka/v20190819/api.json +277 -4
- tccli/services/ckafka/v20190819/examples.json +25 -1
- tccli/services/clb/clb_client.py +0 -265
- tccli/services/clb/v20180317/api.json +130 -296
- tccli/services/clb/v20180317/examples.json +12 -40
- tccli/services/cloudapp/v20220530/api.json +55 -0
- tccli/services/cloudaudit/v20190319/api.json +11 -0
- tccli/services/cloudhsm/v20191112/api.json +10 -10
- tccli/services/cls/v20201016/api.json +63 -45
- tccli/services/cls/v20201016/examples.json +10 -4
- tccli/services/csip/v20221121/api.json +53 -3
- tccli/services/ctem/v20231128/api.json +320 -0
- tccli/services/ctem/v20231128/examples.json +3 -3
- tccli/services/cvm/cvm_client.py +0 -212
- tccli/services/cvm/v20170312/api.json +91 -843
- tccli/services/cvm/v20170312/examples.json +32 -58
- tccli/services/cynosdb/cynosdb_client.py +167 -8
- tccli/services/cynosdb/v20190107/api.json +1126 -148
- tccli/services/cynosdb/v20190107/examples.json +31 -7
- tccli/services/dbbrain/dbbrain_client.py +246 -87
- tccli/services/dbbrain/v20191016/api.json +74 -62
- tccli/services/dbbrain/v20191016/examples.json +1 -1
- tccli/services/dbbrain/v20210527/api.json +601 -177
- tccli/services/dbbrain/v20210527/examples.json +28 -4
- tccli/services/dc/v20180410/api.json +101 -3
- tccli/services/dcdb/v20180411/api.json +1 -1
- tccli/services/dlc/dlc_client.py +53 -0
- tccli/services/dlc/v20210125/api.json +237 -24
- tccli/services/dlc/v20210125/examples.json +12 -4
- tccli/services/dnspod/dnspod_client.py +106 -0
- tccli/services/dnspod/v20210323/api.json +126 -20
- tccli/services/dnspod/v20210323/examples.json +17 -7
- tccli/services/dsgc/v20190723/api.json +73 -15
- tccli/services/dts/v20180330/api.json +4 -4
- tccli/services/dts/v20211206/api.json +408 -127
- tccli/services/dts/v20211206/examples.json +15 -9
- tccli/services/eb/v20210416/api.json +41 -1
- tccli/services/eb/v20210416/examples.json +1 -1
- tccli/services/emr/v20190103/api.json +56 -9
- tccli/services/emr/v20190103/examples.json +5 -5
- tccli/services/es/es_client.py +273 -8
- tccli/services/es/v20180416/api.json +845 -33
- tccli/services/es/v20180416/examples.json +33 -1
- tccli/services/es/v20250101/api.json +135 -2
- tccli/services/es/v20250101/examples.json +8 -0
- tccli/services/ess/ess_client.py +509 -32
- tccli/services/ess/v20201111/api.json +1366 -113
- tccli/services/ess/v20201111/examples.json +94 -10
- tccli/services/essbasic/v20210526/api.json +265 -27
- tccli/services/essbasic/v20210526/examples.json +12 -12
- tccli/services/facefusion/v20220927/api.json +1 -1
- tccli/services/gaap/v20180529/api.json +18 -8
- tccli/services/gme/gme_client.py +53 -0
- tccli/services/gme/v20180711/api.json +241 -1
- tccli/services/gme/v20180711/examples.json +8 -0
- tccli/services/gs/gs_client.py +216 -4
- tccli/services/gs/v20191118/api.json +202 -1
- tccli/services/gs/v20191118/examples.json +32 -0
- tccli/services/gwlb/gwlb_client.py +53 -0
- tccli/services/gwlb/v20240906/api.json +150 -0
- tccli/services/gwlb/v20240906/examples.json +8 -0
- tccli/services/hai/v20230812/api.json +5 -5
- tccli/services/hunyuan/v20230901/api.json +3 -3
- tccli/services/hunyuan/v20230901/examples.json +1 -1
- tccli/services/iai/v20180301/api.json +227 -207
- tccli/services/iai/v20180301/examples.json +26 -26
- tccli/services/iai/v20200303/api.json +4 -4
- tccli/services/iai/v20200303/examples.json +1 -1
- tccli/services/ioa/ioa_client.py +265 -0
- tccli/services/ioa/v20220601/api.json +781 -85
- tccli/services/ioa/v20220601/examples.json +46 -0
- tccli/services/iotexplorer/iotexplorer_client.py +387 -16
- tccli/services/iotexplorer/v20190423/api.json +1183 -63
- tccli/services/iotexplorer/v20190423/examples.json +92 -0
- tccli/services/keewidb/v20220308/api.json +69 -17
- tccli/services/keewidb/v20220308/examples.json +5 -5
- tccli/services/lcic/v20220817/api.json +61 -15
- tccli/services/lighthouse/v20200324/api.json +193 -24
- tccli/services/lighthouse/v20200324/examples.json +9 -3
- tccli/services/live/v20180801/api.json +6 -6
- tccli/services/live/v20180801/examples.json +7 -1
- tccli/services/lke/lke_client.py +40 -93
- tccli/services/lke/v20231130/api.json +943 -390
- tccli/services/lke/v20231130/examples.json +38 -46
- tccli/services/lkeap/v20240522/api.json +39 -12
- tccli/services/lkeap/v20240522/examples.json +12 -0
- tccli/services/mariadb/v20170312/api.json +1 -1
- tccli/services/mna/v20210119/api.json +11 -2
- tccli/services/mna/v20210119/examples.json +1 -1
- tccli/services/mongodb/mongodb_client.py +334 -16
- tccli/services/mongodb/v20190725/api.json +1092 -383
- tccli/services/mongodb/v20190725/examples.json +69 -21
- tccli/services/monitor/monitor_client.py +106 -0
- tccli/services/monitor/v20180724/api.json +383 -12
- tccli/services/monitor/v20180724/examples.json +24 -2
- tccli/services/mps/mps_client.py +220 -8
- tccli/services/mps/v20190612/api.json +1999 -179
- tccli/services/mps/v20190612/examples.json +56 -6
- tccli/services/mqtt/v20240516/api.json +10 -0
- tccli/services/mqtt/v20240516/examples.json +3 -9
- tccli/services/nlp/v20190408/api.json +6 -6
- tccli/services/oceanus/oceanus_client.py +318 -0
- tccli/services/oceanus/v20190422/api.json +461 -26
- tccli/services/oceanus/v20190422/examples.json +50 -2
- tccli/services/ocr/ocr_client.py +41 -253
- tccli/services/ocr/v20181119/api.json +153 -659
- tccli/services/ocr/v20181119/examples.json +8 -40
- tccli/services/omics/v20221128/api.json +90 -7
- tccli/services/organization/v20210331/api.json +46 -7
- tccli/services/postgres/v20170312/api.json +333 -77
- tccli/services/postgres/v20170312/examples.json +37 -31
- tccli/services/privatedns/privatedns_client.py +641 -58
- tccli/services/privatedns/v20201028/api.json +930 -19
- tccli/services/privatedns/v20201028/examples.json +91 -3
- tccli/services/pts/v20210728/api.json +2 -2
- tccli/services/redis/v20180412/api.json +303 -109
- tccli/services/redis/v20180412/examples.json +12 -12
- tccli/services/region/v20220627/api.json +1 -1
- tccli/services/rum/v20210622/api.json +22 -4
- tccli/services/rum/v20210622/examples.json +2 -2
- tccli/services/sms/v20190711/api.json +12 -12
- tccli/services/sms/v20190711/examples.json +9 -3
- tccli/services/sms/v20210111/api.json +13 -13
- tccli/services/sms/v20210111/examples.json +8 -2
- tccli/services/sqlserver/v20180328/api.json +46 -7
- tccli/services/sqlserver/v20180328/examples.json +2 -2
- tccli/services/ssl/v20191205/api.json +28 -0
- tccli/services/svp/v20240125/api.json +14 -4
- tccli/services/tag/v20180813/api.json +3 -3
- tccli/services/tat/v20201028/api.json +22 -3
- tccli/services/tcb/v20180608/api.json +1 -1
- tccli/services/tcss/tcss_client.py +228 -69
- tccli/services/tcss/v20201101/api.json +273 -25
- tccli/services/tcss/v20201101/examples.json +26 -2
- tccli/services/teo/teo_client.py +317 -52
- tccli/services/teo/v20220901/api.json +1824 -242
- tccli/services/teo/v20220901/examples.json +109 -21
- tccli/services/thpc/thpc_client.py +57 -4
- tccli/services/thpc/v20230321/api.json +163 -21
- tccli/services/thpc/v20230321/examples.json +13 -5
- tccli/services/tione/tione_client.py +163 -4
- tccli/services/tione/v20211111/api.json +285 -21
- tccli/services/tione/v20211111/examples.json +27 -3
- tccli/services/tke/tke_client.py +8 -8
- tccli/services/tke/v20180525/api.json +168 -130
- tccli/services/tke/v20180525/examples.json +20 -20
- tccli/services/tke/v20220501/api.json +215 -3
- tccli/services/tke/v20220501/examples.json +8 -0
- tccli/services/tms/tms_client.py +106 -0
- tccli/services/tms/v20201229/api.json +249 -3
- tccli/services/tms/v20201229/examples.json +16 -0
- tccli/services/tmt/v20180321/api.json +78 -1
- tccli/services/trabbit/v20230418/api.json +271 -4
- tccli/services/trabbit/v20230418/examples.json +9 -3
- tccli/services/trocket/v20230308/api.json +4 -4
- tccli/services/trro/trro_client.py +106 -0
- tccli/services/trro/v20220325/api.json +456 -0
- tccli/services/trro/v20220325/examples.json +16 -0
- tccli/services/trtc/v20190722/api.json +197 -49
- tccli/services/trtc/v20190722/examples.json +4 -4
- tccli/services/tse/v20201207/api.json +69 -2
- tccli/services/tse/v20201207/examples.json +3 -3
- tccli/services/tsf/v20180326/api.json +70 -7
- tccli/services/tsf/v20180326/examples.json +2 -2
- tccli/services/vclm/v20240523/api.json +145 -0
- tccli/services/vclm/v20240523/examples.json +16 -0
- tccli/services/vclm/vclm_client.py +106 -0
- tccli/services/vcube/v20220410/api.json +1 -1
- tccli/services/vod/v20180717/api.json +7 -7
- tccli/services/vpc/v20170312/api.json +1216 -70
- tccli/services/vpc/v20170312/examples.json +139 -3
- tccli/services/vpc/vpc_client.py +1023 -122
- tccli/services/vrs/v20200824/api.json +11 -11
- tccli/services/vrs/v20200824/examples.json +1 -1
- tccli/services/vtc/v20240223/api.json +14 -14
- tccli/services/waf/v20180125/api.json +812 -143
- tccli/services/waf/v20180125/examples.json +2 -2
- tccli/services/wedata/v20210820/api.json +1281 -601
- tccli/services/wedata/v20210820/examples.json +127 -157
- tccli/services/wedata/v20250806/api.json +19335 -0
- tccli/services/wedata/v20250806/examples.json +999 -0
- tccli/services/wedata/wedata_client.py +7072 -1131
- {tccli-3.0.1391.1.dist-info → tccli-3.0.1414.1.dist-info}/METADATA +9 -7
- {tccli-3.0.1391.1.dist-info → tccli-3.0.1414.1.dist-info}/RECORD +226 -224
- {tccli-3.0.1391.1.dist-info → tccli-3.0.1414.1.dist-info}/WHEEL +1 -1
- {tccli-3.0.1391.1.dist-info → tccli-3.0.1414.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1391.1.dist-info/license_files → tccli-3.0.1414.1.dist-info/licenses}/LICENSE +0 -0
tccli/services/bda/bda_client.py
CHANGED
|
@@ -17,475 +17,7 @@ from tencentcloud.bda.v20200324 import models as models_v20200324
|
|
|
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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
47
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
48
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
49
|
-
model = models.SearchTraceRequest()
|
|
50
|
-
model.from_json_string(json.dumps(args))
|
|
51
|
-
start_time = time.time()
|
|
52
|
-
while True:
|
|
53
|
-
rsp = client.SearchTrace(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 doTerminateSegmentationTask(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
99
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
100
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
101
|
-
model = models.TerminateSegmentationTaskRequest()
|
|
102
|
-
model.from_json_string(json.dumps(args))
|
|
103
|
-
start_time = time.time()
|
|
104
|
-
while True:
|
|
105
|
-
rsp = client.TerminateSegmentationTask(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 doGetSummaryInfo(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
151
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
152
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
153
|
-
model = models.GetSummaryInfoRequest()
|
|
154
|
-
model.from_json_string(json.dumps(args))
|
|
155
|
-
start_time = time.time()
|
|
156
|
-
while True:
|
|
157
|
-
rsp = client.GetSummaryInfo(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 doDetectBody(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
203
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
204
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
205
|
-
model = models.DetectBodyRequest()
|
|
206
|
-
model.from_json_string(json.dumps(args))
|
|
207
|
-
start_time = time.time()
|
|
208
|
-
while True:
|
|
209
|
-
rsp = client.DetectBody(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 doSegmentPortraitPic(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
255
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
256
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
257
|
-
model = models.SegmentPortraitPicRequest()
|
|
258
|
-
model.from_json_string(json.dumps(args))
|
|
259
|
-
start_time = time.time()
|
|
260
|
-
while True:
|
|
261
|
-
rsp = client.SegmentPortraitPic(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 doDetectBodyJoints(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
307
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
308
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
309
|
-
model = models.DetectBodyJointsRequest()
|
|
310
|
-
model.from_json_string(json.dumps(args))
|
|
311
|
-
start_time = time.time()
|
|
312
|
-
while True:
|
|
313
|
-
rsp = client.DetectBodyJoints(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 doCreateTrace(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
359
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
360
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
361
|
-
model = models.CreateTraceRequest()
|
|
362
|
-
model.from_json_string(json.dumps(args))
|
|
363
|
-
start_time = time.time()
|
|
364
|
-
while True:
|
|
365
|
-
rsp = client.CreateTrace(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 doDeleteGroup(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
411
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
412
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
413
|
-
model = models.DeleteGroupRequest()
|
|
414
|
-
model.from_json_string(json.dumps(args))
|
|
415
|
-
start_time = time.time()
|
|
416
|
-
while True:
|
|
417
|
-
rsp = client.DeleteGroup(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 doDeletePerson(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
463
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
464
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
465
|
-
model = models.DeletePersonRequest()
|
|
466
|
-
model.from_json_string(json.dumps(args))
|
|
467
|
-
start_time = time.time()
|
|
468
|
-
while True:
|
|
469
|
-
rsp = client.DeletePerson(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 doSegmentCustomizedPortraitPic(args, parsed_globals):
|
|
20
|
+
def doSegmentPortraitPic(args, parsed_globals):
|
|
489
21
|
g_param = parse_global_arg(parsed_globals)
|
|
490
22
|
|
|
491
23
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -514,11 +46,11 @@ def doSegmentCustomizedPortraitPic(args, parsed_globals):
|
|
|
514
46
|
client = mod.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
515
47
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
516
48
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
517
|
-
model = models.
|
|
49
|
+
model = models.SegmentPortraitPicRequest()
|
|
518
50
|
model.from_json_string(json.dumps(args))
|
|
519
51
|
start_time = time.time()
|
|
520
52
|
while True:
|
|
521
|
-
rsp = client.
|
|
53
|
+
rsp = client.SegmentPortraitPic(model)
|
|
522
54
|
result = rsp.to_json_string()
|
|
523
55
|
try:
|
|
524
56
|
json_obj = json.loads(result)
|
|
@@ -537,7 +69,7 @@ def doSegmentCustomizedPortraitPic(args, parsed_globals):
|
|
|
537
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
538
70
|
|
|
539
71
|
|
|
540
|
-
def
|
|
72
|
+
def doCreateSegmentationTask(args, parsed_globals):
|
|
541
73
|
g_param = parse_global_arg(parsed_globals)
|
|
542
74
|
|
|
543
75
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -566,11 +98,11 @@ def doModifyGroup(args, parsed_globals):
|
|
|
566
98
|
client = mod.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
567
99
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
568
100
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
569
|
-
model = models.
|
|
101
|
+
model = models.CreateSegmentationTaskRequest()
|
|
570
102
|
model.from_json_string(json.dumps(args))
|
|
571
103
|
start_time = time.time()
|
|
572
104
|
while True:
|
|
573
|
-
rsp = client.
|
|
105
|
+
rsp = client.CreateSegmentationTask(model)
|
|
574
106
|
result = rsp.to_json_string()
|
|
575
107
|
try:
|
|
576
108
|
json_obj = json.loads(result)
|
|
@@ -589,7 +121,7 @@ def doModifyGroup(args, parsed_globals):
|
|
|
589
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
590
122
|
|
|
591
123
|
|
|
592
|
-
def
|
|
124
|
+
def doTerminateSegmentationTask(args, parsed_globals):
|
|
593
125
|
g_param = parse_global_arg(parsed_globals)
|
|
594
126
|
|
|
595
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -618,11 +150,11 @@ def doGetGroupList(args, parsed_globals):
|
|
|
618
150
|
client = mod.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
619
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
620
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
621
|
-
model = models.
|
|
153
|
+
model = models.TerminateSegmentationTaskRequest()
|
|
622
154
|
model.from_json_string(json.dumps(args))
|
|
623
155
|
start_time = time.time()
|
|
624
156
|
while True:
|
|
625
|
-
rsp = client.
|
|
157
|
+
rsp = client.TerminateSegmentationTask(model)
|
|
626
158
|
result = rsp.to_json_string()
|
|
627
159
|
try:
|
|
628
160
|
json_obj = json.loads(result)
|
|
@@ -693,215 +225,7 @@ def doDescribeSegmentationTask(args, parsed_globals):
|
|
|
693
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
694
226
|
|
|
695
227
|
|
|
696
|
-
def
|
|
697
|
-
g_param = parse_global_arg(parsed_globals)
|
|
698
|
-
|
|
699
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
700
|
-
cred = credential.CVMRoleCredential()
|
|
701
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
702
|
-
cred = credential.STSAssumeRoleCredential(
|
|
703
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
704
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
705
|
-
)
|
|
706
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
707
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
708
|
-
else:
|
|
709
|
-
cred = credential.Credential(
|
|
710
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
711
|
-
)
|
|
712
|
-
http_profile = HttpProfile(
|
|
713
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
714
|
-
reqMethod="POST",
|
|
715
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
|
716
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
717
|
-
)
|
|
718
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
719
|
-
if g_param[OptionsDefine.Language]:
|
|
720
|
-
profile.language = g_param[OptionsDefine.Language]
|
|
721
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
722
|
-
client = mod.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
723
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
724
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
725
|
-
model = models.CreateGroupRequest()
|
|
726
|
-
model.from_json_string(json.dumps(args))
|
|
727
|
-
start_time = time.time()
|
|
728
|
-
while True:
|
|
729
|
-
rsp = client.CreateGroup(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 doCreatePerson(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
775
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
776
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
777
|
-
model = models.CreatePersonRequest()
|
|
778
|
-
model.from_json_string(json.dumps(args))
|
|
779
|
-
start_time = time.time()
|
|
780
|
-
while True:
|
|
781
|
-
rsp = client.CreatePerson(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 doGetPersonList(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
827
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
828
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
829
|
-
model = models.GetPersonListRequest()
|
|
830
|
-
model.from_json_string(json.dumps(args))
|
|
831
|
-
start_time = time.time()
|
|
832
|
-
while True:
|
|
833
|
-
rsp = client.GetPersonList(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 doModifyPersonInfo(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.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
879
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
|
880
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
881
|
-
model = models.ModifyPersonInfoRequest()
|
|
882
|
-
model.from_json_string(json.dumps(args))
|
|
883
|
-
start_time = time.time()
|
|
884
|
-
while True:
|
|
885
|
-
rsp = client.ModifyPersonInfo(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 doCreateSegmentationTask(args, parsed_globals):
|
|
228
|
+
def doSegmentCustomizedPortraitPic(args, parsed_globals):
|
|
905
229
|
g_param = parse_global_arg(parsed_globals)
|
|
906
230
|
|
|
907
231
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -930,11 +254,11 @@ def doCreateSegmentationTask(args, parsed_globals):
|
|
|
930
254
|
client = mod.BdaClient(cred, g_param[OptionsDefine.Region], profile)
|
|
931
255
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
932
256
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
933
|
-
model = models.
|
|
257
|
+
model = models.SegmentCustomizedPortraitPicRequest()
|
|
934
258
|
model.from_json_string(json.dumps(args))
|
|
935
259
|
start_time = time.time()
|
|
936
260
|
while True:
|
|
937
|
-
rsp = client.
|
|
261
|
+
rsp = client.SegmentCustomizedPortraitPic(model)
|
|
938
262
|
result = rsp.to_json_string()
|
|
939
263
|
try:
|
|
940
264
|
json_obj = json.loads(result)
|
|
@@ -964,24 +288,11 @@ MODELS_MAP = {
|
|
|
964
288
|
}
|
|
965
289
|
|
|
966
290
|
ACTION_MAP = {
|
|
967
|
-
"SearchTrace": doSearchTrace,
|
|
968
|
-
"TerminateSegmentationTask": doTerminateSegmentationTask,
|
|
969
|
-
"GetSummaryInfo": doGetSummaryInfo,
|
|
970
|
-
"DetectBody": doDetectBody,
|
|
971
291
|
"SegmentPortraitPic": doSegmentPortraitPic,
|
|
972
|
-
"DetectBodyJoints": doDetectBodyJoints,
|
|
973
|
-
"CreateTrace": doCreateTrace,
|
|
974
|
-
"DeleteGroup": doDeleteGroup,
|
|
975
|
-
"DeletePerson": doDeletePerson,
|
|
976
|
-
"SegmentCustomizedPortraitPic": doSegmentCustomizedPortraitPic,
|
|
977
|
-
"ModifyGroup": doModifyGroup,
|
|
978
|
-
"GetGroupList": doGetGroupList,
|
|
979
|
-
"DescribeSegmentationTask": doDescribeSegmentationTask,
|
|
980
|
-
"CreateGroup": doCreateGroup,
|
|
981
|
-
"CreatePerson": doCreatePerson,
|
|
982
|
-
"GetPersonList": doGetPersonList,
|
|
983
|
-
"ModifyPersonInfo": doModifyPersonInfo,
|
|
984
292
|
"CreateSegmentationTask": doCreateSegmentationTask,
|
|
293
|
+
"TerminateSegmentationTask": doTerminateSegmentationTask,
|
|
294
|
+
"DescribeSegmentationTask": doDescribeSegmentationTask,
|
|
295
|
+
"SegmentCustomizedPortraitPic": doSegmentCustomizedPortraitPic,
|
|
985
296
|
|
|
986
297
|
}
|
|
987
298
|
|