tccli 3.0.1229.1__py2.py3-none-any.whl → 3.0.1231.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/aiart/aiart_client.py +110 -4
  3. tccli/services/aiart/v20221229/api.json +197 -10
  4. tccli/services/aiart/v20221229/examples.json +16 -0
  5. tccli/services/batch/v20170312/api.json +19 -14
  6. tccli/services/cam/cam_client.py +53 -0
  7. tccli/services/cam/v20190116/api.json +125 -52
  8. tccli/services/cam/v20190116/examples.json +12 -4
  9. tccli/services/cfg/v20210820/api.json +9 -0
  10. tccli/services/cfw/v20190904/api.json +1 -1
  11. tccli/services/cloudaudit/v20190319/api.json +39 -39
  12. tccli/services/cloudaudit/v20190319/examples.json +5 -5
  13. tccli/services/cvm/v20170312/api.json +53 -55
  14. tccli/services/cvm/v20170312/examples.json +3 -3
  15. tccli/services/cwp/v20180228/api.json +1 -1
  16. tccli/services/cynosdb/cynosdb_client.py +110 -57
  17. tccli/services/cynosdb/v20190107/api.json +166 -18
  18. tccli/services/cynosdb/v20190107/examples.json +14 -0
  19. tccli/services/dbbrain/v20210527/api.json +3 -1
  20. tccli/services/emr/emr_client.py +110 -4
  21. tccli/services/emr/v20190103/api.json +645 -0
  22. tccli/services/emr/v20190103/examples.json +16 -0
  23. tccli/services/es/v20180416/api.json +106 -8
  24. tccli/services/essbasic/v20210526/api.json +2 -2
  25. tccli/services/iotexplorer/v20190423/api.json +10 -0
  26. tccli/services/ivld/v20210903/api.json +25 -25
  27. tccli/services/ivld/v20210903/examples.json +1 -1
  28. tccli/services/lcic/v20220817/api.json +2 -2
  29. tccli/services/lke/v20231130/api.json +4 -4
  30. tccli/services/memcached/v20190318/api.json +20 -20
  31. tccli/services/mps/v20190612/api.json +65 -1
  32. tccli/services/mqtt/mqtt_client.py +283 -71
  33. tccli/services/mqtt/v20240516/api.json +312 -0
  34. tccli/services/mqtt/v20240516/examples.json +32 -0
  35. tccli/services/ocr/v20181119/api.json +251 -28
  36. tccli/services/ocr/v20181119/examples.json +1 -1
  37. tccli/services/postgres/v20170312/api.json +232 -228
  38. tccli/services/postgres/v20170312/examples.json +38 -38
  39. tccli/services/redis/v20180412/examples.json +2 -2
  40. tccli/services/ssl/v20191205/api.json +4 -4
  41. tccli/services/ssl/v20191205/examples.json +1 -1
  42. tccli/services/sts/v20180813/api.json +9 -9
  43. tccli/services/tdmq/v20200217/api.json +2 -2
  44. tccli/services/trtc/v20190722/api.json +4 -8
  45. tccli/services/tse/tse_client.py +228 -16
  46. tccli/services/tse/v20201207/api.json +476 -0
  47. tccli/services/tse/v20201207/examples.json +32 -0
  48. tccli/services/vclm/v20240523/api.json +3 -3
  49. tccli/services/vdb/v20230616/api.json +3 -3
  50. tccli/services/vdb/v20230616/examples.json +1 -1
  51. tccli/services/vod/v20180717/api.json +17 -17
  52. tccli/services/vpc/v20170312/api.json +510 -34
  53. tccli/services/vpc/v20170312/examples.json +68 -12
  54. tccli/services/vpc/vpc_client.py +475 -104
  55. {tccli-3.0.1229.1.dist-info → tccli-3.0.1231.1.dist-info}/METADATA +2 -2
  56. {tccli-3.0.1229.1.dist-info → tccli-3.0.1231.1.dist-info}/RECORD +59 -59
  57. {tccli-3.0.1229.1.dist-info → tccli-3.0.1231.1.dist-info}/WHEEL +0 -0
  58. {tccli-3.0.1229.1.dist-info → tccli-3.0.1231.1.dist-info}/entry_points.txt +0 -0
  59. {tccli-3.0.1229.1.dist-info → tccli-3.0.1231.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1229.1'
1
+ __version__ = '3.0.1231.1'
@@ -225,7 +225,7 @@ def doSubmitTrainPortraitModelJob(args, parsed_globals):
225
225
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
226
 
227
227
 
228
- def doQueryTextToImageProJob(args, parsed_globals):
228
+ def doImageOutpainting(args, parsed_globals):
229
229
  g_param = parse_global_arg(parsed_globals)
230
230
 
231
231
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -254,11 +254,11 @@ def doQueryTextToImageProJob(args, parsed_globals):
254
254
  client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
255
255
  client._sdkVersion += ("_CLI_" + __version__)
256
256
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
257
- model = models.QueryTextToImageProJobRequest()
257
+ model = models.ImageOutpaintingRequest()
258
258
  model.from_json_string(json.dumps(args))
259
259
  start_time = time.time()
260
260
  while True:
261
- rsp = client.QueryTextToImageProJob(model)
261
+ rsp = client.ImageOutpainting(model)
262
262
  result = rsp.to_json_string()
263
263
  try:
264
264
  json_obj = json.loads(result)
@@ -537,6 +537,58 @@ def doTextToImage(args, parsed_globals):
537
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
538
 
539
539
 
540
+ def doQueryTextToImageProJob(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.AiartClient(cred, g_param[OptionsDefine.Region], profile)
567
+ client._sdkVersion += ("_CLI_" + __version__)
568
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
+ model = models.QueryTextToImageProJobRequest()
570
+ model.from_json_string(json.dumps(args))
571
+ start_time = time.time()
572
+ while True:
573
+ rsp = client.QueryTextToImageProJob(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
+
540
592
  def doChangeClothes(args, parsed_globals):
541
593
  g_param = parse_global_arg(parsed_globals)
542
594
 
@@ -589,6 +641,58 @@ def doChangeClothes(args, parsed_globals):
589
641
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
590
642
 
591
643
 
644
+ def doImageInpaintingRemoval(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.AiartClient(cred, g_param[OptionsDefine.Region], profile)
671
+ client._sdkVersion += ("_CLI_" + __version__)
672
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
673
+ model = models.ImageInpaintingRemovalRequest()
674
+ model.from_json_string(json.dumps(args))
675
+ start_time = time.time()
676
+ while True:
677
+ rsp = client.ImageInpaintingRemoval(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
+
592
696
  def doSubmitDrawPortraitJob(args, parsed_globals):
593
697
  g_param = parse_global_arg(parsed_globals)
594
698
 
@@ -708,13 +812,15 @@ ACTION_MAP = {
708
812
  "SubmitTextToImageProJob": doSubmitTextToImageProJob,
709
813
  "ReplaceBackground": doReplaceBackground,
710
814
  "SubmitTrainPortraitModelJob": doSubmitTrainPortraitModelJob,
711
- "QueryTextToImageProJob": doQueryTextToImageProJob,
815
+ "ImageOutpainting": doImageOutpainting,
712
816
  "GenerateAvatar": doGenerateAvatar,
713
817
  "QueryTrainPortraitModelJob": doQueryTrainPortraitModelJob,
714
818
  "UploadTrainPortraitImages": doUploadTrainPortraitImages,
715
819
  "QueryDrawPortraitJob": doQueryDrawPortraitJob,
716
820
  "TextToImage": doTextToImage,
821
+ "QueryTextToImageProJob": doQueryTextToImageProJob,
717
822
  "ChangeClothes": doChangeClothes,
823
+ "ImageInpaintingRemoval": doImageInpaintingRemoval,
718
824
  "SubmitDrawPortraitJob": doSubmitDrawPortraitJob,
719
825
  "ImageToImage": doImageToImage,
720
826
 
@@ -14,6 +14,20 @@
14
14
  "output": "GenerateAvatarResponse",
15
15
  "status": "online"
16
16
  },
17
+ "ImageInpaintingRemoval": {
18
+ "document": "消除补全接口通过图像 mask 指定需要消除的人、物、文字等区域,在选定区域对图像内容进行消除与重绘补全。\n默认提供1个并发,代表最多能同时处理1个已提交的任务。",
19
+ "input": "ImageInpaintingRemovalRequest",
20
+ "name": "局部消除",
21
+ "output": "ImageInpaintingRemovalResponse",
22
+ "status": "online"
23
+ },
24
+ "ImageOutpainting": {
25
+ "document": "扩图接口支持对输入图像按指定宽高比实现智能扩图。\n默认提供1个并发,代表最多能同时处理1个已提交的任务。",
26
+ "input": "ImageOutpaintingRequest",
27
+ "name": "扩图",
28
+ "output": "ImageOutpaintingResponse",
29
+ "status": "online"
30
+ },
17
31
  "ImageToImage": {
18
32
  "document": "图像风格化(图生图)接口提供生成式的图生图风格转化能力,将根据输入的图像及文本描述,智能生成风格转化后的图像。建议避免输入人像过小、姿势复杂、人数较多的人像图片。\n图像风格化(图生图)默认提供3个并发任务数,代表最多能同时处理3个已提交的任务,上一个任务处理完毕后才能开始处理下一个任务。",
19
33
  "input": "ImageToImageRequest",
@@ -219,7 +233,16 @@
219
233
  "members": [
220
234
  {
221
235
  "disabled": false,
222
- "document": "头像风格,仅在人像模式下生效。\n请在 [百变头像风格列表](https://cloud.tencent.com/document/product/1668/107741) 中选择期望的风格,传入风格编号,不传默认使用 flower 风格。\n若使用萌宠贴纸模式,无需选择风格,该参数不生效。",
236
+ "document": "图像类型,默认为人像。\nhuman:人像头像,仅支持人像图片输入,建议避免上传无人、多人、人像过小的图片。\npet:萌宠贴纸,仅支持动物图片输入,建议避免上传无动物、多动物、动物过小的图片。",
237
+ "example": "human",
238
+ "member": "string",
239
+ "name": "Type",
240
+ "required": false,
241
+ "type": "string"
242
+ },
243
+ {
244
+ "disabled": false,
245
+ "document": "头像风格,仅在人像模式下生效。\n若使用人像模式,请在 [百变头像风格列表](https://cloud.tencent.com/document/product/1668/107741) 中选择期望的风格,传入风格编号,不传默认使用 flower 风格。\n若使用萌宠贴纸模式,无需选择风格,该参数不生效。",
223
246
  "example": "flower",
224
247
  "member": "string",
225
248
  "name": "Style",
@@ -244,15 +267,6 @@
244
267
  "required": false,
245
268
  "type": "string"
246
269
  },
247
- {
248
- "disabled": false,
249
- "document": "图像类型,默认为人像。\nhuman:人像头像,仅支持人像图片输入,建议避免上传无人、多人、人像过小的图片。\npet:萌宠贴纸,仅支持动物图片输入,建议避免上传无动物、多动物、动物过小的图片。",
250
- "example": "human",
251
- "member": "string",
252
- "name": "Type",
253
- "required": false,
254
- "type": "string"
255
- },
256
270
  {
257
271
  "disabled": false,
258
272
  "document": "输入人像图的质量检测开关,默认开启,仅在人像模式下生效。\n1:开启\n0:关闭\n建议开启检测,可提升生成效果,关闭检测可能因输入图像质量较差导致生成效果受损。\n开启后,将增强对输入图像的质量要求,如果输入图像单边分辨率<500、图像中人脸占比较小、存在多人、没有检测到人脸、人脸不完整、人脸遮挡等,将被拦截。\n关闭后,将降低对输入图像的质量要求,如果图像中没有检测到人脸或人脸占比过小等,将被拦截。",
@@ -314,6 +328,179 @@
314
328
  ],
315
329
  "type": "object"
316
330
  },
331
+ "ImageInpaintingRemovalRequest": {
332
+ "document": "ImageInpaintingRemoval请求参数结构体",
333
+ "members": [
334
+ {
335
+ "disabled": false,
336
+ "document": "输入图 Base64 数据。\nBase64 和 Url 必须提供一个,如果都提供以 Url 为准。\n图片限制:单边分辨率小于5000,转成 Base64 字符串后小于 6MB,格式支持 jpg、jpeg、png、bmp、tiff、webp。",
337
+ "example": "9j/4QlQaHR0c...N6a2M5ZCI",
338
+ "member": "string",
339
+ "name": "InputImage",
340
+ "required": false,
341
+ "type": "string"
342
+ },
343
+ {
344
+ "disabled": false,
345
+ "document": "输入图 Url。\nBase64 和 Url 必须提供一个,如果都提供以 Url 为准。\n图片限制:单边分辨率小于5000,转成 Base64 字符串后小于 6MB,格式支持 jpg、jpeg、png、bmp、tiff、webp。",
346
+ "example": "https://xxx.com/image.jpg",
347
+ "member": "string",
348
+ "name": "InputUrl",
349
+ "required": false,
350
+ "type": "string"
351
+ },
352
+ {
353
+ "disabled": false,
354
+ "document": "消除区域 Mask 图 Base64 数据。\nMask 为单通道灰度图,待消除部分呈白色区域,原图保持部分呈黑色区域。\nMask 的 Base64 和 Url 必须提供一个,如果都提供以 Url 为准。\n图片限制:Mask 分辨率需要和输入原图保持一致,转成 Base64 字符串后小于 6MB。",
355
+ "example": "9j/4QlQaHR0c...N6a2M5ZCI",
356
+ "member": "string",
357
+ "name": "Mask",
358
+ "required": false,
359
+ "type": "string"
360
+ },
361
+ {
362
+ "disabled": false,
363
+ "document": "消除区域 Mask 图 Url。\nMask 为单通道灰度图,待消除部分呈白色区域,原图保持部分呈黑色区域。\nMask 的 Base64 和 Url 必须提供一个,如果都提供以 Url 为准。\n图片限制:Mask 分辨率需要和输入原图保持一致,转成 Base64 字符串后小于 6MB。",
364
+ "example": "https://xxx.com/mask.jpg",
365
+ "member": "string",
366
+ "name": "MaskUrl",
367
+ "required": false,
368
+ "type": "string"
369
+ },
370
+ {
371
+ "disabled": false,
372
+ "document": "返回图像方式(base64 或 url) ,二选一,默认为 base64。url 有效期为1小时。",
373
+ "example": "url",
374
+ "member": "string",
375
+ "name": "RspImgType",
376
+ "required": false,
377
+ "type": "string"
378
+ },
379
+ {
380
+ "disabled": false,
381
+ "document": "为生成结果图添加标识的开关,默认为1。\n1:添加标识。\n0:不添加标识。\n其他数值:默认按1处理。\n建议您使用显著标识来提示结果图使用了 AI 绘画技术,是 AI 生成的图片。",
382
+ "example": "1",
383
+ "member": "int64",
384
+ "name": "LogoAdd",
385
+ "required": false,
386
+ "type": "int"
387
+ },
388
+ {
389
+ "disabled": false,
390
+ "document": "标识内容设置。\n默认在生成结果图右下角添加“图片由 AI 生成”字样,您可根据自身需要替换为其他的标识图片。",
391
+ "example": "{\"LogoUrl\": \"https://xxx.com/logo.jpg\", \"LogoRect\": {\"X\": 10, \"Y\": 10, \"Width\": 20, \"Height\": 20}}",
392
+ "member": "LogoParam",
393
+ "name": "LogoParam",
394
+ "required": false,
395
+ "type": "object"
396
+ }
397
+ ],
398
+ "type": "object"
399
+ },
400
+ "ImageInpaintingRemovalResponse": {
401
+ "document": "ImageInpaintingRemoval返回参数结构体",
402
+ "members": [
403
+ {
404
+ "disabled": false,
405
+ "document": "根据入参 RspImgType 填入不同,返回不同的内容。 如果传入 base64 则返回生成图 Base64 编码。 如果传入 url 则返回的生成图 URL , 有效期1小时,请及时保存。",
406
+ "example": "https://xxx.com/image.jpg",
407
+ "member": "string",
408
+ "name": "ResultImage",
409
+ "output_required": false,
410
+ "type": "string",
411
+ "value_allowed_null": false
412
+ },
413
+ {
414
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
415
+ "member": "string",
416
+ "name": "RequestId",
417
+ "type": "string"
418
+ }
419
+ ],
420
+ "type": "object"
421
+ },
422
+ "ImageOutpaintingRequest": {
423
+ "document": "ImageOutpainting请求参数结构体",
424
+ "members": [
425
+ {
426
+ "disabled": false,
427
+ "document": "扩展后的比例(宽:高),需要不等于原图比例。\n支持:1:1、4:3、3:4、16:9、9:16",
428
+ "example": "4:3",
429
+ "member": "string",
430
+ "name": "Ratio",
431
+ "required": true,
432
+ "type": "string"
433
+ },
434
+ {
435
+ "disabled": false,
436
+ "document": "输入图 Base64 数据。\nBase64 和 Url 必须提供一个,如果都提供以 Url 为准。\n图片限制:单边分辨率小于5000,转成 Base64 字符串后小于 6MB,格式支持 jpg、jpeg、png、bmp、tiff、webp。",
437
+ "example": "9j/4QlQaHR0c...N6a2M5ZCI",
438
+ "member": "string",
439
+ "name": "InputImage",
440
+ "required": false,
441
+ "type": "string"
442
+ },
443
+ {
444
+ "disabled": false,
445
+ "document": "输入图 Url。\nBase64 和 Url 必须提供一个,如果都提供以 Url 为准。\n图片限制:单边分辨率小于5000,转成 Base64 字符串后小于 6MB,格式支持 jpg、jpeg、png、bmp、tiff、webp。",
446
+ "example": "https://xxx.com/image.jpg",
447
+ "member": "string",
448
+ "name": "InputUrl",
449
+ "required": false,
450
+ "type": "string"
451
+ },
452
+ {
453
+ "disabled": false,
454
+ "document": "返回图像方式(base64 或 url) ,二选一,默认为 base64。url 有效期为1小时。",
455
+ "example": "url",
456
+ "member": "string",
457
+ "name": "RspImgType",
458
+ "required": false,
459
+ "type": "string"
460
+ },
461
+ {
462
+ "disabled": false,
463
+ "document": "为生成结果图添加标识的开关,默认为1。\n1:添加标识。\n0:不添加标识。\n其他数值:默认按1处理。\n建议您使用显著标识来提示结果图使用了 AI 绘画技术,是 AI 生成的图片。",
464
+ "example": "1",
465
+ "member": "int64",
466
+ "name": "LogoAdd",
467
+ "required": false,
468
+ "type": "int"
469
+ },
470
+ {
471
+ "disabled": false,
472
+ "document": "标识内容设置。\n默认在生成结果图右下角添加“图片由 AI 生成”字样,您可根据自身需要替换为其他的标识图片。",
473
+ "example": "{\"LogoUrl\": \"https://xxx.com/logo.jpg\", \"LogoRect\": {\"X\": 10, \"Y\": 10, \"Width\": 20, \"Height\": 20}}",
474
+ "member": "LogoParam",
475
+ "name": "LogoParam",
476
+ "required": false,
477
+ "type": "object"
478
+ }
479
+ ],
480
+ "type": "object"
481
+ },
482
+ "ImageOutpaintingResponse": {
483
+ "document": "ImageOutpainting返回参数结构体",
484
+ "members": [
485
+ {
486
+ "disabled": false,
487
+ "document": "根据入参 RspImgType 填入不同,返回不同的内容。\n如果传入 base64 则返回生成图 Base64 编码。\n如果传入 url 则返回的生成图 URL , 有效期1小时,请及时保存。",
488
+ "example": "https://aiart-xxx.cos.ap-guangzhou.myqcloud.com/xxx.jpg?q-sign-algorithm=sha1&q-ak=xxxxx&q-sign-time=1731574045;1731577645&q-key-time=1731574045;1731577645&q-header-list=host&q-url-param-list=&q-signature=31fe75c1c18c3d91db59508961209dd37aaf41c7",
489
+ "member": "string",
490
+ "name": "ResultImage",
491
+ "output_required": false,
492
+ "type": "string",
493
+ "value_allowed_null": false
494
+ },
495
+ {
496
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
497
+ "member": "string",
498
+ "name": "RequestId",
499
+ "type": "string"
500
+ }
501
+ ],
502
+ "type": "object"
503
+ },
317
504
  "ImageToImageRequest": {
318
505
  "document": "ImageToImage请求参数结构体",
319
506
  "members": [
@@ -16,6 +16,22 @@
16
16
  "title": "调用成功示例"
17
17
  }
18
18
  ],
19
+ "ImageInpaintingRemoval": [
20
+ {
21
+ "document": "",
22
+ "input": "POST / HTTP/1.1\nHost: aiart.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ImageInpaintingRemoval\n<公共请求参数>\n\n{\n \"InputUrl\": \"https://xxx.com/image.jpg\",\n \"MaskUrl\": \"https://xxx.com/mask.jpg\",\n \"RspImgType\": \"url\"\n}",
23
+ "output": "{\n \"Response\": {\n \"ResultImage\": \"https://aiart-xxx.cos.ap-guangzhou.myqcloud.com/xxx.jpg?q-sign-algorithm=sha1&q-ak=xxxxx&q-sign-time=1731574045;1731577645&q-key-time=1731574045;1731577645&q-header-list=host&q-url-param-list=&q-signature=31fe75c1c18c3d91db59508961209dd37aaf41c7\",\n \"RequestId\": \"301bfc25-61ca-4ece-b03e-f6aefb547969\"\n }\n}",
24
+ "title": "调用示例"
25
+ }
26
+ ],
27
+ "ImageOutpainting": [
28
+ {
29
+ "document": "",
30
+ "input": "POST / HTTP/1.1\nHost: aiart.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ImageOutpainting\n<公共请求参数>\n\n{\n \"InputUrl\": \"https://xxx.com/image.jpg\",\n \"Ratio\": \"4:3\",\n \"RspImgType\": \"url\"\n}",
31
+ "output": "{\n \"Response\": {\n \"ResultImage\": \"https://aiart-xxx.cos.ap-guangzhou.myqcloud.com/xxx.jpg?q-sign-algorithm=sha1&q-ak=xxxxx&q-sign-time=1731574045;1731577645&q-key-time=1731574045;1731577645&q-header-list=host&q-url-param-list=&q-signature=31fe75c1c18c3d91db59508961209dd37aaf41c7\",\n \"RequestId\": \"301bfc25-61ca-4ece-b03e-f6aefb547969\"\n }\n}",
32
+ "title": "调用示例"
33
+ }
34
+ ],
19
35
  "ImageToImage": [
20
36
  {
21
37
  "document": "调用成功示例",
@@ -2762,31 +2762,34 @@
2762
2762
  "members": [
2763
2763
  {
2764
2764
  "disabled": false,
2765
- "document": "Docker Hub 用户名或 Tencent Registry 用户名",
2765
+ "document": "Docker Hub填写“[user/repo]:[tag]”,Tencent Registry填写“ccr.ccs.tencentyun.com/[namespace/repo]:[tag]”",
2766
2766
  "example": "无",
2767
2767
  "member": "string",
2768
- "name": "User",
2768
+ "name": "Image",
2769
+ "output_required": true,
2769
2770
  "required": true,
2770
2771
  "type": "string",
2771
2772
  "value_allowed_null": false
2772
2773
  },
2773
2774
  {
2774
2775
  "disabled": false,
2775
- "document": "Docker Hub 密码或 Tencent Registry 密码",
2776
+ "document": "Docker Hub 用户名或 Tencent Registry 用户名;公共镜像可不填写此参数。",
2776
2777
  "example": "无",
2777
2778
  "member": "string",
2778
- "name": "Password",
2779
- "required": true,
2779
+ "name": "User",
2780
+ "output_required": true,
2781
+ "required": false,
2780
2782
  "type": "string",
2781
2783
  "value_allowed_null": false
2782
2784
  },
2783
2785
  {
2784
2786
  "disabled": false,
2785
- "document": "Docker Hub填写“[user/repo]:[tag]”,Tencent Registry填写“ccr.ccs.tencentyun.com/[namespace/repo]:[tag]”",
2787
+ "document": "Docker Hub 密码或 Tencent Registry 密码;公共镜像可不填写此参数。",
2786
2788
  "example": "无",
2787
2789
  "member": "string",
2788
- "name": "Image",
2789
- "required": true,
2790
+ "name": "Password",
2791
+ "output_required": true,
2792
+ "required": false,
2790
2793
  "type": "string",
2791
2794
  "value_allowed_null": false
2792
2795
  },
@@ -2796,6 +2799,7 @@
2796
2799
  "example": "无",
2797
2800
  "member": "string",
2798
2801
  "name": "Server",
2802
+ "output_required": true,
2799
2803
  "required": false,
2800
2804
  "type": "string",
2801
2805
  "value_allowed_null": false
@@ -2806,6 +2810,7 @@
2806
2810
  "example": "0",
2807
2811
  "member": "uint64",
2808
2812
  "name": "MaxRetryCount",
2813
+ "output_required": true,
2809
2814
  "required": false,
2810
2815
  "type": "int",
2811
2816
  "value_allowed_null": false
@@ -2816,6 +2821,7 @@
2816
2821
  "example": "1",
2817
2822
  "member": "uint64",
2818
2823
  "name": "DelayOnRetry",
2824
+ "output_required": true,
2819
2825
  "required": false,
2820
2826
  "type": "int",
2821
2827
  "value_allowed_null": false
@@ -2826,6 +2832,7 @@
2826
2832
  "example": "-u root",
2827
2833
  "member": "string",
2828
2834
  "name": "DockerRunOption",
2835
+ "output_required": true,
2829
2836
  "required": false,
2830
2837
  "type": "string",
2831
2838
  "value_allowed_null": true
@@ -3373,22 +3380,20 @@
3373
3380
  {
3374
3381
  "disabled": false,
3375
3382
  "document": "需要过滤的字段。",
3376
- "example": "",
3383
+ "example": "zone",
3377
3384
  "member": "string",
3378
3385
  "name": "Name",
3379
3386
  "required": true,
3380
- "type": "string",
3381
- "value_allowed_null": false
3387
+ "type": "string"
3382
3388
  },
3383
3389
  {
3384
3390
  "disabled": false,
3385
3391
  "document": "字段的过滤值。",
3386
- "example": "",
3392
+ "example": "[\"ap-guangzhou-2\"]",
3387
3393
  "member": "string",
3388
3394
  "name": "Values",
3389
3395
  "required": true,
3390
- "type": "list",
3391
- "value_allowed_null": false
3396
+ "type": "list"
3392
3397
  }
3393
3398
  ],
3394
3399
  "usage": "in"
@@ -3345,6 +3345,58 @@ def doDescribeSafeAuthFlagIntl(args, parsed_globals):
3345
3345
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3346
3346
 
3347
3347
 
3348
+ def doUpdateRoleSessionDuration(args, parsed_globals):
3349
+ g_param = parse_global_arg(parsed_globals)
3350
+
3351
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3352
+ cred = credential.CVMRoleCredential()
3353
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3354
+ cred = credential.STSAssumeRoleCredential(
3355
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3356
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3357
+ )
3358
+ 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):
3359
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3360
+ else:
3361
+ cred = credential.Credential(
3362
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3363
+ )
3364
+ http_profile = HttpProfile(
3365
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3366
+ reqMethod="POST",
3367
+ endpoint=g_param[OptionsDefine.Endpoint],
3368
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3369
+ )
3370
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3371
+ if g_param[OptionsDefine.Language]:
3372
+ profile.language = g_param[OptionsDefine.Language]
3373
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3374
+ client = mod.CamClient(cred, g_param[OptionsDefine.Region], profile)
3375
+ client._sdkVersion += ("_CLI_" + __version__)
3376
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
3377
+ model = models.UpdateRoleSessionDurationRequest()
3378
+ model.from_json_string(json.dumps(args))
3379
+ start_time = time.time()
3380
+ while True:
3381
+ rsp = client.UpdateRoleSessionDuration(model)
3382
+ result = rsp.to_json_string()
3383
+ try:
3384
+ json_obj = json.loads(result)
3385
+ except TypeError as e:
3386
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
3387
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3388
+ break
3389
+ cur_time = time.time()
3390
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3391
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3392
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3393
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3394
+ else:
3395
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3396
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3397
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3398
+
3399
+
3348
3400
  def doListGroups(args, parsed_globals):
3349
3401
  g_param = parse_global_arg(parsed_globals)
3350
3402
 
@@ -4772,6 +4824,7 @@ ACTION_MAP = {
4772
4824
  "DetachGroupPolicy": doDetachGroupPolicy,
4773
4825
  "DescribeSafeAuthFlag": doDescribeSafeAuthFlag,
4774
4826
  "DescribeSafeAuthFlagIntl": doDescribeSafeAuthFlagIntl,
4827
+ "UpdateRoleSessionDuration": doUpdateRoleSessionDuration,
4775
4828
  "ListGroups": doListGroups,
4776
4829
  "ListWeChatWorkSubAccounts": doListWeChatWorkSubAccounts,
4777
4830
  "ListPolicyVersions": doListPolicyVersions,