tccli 3.0.1010.1__py2.py3-none-any.whl → 3.0.1012.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/examples/antiddos/v20200309/DescribeBasicDeviceStatus.md +12 -0
- tccli/examples/cat/v20180409/DescribeProbeMetricData.md +2 -2
- tccli/examples/cfw/v20190904/DescribeResourceGroup.md +5 -4
- tccli/examples/cfw/v20190904/DescribeResourceGroupNew.md +6 -5
- tccli/examples/cwp/v20180228/DescribeLogExports.md +2 -2
- tccli/examples/cwp/v20180228/ModifyLogKafkaDeliverType.md +3 -3
- tccli/examples/dsgc/v20190723/CopyDSPATemplate.md +3 -3
- tccli/examples/dsgc/v20190723/CreateDSPAAssessmentRiskLevel.md +1 -1
- tccli/examples/dsgc/v20190723/CreateDSPAAssessmentRiskTemplate.md +2 -2
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentHighRiskTop10Overview.md +3 -3
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentLatestRiskDetailInfo.md +4 -4
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentLatestRiskList.md +2 -2
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentNewDiscoveredRiskOverview.md +3 -3
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentPendingRiskOverview.md +2 -2
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentProcessingRiskOverview.md +3 -3
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentRiskAmountOverview.md +3 -3
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentRiskDealedTrend.md +0 -40
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentRiskDistributionOverview.md +2 -2
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentRiskLevelDetail.md +2 -2
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentRiskLevelTrend.md +0 -32
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentRiskSideDistributed.md +2 -2
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentRiskSideList.md +1 -1
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentRiskTemplateDetail.md +9 -2
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentRiskTemplateVulnerableList.md +9 -3
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentTemplateControlItems.md +1 -1
- tccli/examples/dsgc/v20190723/DescribeDSPAAssessmentTemplates.md +17 -11
- tccli/examples/ess/v20201111/CreateSchemeUrl.md +31 -31
- tccli/examples/essbasic/v20210526/DescribeChannelSealPolicyWorkflowUrl.md +25 -0
- tccli/examples/iotvideo/v20211125/DescribeCloudStorageThumbnailList.md +28 -0
- tccli/examples/mna/v20210119/ActivateHardware.md +33 -0
- tccli/examples/mna/v20210119/AddHardware.md +30 -0
- tccli/examples/mna/v20210119/GetHardwareList.md +82 -0
- tccli/examples/mna/v20210119/GetVendorHardware.md +163 -0
- tccli/examples/mna/v20210119/UpdateHardware.md +22 -0
- tccli/examples/oceanus/v20190422/DescribeResourceRelatedJobs.md +11 -11
- tccli/examples/sms/v20190711/ModifySmsSign.md +4 -4
- tccli/examples/sms/v20190711/PullSmsSendStatus.md +2 -2
- tccli/examples/sms/v20210111/AddSmsSign.md +2 -2
- tccli/examples/tat/v20201028/CreateRegisterCode.md +28 -8
- tccli/examples/tcss/v20201101/DescribeAbnormalProcessDetail.md +6 -1
- tccli/examples/tcss/v20201101/DescribeAccessControlDetail.md +5 -1
- tccli/examples/tcss/v20201101/DescribeAssetSyncLastTime.md +4 -2
- tccli/examples/tcss/v20201101/DescribeEscapeEventDetail.md +3 -1
- tccli/examples/tcss/v20201101/DescribeRiskDnsEventDetail.md +2 -0
- tccli/examples/tcss/v20201101/DescribeRiskSyscallDetail.md +6 -1
- tccli/examples/tcss/v20201101/DescribeVirusDetail.md +2 -0
- tccli/examples/tcss/v20201101/DescribeVulDefenceEventDetail.md +11 -1
- tccli/examples/tdmq/v20200217/CreateProCluster.md +1 -1
- tccli/examples/tdmq/v20200217/DeleteProCluster.md +21 -0
- tccli/examples/tms/v20201229/TextModeration.md +70 -81
- tccli/examples/trtc/v20190722/DescribeMixTranscodingUsage.md +1 -1
- tccli/examples/trtc/v20190722/DescribeRecordingUsage.md +1 -1
- tccli/examples/trtc/v20190722/DescribeRelayUsage.md +1 -1
- tccli/examples/trtc/v20190722/DescribeTrtcUsage.md +1 -1
- tccli/examples/vod/v20180717/SetVodDomainCertificate.md +18 -0
- tccli/examples/waf/v20180125/GenerateDealsAndPayNew.md +1 -1
- tccli/services/antiddos/v20200309/api.json +21 -0
- tccli/services/antiddos/v20200309/examples.json +2 -2
- tccli/services/asr/v20190614/api.json +4 -4
- tccli/services/cat/v20180409/api.json +4 -3
- tccli/services/cat/v20180409/examples.json +1 -1
- tccli/services/cfw/v20190904/api.json +21 -12
- tccli/services/cfw/v20190904/examples.json +4 -4
- tccli/services/cls/v20201016/api.json +27 -27
- tccli/services/cwp/v20180228/api.json +3 -3
- tccli/services/cwp/v20180228/examples.json +3 -3
- tccli/services/domain/v20180808/api.json +1 -1
- tccli/services/dsgc/v20190723/api.json +92 -47
- tccli/services/dsgc/v20190723/examples.json +41 -53
- tccli/services/ecm/v20190719/api.json +2 -1
- tccli/services/ess/v20201111/api.json +1 -1
- tccli/services/ess/v20201111/examples.json +6 -6
- tccli/services/essbasic/essbasic_client.py +53 -0
- tccli/services/essbasic/v20210526/api.json +57 -4
- tccli/services/essbasic/v20210526/examples.json +8 -0
- tccli/services/hunyuan/v20230901/api.json +2 -2
- tccli/services/iotvideo/iotvideo_client.py +53 -0
- tccli/services/iotvideo/v20211125/api.json +90 -0
- tccli/services/iotvideo/v20211125/examples.json +8 -0
- tccli/services/mna/mna_client.py +273 -8
- tccli/services/mna/v20210119/api.json +601 -0
- tccli/services/mna/v20210119/examples.json +52 -0
- tccli/services/oceanus/v20190422/api.json +26 -8
- tccli/services/oceanus/v20190422/examples.json +4 -4
- tccli/services/scf/v20180416/api.json +33 -0
- tccli/services/sms/v20190711/api.json +36 -36
- tccli/services/sms/v20190711/examples.json +2 -2
- tccli/services/sms/v20210111/api.json +13 -13
- tccli/services/sms/v20210111/examples.json +1 -1
- tccli/services/tat/v20201028/api.json +2 -2
- tccli/services/tat/v20201028/examples.json +10 -4
- tccli/services/tcb/v20180608/api.json +7 -1
- tccli/services/tchd/v20230306/api.json +1 -1
- tccli/services/tcss/v20201101/api.json +304 -74
- tccli/services/tcss/v20201101/examples.json +8 -8
- tccli/services/tdmq/tdmq_client.py +53 -0
- tccli/services/tdmq/v20200217/api.json +48 -4
- tccli/services/tdmq/v20200217/examples.json +9 -1
- tccli/services/teo/v20220901/api.json +6 -6
- tccli/services/tms/v20201229/api.json +104 -12
- tccli/services/tms/v20201229/examples.json +2 -8
- tccli/services/trtc/v20190722/api.json +8 -8
- tccli/services/trtc/v20190722/examples.json +4 -4
- tccli/services/vod/v20180717/api.json +54 -1
- tccli/services/vod/v20180717/examples.json +8 -0
- tccli/services/vod/vod_client.py +53 -0
- tccli/services/vpc/v20170312/api.json +55 -25
- tccli/services/waf/v20180125/api.json +1 -1
- tccli/services/waf/v20180125/examples.json +1 -1
- tccli/services/weilingwith/v20230427/api.json +2 -2
- {tccli-3.0.1010.1.dist-info → tccli-3.0.1012.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1010.1.dist-info → tccli-3.0.1012.1.dist-info}/RECORD +116 -107
- {tccli-3.0.1010.1.dist-info → tccli-3.0.1012.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1010.1.dist-info → tccli-3.0.1012.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1010.1.dist-info → tccli-3.0.1012.1.dist-info}/license_files/LICENSE +0 -0
@@ -294,6 +294,13 @@
|
|
294
294
|
"output": "DescribeCloudStorageThumbnailResponse",
|
295
295
|
"status": "online"
|
296
296
|
},
|
297
|
+
"DescribeCloudStorageThumbnailList": {
|
298
|
+
"document": "批量拉取云存事件缩略图",
|
299
|
+
"input": "DescribeCloudStorageThumbnailListRequest",
|
300
|
+
"name": "批量拉取云存事件缩略图",
|
301
|
+
"output": "DescribeCloudStorageThumbnailListResponse",
|
302
|
+
"status": "online"
|
303
|
+
},
|
297
304
|
"DescribeCloudStorageTime": {
|
298
305
|
"document": "获取某一天云存时间轴",
|
299
306
|
"input": "DescribeCloudStorageTimeRequest",
|
@@ -4173,6 +4180,61 @@
|
|
4173
4180
|
],
|
4174
4181
|
"type": "object"
|
4175
4182
|
},
|
4183
|
+
"DescribeCloudStorageThumbnailListRequest": {
|
4184
|
+
"document": "DescribeCloudStorageThumbnailList请求参数结构体",
|
4185
|
+
"members": [
|
4186
|
+
{
|
4187
|
+
"disabled": false,
|
4188
|
+
"document": "产品ID",
|
4189
|
+
"example": "H541SOP191",
|
4190
|
+
"member": "string",
|
4191
|
+
"name": "ProductId",
|
4192
|
+
"required": true,
|
4193
|
+
"type": "string"
|
4194
|
+
},
|
4195
|
+
{
|
4196
|
+
"disabled": false,
|
4197
|
+
"document": "设备名称",
|
4198
|
+
"example": "event_36502632_1",
|
4199
|
+
"member": "string",
|
4200
|
+
"name": "DeviceName",
|
4201
|
+
"required": true,
|
4202
|
+
"type": "string"
|
4203
|
+
},
|
4204
|
+
{
|
4205
|
+
"disabled": false,
|
4206
|
+
"document": "缩略图文件名列表",
|
4207
|
+
"example": "[\"/100008401725/AQTV2839QJ/sp01_32820237_7/events/1615200613.jpg\",\"/100008401725/AQTV2839QJ/sp01_32820237_7/events/1615200613.jpg\"]",
|
4208
|
+
"member": "string",
|
4209
|
+
"name": "ThumbnailList",
|
4210
|
+
"required": true,
|
4211
|
+
"type": "list"
|
4212
|
+
}
|
4213
|
+
],
|
4214
|
+
"type": "object"
|
4215
|
+
},
|
4216
|
+
"DescribeCloudStorageThumbnailListResponse": {
|
4217
|
+
"document": "DescribeCloudStorageThumbnailList返回参数结构体",
|
4218
|
+
"members": [
|
4219
|
+
{
|
4220
|
+
"disabled": false,
|
4221
|
+
"document": "缩略图访问地址",
|
4222
|
+
"example": "无",
|
4223
|
+
"member": "ThumbnailURLInfoList",
|
4224
|
+
"name": "ThumbnailURLInfoList",
|
4225
|
+
"output_required": true,
|
4226
|
+
"type": "list",
|
4227
|
+
"value_allowed_null": false
|
4228
|
+
},
|
4229
|
+
{
|
4230
|
+
"document": "唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。",
|
4231
|
+
"member": "string",
|
4232
|
+
"name": "RequestId",
|
4233
|
+
"type": "string"
|
4234
|
+
}
|
4235
|
+
],
|
4236
|
+
"type": "object"
|
4237
|
+
},
|
4176
4238
|
"DescribeCloudStorageThumbnailRequest": {
|
4177
4239
|
"document": "DescribeCloudStorageThumbnail请求参数结构体",
|
4178
4240
|
"members": [
|
@@ -9068,6 +9130,34 @@
|
|
9068
9130
|
],
|
9069
9131
|
"usage": "out"
|
9070
9132
|
},
|
9133
|
+
"ThumbnailURLInfoList": {
|
9134
|
+
"document": "缩略图信息",
|
9135
|
+
"members": [
|
9136
|
+
{
|
9137
|
+
"disabled": false,
|
9138
|
+
"document": "缩略图访问地址\n注意:此字段可能返回 null,表示取不到有效值。",
|
9139
|
+
"example": "https://video-cv-1258344699.cos.ap-guangzhou.myqcloud.com/%2F100",
|
9140
|
+
"member": "string",
|
9141
|
+
"name": "ThumbnailURL",
|
9142
|
+
"output_required": false,
|
9143
|
+
"required": false,
|
9144
|
+
"type": "string",
|
9145
|
+
"value_allowed_null": true
|
9146
|
+
},
|
9147
|
+
{
|
9148
|
+
"disabled": false,
|
9149
|
+
"document": "缩略图访问地址的过期时间\n注意:此字段可能返回 null,表示取不到有效值。",
|
9150
|
+
"example": "1690195335",
|
9151
|
+
"member": "int64",
|
9152
|
+
"name": "ExpireTime",
|
9153
|
+
"output_required": false,
|
9154
|
+
"required": false,
|
9155
|
+
"type": "int",
|
9156
|
+
"value_allowed_null": true
|
9157
|
+
}
|
9158
|
+
],
|
9159
|
+
"usage": "both"
|
9160
|
+
},
|
9071
9161
|
"TransferCloudStorageRequest": {
|
9072
9162
|
"document": "TransferCloudStorage请求参数结构体",
|
9073
9163
|
"members": [
|
@@ -336,6 +336,14 @@
|
|
336
336
|
"title": "拉取云存事件缩略图"
|
337
337
|
}
|
338
338
|
],
|
339
|
+
"DescribeCloudStorageThumbnailList": [
|
340
|
+
{
|
341
|
+
"document": "批量拉取云存事件缩略图",
|
342
|
+
"input": "POST / HTTP/1.1\nHost: iotvideo.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeCloudStorageThumbnailList\n<公共请求参数>\n\n{\n \"ProductId\": \"H541SOP191\",\n \"DeviceName\": \"event_36502632_1\",\n \"ThumbnailList\": [\n \"/100008401725/AQTV2839QJ/sp01_32820237_7/events/1615200613.jpg\"\n ]\n}",
|
343
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"77dbf0ae-bdee-4b09-a5eb-0086d0164a20\",\n \"ThumbnailURLInfoList\": [\n {\n \"ExpireTime\": 12321321,\n \"ThumbnailURL\": \"https://video-cv-1258344699.cos.ap-guangzhou.myqcloud.com/%2F100\"\n }\n ]\n }\n}",
|
344
|
+
"title": "批量拉取云存事件缩略图"
|
345
|
+
}
|
346
|
+
],
|
339
347
|
"DescribeCloudStorageTime": [
|
340
348
|
{
|
341
349
|
"document": "",
|
tccli/services/mna/mna_client.py
CHANGED
@@ -69,7 +69,7 @@ def doGetNetMonitor(args, parsed_globals):
|
|
69
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
70
|
|
71
71
|
|
72
|
-
def
|
72
|
+
def doUpdateHardware(args, parsed_globals):
|
73
73
|
g_param = parse_global_arg(parsed_globals)
|
74
74
|
|
75
75
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -98,11 +98,11 @@ def doGetStatisticData(args, parsed_globals):
|
|
98
98
|
client = mod.MnaClient(cred, g_param[OptionsDefine.Region], profile)
|
99
99
|
client._sdkVersion += ("_CLI_" + __version__)
|
100
100
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.
|
101
|
+
model = models.UpdateHardwareRequest()
|
102
102
|
model.from_json_string(json.dumps(args))
|
103
103
|
start_time = time.time()
|
104
104
|
while True:
|
105
|
-
rsp = client.
|
105
|
+
rsp = client.UpdateHardware(model)
|
106
106
|
result = rsp.to_json_string()
|
107
107
|
try:
|
108
108
|
json_obj = json.loads(result)
|
@@ -121,7 +121,7 @@ def doGetStatisticData(args, parsed_globals):
|
|
121
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
122
|
|
123
123
|
|
124
|
-
def
|
124
|
+
def doAddHardware(args, parsed_globals):
|
125
125
|
g_param = parse_global_arg(parsed_globals)
|
126
126
|
|
127
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +150,63 @@ def doAddDevice(args, parsed_globals):
|
|
150
150
|
client = mod.MnaClient(cred, g_param[OptionsDefine.Region], profile)
|
151
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
153
|
+
model = models.AddHardwareRequest()
|
154
154
|
model.from_json_string(json.dumps(args))
|
155
155
|
start_time = time.time()
|
156
156
|
while True:
|
157
|
-
rsp = client.
|
157
|
+
rsp = client.AddHardware(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 doGetHardwareList(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('-', '_')]
|
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.MnaClient(cred, g_param[OptionsDefine.Region], profile)
|
203
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
204
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
+
model = models.GetHardwareListRequest()
|
206
|
+
model.from_json_string(json.dumps(args))
|
207
|
+
start_time = time.time()
|
208
|
+
while True:
|
209
|
+
rsp = client.GetHardwareList(model)
|
158
210
|
result = rsp.to_json_string()
|
159
211
|
try:
|
160
212
|
json_obj = json.loads(result)
|
@@ -225,6 +277,110 @@ def doCreateQos(args, parsed_globals):
|
|
225
277
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
278
|
|
227
279
|
|
280
|
+
def doAddDevice(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('-', '_')]
|
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.MnaClient(cred, g_param[OptionsDefine.Region], profile)
|
307
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
308
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
+
model = models.AddDeviceRequest()
|
310
|
+
model.from_json_string(json.dumps(args))
|
311
|
+
start_time = time.time()
|
312
|
+
while True:
|
313
|
+
rsp = client.AddDevice(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 doGetVendorHardware(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('-', '_')]
|
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.MnaClient(cred, g_param[OptionsDefine.Region], profile)
|
359
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
360
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
+
model = models.GetVendorHardwareRequest()
|
362
|
+
model.from_json_string(json.dumps(args))
|
363
|
+
start_time = time.time()
|
364
|
+
while True:
|
365
|
+
rsp = client.GetVendorHardware(model)
|
366
|
+
result = rsp.to_json_string()
|
367
|
+
try:
|
368
|
+
json_obj = json.loads(result)
|
369
|
+
except TypeError as e:
|
370
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
371
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
372
|
+
break
|
373
|
+
cur_time = time.time()
|
374
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
375
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
376
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
377
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
378
|
+
else:
|
379
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
380
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
381
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
382
|
+
|
383
|
+
|
228
384
|
def doDescribeQos(args, parsed_globals):
|
229
385
|
g_param = parse_global_arg(parsed_globals)
|
230
386
|
|
@@ -537,6 +693,58 @@ def doCreateEncryptedKey(args, parsed_globals):
|
|
537
693
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
694
|
|
539
695
|
|
696
|
+
def doGetStatisticData(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('-', '_')]
|
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.MnaClient(cred, g_param[OptionsDefine.Region], profile)
|
723
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
724
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
+
model = models.GetStatisticDataRequest()
|
726
|
+
model.from_json_string(json.dumps(args))
|
727
|
+
start_time = time.time()
|
728
|
+
while True:
|
729
|
+
rsp = client.GetStatisticData(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
|
+
|
540
748
|
def doDeleteDevice(args, parsed_globals):
|
541
749
|
g_param = parse_global_arg(parsed_globals)
|
542
750
|
|
@@ -745,6 +953,58 @@ def doGetFlowStatistic(args, parsed_globals):
|
|
745
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
954
|
|
747
955
|
|
956
|
+
def doActivateHardware(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('-', '_')]
|
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.MnaClient(cred, g_param[OptionsDefine.Region], profile)
|
983
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
984
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
+
model = models.ActivateHardwareRequest()
|
986
|
+
model.from_json_string(json.dumps(args))
|
987
|
+
start_time = time.time()
|
988
|
+
while True:
|
989
|
+
rsp = client.ActivateHardware(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
|
+
|
748
1008
|
CLIENT_MAP = {
|
749
1009
|
"v20210119": mna_client_v20210119,
|
750
1010
|
|
@@ -757,19 +1017,24 @@ MODELS_MAP = {
|
|
757
1017
|
|
758
1018
|
ACTION_MAP = {
|
759
1019
|
"GetNetMonitor": doGetNetMonitor,
|
760
|
-
"
|
761
|
-
"
|
1020
|
+
"UpdateHardware": doUpdateHardware,
|
1021
|
+
"AddHardware": doAddHardware,
|
1022
|
+
"GetHardwareList": doGetHardwareList,
|
762
1023
|
"CreateQos": doCreateQos,
|
1024
|
+
"AddDevice": doAddDevice,
|
1025
|
+
"GetVendorHardware": doGetVendorHardware,
|
763
1026
|
"DescribeQos": doDescribeQos,
|
764
1027
|
"GetMultiFlowStatistic": doGetMultiFlowStatistic,
|
765
1028
|
"GetDevices": doGetDevices,
|
766
1029
|
"GetPublicKey": doGetPublicKey,
|
767
1030
|
"DeleteQos": doDeleteQos,
|
768
1031
|
"CreateEncryptedKey": doCreateEncryptedKey,
|
1032
|
+
"GetStatisticData": doGetStatisticData,
|
769
1033
|
"DeleteDevice": doDeleteDevice,
|
770
1034
|
"UpdateDevice": doUpdateDevice,
|
771
1035
|
"GetDevice": doGetDevice,
|
772
1036
|
"GetFlowStatistic": doGetFlowStatistic,
|
1037
|
+
"ActivateHardware": doActivateHardware,
|
773
1038
|
|
774
1039
|
}
|
775
1040
|
|