tccli 3.0.1348.1__py2.py3-none-any.whl → 3.0.1350.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/__init__.py +0 -76
- tccli/services/ai3d/v20250513/api.json +1 -1
- tccli/services/aiart/v20221229/api.json +2 -2
- tccli/services/autoscaling/v20180419/api.json +11 -0
- tccli/services/batch/v20170312/api.json +44 -0
- tccli/services/cdb/v20170320/api.json +8 -8
- tccli/services/cdb/v20170320/examples.json +1 -1
- tccli/services/cdn/v20180606/api.json +5 -5
- tccli/services/cdwch/v20200915/api.json +11 -1
- tccli/services/cdwdoris/v20211228/api.json +145 -7
- tccli/services/cfg/v20210820/api.json +20 -0
- tccli/services/cfs/v20190719/api.json +10 -10
- tccli/services/cfw/cfw_client.py +53 -0
- tccli/services/cfw/v20190904/api.json +272 -0
- tccli/services/cfw/v20190904/examples.json +8 -0
- tccli/services/ckafka/ckafka_client.py +0 -53
- tccli/services/ckafka/v20190819/api.json +0 -215
- tccli/services/ckafka/v20190819/examples.json +0 -8
- tccli/services/csip/csip_client.py +833 -144
- tccli/services/csip/v20221121/api.json +3304 -1436
- tccli/services/csip/v20221121/examples.json +105 -7
- tccli/services/ctem/v20231128/api.json +20 -0
- tccli/services/cvm/v20170312/api.json +3 -3
- tccli/services/cwp/v20180228/api.json +9 -0
- tccli/services/cwp/v20180228/examples.json +6 -0
- tccli/services/dts/v20211206/api.json +21 -1
- tccli/services/emr/v20190103/api.json +219 -4
- tccli/services/es/v20250101/api.json +22 -0
- tccli/services/ess/v20201111/api.json +10 -1
- tccli/services/essbasic/v20210526/api.json +3 -3
- tccli/services/faceid/v20180301/api.json +3 -3
- tccli/services/gs/v20191118/api.json +38 -0
- tccli/services/igtm/igtm_client.py +159 -0
- tccli/services/igtm/v20231024/api.json +577 -0
- tccli/services/igtm/v20231024/examples.json +24 -0
- tccli/services/iotexplorer/v20190423/api.json +3 -3
- tccli/services/lcic/lcic_client.py +53 -0
- tccli/services/lcic/v20220817/api.json +53 -0
- tccli/services/lcic/v20220817/examples.json +8 -0
- tccli/services/live/live_client.py +224 -65
- tccli/services/live/v20180801/api.json +275 -1
- tccli/services/live/v20180801/examples.json +25 -1
- tccli/services/lke/v20231130/api.json +248 -2
- tccli/services/lke/v20231130/examples.json +1 -1
- tccli/services/lkeap/v20240522/api.json +1 -1
- tccli/services/mrs/v20200910/api.json +10 -0
- tccli/services/nlp/nlp_client.py +4 -322
- tccli/services/nlp/v20190408/api.json +0 -459
- tccli/services/nlp/v20190408/examples.json +0 -48
- tccli/services/ocr/v20181119/api.json +60 -5
- tccli/services/omics/v20221128/api.json +41 -3
- tccli/services/redis/v20180412/api.json +6 -6
- tccli/services/redis/v20180412/examples.json +1 -1
- tccli/services/ses/v20201002/api.json +100 -5
- tccli/services/tcb/v20180608/api.json +1 -1
- tccli/services/tcb/v20180608/examples.json +1 -1
- tccli/services/tdmq/v20200217/api.json +19 -0
- tccli/services/teo/teo_client.py +281 -16
- tccli/services/teo/v20220901/api.json +611 -6
- tccli/services/teo/v20220901/examples.json +48 -2
- tccli/services/tione/v20211111/api.json +16 -0
- tccli/services/tke/tke_client.py +57 -4
- tccli/services/tke/v20180525/api.json +24 -24
- tccli/services/tke/v20220501/api.json +52 -0
- tccli/services/tke/v20220501/examples.json +8 -0
- tccli/services/tmt/v20180321/api.json +4 -4
- tccli/services/tsf/v20180326/api.json +4 -4
- tccli/services/vclm/v20240523/api.json +2 -2
- tccli/services/vod/v20180717/api.json +5 -5
- tccli/services/vod/v20180717/examples.json +9 -9
- tccli/services/vpc/v20170312/api.json +1 -1
- tccli/services/vrs/v20200824/api.json +1 -1
- {tccli-3.0.1348.1.dist-info → tccli-3.0.1350.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1348.1.dist-info → tccli-3.0.1350.1.dist-info}/RECORD +78 -180
- tccli/services/cis/__init__.py +0 -4
- tccli/services/cis/cis_client.py +0 -525
- tccli/services/cis/v20180408/api.json +0 -737
- tccli/services/cis/v20180408/examples.json +0 -93
- tccli/services/dataintegration/__init__.py +0 -4
- tccli/services/dataintegration/dataintegration_client.py +0 -207
- tccli/services/dataintegration/v20220613/api.json +0 -87
- tccli/services/dataintegration/v20220613/examples.json +0 -13
- tccli/services/dtf/__init__.py +0 -4
- tccli/services/dtf/dtf_client.py +0 -207
- tccli/services/dtf/v20200506/api.json +0 -274
- tccli/services/dtf/v20200506/examples.json +0 -13
- tccli/services/gpm/__init__.py +0 -4
- tccli/services/gpm/gpm_client.py +0 -1108
- tccli/services/gpm/v20200820/api.json +0 -1959
- tccli/services/gpm/v20200820/examples.json +0 -149
- tccli/services/gse/__init__.py +0 -4
- tccli/services/gse/gse_client.py +0 -4076
- tccli/services/gse/v20191112/api.json +0 -7095
- tccli/services/gse/v20191112/examples.json +0 -615
- tccli/services/iecp/__init__.py +0 -4
- tccli/services/iecp/iecp_client.py +0 -4500
- tccli/services/iecp/v20210914/api.json +0 -9770
- tccli/services/iecp/v20210914/examples.json +0 -691
- tccli/services/iir/__init__.py +0 -4
- tccli/services/iir/iir_client.py +0 -207
- tccli/services/iir/v20200417/api.json +0 -204
- tccli/services/iir/v20200417/examples.json +0 -13
- tccli/services/iottid/__init__.py +0 -4
- tccli/services/iottid/iottid_client.py +0 -631
- tccli/services/iottid/v20190411/api.json +0 -553
- tccli/services/iottid/v20190411/examples.json +0 -95
- tccli/services/mgobe/__init__.py +0 -4
- tccli/services/mgobe/mgobe_client.py +0 -530
- tccli/services/mgobe/v20190929/api.json +0 -52
- tccli/services/mgobe/v20190929/examples.json +0 -13
- tccli/services/mgobe/v20201014/api.json +0 -671
- tccli/services/mgobe/v20201014/examples.json +0 -61
- tccli/services/mvj/__init__.py +0 -4
- tccli/services/mvj/mvj_client.py +0 -207
- tccli/services/mvj/v20190926/api.json +0 -123
- tccli/services/mvj/v20190926/examples.json +0 -19
- tccli/services/pds/__init__.py +0 -4
- tccli/services/pds/pds_client.py +0 -260
- tccli/services/pds/v20210701/api.json +0 -193
- tccli/services/pds/v20210701/examples.json +0 -21
- tccli/services/smpn/__init__.py +0 -4
- tccli/services/smpn/smpn_client.py +0 -260
- tccli/services/smpn/v20190822/api.json +0 -191
- tccli/services/smpn/v20190822/examples.json +0 -21
- tccli/services/solar/__init__.py +0 -4
- tccli/services/solar/solar_client.py +0 -1055
- tccli/services/solar/v20181011/api.json +0 -1760
- tccli/services/solar/v20181011/examples.json +0 -125
- tccli/services/tan/__init__.py +0 -4
- tccli/services/tan/tan_client.py +0 -207
- tccli/services/tan/v20220420/api.json +0 -65
- tccli/services/tan/v20220420/examples.json +0 -19
- tccli/services/tav/__init__.py +0 -4
- tccli/services/tav/tav_client.py +0 -366
- tccli/services/tav/v20190118/api.json +0 -262
- tccli/services/tav/v20190118/examples.json +0 -37
- tccli/services/tbm/__init__.py +0 -4
- tccli/services/tbm/tbm_client.py +0 -631
- tccli/services/tbm/v20180129/api.json +0 -1037
- tccli/services/tbm/v20180129/examples.json +0 -77
- tccli/services/tcex/__init__.py +0 -4
- tccli/services/tcex/tcex_client.py +0 -260
- tccli/services/tcex/v20200727/api.json +0 -158
- tccli/services/tcex/v20200727/examples.json +0 -21
- tccli/services/tci/__init__.py +0 -4
- tccli/services/tci/tci_client.py +0 -2327
- tccli/services/tci/v20190318/api.json +0 -4958
- tccli/services/tci/v20190318/examples.json +0 -333
- tccli/services/tic/__init__.py +0 -4
- tccli/services/tic/tic_client.py +0 -843
- tccli/services/tic/v20201117/api.json +0 -1067
- tccli/services/tic/v20201117/examples.json +0 -121
- tccli/services/ticm/__init__.py +0 -4
- tccli/services/ticm/ticm_client.py +0 -313
- tccli/services/ticm/v20181127/api.json +0 -1391
- tccli/services/ticm/v20181127/examples.json +0 -53
- tccli/services/tics/__init__.py +0 -4
- tccli/services/tics/tics_client.py +0 -366
- tccli/services/tics/v20181115/api.json +0 -694
- tccli/services/tics/v20181115/examples.json +0 -37
- tccli/services/tiems/__init__.py +0 -4
- tccli/services/tiems/tiems_client.py +0 -1479
- tccli/services/tiems/v20190416/api.json +0 -3144
- tccli/services/tiems/v20190416/examples.json +0 -217
- tccli/services/trdp/__init__.py +0 -4
- tccli/services/trdp/trdp_client.py +0 -207
- tccli/services/trdp/v20220726/api.json +0 -843
- tccli/services/trdp/v20220726/examples.json +0 -13
- tccli/services/ump/__init__.py +0 -4
- tccli/services/ump/ump_client.py +0 -1055
- tccli/services/ump/v20200918/api.json +0 -2168
- tccli/services/ump/v20200918/examples.json +0 -141
- tccli/services/youmall/__init__.py +0 -4
- tccli/services/youmall/v20180228/api.json +0 -3572
- tccli/services/youmall/v20180228/examples.json +0 -313
- tccli/services/youmall/youmall_client.py +0 -1797
- {tccli-3.0.1348.1.dist-info → tccli-3.0.1350.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1348.1.dist-info → tccli-3.0.1350.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1348.1.dist-info → tccli-3.0.1350.1.dist-info}/license_files/LICENSE +0 -0
@@ -1,1797 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
import os
|
3
|
-
import sys
|
4
|
-
import six
|
5
|
-
import json
|
6
|
-
import tccli.options_define as OptionsDefine
|
7
|
-
import tccli.format_output as FormatOutput
|
8
|
-
from tccli import __version__
|
9
|
-
from tccli.utils import Utils
|
10
|
-
from tccli.exceptions import ConfigurationError, ClientError, ParamError
|
11
|
-
from tencentcloud.common import credential
|
12
|
-
from tencentcloud.common.profile.http_profile import HttpProfile
|
13
|
-
from tencentcloud.common.profile.client_profile import ClientProfile
|
14
|
-
from tencentcloud.youmall.v20180228 import youmall_client as youmall_client_v20180228
|
15
|
-
from tencentcloud.youmall.v20180228 import models as models_v20180228
|
16
|
-
|
17
|
-
from jmespath import search
|
18
|
-
import time
|
19
|
-
|
20
|
-
def doDescribeCameraPerson(args, parsed_globals):
|
21
|
-
g_param = parse_global_arg(parsed_globals)
|
22
|
-
|
23
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
24
|
-
cred = credential.CVMRoleCredential()
|
25
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
26
|
-
cred = credential.STSAssumeRoleCredential(
|
27
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
28
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
29
|
-
)
|
30
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
31
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
32
|
-
else:
|
33
|
-
cred = credential.Credential(
|
34
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
35
|
-
)
|
36
|
-
http_profile = HttpProfile(
|
37
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
38
|
-
reqMethod="POST",
|
39
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
40
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
41
|
-
)
|
42
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
43
|
-
if g_param[OptionsDefine.Language]:
|
44
|
-
profile.language = g_param[OptionsDefine.Language]
|
45
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
46
|
-
client = mod.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
-
model = models.DescribeCameraPersonRequest()
|
50
|
-
model.from_json_string(json.dumps(args))
|
51
|
-
start_time = time.time()
|
52
|
-
while True:
|
53
|
-
rsp = client.DescribeCameraPerson(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 doDescribePersonInfo(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
99
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
100
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.DescribePersonInfoRequest()
|
102
|
-
model.from_json_string(json.dumps(args))
|
103
|
-
start_time = time.time()
|
104
|
-
while True:
|
105
|
-
rsp = client.DescribePersonInfo(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 doDescribeZoneTrafficInfo(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
151
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
152
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.DescribeZoneTrafficInfoRequest()
|
154
|
-
model.from_json_string(json.dumps(args))
|
155
|
-
start_time = time.time()
|
156
|
-
while True:
|
157
|
-
rsp = client.DescribeZoneTrafficInfo(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 doDescribeZoneFlowAgeInfoByZoneId(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
203
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
204
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
-
model = models.DescribeZoneFlowAgeInfoByZoneIdRequest()
|
206
|
-
model.from_json_string(json.dumps(args))
|
207
|
-
start_time = time.time()
|
208
|
-
while True:
|
209
|
-
rsp = client.DescribeZoneFlowAgeInfoByZoneId(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 doCreateAccount(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
255
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
256
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.CreateAccountRequest()
|
258
|
-
model.from_json_string(json.dumps(args))
|
259
|
-
start_time = time.time()
|
260
|
-
while True:
|
261
|
-
rsp = client.CreateAccount(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 doDescribeZoneFlowAndStayTime(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
307
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
308
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.DescribeZoneFlowAndStayTimeRequest()
|
310
|
-
model.from_json_string(json.dumps(args))
|
311
|
-
start_time = time.time()
|
312
|
-
while True:
|
313
|
-
rsp = client.DescribeZoneFlowAndStayTime(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 doDescribePersonVisitInfo(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
359
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
360
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
-
model = models.DescribePersonVisitInfoRequest()
|
362
|
-
model.from_json_string(json.dumps(args))
|
363
|
-
start_time = time.time()
|
364
|
-
while True:
|
365
|
-
rsp = client.DescribePersonVisitInfo(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 doDescribeZoneFlowHourlyByZoneId(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
411
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
412
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
413
|
-
model = models.DescribeZoneFlowHourlyByZoneIdRequest()
|
414
|
-
model.from_json_string(json.dumps(args))
|
415
|
-
start_time = time.time()
|
416
|
-
while True:
|
417
|
-
rsp = client.DescribeZoneFlowHourlyByZoneId(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 doDescribeShopInfo(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
463
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
464
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.DescribeShopInfoRequest()
|
466
|
-
model.from_json_string(json.dumps(args))
|
467
|
-
start_time = time.time()
|
468
|
-
while True:
|
469
|
-
rsp = client.DescribeShopInfo(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 doDescribeFaceIdByTempId(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
515
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
516
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
-
model = models.DescribeFaceIdByTempIdRequest()
|
518
|
-
model.from_json_string(json.dumps(args))
|
519
|
-
start_time = time.time()
|
520
|
-
while True:
|
521
|
-
rsp = client.DescribeFaceIdByTempId(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 doDescribeShopTrafficInfo(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
567
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
568
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
-
model = models.DescribeShopTrafficInfoRequest()
|
570
|
-
model.from_json_string(json.dumps(args))
|
571
|
-
start_time = time.time()
|
572
|
-
while True:
|
573
|
-
rsp = client.DescribeShopTrafficInfo(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 doDescribePersonInfoByFacePicture(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
619
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
620
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
-
model = models.DescribePersonInfoByFacePictureRequest()
|
622
|
-
model.from_json_string(json.dumps(args))
|
623
|
-
start_time = time.time()
|
624
|
-
while True:
|
625
|
-
rsp = client.DescribePersonInfoByFacePicture(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 doCreateFacePicture(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
671
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
672
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
-
model = models.CreateFacePictureRequest()
|
674
|
-
model.from_json_string(json.dumps(args))
|
675
|
-
start_time = time.time()
|
676
|
-
while True:
|
677
|
-
rsp = client.CreateFacePicture(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 doDescribeZoneFlowGenderAvrStayTimeByZoneId(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
723
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
724
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
-
model = models.DescribeZoneFlowGenderAvrStayTimeByZoneIdRequest()
|
726
|
-
model.from_json_string(json.dumps(args))
|
727
|
-
start_time = time.time()
|
728
|
-
while True:
|
729
|
-
rsp = client.DescribeZoneFlowGenderAvrStayTimeByZoneId(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 doDescribeTrajectoryData(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
775
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
776
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
-
model = models.DescribeTrajectoryDataRequest()
|
778
|
-
model.from_json_string(json.dumps(args))
|
779
|
-
start_time = time.time()
|
780
|
-
while True:
|
781
|
-
rsp = client.DescribeTrajectoryData(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 doDescribeShopHourTrafficInfo(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
827
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
828
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.DescribeShopHourTrafficInfoRequest()
|
830
|
-
model.from_json_string(json.dumps(args))
|
831
|
-
start_time = time.time()
|
832
|
-
while True:
|
833
|
-
rsp = client.DescribeShopHourTrafficInfo(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 doDescribePersonTrace(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
879
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
880
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
-
model = models.DescribePersonTraceRequest()
|
882
|
-
model.from_json_string(json.dumps(args))
|
883
|
-
start_time = time.time()
|
884
|
-
while True:
|
885
|
-
rsp = client.DescribePersonTrace(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 doDescribeZoneFlowDailyByZoneId(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
931
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
932
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
-
model = models.DescribeZoneFlowDailyByZoneIdRequest()
|
934
|
-
model.from_json_string(json.dumps(args))
|
935
|
-
start_time = time.time()
|
936
|
-
while True:
|
937
|
-
rsp = client.DescribeZoneFlowDailyByZoneId(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 doDescribePersonArrivedMall(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
983
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
984
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
-
model = models.DescribePersonArrivedMallRequest()
|
986
|
-
model.from_json_string(json.dumps(args))
|
987
|
-
start_time = time.time()
|
988
|
-
while True:
|
989
|
-
rsp = client.DescribePersonArrivedMall(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 doModifyPersonType(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1036
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
-
model = models.ModifyPersonTypeRequest()
|
1038
|
-
model.from_json_string(json.dumps(args))
|
1039
|
-
start_time = time.time()
|
1040
|
-
while True:
|
1041
|
-
rsp = client.ModifyPersonType(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 doDescribeClusterPersonArrivedMall(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1088
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.DescribeClusterPersonArrivedMallRequest()
|
1090
|
-
model.from_json_string(json.dumps(args))
|
1091
|
-
start_time = time.time()
|
1092
|
-
while True:
|
1093
|
-
rsp = client.DescribeClusterPersonArrivedMall(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 doDescribePersonTraceDetail(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1140
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
-
model = models.DescribePersonTraceDetailRequest()
|
1142
|
-
model.from_json_string(json.dumps(args))
|
1143
|
-
start_time = time.time()
|
1144
|
-
while True:
|
1145
|
-
rsp = client.DescribePersonTraceDetail(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 doRegisterCallback(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.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1191
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1192
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1193
|
-
model = models.RegisterCallbackRequest()
|
1194
|
-
model.from_json_string(json.dumps(args))
|
1195
|
-
start_time = time.time()
|
1196
|
-
while True:
|
1197
|
-
rsp = client.RegisterCallback(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 doModifyPersonFeatureInfo(args, parsed_globals):
|
1217
|
-
g_param = parse_global_arg(parsed_globals)
|
1218
|
-
|
1219
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1220
|
-
cred = credential.CVMRoleCredential()
|
1221
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1222
|
-
cred = credential.STSAssumeRoleCredential(
|
1223
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1224
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1225
|
-
)
|
1226
|
-
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):
|
1227
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1228
|
-
else:
|
1229
|
-
cred = credential.Credential(
|
1230
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1231
|
-
)
|
1232
|
-
http_profile = HttpProfile(
|
1233
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1234
|
-
reqMethod="POST",
|
1235
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1236
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1237
|
-
)
|
1238
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1239
|
-
if g_param[OptionsDefine.Language]:
|
1240
|
-
profile.language = g_param[OptionsDefine.Language]
|
1241
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1242
|
-
client = mod.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1244
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
-
model = models.ModifyPersonFeatureInfoRequest()
|
1246
|
-
model.from_json_string(json.dumps(args))
|
1247
|
-
start_time = time.time()
|
1248
|
-
while True:
|
1249
|
-
rsp = client.ModifyPersonFeatureInfo(model)
|
1250
|
-
result = rsp.to_json_string()
|
1251
|
-
try:
|
1252
|
-
json_obj = json.loads(result)
|
1253
|
-
except TypeError as e:
|
1254
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1255
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1256
|
-
break
|
1257
|
-
cur_time = time.time()
|
1258
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1259
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1260
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1261
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1262
|
-
else:
|
1263
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1264
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1265
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
|
-
|
1267
|
-
|
1268
|
-
def doDescribeHistoryNetworkInfo(args, parsed_globals):
|
1269
|
-
g_param = parse_global_arg(parsed_globals)
|
1270
|
-
|
1271
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1272
|
-
cred = credential.CVMRoleCredential()
|
1273
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1274
|
-
cred = credential.STSAssumeRoleCredential(
|
1275
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1276
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1277
|
-
)
|
1278
|
-
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):
|
1279
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1280
|
-
else:
|
1281
|
-
cred = credential.Credential(
|
1282
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1283
|
-
)
|
1284
|
-
http_profile = HttpProfile(
|
1285
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1286
|
-
reqMethod="POST",
|
1287
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1288
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1289
|
-
)
|
1290
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1291
|
-
if g_param[OptionsDefine.Language]:
|
1292
|
-
profile.language = g_param[OptionsDefine.Language]
|
1293
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1294
|
-
client = mod.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1295
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1296
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1297
|
-
model = models.DescribeHistoryNetworkInfoRequest()
|
1298
|
-
model.from_json_string(json.dumps(args))
|
1299
|
-
start_time = time.time()
|
1300
|
-
while True:
|
1301
|
-
rsp = client.DescribeHistoryNetworkInfo(model)
|
1302
|
-
result = rsp.to_json_string()
|
1303
|
-
try:
|
1304
|
-
json_obj = json.loads(result)
|
1305
|
-
except TypeError as e:
|
1306
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1307
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1308
|
-
break
|
1309
|
-
cur_time = time.time()
|
1310
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1311
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1312
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1313
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1314
|
-
else:
|
1315
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1316
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1317
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
|
-
|
1319
|
-
|
1320
|
-
def doDescribeNetworkInfo(args, parsed_globals):
|
1321
|
-
g_param = parse_global_arg(parsed_globals)
|
1322
|
-
|
1323
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1324
|
-
cred = credential.CVMRoleCredential()
|
1325
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1326
|
-
cred = credential.STSAssumeRoleCredential(
|
1327
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1328
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1329
|
-
)
|
1330
|
-
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):
|
1331
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1332
|
-
else:
|
1333
|
-
cred = credential.Credential(
|
1334
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1335
|
-
)
|
1336
|
-
http_profile = HttpProfile(
|
1337
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1338
|
-
reqMethod="POST",
|
1339
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1340
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1341
|
-
)
|
1342
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1343
|
-
if g_param[OptionsDefine.Language]:
|
1344
|
-
profile.language = g_param[OptionsDefine.Language]
|
1345
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1346
|
-
client = mod.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1347
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1348
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1349
|
-
model = models.DescribeNetworkInfoRequest()
|
1350
|
-
model.from_json_string(json.dumps(args))
|
1351
|
-
start_time = time.time()
|
1352
|
-
while True:
|
1353
|
-
rsp = client.DescribeNetworkInfo(model)
|
1354
|
-
result = rsp.to_json_string()
|
1355
|
-
try:
|
1356
|
-
json_obj = json.loads(result)
|
1357
|
-
except TypeError as e:
|
1358
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1359
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1360
|
-
break
|
1361
|
-
cur_time = time.time()
|
1362
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1363
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1364
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1365
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1366
|
-
else:
|
1367
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1368
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1369
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1370
|
-
|
1371
|
-
|
1372
|
-
def doDeletePersonFeature(args, parsed_globals):
|
1373
|
-
g_param = parse_global_arg(parsed_globals)
|
1374
|
-
|
1375
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1376
|
-
cred = credential.CVMRoleCredential()
|
1377
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1378
|
-
cred = credential.STSAssumeRoleCredential(
|
1379
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1380
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1381
|
-
)
|
1382
|
-
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):
|
1383
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1384
|
-
else:
|
1385
|
-
cred = credential.Credential(
|
1386
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1387
|
-
)
|
1388
|
-
http_profile = HttpProfile(
|
1389
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1390
|
-
reqMethod="POST",
|
1391
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1392
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1393
|
-
)
|
1394
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1395
|
-
if g_param[OptionsDefine.Language]:
|
1396
|
-
profile.language = g_param[OptionsDefine.Language]
|
1397
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1398
|
-
client = mod.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1400
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
-
model = models.DeletePersonFeatureRequest()
|
1402
|
-
model.from_json_string(json.dumps(args))
|
1403
|
-
start_time = time.time()
|
1404
|
-
while True:
|
1405
|
-
rsp = client.DeletePersonFeature(model)
|
1406
|
-
result = rsp.to_json_string()
|
1407
|
-
try:
|
1408
|
-
json_obj = json.loads(result)
|
1409
|
-
except TypeError as e:
|
1410
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1411
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1412
|
-
break
|
1413
|
-
cur_time = time.time()
|
1414
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1415
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1416
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1417
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1418
|
-
else:
|
1419
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1420
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1421
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
|
-
|
1423
|
-
|
1424
|
-
def doModifyPersonTagInfo(args, parsed_globals):
|
1425
|
-
g_param = parse_global_arg(parsed_globals)
|
1426
|
-
|
1427
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1428
|
-
cred = credential.CVMRoleCredential()
|
1429
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1430
|
-
cred = credential.STSAssumeRoleCredential(
|
1431
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1432
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1433
|
-
)
|
1434
|
-
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):
|
1435
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1436
|
-
else:
|
1437
|
-
cred = credential.Credential(
|
1438
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1439
|
-
)
|
1440
|
-
http_profile = HttpProfile(
|
1441
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1442
|
-
reqMethod="POST",
|
1443
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1444
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1445
|
-
)
|
1446
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1447
|
-
if g_param[OptionsDefine.Language]:
|
1448
|
-
profile.language = g_param[OptionsDefine.Language]
|
1449
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1450
|
-
client = mod.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1451
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1452
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1453
|
-
model = models.ModifyPersonTagInfoRequest()
|
1454
|
-
model.from_json_string(json.dumps(args))
|
1455
|
-
start_time = time.time()
|
1456
|
-
while True:
|
1457
|
-
rsp = client.ModifyPersonTagInfo(model)
|
1458
|
-
result = rsp.to_json_string()
|
1459
|
-
try:
|
1460
|
-
json_obj = json.loads(result)
|
1461
|
-
except TypeError as e:
|
1462
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1463
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1464
|
-
break
|
1465
|
-
cur_time = time.time()
|
1466
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1467
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1468
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1469
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1470
|
-
else:
|
1471
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1472
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1473
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1474
|
-
|
1475
|
-
|
1476
|
-
def doDescribeZoneFlowGenderInfoByZoneId(args, parsed_globals):
|
1477
|
-
g_param = parse_global_arg(parsed_globals)
|
1478
|
-
|
1479
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1480
|
-
cred = credential.CVMRoleCredential()
|
1481
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1482
|
-
cred = credential.STSAssumeRoleCredential(
|
1483
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1484
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1485
|
-
)
|
1486
|
-
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):
|
1487
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1488
|
-
else:
|
1489
|
-
cred = credential.Credential(
|
1490
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1491
|
-
)
|
1492
|
-
http_profile = HttpProfile(
|
1493
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1494
|
-
reqMethod="POST",
|
1495
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1496
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1497
|
-
)
|
1498
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1499
|
-
if g_param[OptionsDefine.Language]:
|
1500
|
-
profile.language = g_param[OptionsDefine.Language]
|
1501
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1502
|
-
client = mod.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1503
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1504
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1505
|
-
model = models.DescribeZoneFlowGenderInfoByZoneIdRequest()
|
1506
|
-
model.from_json_string(json.dumps(args))
|
1507
|
-
start_time = time.time()
|
1508
|
-
while True:
|
1509
|
-
rsp = client.DescribeZoneFlowGenderInfoByZoneId(model)
|
1510
|
-
result = rsp.to_json_string()
|
1511
|
-
try:
|
1512
|
-
json_obj = json.loads(result)
|
1513
|
-
except TypeError as e:
|
1514
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1515
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1516
|
-
break
|
1517
|
-
cur_time = time.time()
|
1518
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1519
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1520
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1521
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1522
|
-
else:
|
1523
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1524
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1525
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1526
|
-
|
1527
|
-
|
1528
|
-
def doDescribeClusterPersonTrace(args, parsed_globals):
|
1529
|
-
g_param = parse_global_arg(parsed_globals)
|
1530
|
-
|
1531
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1532
|
-
cred = credential.CVMRoleCredential()
|
1533
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1534
|
-
cred = credential.STSAssumeRoleCredential(
|
1535
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1536
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1537
|
-
)
|
1538
|
-
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):
|
1539
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1540
|
-
else:
|
1541
|
-
cred = credential.Credential(
|
1542
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1543
|
-
)
|
1544
|
-
http_profile = HttpProfile(
|
1545
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1546
|
-
reqMethod="POST",
|
1547
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1548
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1549
|
-
)
|
1550
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1551
|
-
if g_param[OptionsDefine.Language]:
|
1552
|
-
profile.language = g_param[OptionsDefine.Language]
|
1553
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1554
|
-
client = mod.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1555
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1556
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1557
|
-
model = models.DescribeClusterPersonTraceRequest()
|
1558
|
-
model.from_json_string(json.dumps(args))
|
1559
|
-
start_time = time.time()
|
1560
|
-
while True:
|
1561
|
-
rsp = client.DescribeClusterPersonTrace(model)
|
1562
|
-
result = rsp.to_json_string()
|
1563
|
-
try:
|
1564
|
-
json_obj = json.loads(result)
|
1565
|
-
except TypeError as e:
|
1566
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1567
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1568
|
-
break
|
1569
|
-
cur_time = time.time()
|
1570
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1571
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1572
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1573
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1574
|
-
else:
|
1575
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1576
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1577
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1578
|
-
|
1579
|
-
|
1580
|
-
def doDescribePerson(args, parsed_globals):
|
1581
|
-
g_param = parse_global_arg(parsed_globals)
|
1582
|
-
|
1583
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1584
|
-
cred = credential.CVMRoleCredential()
|
1585
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1586
|
-
cred = credential.STSAssumeRoleCredential(
|
1587
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1588
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1589
|
-
)
|
1590
|
-
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):
|
1591
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1592
|
-
else:
|
1593
|
-
cred = credential.Credential(
|
1594
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1595
|
-
)
|
1596
|
-
http_profile = HttpProfile(
|
1597
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1598
|
-
reqMethod="POST",
|
1599
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1600
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1601
|
-
)
|
1602
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1603
|
-
if g_param[OptionsDefine.Language]:
|
1604
|
-
profile.language = g_param[OptionsDefine.Language]
|
1605
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1606
|
-
client = mod.YoumallClient(cred, g_param[OptionsDefine.Region], profile)
|
1607
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1608
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1609
|
-
model = models.DescribePersonRequest()
|
1610
|
-
model.from_json_string(json.dumps(args))
|
1611
|
-
start_time = time.time()
|
1612
|
-
while True:
|
1613
|
-
rsp = client.DescribePerson(model)
|
1614
|
-
result = rsp.to_json_string()
|
1615
|
-
try:
|
1616
|
-
json_obj = json.loads(result)
|
1617
|
-
except TypeError as e:
|
1618
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1619
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1620
|
-
break
|
1621
|
-
cur_time = time.time()
|
1622
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1623
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1624
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1625
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1626
|
-
else:
|
1627
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1628
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1629
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1630
|
-
|
1631
|
-
|
1632
|
-
CLIENT_MAP = {
|
1633
|
-
"v20180228": youmall_client_v20180228,
|
1634
|
-
|
1635
|
-
}
|
1636
|
-
|
1637
|
-
MODELS_MAP = {
|
1638
|
-
"v20180228": models_v20180228,
|
1639
|
-
|
1640
|
-
}
|
1641
|
-
|
1642
|
-
ACTION_MAP = {
|
1643
|
-
"DescribeCameraPerson": doDescribeCameraPerson,
|
1644
|
-
"DescribePersonInfo": doDescribePersonInfo,
|
1645
|
-
"DescribeZoneTrafficInfo": doDescribeZoneTrafficInfo,
|
1646
|
-
"DescribeZoneFlowAgeInfoByZoneId": doDescribeZoneFlowAgeInfoByZoneId,
|
1647
|
-
"CreateAccount": doCreateAccount,
|
1648
|
-
"DescribeZoneFlowAndStayTime": doDescribeZoneFlowAndStayTime,
|
1649
|
-
"DescribePersonVisitInfo": doDescribePersonVisitInfo,
|
1650
|
-
"DescribeZoneFlowHourlyByZoneId": doDescribeZoneFlowHourlyByZoneId,
|
1651
|
-
"DescribeShopInfo": doDescribeShopInfo,
|
1652
|
-
"DescribeFaceIdByTempId": doDescribeFaceIdByTempId,
|
1653
|
-
"DescribeShopTrafficInfo": doDescribeShopTrafficInfo,
|
1654
|
-
"DescribePersonInfoByFacePicture": doDescribePersonInfoByFacePicture,
|
1655
|
-
"CreateFacePicture": doCreateFacePicture,
|
1656
|
-
"DescribeZoneFlowGenderAvrStayTimeByZoneId": doDescribeZoneFlowGenderAvrStayTimeByZoneId,
|
1657
|
-
"DescribeTrajectoryData": doDescribeTrajectoryData,
|
1658
|
-
"DescribeShopHourTrafficInfo": doDescribeShopHourTrafficInfo,
|
1659
|
-
"DescribePersonTrace": doDescribePersonTrace,
|
1660
|
-
"DescribeZoneFlowDailyByZoneId": doDescribeZoneFlowDailyByZoneId,
|
1661
|
-
"DescribePersonArrivedMall": doDescribePersonArrivedMall,
|
1662
|
-
"ModifyPersonType": doModifyPersonType,
|
1663
|
-
"DescribeClusterPersonArrivedMall": doDescribeClusterPersonArrivedMall,
|
1664
|
-
"DescribePersonTraceDetail": doDescribePersonTraceDetail,
|
1665
|
-
"RegisterCallback": doRegisterCallback,
|
1666
|
-
"ModifyPersonFeatureInfo": doModifyPersonFeatureInfo,
|
1667
|
-
"DescribeHistoryNetworkInfo": doDescribeHistoryNetworkInfo,
|
1668
|
-
"DescribeNetworkInfo": doDescribeNetworkInfo,
|
1669
|
-
"DeletePersonFeature": doDeletePersonFeature,
|
1670
|
-
"ModifyPersonTagInfo": doModifyPersonTagInfo,
|
1671
|
-
"DescribeZoneFlowGenderInfoByZoneId": doDescribeZoneFlowGenderInfoByZoneId,
|
1672
|
-
"DescribeClusterPersonTrace": doDescribeClusterPersonTrace,
|
1673
|
-
"DescribePerson": doDescribePerson,
|
1674
|
-
|
1675
|
-
}
|
1676
|
-
|
1677
|
-
AVAILABLE_VERSION_LIST = [
|
1678
|
-
"v20180228",
|
1679
|
-
|
1680
|
-
]
|
1681
|
-
|
1682
|
-
|
1683
|
-
def action_caller():
|
1684
|
-
return ACTION_MAP
|
1685
|
-
|
1686
|
-
|
1687
|
-
def parse_global_arg(parsed_globals):
|
1688
|
-
g_param = parsed_globals
|
1689
|
-
cvm_role_flag = True
|
1690
|
-
for param in parsed_globals.keys():
|
1691
|
-
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
1692
|
-
OptionsDefine.RoleSessionName]:
|
1693
|
-
if parsed_globals[param] is not None:
|
1694
|
-
cvm_role_flag = False
|
1695
|
-
break
|
1696
|
-
is_exist_profile = True
|
1697
|
-
if not parsed_globals["profile"]:
|
1698
|
-
is_exist_profile = False
|
1699
|
-
g_param["profile"] = os.environ.get("TCCLI_PROFILE", "default")
|
1700
|
-
|
1701
|
-
configure_path = os.path.join(os.path.expanduser("~"), ".tccli")
|
1702
|
-
is_conf_exist, conf_path = Utils.file_existed(configure_path, g_param["profile"] + ".configure")
|
1703
|
-
is_cred_exist, cred_path = Utils.file_existed(configure_path, g_param["profile"] + ".credential")
|
1704
|
-
|
1705
|
-
conf = {}
|
1706
|
-
cred = {}
|
1707
|
-
|
1708
|
-
if is_conf_exist:
|
1709
|
-
conf = Utils.load_json_msg(conf_path)
|
1710
|
-
if is_cred_exist:
|
1711
|
-
cred = Utils.load_json_msg(cred_path)
|
1712
|
-
|
1713
|
-
if not (isinstance(conf, dict) and isinstance(cred, dict)):
|
1714
|
-
raise ConfigurationError(
|
1715
|
-
"file: %s or %s is not json format"
|
1716
|
-
% (g_param["profile"] + ".configure", g_param["profile"] + ".credential"))
|
1717
|
-
|
1718
|
-
if OptionsDefine.Token not in cred:
|
1719
|
-
cred[OptionsDefine.Token] = None
|
1720
|
-
|
1721
|
-
if not is_exist_profile:
|
1722
|
-
if os.environ.get(OptionsDefine.ENV_SECRET_ID) and os.environ.get(OptionsDefine.ENV_SECRET_KEY):
|
1723
|
-
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
1724
|
-
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
1725
|
-
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
1726
|
-
cvm_role_flag = False
|
1727
|
-
|
1728
|
-
if os.environ.get(OptionsDefine.ENV_REGION):
|
1729
|
-
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
1730
|
-
|
1731
|
-
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
1732
|
-
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
1733
|
-
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
1734
|
-
cvm_role_flag = False
|
1735
|
-
|
1736
|
-
if cvm_role_flag:
|
1737
|
-
if "type" in cred and cred["type"] == "cvm-role":
|
1738
|
-
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
1739
|
-
|
1740
|
-
for param in g_param.keys():
|
1741
|
-
if g_param[param] is None:
|
1742
|
-
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.Token]:
|
1743
|
-
if param in cred:
|
1744
|
-
g_param[param] = cred[param]
|
1745
|
-
elif not (g_param[OptionsDefine.UseCVMRole.replace('-', '_')]
|
1746
|
-
or os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN)):
|
1747
|
-
raise ConfigurationError("%s is invalid" % param)
|
1748
|
-
elif param in [OptionsDefine.Region, OptionsDefine.Output, OptionsDefine.Language]:
|
1749
|
-
if param in conf[OptionsDefine.SysParam]:
|
1750
|
-
g_param[param] = conf[OptionsDefine.SysParam][param]
|
1751
|
-
elif param != OptionsDefine.Language:
|
1752
|
-
raise ConfigurationError("%s is invalid" % param)
|
1753
|
-
elif param.replace('_', '-') in [OptionsDefine.RoleArn, OptionsDefine.RoleSessionName]:
|
1754
|
-
if param.replace('_', '-') in cred:
|
1755
|
-
g_param[param] = cred[param.replace('_', '-')]
|
1756
|
-
|
1757
|
-
try:
|
1758
|
-
if g_param[OptionsDefine.ServiceVersion]:
|
1759
|
-
g_param[OptionsDefine.Version] = "v" + g_param[OptionsDefine.ServiceVersion].replace('-', '')
|
1760
|
-
else:
|
1761
|
-
version = conf["youmall"][OptionsDefine.Version]
|
1762
|
-
g_param[OptionsDefine.Version] = "v" + version.replace('-', '')
|
1763
|
-
|
1764
|
-
if g_param[OptionsDefine.Endpoint] is None:
|
1765
|
-
g_param[OptionsDefine.Endpoint] = conf["youmall"][OptionsDefine.Endpoint]
|
1766
|
-
g_param["sts_cred_endpoint"] = conf.get("sts", {}).get("endpoint")
|
1767
|
-
except Exception as err:
|
1768
|
-
raise ConfigurationError("config file:%s error, %s" % (conf_path, str(err)))
|
1769
|
-
|
1770
|
-
if g_param[OptionsDefine.Version] not in AVAILABLE_VERSION_LIST:
|
1771
|
-
raise Exception("available versions: %s" % " ".join(AVAILABLE_VERSION_LIST))
|
1772
|
-
|
1773
|
-
if g_param[OptionsDefine.Waiter]:
|
1774
|
-
param = eval(g_param[OptionsDefine.Waiter])
|
1775
|
-
if 'expr' not in param:
|
1776
|
-
raise Exception('`expr` in `--waiter` must be defined')
|
1777
|
-
if 'to' not in param:
|
1778
|
-
raise Exception('`to` in `--waiter` must be defined')
|
1779
|
-
if 'timeout' not in param:
|
1780
|
-
if 'waiter' in conf and 'timeout' in conf['waiter']:
|
1781
|
-
param['timeout'] = conf['waiter']['timeout']
|
1782
|
-
else:
|
1783
|
-
param['timeout'] = 180
|
1784
|
-
if 'interval' not in param:
|
1785
|
-
if 'waiter' in conf and 'interval' in conf['waiter']:
|
1786
|
-
param['interval'] = conf['waiter']['interval']
|
1787
|
-
else:
|
1788
|
-
param['interval'] = 5
|
1789
|
-
param['interval'] = min(param['interval'], param['timeout'])
|
1790
|
-
g_param['OptionsDefine.WaiterInfo'] = param
|
1791
|
-
|
1792
|
-
if six.PY2:
|
1793
|
-
for key, value in g_param.items():
|
1794
|
-
if isinstance(value, six.text_type):
|
1795
|
-
g_param[key] = value.encode('utf-8')
|
1796
|
-
return g_param
|
1797
|
-
|