tccli 3.0.1302.1__py2.py3-none-any.whl → 3.0.1303.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 CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1302.1'
1
+ __version__ = '3.0.1303.1'
@@ -10982,7 +10982,7 @@
10982
10982
  {
10983
10983
  "disabled": false,
10984
10984
  "document": "各地域花费分布详情\n注意:此字段可能返回 null,表示取不到有效值。",
10985
- "example": "[{\"ProjectId\":\"0\",\"RealTotalCost\":\"2924616.19000000\",\"TotalCost\":\"6622736.21547221\",\"CashPayAmount\":\"2924616.19000000\",\"IncentivePayAmount\":\"0.00000000\",\"VoucherPayAmount\":\"0.00000000\",\"TransferPayAmount\":\"0.00000000\",\"BillMonth\":\"2024-01\",\"RealTotalCostRatio\":\"100.00\",\"ProjectName\":\"默认项目\"}]",
10985
+ "example": "",
10986
10986
  "member": "RegionSummaryOverviewItem",
10987
10987
  "name": "SummaryOverview",
10988
10988
  "output_required": true,
@@ -11205,7 +11205,7 @@
11205
11205
  {
11206
11206
  "disabled": false,
11207
11207
  "document": "账单多维度汇总消费详情",
11208
- "example": "[{\"tagValue\":\"运维服务-temp\",\"business\":[{\"businessCode\":\"p_cvm\",\"businessCodeName\":\"云服务器CVM\",\"totalCost\":\"385.50\",\"realTotalCost\":\"212.03\",\"cashPayAmount\":\"212.03\",\"incentivePayAmount\":\"0.00\",\"voucherPayAmount\":\"0.00\",\"transferPayAmount\":\"0.00\",\"trend\":{\"type\":\"type_a\",\"value\":\"0.00\",\"preMonthRealTotalCost\":\"212.03\"}}],\"totalCost\":\"385.50\",\"realTotalCost\":\"212.03\",\"cashPayAmount\":\"212.03\",\"incentivePayAmount\":\"0.00\",\"voucherPayAmount\":\"0.00\",\"transferPayAmount\":\"0.00\",\"trend\":{\"type\":\"type_a\",\"value\":\"47.59\",\"preMonthRealTotalCost\":\"404.53\"}}]",
11208
+ "example": "",
11209
11209
  "member": "SummaryDetail",
11210
11210
  "name": "SummaryDetail",
11211
11211
  "output_required": true,
@@ -168,7 +168,7 @@
168
168
  {
169
169
  "document": "获取按产品维度汇总费用明细",
170
170
  "input": "POST / HTTP/1.1\nHost: billing.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeBillSummary\n<公共请求参数>\n\n{\n \"Month\": \"2023-04\",\n \"GroupType\": \"business\"\n}",
171
- "output": "{\n \"Response\": {\n \"Ready\": 1,\n \"RequestId\": \"db6f4a8c-c8b3-4d86-836a-b0897e772b22\",\n \"SummaryDetail\": [\n {\n \"Business\": null,\n \"CashPayAmount\": \"5661.16\",\n \"GroupKey\": \"p_rav\",\n \"GroupValue\": \"实时音视频\",\n \"IncentivePayAmount\": \"0.00\",\n \"RealTotalCost\": \"5661.16\",\n \"TotalCost\": \"24600.63\",\n \"TransferPayAmount\": \"0.00\",\n \"VoucherPayAmount\": \"0.00\"\n },\n {\n \"Business\": null,\n \"CashPayAmount\": \"4783.65\",\n \"GroupKey\": \"p_cvm\",\n \"GroupValue\": \"云服务器CVM\",\n \"IncentivePayAmount\": \"0.00\",\n \"RealTotalCost\": \"5069.65\",\n \"TotalCost\": \"13178.28\",\n \"TransferPayAmount\": \"0.00\",\n \"VoucherPayAmount\": \"286.00\"\n }\n ]\n }\n}",
171
+ "output": "{\n \"Response\": {\n \"Ready\": 1,\n \"RequestId\": \"db6f4a8c-c8b3-4d86-836a-b0897e772b22\",\n \"SummaryDetail\": [\n {\n \"Business\": [],\n \"CashPayAmount\": \"5661.16\",\n \"GroupKey\": \"p_rav\",\n \"GroupValue\": \"实时音视频\",\n \"IncentivePayAmount\": \"0.00\",\n \"RealTotalCost\": \"5661.16\",\n \"TotalCost\": \"24600.63\",\n \"TransferPayAmount\": \"0.00\",\n \"VoucherPayAmount\": \"0.00\"\n },\n {\n \"Business\": [],\n \"CashPayAmount\": \"4783.65\",\n \"GroupKey\": \"p_cvm\",\n \"GroupValue\": \"云服务器CVM\",\n \"IncentivePayAmount\": \"0.00\",\n \"RealTotalCost\": \"5069.65\",\n \"TotalCost\": \"13178.28\",\n \"TransferPayAmount\": \"0.00\",\n \"VoucherPayAmount\": \"286.00\"\n }\n ]\n }\n}",
172
172
  "title": "获取按产品维度汇总费用明细"
173
173
  },
174
174
  {
@@ -292,7 +292,7 @@
292
292
  {
293
293
  "document": "获取按地域汇总消耗详情",
294
294
  "input": "POST / HTTP/1.1\nHost: billing.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeCostSummaryByRegion\n<公共请求参数>\n\n{\n \"NeedRecordNum\": \"1\",\n \"EndTime\": \"2018-11\",\n \"Limit\": \"1\",\n \"BeginTime\": \"2018-11\",\n \"Offset\": \"0\"\n}",
295
- "output": "{\n \"Response\": {\n \"Ready\": 1,\n \"RecordNum\": 0,\n \"Total\": {\n \"RealTotalCost\": \"91.04\"\n },\n \"Data\": [\n {\n \"RegionId\": \"18\",\n \"RegionName\": \"Asia Pacific (Seoul)\",\n \"RealTotalCost\": \"67.00\",\n \"CashPayAmount\": \"66.99654091\",\n \"VoucherPayAmount\": \"0.00000000\",\n \"IncentivePayAmount\": \"0.00000000\",\n \"TransferPayAmount\": \"0.00000000\",\n \"Trend\": {\n \"Type\": \"none\",\n \"Value\": null\n },\n \"Business\": [\n {\n \"BusinessCode\": \"p_cos\",\n \"BusinessCodeName\": \"Cloud Object Storage\",\n \"RegionName\": \"Asia Pacific (Seoul)\",\n \"RealTotalCost\": \"66.99654091\",\n \"CashPayAmount\": \"66.99654091\",\n \"IncentivePayAmount\": \"0.00000000\",\n \"VoucherPayAmount\": \"0.00000000\",\n \"TransferPayAmount\": \"0.00000000\",\n \"Trend\": {\n \"Type\": \"none\",\n \"Value\": null\n }\n }\n ]\n }\n ],\n \"RequestId\": \"cdf3ef28-5ec7-4915-9cc8-a07210dc1f28\"\n }\n}",
295
+ "output": "{\n \"Response\": {\n \"Ready\": 1,\n \"RecordNum\": 0,\n \"Total\": {\n \"RealTotalCost\": \"91.04\"\n },\n \"Data\": [\n {\n \"RegionId\": \"18\",\n \"RegionName\": \"Asia Pacific (Seoul)\",\n \"RealTotalCost\": \"67.00\",\n \"CashPayAmount\": \"66.99654091\",\n \"VoucherPayAmount\": \"0.00000000\",\n \"IncentivePayAmount\": \"0.00000000\",\n \"TransferPayAmount\": \"0.00000000\",\n \"Trend\": {\n \"Type\": \"none\",\n \"Value\": \"0\"\n },\n \"Business\": [\n {\n \"BusinessCode\": \"p_cos\",\n \"BusinessCodeName\": \"Cloud Object Storage\",\n \"RegionName\": \"Asia Pacific (Seoul)\",\n \"RealTotalCost\": \"66.99654091\",\n \"CashPayAmount\": \"66.99654091\",\n \"IncentivePayAmount\": \"0.00000000\",\n \"VoucherPayAmount\": \"0.00000000\",\n \"TransferPayAmount\": \"0.00000000\",\n \"Trend\": {\n \"Type\": \"none\",\n \"Value\": \"0\"\n }\n }\n ]\n }\n ],\n \"RequestId\": \"cdf3ef28-5ec7-4915-9cc8-a07210dc1f28\"\n }\n}",
296
296
  "title": "获取按地域汇总消耗详情"
297
297
  }
298
298
  ],
@@ -3663,13 +3663,13 @@
3663
3663
  "members": [
3664
3664
  {
3665
3665
  "disabled": false,
3666
- "document": "策略版本详情\n注意:此字段可能返回 null,表示取不到有效值。",
3666
+ "document": "策略版本详情",
3667
3667
  "example": "{\"VersionId\":2,\"CreateDate\":\"2019-08-09T10:31:47Z\",\"IsDefaultVersion\":1,\"Document\":\"{\\\"version\\\":\\\"2.0\\\",\\\"statement\\\":[{\\\"effect\\\":\\\"allow\\\",\\\"action\\\":[\\\"name\\\\/cos:*\\\"],\\\"resource\\\":[\\\"*\\\"]}]}\"}",
3668
3668
  "member": "PolicyVersionDetail",
3669
3669
  "name": "PolicyVersion",
3670
3670
  "output_required": true,
3671
3671
  "type": "object",
3672
- "value_allowed_null": true
3672
+ "value_allowed_null": false
3673
3673
  },
3674
3674
  {
3675
3675
  "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
@@ -639,6 +639,36 @@
639
639
  "DescribeNodeGroupsResponse": {
640
640
  "document": "DescribeNodeGroups返回参数结构体",
641
641
  "members": [
642
+ {
643
+ "disabled": false,
644
+ "document": "树状节点列表,总共两级\n注意:此字段可能返回 null,表示取不到有效值。",
645
+ "example": "无",
646
+ "member": "NodeTree",
647
+ "name": "NodeList",
648
+ "output_required": true,
649
+ "type": "list",
650
+ "value_allowed_null": true
651
+ },
652
+ {
653
+ "disabled": false,
654
+ "document": "省份或国家列表\n注意:此字段可能返回 null,表示取不到有效值。",
655
+ "example": "无",
656
+ "member": "DistinctOrNetServiceInfo",
657
+ "name": "DistrictList",
658
+ "output_required": true,
659
+ "type": "list",
660
+ "value_allowed_null": true
661
+ },
662
+ {
663
+ "disabled": false,
664
+ "document": "运营商列表\n注意:此字段可能返回 null,表示取不到有效值。",
665
+ "example": "无",
666
+ "member": "DistinctOrNetServiceInfo",
667
+ "name": "NetServiceList",
668
+ "output_required": true,
669
+ "type": "list",
670
+ "value_allowed_null": true
671
+ },
642
672
  {
643
673
  "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
644
674
  "member": "string",
@@ -1076,6 +1106,32 @@
1076
1106
  ],
1077
1107
  "usage": "out"
1078
1108
  },
1109
+ "DistinctOrNetServiceInfo": {
1110
+ "document": "省份(国际)或运营商基本信息",
1111
+ "members": [
1112
+ {
1113
+ "disabled": false,
1114
+ "document": "省份(国际)或运营商ID",
1115
+ "example": "100",
1116
+ "member": "string",
1117
+ "name": "ID",
1118
+ "output_required": true,
1119
+ "type": "string",
1120
+ "value_allowed_null": false
1121
+ },
1122
+ {
1123
+ "disabled": false,
1124
+ "document": "名称",
1125
+ "example": "广东",
1126
+ "member": "string",
1127
+ "name": "Name",
1128
+ "output_required": true,
1129
+ "type": "string",
1130
+ "value_allowed_null": false
1131
+ }
1132
+ ],
1133
+ "usage": "out"
1134
+ },
1079
1135
  "Field": {
1080
1136
  "document": "储存float类型字段",
1081
1137
  "members": [
@@ -1386,6 +1442,104 @@
1386
1442
  ],
1387
1443
  "usage": "out"
1388
1444
  },
1445
+ "NodeInfoBase": {
1446
+ "document": "Node节点基本信息,用于新建任务页面重构节点选择",
1447
+ "members": [
1448
+ {
1449
+ "disabled": false,
1450
+ "document": "节点code",
1451
+ "example": "10000",
1452
+ "member": "string",
1453
+ "name": "ID",
1454
+ "output_required": true,
1455
+ "type": "string",
1456
+ "value_allowed_null": false
1457
+ },
1458
+ {
1459
+ "disabled": false,
1460
+ "document": "节点名称",
1461
+ "example": "北京-北京市-中国电信[IDC]",
1462
+ "member": "string",
1463
+ "name": "Content",
1464
+ "output_required": true,
1465
+ "type": "string",
1466
+ "value_allowed_null": false
1467
+ }
1468
+ ],
1469
+ "usage": "out"
1470
+ },
1471
+ "NodeLeaf": {
1472
+ "document": "子节点。用于新建任务重构页面的节点选择",
1473
+ "members": [
1474
+ {
1475
+ "disabled": false,
1476
+ "document": "子节点ID",
1477
+ "example": "1100201",
1478
+ "member": "string",
1479
+ "name": "ID",
1480
+ "output_required": true,
1481
+ "type": "string",
1482
+ "value_allowed_null": false
1483
+ },
1484
+ {
1485
+ "disabled": false,
1486
+ "document": "子节点名称",
1487
+ "example": "广东",
1488
+ "member": "string",
1489
+ "name": "Content",
1490
+ "output_required": true,
1491
+ "type": "string",
1492
+ "value_allowed_null": false
1493
+ },
1494
+ {
1495
+ "disabled": false,
1496
+ "document": "节点列表",
1497
+ "example": "无",
1498
+ "member": "NodeInfoBase",
1499
+ "name": "Children",
1500
+ "output_required": true,
1501
+ "type": "list",
1502
+ "value_allowed_null": false
1503
+ }
1504
+ ],
1505
+ "usage": "out"
1506
+ },
1507
+ "NodeTree": {
1508
+ "document": "拨测节点数(新建任务页面重构)",
1509
+ "members": [
1510
+ {
1511
+ "disabled": false,
1512
+ "document": "节点ID",
1513
+ "example": "1100201",
1514
+ "member": "string",
1515
+ "name": "ID",
1516
+ "output_required": true,
1517
+ "type": "string",
1518
+ "value_allowed_null": false
1519
+ },
1520
+ {
1521
+ "disabled": false,
1522
+ "document": "节点名称",
1523
+ "example": "子节点名称",
1524
+ "member": "string",
1525
+ "name": "Content",
1526
+ "output_required": true,
1527
+ "type": "string",
1528
+ "value_allowed_null": false
1529
+ },
1530
+ {
1531
+ "disabled": false,
1532
+ "document": "子节点",
1533
+ "example": "无",
1534
+ "member": "NodeLeaf",
1535
+ "name": "Children",
1536
+ "output_required": true,
1537
+ "type": "list",
1538
+ "value_allowed_null": false
1539
+ }
1540
+ ],
1541
+ "usage": "out"
1542
+ },
1389
1543
  "ProbeTask": {
1390
1544
  "document": "拨测任务",
1391
1545
  "members": [
@@ -42,19 +42,19 @@
42
42
  {
43
43
  "document": "获取拨测点组\n",
44
44
  "input": "POST / HTTP/1.1\nHost: cat.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeNodeGroups\nX-TC-Language: zh-CN\n<公共请求参数>\n\n{\n \"RegionID\": 1,\n \"NetServiceID\": 99\n}",
45
- "output": "{\n \"Response\": {\n \"RequestId\": \"fyy3-g7ujmxbouxshy3plmkmhlnmdbfh\"\n }\n}",
45
+ "output": "{\n \"Response\": {\n \"DistrictList\": [\n {\n \"ID\": \"0\",\n \"Name\": \"全部\"\n },\n {\n \"ID\": \"1100100\",\n \"Name\": \"黑龙江\"\n }\n ],\n \"NetServiceList\": [\n {\n \"ID\": \"0\",\n \"Name\": \"全部\"\n },\n {\n \"ID\": \"99\",\n \"Name\": \"其他\"\n }\n ],\n \"NodeList\": [\n {\n \"ID\": \"1102700\",\n \"Content\": \"黑龙江\",\n \"Children\": [\n {\n \"ID\": \"1102701\",\n \"Content\": \"哈尔滨市\",\n \"Children\": [\n {\n \"ID\": \"11537\",\n \"Content\": \"黑龙江-哈尔滨市-广电宽带[LM]\"\n }\n ]\n }\n ]\n }\n ],\n \"RequestId\": \"fyy3-g7ujmxbouxshy3plmkmhlnmdbfh\"\n }\n}",
46
46
  "title": "获取拨测点组"
47
47
  },
48
48
  {
49
49
  "document": "获取定时任务中网络质量任务类型,PC类任务的可用性拨测点组",
50
50
  "input": "POST / HTTP/1.1\nHost: cat.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeNodeGroups\nX-TC-Language: zh-CN\n<公共请求参数>\n\n{\n \"NodeGroupType\": 1,\n \"IPType\": 0,\n \"NodeType\": [\n 1\n ],\n \"TaskType\": 5,\n \"ProbeType\": 0\n}",
51
- "output": "{\n \"Response\": {\n \"RequestId\": \"3ea82ed9-5901-4c69-b5e2-c4c84c9538e5\"\n }\n}",
51
+ "output": "{\n \"Response\": {\n \"DistrictList\": [],\n \"NetServiceList\": [],\n \"NodeList\": [\n {\n \"ID\": \"PC\",\n \"Content\": \"PC\",\n \"Children\": [\n {\n \"ID\": \"125\",\n \"Content\": \"国内区域可用性探测\",\n \"Children\": [\n {\n \"ID\": \"12136\",\n \"Content\": \"广东-深圳市[IDC]\"\n }\n ]\n },\n {\n \"ID\": \"126\",\n \"Content\": \"国内十大城市\",\n \"Children\": [\n {\n \"ID\": \"12136\",\n \"Content\": \"广东-深圳市[IDC]\"\n }\n ]\n },\n {\n \"ID\": \"127\",\n \"Content\": \"国内主要城市运营商\",\n \"Children\": [\n {\n \"ID\": \"12058\",\n \"Content\": \"广东-广州市-中国移动[IDC]\"\n }\n ]\n },\n {\n \"ID\": \"141\",\n \"Content\": \"海外主要城市\",\n \"Children\": [\n {\n \"ID\": \"12170\",\n \"Content\": \"美国-弗吉尼亚州[IDC]\"\n }\n ]\n },\n {\n \"ID\": \"142\",\n \"Content\": \"港澳台主要城市\",\n \"Children\": [\n {\n \"ID\": \"12181\",\n \"Content\": \"香港-香港特区[IDC]\"\n }\n ]\n }\n ]\n }\n ],\n \"RequestId\": \"3ea82ed9-5901-4c69-b5e2-c4c84c9538e5\"\n }\n}",
52
52
  "title": "获取定时任务拨测点组"
53
53
  },
54
54
  {
55
55
  "document": "获取即时拨测任务中网络质量任务类型,PC类任务的精选拨测点组",
56
56
  "input": "POST / HTTP/1.1\nHost: cat.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeNodeGroups\nX-TC-Language: zh-CN\n<公共请求参数>\n\n{\n \"NodeGroupType\": 0,\n \"TaskCategory\": 1,\n \"IPType\": 0,\n \"NodeType\": [\n 1,\n 2\n ],\n \"TaskType\": 5,\n \"ProbeType\": 1\n}",
57
- "output": "{\n \"Response\": {\n \"RequestId\": \"248cfe54-6cb6-46c7-b73d-9c78108add00\"\n }\n}",
57
+ "output": "{\n \"Response\": {\n \"DistrictList\": [],\n \"NetServiceList\": [\n {\n \"ID\": \"0\",\n \"Name\": \"全部\"\n }\n ],\n \"NodeList\": [\n {\n \"ID\": \"IDC\",\n \"Content\": \"IDC\",\n \"Children\": [\n {\n \"ID\": \"560\",\n \"Content\": \"境内主要城市运营商\",\n \"Children\": [\n {\n \"ID\": \"10000\",\n \"Content\": \"北京-北京市-中国电信[IDC]\"\n }\n ]\n }\n ]\n },\n {\n \"ID\": \"LastMile\",\n \"Content\": \"LastMile\",\n \"Children\": [\n {\n \"ID\": \"27\",\n \"Content\": \"省会城市-电信(Last Mile)\",\n \"Children\": [\n {\n \"ID\": \"10103\",\n \"Content\": \"北京-北京市-中国电信[LM]\"\n }\n ]\n }\n ]\n }\n ],\n \"RequestId\": \"248cfe54-6cb6-46c7-b73d-9c78108add00\"\n }\n}",
58
58
  "title": "获取即时拨测拨测点组"
59
59
  }
60
60
  ],
@@ -8429,7 +8429,7 @@
8429
8429
  "value_allowed_null": false
8430
8430
  },
8431
8431
  {
8432
- "disabled": false,
8432
+ "disabled": true,
8433
8433
  "document": "用户角色id列表",
8434
8434
  "example": "[1]",
8435
8435
  "member": "uint64",
@@ -8438,6 +8438,16 @@
8438
8438
  "type": "int",
8439
8439
  "value_allowed_null": false
8440
8440
  },
8441
+ {
8442
+ "disabled": false,
8443
+ "document": "用户角色id列表",
8444
+ "example": "[1]",
8445
+ "member": "uint64",
8446
+ "name": "RoleList",
8447
+ "output_required": false,
8448
+ "type": "list",
8449
+ "value_allowed_null": false
8450
+ },
8441
8451
  {
8442
8452
  "disabled": false,
8443
8453
  "document": "所属技能组列表",
@@ -537,7 +537,7 @@ def doCreateAndroidInstanceImage(args, parsed_globals):
537
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
538
 
539
539
 
540
- def doDescribeInstancesCount(args, parsed_globals):
540
+ def doModifyAndroidInstancesInformation(args, parsed_globals):
541
541
  g_param = parse_global_arg(parsed_globals)
542
542
 
543
543
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -566,11 +566,11 @@ def doDescribeInstancesCount(args, parsed_globals):
566
566
  client = mod.GsClient(cred, g_param[OptionsDefine.Region], profile)
567
567
  client._sdkVersion += ("_CLI_" + __version__)
568
568
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
- model = models.DescribeInstancesCountRequest()
569
+ model = models.ModifyAndroidInstancesInformationRequest()
570
570
  model.from_json_string(json.dumps(args))
571
571
  start_time = time.time()
572
572
  while True:
573
- rsp = client.DescribeInstancesCount(model)
573
+ rsp = client.ModifyAndroidInstancesInformation(model)
574
574
  result = rsp.to_json_string()
575
575
  try:
576
576
  json_obj = json.loads(result)
@@ -2201,6 +2201,58 @@ def doDescribeAndroidApps(args, parsed_globals):
2201
2201
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2202
2202
 
2203
2203
 
2204
+ def doDescribeInstancesCount(args, parsed_globals):
2205
+ g_param = parse_global_arg(parsed_globals)
2206
+
2207
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2208
+ cred = credential.CVMRoleCredential()
2209
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2210
+ cred = credential.STSAssumeRoleCredential(
2211
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2212
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2213
+ )
2214
+ 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):
2215
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2216
+ else:
2217
+ cred = credential.Credential(
2218
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2219
+ )
2220
+ http_profile = HttpProfile(
2221
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2222
+ reqMethod="POST",
2223
+ endpoint=g_param[OptionsDefine.Endpoint],
2224
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2225
+ )
2226
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2227
+ if g_param[OptionsDefine.Language]:
2228
+ profile.language = g_param[OptionsDefine.Language]
2229
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2230
+ client = mod.GsClient(cred, g_param[OptionsDefine.Region], profile)
2231
+ client._sdkVersion += ("_CLI_" + __version__)
2232
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2233
+ model = models.DescribeInstancesCountRequest()
2234
+ model.from_json_string(json.dumps(args))
2235
+ start_time = time.time()
2236
+ while True:
2237
+ rsp = client.DescribeInstancesCount(model)
2238
+ result = rsp.to_json_string()
2239
+ try:
2240
+ json_obj = json.loads(result)
2241
+ except TypeError as e:
2242
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2243
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2244
+ break
2245
+ cur_time = time.time()
2246
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2247
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2248
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2249
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2250
+ else:
2251
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2252
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2253
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2254
+
2255
+
2204
2256
  def doCopyAndroidInstance(args, parsed_globals):
2205
2257
  g_param = parse_global_arg(parsed_globals)
2206
2258
 
@@ -2461,6 +2513,58 @@ def doModifyAndroidInstancesUserId(args, parsed_globals):
2461
2513
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2462
2514
 
2463
2515
 
2516
+ def doFetchAndroidInstancesLogs(args, parsed_globals):
2517
+ g_param = parse_global_arg(parsed_globals)
2518
+
2519
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2520
+ cred = credential.CVMRoleCredential()
2521
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2522
+ cred = credential.STSAssumeRoleCredential(
2523
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2524
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2525
+ )
2526
+ 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):
2527
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2528
+ else:
2529
+ cred = credential.Credential(
2530
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2531
+ )
2532
+ http_profile = HttpProfile(
2533
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2534
+ reqMethod="POST",
2535
+ endpoint=g_param[OptionsDefine.Endpoint],
2536
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2537
+ )
2538
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2539
+ if g_param[OptionsDefine.Language]:
2540
+ profile.language = g_param[OptionsDefine.Language]
2541
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2542
+ client = mod.GsClient(cred, g_param[OptionsDefine.Region], profile)
2543
+ client._sdkVersion += ("_CLI_" + __version__)
2544
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2545
+ model = models.FetchAndroidInstancesLogsRequest()
2546
+ model.from_json_string(json.dumps(args))
2547
+ start_time = time.time()
2548
+ while True:
2549
+ rsp = client.FetchAndroidInstancesLogs(model)
2550
+ result = rsp.to_json_string()
2551
+ try:
2552
+ json_obj = json.loads(result)
2553
+ except TypeError as e:
2554
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2555
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2556
+ break
2557
+ cur_time = time.time()
2558
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2559
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2560
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2561
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2562
+ else:
2563
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2564
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2565
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2566
+
2567
+
2464
2568
  def doExecuteCommandOnAndroidInstances(args, parsed_globals):
2465
2569
  g_param = parse_global_arg(parsed_globals)
2466
2570
 
@@ -2794,7 +2898,7 @@ ACTION_MAP = {
2794
2898
  "CreateAndroidInstancesScreenshot": doCreateAndroidInstancesScreenshot,
2795
2899
  "UninstallAndroidInstancesApp": doUninstallAndroidInstancesApp,
2796
2900
  "CreateAndroidInstanceImage": doCreateAndroidInstanceImage,
2797
- "DescribeInstancesCount": doDescribeInstancesCount,
2901
+ "ModifyAndroidInstancesInformation": doModifyAndroidInstancesInformation,
2798
2902
  "DeleteAndroidInstanceImages": doDeleteAndroidInstanceImages,
2799
2903
  "DescribeAndroidInstanceTasksStatus": doDescribeAndroidInstanceTasksStatus,
2800
2904
  "TrylockWorker": doTrylockWorker,
@@ -2826,11 +2930,13 @@ ACTION_MAP = {
2826
2930
  "DescribeAndroidInstanceLabels": doDescribeAndroidInstanceLabels,
2827
2931
  "InstallAndroidInstancesApp": doInstallAndroidInstancesApp,
2828
2932
  "DescribeAndroidApps": doDescribeAndroidApps,
2933
+ "DescribeInstancesCount": doDescribeInstancesCount,
2829
2934
  "CopyAndroidInstance": doCopyAndroidInstance,
2830
2935
  "DescribeAndroidInstanceApps": doDescribeAndroidInstanceApps,
2831
2936
  "CreateAndroidAppVersion": doCreateAndroidAppVersion,
2832
2937
  "DestroyAndroidInstances": doDestroyAndroidInstances,
2833
2938
  "ModifyAndroidInstancesUserId": doModifyAndroidInstancesUserId,
2939
+ "FetchAndroidInstancesLogs": doFetchAndroidInstancesLogs,
2834
2940
  "ExecuteCommandOnAndroidInstances": doExecuteCommandOnAndroidInstances,
2835
2941
  "StartPublishStreamToCSS": doStartPublishStreamToCSS,
2836
2942
  "StopAndroidInstances": doStopAndroidInstances,
@@ -182,6 +182,13 @@
182
182
  "output": "ExecuteCommandOnAndroidInstancesResponse",
183
183
  "status": "online"
184
184
  },
185
+ "FetchAndroidInstancesLogs": {
186
+ "document": "批量获取安卓实例日志",
187
+ "input": "FetchAndroidInstancesLogsRequest",
188
+ "name": "批量获取安卓实例日志",
189
+ "output": "FetchAndroidInstancesLogsResponse",
190
+ "status": "online"
191
+ },
185
192
  "InstallAndroidInstancesApp": {
186
193
  "document": "安装安卓实例应用",
187
194
  "input": "InstallAndroidInstancesAppRequest",
@@ -217,6 +224,13 @@
217
224
  "output": "ModifyAndroidInstanceResolutionResponse",
218
225
  "status": "online"
219
226
  },
227
+ "ModifyAndroidInstancesInformation": {
228
+ "document": "批量修改安卓实例信息",
229
+ "input": "ModifyAndroidInstancesInformationRequest",
230
+ "name": "批量修改安卓实例信息",
231
+ "output": "ModifyAndroidInstancesInformationResponse",
232
+ "status": "online"
233
+ },
220
234
  "ModifyAndroidInstancesLabels": {
221
235
  "document": "修改安卓实例分辨率。需要注意的是该接口可能导致正在运行的应用出现闪退,所以建议在实例维护时期才进行调用。",
222
236
  "input": "ModifyAndroidInstancesLabelsRequest",
@@ -803,6 +817,30 @@
803
817
  ],
804
818
  "usage": "out"
805
819
  },
820
+ "AndroidInstanceInformation": {
821
+ "document": "安卓实例信息",
822
+ "members": [
823
+ {
824
+ "disabled": false,
825
+ "document": "安卓实例 ID",
826
+ "example": "cai-abcd1234",
827
+ "member": "string",
828
+ "name": "AndroidInstanceId",
829
+ "required": true,
830
+ "type": "string"
831
+ },
832
+ {
833
+ "disabled": false,
834
+ "document": "实例名称",
835
+ "example": "test_name",
836
+ "member": "string",
837
+ "name": "Name",
838
+ "required": true,
839
+ "type": "string"
840
+ }
841
+ ],
842
+ "usage": "in"
843
+ },
806
844
  "AndroidInstanceLabel": {
807
845
  "document": "安卓实例标签",
808
846
  "members": [
@@ -2650,6 +2688,69 @@
2650
2688
  ],
2651
2689
  "type": "object"
2652
2690
  },
2691
+ "FetchAndroidInstancesLogsRequest": {
2692
+ "document": "FetchAndroidInstancesLogs请求参数结构体",
2693
+ "members": [
2694
+ {
2695
+ "disabled": false,
2696
+ "document": "安卓实例 ID 列表",
2697
+ "example": "[\"cai_xxx\"]",
2698
+ "member": "string",
2699
+ "name": "AndroidInstanceIds",
2700
+ "required": true,
2701
+ "type": "list"
2702
+ },
2703
+ {
2704
+ "disabled": false,
2705
+ "document": "cos 桶名称",
2706
+ "example": "test-appid",
2707
+ "member": "string",
2708
+ "name": "BucketName",
2709
+ "required": true,
2710
+ "type": "string"
2711
+ },
2712
+ {
2713
+ "disabled": false,
2714
+ "document": "cos 桶区域",
2715
+ "example": "ap-guangzhou",
2716
+ "member": "string",
2717
+ "name": "BucketRegion",
2718
+ "required": true,
2719
+ "type": "string"
2720
+ },
2721
+ {
2722
+ "disabled": false,
2723
+ "document": "cos 桶目录,默认为 /log/",
2724
+ "example": "/log/",
2725
+ "member": "string",
2726
+ "name": "BucketDirectory",
2727
+ "required": false,
2728
+ "type": "string"
2729
+ },
2730
+ {
2731
+ "disabled": false,
2732
+ "document": "下载最近几天的日志,默认值为 1",
2733
+ "example": "1",
2734
+ "member": "uint64",
2735
+ "name": "RecentDays",
2736
+ "required": false,
2737
+ "type": "int"
2738
+ }
2739
+ ],
2740
+ "type": "object"
2741
+ },
2742
+ "FetchAndroidInstancesLogsResponse": {
2743
+ "document": "FetchAndroidInstancesLogs返回参数结构体",
2744
+ "members": [
2745
+ {
2746
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
2747
+ "member": "string",
2748
+ "name": "RequestId",
2749
+ "type": "string"
2750
+ }
2751
+ ],
2752
+ "type": "object"
2753
+ },
2653
2754
  "Filter": {
2654
2755
  "document": "过滤",
2655
2756
  "members": [
@@ -2975,6 +3076,33 @@
2975
3076
  ],
2976
3077
  "type": "object"
2977
3078
  },
3079
+ "ModifyAndroidInstancesInformationRequest": {
3080
+ "document": "ModifyAndroidInstancesInformation请求参数结构体",
3081
+ "members": [
3082
+ {
3083
+ "disabled": false,
3084
+ "document": "安卓实例信息数据",
3085
+ "example": "无",
3086
+ "member": "AndroidInstanceInformation",
3087
+ "name": "AndroidInstanceInformations",
3088
+ "required": true,
3089
+ "type": "list"
3090
+ }
3091
+ ],
3092
+ "type": "object"
3093
+ },
3094
+ "ModifyAndroidInstancesInformationResponse": {
3095
+ "document": "ModifyAndroidInstancesInformation返回参数结构体",
3096
+ "members": [
3097
+ {
3098
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
3099
+ "member": "string",
3100
+ "name": "RequestId",
3101
+ "type": "string"
3102
+ }
3103
+ ],
3104
+ "type": "object"
3105
+ },
2978
3106
  "ModifyAndroidInstancesLabelsRequest": {
2979
3107
  "document": "ModifyAndroidInstancesLabels请求参数结构体",
2980
3108
  "members": [