tccli 3.0.1331.1__py2.py3-none-any.whl → 3.0.1333.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/asr/v20190614/api.json +1 -1
- tccli/services/autoscaling/v20180419/api.json +1 -1
- tccli/services/bmvpc/v20180625/api.json +36 -36
- tccli/services/cdb/v20170320/api.json +37 -37
- tccli/services/cdn/v20180606/api.json +2 -2
- tccli/services/cdn/v20180606/examples.json +2 -2
- tccli/services/cfw/v20190904/api.json +1 -1
- tccli/services/ckafka/v20190819/api.json +11 -1
- tccli/services/cwp/v20180228/api.json +4 -4
- tccli/services/dc/v20180410/api.json +39 -0
- tccli/services/emr/v20190103/api.json +2 -2
- tccli/services/ess/ess_client.py +57 -4
- tccli/services/ess/v20201111/api.json +61 -0
- tccli/services/ess/v20201111/examples.json +8 -0
- tccli/services/essbasic/v20210526/api.json +1 -1
- tccli/services/goosefs/v20220519/api.json +2 -2
- tccli/services/gs/gs_client.py +163 -4
- tccli/services/gs/v20191118/api.json +216 -0
- tccli/services/gs/v20191118/examples.json +24 -0
- tccli/services/ioa/ioa_client.py +114 -8
- tccli/services/ioa/v20220601/api.json +375 -0
- tccli/services/ioa/v20220601/examples.json +28 -0
- tccli/services/iotexplorer/v20190423/api.json +5 -5
- tccli/services/iotexplorer/v20190423/examples.json +1 -1
- tccli/services/live/v20180801/api.json +3 -3
- tccli/services/lke/lke_client.py +284 -19
- tccli/services/lke/v20231130/api.json +1192 -132
- tccli/services/lke/v20231130/examples.json +40 -0
- tccli/services/lkeap/v20240522/examples.json +5 -5
- tccli/services/ocr/v20181119/api.json +4 -4
- tccli/services/ssl/v20191205/api.json +4 -4
- tccli/services/ssl/v20191205/examples.json +1 -1
- tccli/services/tat/v20201028/api.json +1 -1
- tccli/services/tke/tke_client.py +106 -0
- tccli/services/tke/v20180525/api.json +124 -0
- tccli/services/tke/v20180525/examples.json +16 -0
- tccli/services/tsf/v20180326/api.json +46 -17
- tccli/services/tsf/v20180326/examples.json +10 -10
- tccli/services/vpc/v20170312/api.json +5 -5
- tccli/services/vpc/v20170312/examples.json +6 -6
- {tccli-3.0.1331.1.dist-info → tccli-3.0.1333.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1331.1.dist-info → tccli-3.0.1333.1.dist-info}/RECORD +46 -46
- {tccli-3.0.1331.1.dist-info → tccli-3.0.1333.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1331.1.dist-info → tccli-3.0.1333.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1331.1.dist-info → tccli-3.0.1333.1.dist-info}/license_files/LICENSE +0 -0
@@ -84,6 +84,13 @@
|
|
84
84
|
"output": "CreateAndroidInstancesResponse",
|
85
85
|
"status": "online"
|
86
86
|
},
|
87
|
+
"CreateAndroidInstancesAccessToken": {
|
88
|
+
"document": "创建安卓实例访问Token",
|
89
|
+
"input": "CreateAndroidInstancesAccessTokenRequest",
|
90
|
+
"name": "创建安卓实例访问Token",
|
91
|
+
"output": "CreateAndroidInstancesAccessTokenResponse",
|
92
|
+
"status": "online"
|
93
|
+
},
|
87
94
|
"CreateAndroidInstancesScreenshot": {
|
88
95
|
"document": "安卓实例截图",
|
89
96
|
"input": "CreateAndroidInstancesScreenshotRequest",
|
@@ -119,6 +126,13 @@
|
|
119
126
|
"output": "DeleteAndroidAppVersionResponse",
|
120
127
|
"status": "online"
|
121
128
|
},
|
129
|
+
"DeleteAndroidInstanceBackupFiles": {
|
130
|
+
"document": "删除安卓实例备份文件",
|
131
|
+
"input": "DeleteAndroidInstanceBackupFilesRequest",
|
132
|
+
"name": "批量删除安卓实例备份文件",
|
133
|
+
"output": "DeleteAndroidInstanceBackupFilesResponse",
|
134
|
+
"status": "online"
|
135
|
+
},
|
122
136
|
"DeleteAndroidInstanceImages": {
|
123
137
|
"document": "删除安卓实例镜像",
|
124
138
|
"input": "DeleteAndroidInstanceImagesRequest",
|
@@ -357,6 +371,13 @@
|
|
357
371
|
"output": "RebootAndroidInstancesResponse",
|
358
372
|
"status": "online"
|
359
373
|
},
|
374
|
+
"RenewAndroidInstancesAccessToken": {
|
375
|
+
"document": "续期安卓实例访问Token",
|
376
|
+
"input": "RenewAndroidInstancesAccessTokenRequest",
|
377
|
+
"name": "续期安卓实例访问Token",
|
378
|
+
"output": "RenewAndroidInstancesAccessTokenResponse",
|
379
|
+
"status": "online"
|
380
|
+
},
|
360
381
|
"ResetAndroidInstances": {
|
361
382
|
"document": "重置安卓实例",
|
362
383
|
"input": "ResetAndroidInstancesRequest",
|
@@ -1056,6 +1077,16 @@
|
|
1056
1077
|
"output_required": false,
|
1057
1078
|
"type": "string",
|
1058
1079
|
"value_allowed_null": false
|
1080
|
+
},
|
1081
|
+
{
|
1082
|
+
"disabled": false,
|
1083
|
+
"document": "安卓10",
|
1084
|
+
"example": "ANDROID10",
|
1085
|
+
"member": "string",
|
1086
|
+
"name": "AndroidVersion",
|
1087
|
+
"output_required": false,
|
1088
|
+
"type": "string",
|
1089
|
+
"value_allowed_null": false
|
1059
1090
|
}
|
1060
1091
|
],
|
1061
1092
|
"usage": "out"
|
@@ -2004,6 +2035,72 @@
|
|
2004
2035
|
],
|
2005
2036
|
"type": "object"
|
2006
2037
|
},
|
2038
|
+
"CreateAndroidInstancesAccessTokenRequest": {
|
2039
|
+
"document": "CreateAndroidInstancesAccessToken请求参数结构体",
|
2040
|
+
"members": [
|
2041
|
+
{
|
2042
|
+
"disabled": false,
|
2043
|
+
"document": "实例 ID 列表。每次请求的实例的上限为 500。",
|
2044
|
+
"example": "[ \"cai-abcd1234\" ]",
|
2045
|
+
"member": "string",
|
2046
|
+
"name": "AndroidInstanceIds",
|
2047
|
+
"required": true,
|
2048
|
+
"type": "list"
|
2049
|
+
},
|
2050
|
+
{
|
2051
|
+
"disabled": false,
|
2052
|
+
"document": "有效期,默认为 12 小时,最大为 24 小时。支持 s(秒)、m(分)、h(小时)等单位,比如 12h 表示 12 小时,1h2m3s 表示一小时两分三秒",
|
2053
|
+
"example": "12h",
|
2054
|
+
"member": "string",
|
2055
|
+
"name": "ExpirationDuration",
|
2056
|
+
"required": false,
|
2057
|
+
"type": "string"
|
2058
|
+
}
|
2059
|
+
],
|
2060
|
+
"type": "object"
|
2061
|
+
},
|
2062
|
+
"CreateAndroidInstancesAccessTokenResponse": {
|
2063
|
+
"document": "CreateAndroidInstancesAccessToken返回参数结构体",
|
2064
|
+
"members": [
|
2065
|
+
{
|
2066
|
+
"disabled": false,
|
2067
|
+
"document": "token",
|
2068
|
+
"example": "token",
|
2069
|
+
"member": "string",
|
2070
|
+
"name": "Token",
|
2071
|
+
"output_required": true,
|
2072
|
+
"type": "string",
|
2073
|
+
"value_allowed_null": false
|
2074
|
+
},
|
2075
|
+
{
|
2076
|
+
"disabled": false,
|
2077
|
+
"document": "访问信息",
|
2078
|
+
"example": "e30=",
|
2079
|
+
"member": "string",
|
2080
|
+
"name": "AccessInfo",
|
2081
|
+
"output_required": true,
|
2082
|
+
"type": "string",
|
2083
|
+
"value_allowed_null": false
|
2084
|
+
},
|
2085
|
+
{
|
2086
|
+
"disabled": false,
|
2087
|
+
"document": "安卓实例错误列表。列表包含有问题的安卓实例 ID,生成的 Token 对这些有问题的实例无效。",
|
2088
|
+
"example": "无",
|
2089
|
+
"member": "AndroidInstanceError",
|
2090
|
+
"name": "AndroidInstanceErrors",
|
2091
|
+
"output_required": false,
|
2092
|
+
"type": "list",
|
2093
|
+
"value_allowed_null": false
|
2094
|
+
},
|
2095
|
+
{
|
2096
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
2097
|
+
"member": "string",
|
2098
|
+
"name": "RequestId",
|
2099
|
+
"type": "string"
|
2100
|
+
}
|
2101
|
+
],
|
2102
|
+
"type": "object"
|
2103
|
+
},
|
2007
2104
|
"CreateAndroidInstancesRequest": {
|
2008
2105
|
"document": "CreateAndroidInstances请求参数结构体",
|
2009
2106
|
"members": [
|
@@ -2503,6 +2600,69 @@
|
|
2503
2600
|
],
|
2504
2601
|
"type": "object"
|
2505
2602
|
},
|
2603
|
+
"DeleteAndroidInstanceBackupFilesRequest": {
|
2604
|
+
"document": "DeleteAndroidInstanceBackupFiles请求参数结构体",
|
2605
|
+
"members": [
|
2606
|
+
{
|
2607
|
+
"disabled": false,
|
2608
|
+
"document": "文件对象键列表",
|
2609
|
+
"example": "[ \"/dir/test_file\" ]",
|
2610
|
+
"member": "string",
|
2611
|
+
"name": "ObjectKeys",
|
2612
|
+
"required": true,
|
2613
|
+
"type": "list"
|
2614
|
+
},
|
2615
|
+
{
|
2616
|
+
"disabled": false,
|
2617
|
+
"document": "存储服务器类型,如 COS、S3。注意:使用 COS 和 S3 都将占用外网带宽。",
|
2618
|
+
"example": "S3",
|
2619
|
+
"member": "string",
|
2620
|
+
"name": "StorageType",
|
2621
|
+
"required": true,
|
2622
|
+
"type": "string"
|
2623
|
+
},
|
2624
|
+
{
|
2625
|
+
"disabled": false,
|
2626
|
+
"document": "COS协议选项",
|
2627
|
+
"example": "无",
|
2628
|
+
"member": "COSOptions",
|
2629
|
+
"name": "COSOptions",
|
2630
|
+
"required": false,
|
2631
|
+
"type": "object"
|
2632
|
+
},
|
2633
|
+
{
|
2634
|
+
"disabled": false,
|
2635
|
+
"document": "S3存储协议选项",
|
2636
|
+
"example": "无",
|
2637
|
+
"member": "S3Options",
|
2638
|
+
"name": "S3Options",
|
2639
|
+
"required": false,
|
2640
|
+
"type": "object"
|
2641
|
+
},
|
2642
|
+
{
|
2643
|
+
"disabled": false,
|
2644
|
+
"document": "安卓实例可用区。StorageType 为 S3 时,需要填写该字段;StorageType 为 COS 时,不需要填写该字段",
|
2645
|
+
"example": "ap-beijing-1",
|
2646
|
+
"member": "string",
|
2647
|
+
"name": "AndroidInstanceZone",
|
2648
|
+
"required": false,
|
2649
|
+
"type": "string"
|
2650
|
+
}
|
2651
|
+
],
|
2652
|
+
"type": "object"
|
2653
|
+
},
|
2654
|
+
"DeleteAndroidInstanceBackupFilesResponse": {
|
2655
|
+
"document": "DeleteAndroidInstanceBackupFiles返回参数结构体",
|
2656
|
+
"members": [
|
2657
|
+
{
|
2658
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
2659
|
+
"member": "string",
|
2660
|
+
"name": "RequestId",
|
2661
|
+
"type": "string"
|
2662
|
+
}
|
2663
|
+
],
|
2664
|
+
"type": "object"
|
2665
|
+
},
|
2506
2666
|
"DeleteAndroidInstanceImagesRequest": {
|
2507
2667
|
"document": "DeleteAndroidInstanceImages请求参数结构体",
|
2508
2668
|
"members": [
|
@@ -4147,6 +4307,16 @@
|
|
4147
4307
|
"ModifyAndroidInstancesPropertiesResponse": {
|
4148
4308
|
"document": "ModifyAndroidInstancesProperties返回参数结构体",
|
4149
4309
|
"members": [
|
4310
|
+
{
|
4311
|
+
"disabled": false,
|
4312
|
+
"document": "安卓实例错误列表",
|
4313
|
+
"example": "无",
|
4314
|
+
"member": "AndroidInstanceError",
|
4315
|
+
"name": "AndroidInstanceErrors",
|
4316
|
+
"output_required": false,
|
4317
|
+
"type": "list",
|
4318
|
+
"value_allowed_null": false
|
4319
|
+
},
|
4150
4320
|
{
|
4151
4321
|
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
4152
4322
|
"member": "string",
|
@@ -4219,6 +4389,16 @@
|
|
4219
4389
|
"ModifyAndroidInstancesResolutionResponse": {
|
4220
4390
|
"document": "ModifyAndroidInstancesResolution返回参数结构体",
|
4221
4391
|
"members": [
|
4392
|
+
{
|
4393
|
+
"disabled": false,
|
4394
|
+
"document": "安卓实例错误列表",
|
4395
|
+
"example": "无",
|
4396
|
+
"member": "AndroidInstanceError",
|
4397
|
+
"name": "AndroidInstanceErrors",
|
4398
|
+
"output_required": false,
|
4399
|
+
"type": "list",
|
4400
|
+
"value_allowed_null": false
|
4401
|
+
},
|
4222
4402
|
{
|
4223
4403
|
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
4224
4404
|
"member": "string",
|
@@ -4384,6 +4564,42 @@
|
|
4384
4564
|
],
|
4385
4565
|
"type": "object"
|
4386
4566
|
},
|
4567
|
+
"RenewAndroidInstancesAccessTokenRequest": {
|
4568
|
+
"document": "RenewAndroidInstancesAccessToken请求参数结构体",
|
4569
|
+
"members": [
|
4570
|
+
{
|
4571
|
+
"disabled": false,
|
4572
|
+
"document": "token",
|
4573
|
+
"example": "TestToken",
|
4574
|
+
"member": "string",
|
4575
|
+
"name": "AccessToken",
|
4576
|
+
"required": true,
|
4577
|
+
"type": "string"
|
4578
|
+
},
|
4579
|
+
{
|
4580
|
+
"disabled": false,
|
4581
|
+
"document": "有效期,默认为 12 小时,最大为 24 小时。支持 s(秒)、m(分)、h(小时)等单位,比如 12h 表示 12 小时,1h2m3s 表示一小时两分三秒",
|
4582
|
+
"example": "12h",
|
4583
|
+
"member": "string",
|
4584
|
+
"name": "ExpirationDuration",
|
4585
|
+
"required": false,
|
4586
|
+
"type": "string"
|
4587
|
+
}
|
4588
|
+
],
|
4589
|
+
"type": "object"
|
4590
|
+
},
|
4591
|
+
"RenewAndroidInstancesAccessTokenResponse": {
|
4592
|
+
"document": "RenewAndroidInstancesAccessToken返回参数结构体",
|
4593
|
+
"members": [
|
4594
|
+
{
|
4595
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
4596
|
+
"member": "string",
|
4597
|
+
"name": "RequestId",
|
4598
|
+
"type": "string"
|
4599
|
+
}
|
4600
|
+
],
|
4601
|
+
"type": "object"
|
4602
|
+
},
|
4387
4603
|
"ResetAndroidInstancesRequest": {
|
4388
4604
|
"document": "ResetAndroidInstances请求参数结构体",
|
4389
4605
|
"members": [
|
@@ -102,6 +102,14 @@
|
|
102
102
|
"title": "CreateAndroidInstances"
|
103
103
|
}
|
104
104
|
],
|
105
|
+
"CreateAndroidInstancesAccessToken": [
|
106
|
+
{
|
107
|
+
"document": "示例",
|
108
|
+
"input": "POST / HTTP/1.1\nHost: gs.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateAndroidInstancesAccessToken\n<公共请求参数>\n\n{\n \"AndroidInstanceIds\": [\n \"cai-251006279-6c8fmp7G8Mz\",\n \"cai-251006279-ea99wkeEIID\",\n \"cai-251006279-ea99QMMwk3A\"\n ]\n}",
|
109
|
+
"output": "{\n \"Response\": {\n \"AccessInfo\": \"eyJBY2Nlc3NJbmZvIjpbeyJab25lIjoiYXAtc2luZ2Fwb3JlLTIiLCJJbnN0YW5jZUlkcyI6WyJjYWktMjUxMDA2Mjc5LTZjOGZtcDdHOE16Il0sIk9wZXJhdG9yQWRkcmVzcyI6Imh0dHBzOi8vdGVzdC1hcC1zaW5nYXBvcmUtMi1vcGVyYXRvci5jYWkuY3J0cmNsb3VkLmNvbToxMDA4OCIsIldlYlNvY2tldEFkZHJlc3MiOiJ3czovL3Rlc3QtYXAtc2luZ2Fwb3JlLTItbWVkaWFzZXJ2ZXIuY2FpLmNydHJjbG91ZC5jb206MjAwODAiLCJXZWJTb2NrZXRTZWN1cmVBZGRyZXNzIjoid3NzOi8vdGVzdC1hcC1zaW5nYXBvcmUtMi1tZWRpYXNlcnZlci5jYWkuY3J0cmNsb3VkLmNvbToyMDQ0MyJ9LHsiWm9uZSI6ImFwLXNoZW56aGVuLTEiLCJJbnN0YW5jZUlkcyI6WyJjYWktMjUxMDA2Mjc5LWVhOTl3a2VFSUlEIiwiY2FpLTI1MTAwNjI3OS1lYTk5UU1Nd2szQSJdLCJPcGVyYXRvckFkZHJlc3MiOiJodHRwczovL3Rlc3QtYXAtc2hlbnpoZW4tMS1vcGVyYXRvci5jYWkuY3J0cmNsb3VkLmNvbToxMDA4OCIsIldlYlNvY2tldEFkZHJlc3MiOiJ3czovL3Rlc3QtYXAtc2hlbnpoZW4tMS1tZWRpYXNlcnZlci5jYWkuY3J0cmNsb3VkLmNvbToyMDA4MCIsIldlYlNvY2tldFNlY3VyZUFkZHJlc3MiOiJ3c3M6Ly90ZXN0LWFwLXNoZW56aGVuLTEtbWVkaWFzZXJ2ZXIuY2FpLmNydHJjbG91ZC5jb206MjA0NDMifV19\",\n \"RequestId\": \"696f46da-c58f-4627-b98f-37b6a0851ec5\",\n \"Token\": \"XsNVrlOkDDNabKXv7EMCZ1By7zy7x2gWFVBg0ZFrKsHu6hTnv6rnQKfrC19oDk65\"\n }\n}",
|
110
|
+
"title": "示例"
|
111
|
+
}
|
112
|
+
],
|
105
113
|
"CreateAndroidInstancesScreenshot": [
|
106
114
|
{
|
107
115
|
"document": "安卓实例截图",
|
@@ -142,6 +150,14 @@
|
|
142
150
|
"title": "删除安卓应用版本示例"
|
143
151
|
}
|
144
152
|
],
|
153
|
+
"DeleteAndroidInstanceBackupFiles": [
|
154
|
+
{
|
155
|
+
"document": "示例",
|
156
|
+
"input": "POST / HTTP/1.1\nHost: gs.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DeleteAndroidInstanceBackupFiles\n<公共请求参数>\n\n{\n \"AndroidInstanceZone\": \"ap-hangzhou-ec-1\",\n \"ObjectKeys\": [\n \"1234/test1.bak\",\n \"1234/test2.bak\"\n ],\n \"StorageType\": \"S3\",\n \"S3Options\": {\n \"EndPoint\": \"http://192.168.1.10:9910\",\n \"Bucket\": \"testbucket\",\n \"AccessKeyId\": \"admin\",\n \"SecretAccessKey\": \"DFxjDF\"\n }\n}",
|
157
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"92f73a08-f7a7-4092-b690-627878ab2e5b\"\n }\n}",
|
158
|
+
"title": "示例"
|
159
|
+
}
|
160
|
+
],
|
145
161
|
"DeleteAndroidInstanceImages": [
|
146
162
|
{
|
147
163
|
"document": "删除安卓实例镜像",
|
@@ -414,6 +430,14 @@
|
|
414
430
|
"title": "重启安卓实例"
|
415
431
|
}
|
416
432
|
],
|
433
|
+
"RenewAndroidInstancesAccessToken": [
|
434
|
+
{
|
435
|
+
"document": "示例",
|
436
|
+
"input": "POST / HTTP/1.1\nHost: gs.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: RenewAndroidInstancesAccessToken\n<公共请求参数>\n\n{\n \"AccessToken\": \"251006279_l6UxjxWDFHvt4Oo0fYErFesq9qGoH854Ld2rSY0HS7ts8L2GIWZ20\",\n \"ExpirationDuration\": \"12h\"\n}",
|
437
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"a232aa85-9490-4179-91a4-3a78790361c9\"\n }\n}",
|
438
|
+
"title": "示例"
|
439
|
+
}
|
440
|
+
],
|
417
441
|
"ResetAndroidInstances": [
|
418
442
|
{
|
419
443
|
"document": "重置安卓实例",
|
tccli/services/ioa/ioa_client.py
CHANGED
@@ -121,7 +121,7 @@ def doDescribeLocalAccounts(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 doCreateDeviceTask(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,11 @@ def doCreatePrivilegeCode(args, parsed_globals):
|
|
150
150
|
client = mod.IoaClient(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.CreateDeviceTaskRequest()
|
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.CreateDeviceTask(model)
|
158
158
|
result = rsp.to_json_string()
|
159
159
|
try:
|
160
160
|
json_obj = json.loads(result)
|
@@ -277,7 +277,7 @@ def doCreateDLPFileDetectionTask(args, parsed_globals):
|
|
277
277
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
278
|
|
279
279
|
|
280
|
-
def
|
280
|
+
def doCreatePrivilegeCode(args, parsed_globals):
|
281
281
|
g_param = parse_global_arg(parsed_globals)
|
282
282
|
|
283
283
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -306,11 +306,63 @@ def doDescribeSoftCensusListByDevice(args, parsed_globals):
|
|
306
306
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
307
307
|
client._sdkVersion += ("_CLI_" + __version__)
|
308
308
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.
|
309
|
+
model = models.CreatePrivilegeCodeRequest()
|
310
310
|
model.from_json_string(json.dumps(args))
|
311
311
|
start_time = time.time()
|
312
312
|
while True:
|
313
|
-
rsp = client.
|
313
|
+
rsp = client.CreatePrivilegeCode(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 doDescribeDeviceInfo(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.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
359
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
360
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
+
model = models.DescribeDeviceInfoRequest()
|
362
|
+
model.from_json_string(json.dumps(args))
|
363
|
+
start_time = time.time()
|
364
|
+
while True:
|
365
|
+
rsp = client.DescribeDeviceInfo(model)
|
314
366
|
result = rsp.to_json_string()
|
315
367
|
try:
|
316
368
|
json_obj = json.loads(result)
|
@@ -537,6 +589,58 @@ def doDescribeDLPFileDetectResult(args, parsed_globals):
|
|
537
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
590
|
|
539
591
|
|
592
|
+
def doDescribeSoftCensusListByDevice(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.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
619
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
620
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
+
model = models.DescribeSoftCensusListByDeviceRequest()
|
622
|
+
model.from_json_string(json.dumps(args))
|
623
|
+
start_time = time.time()
|
624
|
+
while True:
|
625
|
+
rsp = client.DescribeSoftCensusListByDevice(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
|
+
|
540
644
|
def doDescribeAccountGroups(args, parsed_globals):
|
541
645
|
g_param = parse_global_arg(parsed_globals)
|
542
646
|
|
@@ -602,14 +706,16 @@ MODELS_MAP = {
|
|
602
706
|
ACTION_MAP = {
|
603
707
|
"CreateDeviceVirtualGroup": doCreateDeviceVirtualGroup,
|
604
708
|
"DescribeLocalAccounts": doDescribeLocalAccounts,
|
605
|
-
"
|
709
|
+
"CreateDeviceTask": doCreateDeviceTask,
|
606
710
|
"DescribeDevices": doDescribeDevices,
|
607
711
|
"CreateDLPFileDetectionTask": doCreateDLPFileDetectionTask,
|
608
|
-
"
|
712
|
+
"CreatePrivilegeCode": doCreatePrivilegeCode,
|
713
|
+
"DescribeDeviceInfo": doDescribeDeviceInfo,
|
609
714
|
"DescribeSoftwareInformation": doDescribeSoftwareInformation,
|
610
715
|
"DescribeDeviceHardwareInfoList": doDescribeDeviceHardwareInfoList,
|
611
716
|
"DescribeRootAccountGroup": doDescribeRootAccountGroup,
|
612
717
|
"DescribeDLPFileDetectResult": doDescribeDLPFileDetectResult,
|
718
|
+
"DescribeSoftCensusListByDevice": doDescribeSoftCensusListByDevice,
|
613
719
|
"DescribeAccountGroups": doDescribeAccountGroups,
|
614
720
|
|
615
721
|
}
|