tccli-intl-en 3.1.13.1__py2.py3-none-any.whl → 3.1.39.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tccli/__init__.py +1 -1
- tccli/services/__init__.py +3 -0
- tccli/services/advisor/advisor_client.py +56 -0
- tccli/services/advisor/v20200721/api.json +34 -0
- tccli/services/advisor/v20200721/examples.json +8 -0
- tccli/services/autoscaling/v20180419/api.json +41 -13
- tccli/services/billing/billing_client.py +172 -4
- tccli/services/billing/v20180709/api.json +332 -1
- tccli/services/billing/v20180709/examples.json +24 -0
- tccli/services/ccc/v20200210/api.json +71 -26
- tccli/services/cdb/cdb_client.py +1128 -288
- tccli/services/cdb/v20170320/api.json +2166 -335
- tccli/services/cdb/v20170320/examples.json +126 -6
- tccli/services/cdn/v20180606/api.json +22 -22
- tccli/services/cdn/v20180606/examples.json +1 -1
- tccli/services/ckafka/ckafka_client.py +120 -8
- tccli/services/ckafka/v20190819/api.json +525 -180
- tccli/services/ckafka/v20190819/examples.json +30 -20
- tccli/services/clb/v20180317/api.json +87 -87
- tccli/services/csip/csip_client.py +392 -0
- tccli/services/csip/v20221121/api.json +2050 -284
- tccli/services/csip/v20221121/examples.json +56 -0
- tccli/services/cvm/v20170312/api.json +20 -20
- tccli/services/cvm/v20170312/examples.json +8 -8
- tccli/services/emr/v20190103/api.json +6 -6
- tccli/services/faceid/v20180301/api.json +102 -52
- tccli/services/faceid/v20180301/examples.json +3 -9
- tccli/services/hunyuan/hunyuan_client.py +448 -0
- tccli/services/hunyuan/v20230901/api.json +879 -18
- tccli/services/hunyuan/v20230901/examples.json +64 -0
- tccli/services/lighthouse/lighthouse_client.py +360 -24
- tccli/services/lighthouse/v20200324/api.json +488 -0
- tccli/services/lighthouse/v20200324/examples.json +54 -0
- tccli/services/lkeap/v20240522/api.json +36 -0
- tccli/services/lkeap/v20240522/examples.json +1 -1
- tccli/services/mdl/v20200326/api.json +309 -38
- tccli/services/mdp/v20200527/api.json +191 -28
- tccli/services/mongodb/v20190725/api.json +39 -39
- tccli/services/monitor/v20180724/api.json +5 -5
- tccli/services/mps/mps_client.py +341 -61
- tccli/services/mps/v20190612/api.json +890 -31
- tccli/services/mps/v20190612/examples.json +40 -0
- tccli/services/mqtt/__init__.py +4 -0
- tccli/services/mqtt/mqtt_client.py +1610 -0
- tccli/services/mqtt/v20240516/api.json +3057 -0
- tccli/services/mqtt/v20240516/examples.json +213 -0
- tccli/services/ocr/v20181119/api.json +23 -3
- tccli/services/ocr/v20181119/examples.json +6 -6
- tccli/services/redis/v20180412/api.json +12 -12
- tccli/services/ses/ses_client.py +348 -12
- tccli/services/ses/v20201002/api.json +1197 -256
- tccli/services/ses/v20201002/examples.json +78 -24
- tccli/services/tcsas/tcsas_client.py +2281 -209
- tccli/services/tcsas/v20250106/api.json +8410 -3423
- tccli/services/tcsas/v20250106/examples.json +308 -12
- tccli/services/tdmq/v20200217/api.json +4 -4
- tccli/services/teo/v20220901/api.json +10 -10
- tccli/services/tke/tke_client.py +168 -0
- tccli/services/tke/v20180525/api.json +227 -0
- tccli/services/tke/v20180525/examples.json +24 -0
- tccli/services/trocket/v20230308/api.json +96 -96
- tccli/services/trtc/v20190722/api.json +212 -144
- tccli/services/trtc/v20190722/examples.json +7 -7
- tccli/services/vod/v20180717/api.json +2929 -296
- tccli/services/vod/v20180717/examples.json +40 -6
- tccli/services/vod/vod_client.py +280 -0
- tccli/services/vpc/v20170312/api.json +80 -13
- tccli/services/vpc/v20170312/examples.json +17 -9
- tccli/services/vpc/vpc_client.py +64 -8
- {tccli_intl_en-3.1.13.1.dist-info → tccli_intl_en-3.1.39.1.dist-info}/METADATA +2 -2
- {tccli_intl_en-3.1.13.1.dist-info → tccli_intl_en-3.1.39.1.dist-info}/RECORD +75 -71
- {tccli_intl_en-3.1.13.1.dist-info → tccli_intl_en-3.1.39.1.dist-info}/WHEEL +1 -1
- {tccli_intl_en-3.1.13.1.dist-info → tccli_intl_en-3.1.39.1.dist-info}/LICENSE +0 -0
- {tccli_intl_en-3.1.13.1.dist-info → tccli_intl_en-3.1.39.1.dist-info}/entry_points.txt +0 -0
- {tccli_intl_en-3.1.13.1.dist-info → tccli_intl_en-3.1.39.1.dist-info}/top_level.txt +0 -0
tccli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '3.1.
|
|
1
|
+
__version__ = '3.1.39.1'
|
tccli/services/__init__.py
CHANGED
|
@@ -72,6 +72,61 @@ def doDescribeTaskStrategyRisks(args, parsed_globals):
|
|
|
72
72
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
73
73
|
|
|
74
74
|
|
|
75
|
+
def doCreateAdvisorAuthorization(args, parsed_globals):
|
|
76
|
+
g_param = parse_global_arg(parsed_globals)
|
|
77
|
+
|
|
78
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
79
|
+
cred = credential.CVMRoleCredential()
|
|
80
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
81
|
+
cred = credential.STSAssumeRoleCredential(
|
|
82
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
83
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
84
|
+
)
|
|
85
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
86
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
87
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
88
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
89
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
90
|
+
else:
|
|
91
|
+
cred = credential.Credential(
|
|
92
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
93
|
+
)
|
|
94
|
+
http_profile = HttpProfile(
|
|
95
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
96
|
+
reqMethod="POST",
|
|
97
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
98
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
99
|
+
)
|
|
100
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
101
|
+
if g_param[OptionsDefine.Language]:
|
|
102
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
103
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
104
|
+
client = mod.AdvisorClient(cred, g_param[OptionsDefine.Region], profile)
|
|
105
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
106
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
107
|
+
model = models.CreateAdvisorAuthorizationRequest()
|
|
108
|
+
model.from_json_string(json.dumps(args))
|
|
109
|
+
start_time = time.time()
|
|
110
|
+
while True:
|
|
111
|
+
rsp = client.CreateAdvisorAuthorization(model)
|
|
112
|
+
result = rsp.to_json_string()
|
|
113
|
+
try:
|
|
114
|
+
json_obj = json.loads(result)
|
|
115
|
+
except TypeError as e:
|
|
116
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
117
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
118
|
+
break
|
|
119
|
+
cur_time = time.time()
|
|
120
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
121
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
122
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
123
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
124
|
+
else:
|
|
125
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
126
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
127
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
128
|
+
|
|
129
|
+
|
|
75
130
|
def doDescribeStrategies(args, parsed_globals):
|
|
76
131
|
g_param = parse_global_arg(parsed_globals)
|
|
77
132
|
|
|
@@ -139,6 +194,7 @@ MODELS_MAP = {
|
|
|
139
194
|
|
|
140
195
|
ACTION_MAP = {
|
|
141
196
|
"DescribeTaskStrategyRisks": doDescribeTaskStrategyRisks,
|
|
197
|
+
"CreateAdvisorAuthorization": doCreateAdvisorAuthorization,
|
|
142
198
|
"DescribeStrategies": doDescribeStrategies,
|
|
143
199
|
|
|
144
200
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"actions": {
|
|
3
|
+
"CreateAdvisorAuthorization": {
|
|
4
|
+
"document": "Enable Tencent Cloud Smart Advisor authorization. This will synchronously enable report interpretation and cloud architecture collaboration permissions.",
|
|
5
|
+
"input": "CreateAdvisorAuthorizationRequest",
|
|
6
|
+
"name": "Enable TSA authorization",
|
|
7
|
+
"output": "CreateAdvisorAuthorizationResponse",
|
|
8
|
+
"status": "online"
|
|
9
|
+
},
|
|
3
10
|
"DescribeStrategies": {
|
|
4
11
|
"document": "This API is used to query information about assessment items.",
|
|
5
12
|
"input": "DescribeStrategiesRequest",
|
|
@@ -67,6 +74,33 @@
|
|
|
67
74
|
],
|
|
68
75
|
"usage": "out"
|
|
69
76
|
},
|
|
77
|
+
"CreateAdvisorAuthorizationRequest": {
|
|
78
|
+
"document": "CreateAdvisorAuthorization request structure.",
|
|
79
|
+
"members": [],
|
|
80
|
+
"type": "object"
|
|
81
|
+
},
|
|
82
|
+
"CreateAdvisorAuthorizationResponse": {
|
|
83
|
+
"document": "CreateAdvisorAuthorization response structure.",
|
|
84
|
+
"members": [
|
|
85
|
+
{
|
|
86
|
+
"disabled": false,
|
|
87
|
+
"document": "Returned information.",
|
|
88
|
+
"example": "Already authorized",
|
|
89
|
+
"member": "string",
|
|
90
|
+
"name": "Message",
|
|
91
|
+
"output_required": false,
|
|
92
|
+
"type": "string",
|
|
93
|
+
"value_allowed_null": false
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"document": "The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.",
|
|
97
|
+
"member": "string",
|
|
98
|
+
"name": "RequestId",
|
|
99
|
+
"type": "string"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"type": "object"
|
|
103
|
+
},
|
|
70
104
|
"DescribeStrategiesRequest": {
|
|
71
105
|
"document": "DescribeStrategies request structure.",
|
|
72
106
|
"members": [],
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"actions": {
|
|
3
|
+
"CreateAdvisorAuthorization": [
|
|
4
|
+
{
|
|
5
|
+
"document": "",
|
|
6
|
+
"input": "POST / HTTP/1.1\nHost: advisor.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateAdvisorAuthorization\n<Common request parameters>\n\n{}",
|
|
7
|
+
"output": "{\n \"Response\": {\n \"Message\": \"Already authorized\",\n \"RequestId\": \"97aa2227-1814-4d39-9470-dadca094be1f\"\n }\n}",
|
|
8
|
+
"title": "Activated"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
3
11
|
"DescribeStrategies": [
|
|
4
12
|
{
|
|
5
13
|
"document": " ",
|
|
@@ -2352,21 +2352,21 @@
|
|
|
2352
2352
|
},
|
|
2353
2353
|
{
|
|
2354
2354
|
"disabled": false,
|
|
2355
|
-
"document": "The
|
|
2356
|
-
"example": "
|
|
2355
|
+
"document": "The minimum number of instances set for the auto scaling group when the scheduled task is triggered.",
|
|
2356
|
+
"example": "4",
|
|
2357
2357
|
"member": "uint64",
|
|
2358
|
-
"name": "
|
|
2358
|
+
"name": "MinSize",
|
|
2359
2359
|
"required": true,
|
|
2360
2360
|
"type": "int"
|
|
2361
2361
|
},
|
|
2362
2362
|
{
|
|
2363
2363
|
"disabled": false,
|
|
2364
|
-
"document": "
|
|
2365
|
-
"example": "
|
|
2366
|
-
"member": "
|
|
2367
|
-
"name": "
|
|
2364
|
+
"document": "Initial triggered time of the scheduled task. The value is in `Beijing time` (UTC+8) in the format of `YYYY-MM-DDThh:mm:ss+08:00` according to the `ISO8601` standard.",
|
|
2365
|
+
"example": "2018-08-28T23:00:00+08:00",
|
|
2366
|
+
"member": "datetime_iso",
|
|
2367
|
+
"name": "StartTime",
|
|
2368
2368
|
"required": true,
|
|
2369
|
-
"type": "
|
|
2369
|
+
"type": "string"
|
|
2370
2370
|
},
|
|
2371
2371
|
{
|
|
2372
2372
|
"disabled": false,
|
|
@@ -2379,12 +2379,12 @@
|
|
|
2379
2379
|
},
|
|
2380
2380
|
{
|
|
2381
2381
|
"disabled": false,
|
|
2382
|
-
"document": "
|
|
2383
|
-
"example": "
|
|
2384
|
-
"member": "
|
|
2385
|
-
"name": "
|
|
2382
|
+
"document": "The maximum number of instances set for the auto scaling group when the scheduled task is triggered.",
|
|
2383
|
+
"example": "10",
|
|
2384
|
+
"member": "uint64",
|
|
2385
|
+
"name": "MaxSize",
|
|
2386
2386
|
"required": true,
|
|
2387
|
-
"type": "
|
|
2387
|
+
"type": "int"
|
|
2388
2388
|
},
|
|
2389
2389
|
{
|
|
2390
2390
|
"disabled": false,
|
|
@@ -2403,6 +2403,15 @@
|
|
|
2403
2403
|
"name": "Recurrence",
|
|
2404
2404
|
"required": false,
|
|
2405
2405
|
"type": "string"
|
|
2406
|
+
},
|
|
2407
|
+
{
|
|
2408
|
+
"disabled": false,
|
|
2409
|
+
"document": "Disable update DesiredCapacity Indicates the DesiredCapacity is updated normally during scheduled task triggering.\n\nSpecifies whether the scheduled task triggers proactive modification of the DesiredCapacity when the value is True. DesiredCapacity may be modified by the minSize and maxSize mechanism.\nThe following cases assume that DisableUpdateDesiredCapacity is True:\n- When scheduled task triggered, the original DesiredCapacity is 5. The scheduled task changes the minSize to 10, the maxSize to 20, and the DesiredCapacity to 15. Since the DesiredCapacity update is disabled, 15 does not take effect. However, the original DesiredCapacity 5 is less than minSize 10, so the final new DesiredCapacity is 10.\n- When scheduled task triggered, the original DesiredCapacity is 25. The scheduled task changes the minSize to 10 and the maxSize to 20, and the DesiredCapacity to 15. Since the DesiredCapacity update is disabled, 15 does not take effect. However, the original DesiredCapacity 25 is greater than the maxSize 20, so the final new DesiredCapacity is 20.\n- When scheduled task triggered, the original DesiredCapacity is 13. The scheduled task changes the minSize to 10 and the maxSize to 20, and the DesiredCapacity to 15. Since the DesiredCapacity update is disabled, 15 does not take effect, and the DesiredCapacity is still 13.",
|
|
2410
|
+
"example": "false",
|
|
2411
|
+
"member": "bool",
|
|
2412
|
+
"name": "DisableUpdateDesiredCapacity",
|
|
2413
|
+
"required": false,
|
|
2414
|
+
"type": "bool"
|
|
2406
2415
|
}
|
|
2407
2416
|
],
|
|
2408
2417
|
"type": "object"
|
|
@@ -6323,6 +6332,15 @@
|
|
|
6323
6332
|
"name": "Recurrence",
|
|
6324
6333
|
"required": false,
|
|
6325
6334
|
"type": "string"
|
|
6335
|
+
},
|
|
6336
|
+
{
|
|
6337
|
+
"disabled": false,
|
|
6338
|
+
"document": "Disable update DesiredCapacity Indicates the DesiredCapacity is updated normally during scheduled task triggering.\n\nSpecifies whether the scheduled task triggers proactive modification of the DesiredCapacity when the value is True. DesiredCapacity may be modified by the minSize and maxSize mechanism.\nThe following cases assume that DisableUpdateDesiredCapacity is True:\n- When scheduled task triggered, the original DesiredCapacity is 5. The scheduled task changes the minSize to 10, the maxSize to 20, and the DesiredCapacity to 15. Since the DesiredCapacity update is disabled, 15 does not take effect. However, the original DesiredCapacity 5 is less than minSize 10, so the final new DesiredCapacity is 10.\n- When scheduled task triggered, the original DesiredCapacity is 25. The scheduled task changes the minSize to 10 and the maxSize to 20, and the DesiredCapacity to 15. Since the DesiredCapacity update is disabled, 15 does not take effect. However, the original DesiredCapacity 25 is greater than the maxSize 20, so the final new DesiredCapacity is 20.\n- When scheduled task triggered, the original DesiredCapacity is 13. The scheduled task changes the minSize to 10 and the maxSize to 20, and the DesiredCapacity to 15. Since the DesiredCapacity update is disabled, 15 does not take effect, and the DesiredCapacity is still 13.",
|
|
6339
|
+
"example": "false",
|
|
6340
|
+
"member": "bool",
|
|
6341
|
+
"name": "DisableUpdateDesiredCapacity",
|
|
6342
|
+
"required": false,
|
|
6343
|
+
"type": "bool"
|
|
6326
6344
|
}
|
|
6327
6345
|
],
|
|
6328
6346
|
"type": "object"
|
|
@@ -7264,6 +7282,16 @@
|
|
|
7264
7282
|
"output_required": true,
|
|
7265
7283
|
"type": "string",
|
|
7266
7284
|
"value_allowed_null": false
|
|
7285
|
+
},
|
|
7286
|
+
{
|
|
7287
|
+
"disabled": false,
|
|
7288
|
+
"document": "Disable update DesiredCapacity Indicates the DesiredCapacity is updated normally during scheduled task triggering.\n\nSpecifies whether the scheduled task triggers proactive modification of the DesiredCapacity when the value is True. DesiredCapacity may be modified by the minSize and maxSize mechanism.\nThe following cases assume that DisableUpdateDesiredCapacity is True:\n- When scheduled task triggered, the original DesiredCapacity is 5. The scheduled task changes the minSize to 10, the maxSize to 20, and the DesiredCapacity to 15. Since the DesiredCapacity update is disabled, 15 does not take effect. However, the original DesiredCapacity 5 is less than minSize 10, so the final new DesiredCapacity is 10.\n- When scheduled task triggered, the original DesiredCapacity is 25. The scheduled task changes the minSize to 10 and the maxSize to 20, and the DesiredCapacity to 15. Since the DesiredCapacity update is disabled, 15 does not take effect. However, the original DesiredCapacity 25 is greater than the maxSize 20, so the final new DesiredCapacity is 20.\n- When scheduled task triggered, the original DesiredCapacity is 13. The scheduled task changes the minSize to 10 and the maxSize to 20, and the DesiredCapacity to 15. Since the DesiredCapacity update is disabled, 15 does not take effect, and the DesiredCapacity is still 13.",
|
|
7289
|
+
"example": "false",
|
|
7290
|
+
"member": "bool",
|
|
7291
|
+
"name": "DisableUpdateDesiredCapacity",
|
|
7292
|
+
"output_required": false,
|
|
7293
|
+
"type": "bool",
|
|
7294
|
+
"value_allowed_null": false
|
|
7267
7295
|
}
|
|
7268
7296
|
],
|
|
7269
7297
|
"usage": "out"
|
|
@@ -787,6 +787,61 @@ def doDescribeBillDetail(args, parsed_globals):
|
|
|
787
787
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
788
788
|
|
|
789
789
|
|
|
790
|
+
def doDescribeAllocationTree(args, parsed_globals):
|
|
791
|
+
g_param = parse_global_arg(parsed_globals)
|
|
792
|
+
|
|
793
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
794
|
+
cred = credential.CVMRoleCredential()
|
|
795
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
796
|
+
cred = credential.STSAssumeRoleCredential(
|
|
797
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
798
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
799
|
+
)
|
|
800
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
801
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
802
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
803
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
804
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
805
|
+
else:
|
|
806
|
+
cred = credential.Credential(
|
|
807
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
808
|
+
)
|
|
809
|
+
http_profile = HttpProfile(
|
|
810
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
811
|
+
reqMethod="POST",
|
|
812
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
813
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
814
|
+
)
|
|
815
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
816
|
+
if g_param[OptionsDefine.Language]:
|
|
817
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
818
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
819
|
+
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
|
820
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
821
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
822
|
+
model = models.DescribeAllocationTreeRequest()
|
|
823
|
+
model.from_json_string(json.dumps(args))
|
|
824
|
+
start_time = time.time()
|
|
825
|
+
while True:
|
|
826
|
+
rsp = client.DescribeAllocationTree(model)
|
|
827
|
+
result = rsp.to_json_string()
|
|
828
|
+
try:
|
|
829
|
+
json_obj = json.loads(result)
|
|
830
|
+
except TypeError as e:
|
|
831
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
832
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
833
|
+
break
|
|
834
|
+
cur_time = time.time()
|
|
835
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
836
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
837
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
838
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
839
|
+
else:
|
|
840
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
841
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
842
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
843
|
+
|
|
844
|
+
|
|
790
845
|
def doDescribeBillSummary(args, parsed_globals):
|
|
791
846
|
g_param = parse_global_arg(parsed_globals)
|
|
792
847
|
|
|
@@ -1062,6 +1117,61 @@ def doDescribeDosageCosDetailByDate(args, parsed_globals):
|
|
|
1062
1117
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1063
1118
|
|
|
1064
1119
|
|
|
1120
|
+
def doRenewInstance(args, parsed_globals):
|
|
1121
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1122
|
+
|
|
1123
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1124
|
+
cred = credential.CVMRoleCredential()
|
|
1125
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1126
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1127
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1128
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1129
|
+
)
|
|
1130
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1131
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1132
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1133
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1134
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1135
|
+
else:
|
|
1136
|
+
cred = credential.Credential(
|
|
1137
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1138
|
+
)
|
|
1139
|
+
http_profile = HttpProfile(
|
|
1140
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1141
|
+
reqMethod="POST",
|
|
1142
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1143
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1144
|
+
)
|
|
1145
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1146
|
+
if g_param[OptionsDefine.Language]:
|
|
1147
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1148
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1149
|
+
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1150
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1151
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1152
|
+
model = models.RenewInstanceRequest()
|
|
1153
|
+
model.from_json_string(json.dumps(args))
|
|
1154
|
+
start_time = time.time()
|
|
1155
|
+
while True:
|
|
1156
|
+
rsp = client.RenewInstance(model)
|
|
1157
|
+
result = rsp.to_json_string()
|
|
1158
|
+
try:
|
|
1159
|
+
json_obj = json.loads(result)
|
|
1160
|
+
except TypeError as e:
|
|
1161
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1162
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1163
|
+
break
|
|
1164
|
+
cur_time = time.time()
|
|
1165
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1166
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1167
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1168
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1169
|
+
else:
|
|
1170
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1171
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1172
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1173
|
+
|
|
1174
|
+
|
|
1065
1175
|
def doDescribeBillDownloadUrl(args, parsed_globals):
|
|
1066
1176
|
g_param = parse_global_arg(parsed_globals)
|
|
1067
1177
|
|
|
@@ -1337,7 +1447,7 @@ def doDescribeGatherRuleDetail(args, parsed_globals):
|
|
|
1337
1447
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1338
1448
|
|
|
1339
1449
|
|
|
1340
|
-
def
|
|
1450
|
+
def doCreateInstance(args, parsed_globals):
|
|
1341
1451
|
g_param = parse_global_arg(parsed_globals)
|
|
1342
1452
|
|
|
1343
1453
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1369,11 +1479,11 @@ def doDescribeAllocationTree(args, parsed_globals):
|
|
|
1369
1479
|
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1370
1480
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1371
1481
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1372
|
-
model = models.
|
|
1482
|
+
model = models.CreateInstanceRequest()
|
|
1373
1483
|
model.from_json_string(json.dumps(args))
|
|
1374
1484
|
start_time = time.time()
|
|
1375
1485
|
while True:
|
|
1376
|
-
rsp = client.
|
|
1486
|
+
rsp = client.CreateInstance(model)
|
|
1377
1487
|
result = rsp.to_json_string()
|
|
1378
1488
|
try:
|
|
1379
1489
|
json_obj = json.loads(result)
|
|
@@ -2162,6 +2272,61 @@ def doDescribeCostDetail(args, parsed_globals):
|
|
|
2162
2272
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2163
2273
|
|
|
2164
2274
|
|
|
2275
|
+
def doRefundInstance(args, parsed_globals):
|
|
2276
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2277
|
+
|
|
2278
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2279
|
+
cred = credential.CVMRoleCredential()
|
|
2280
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2281
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2282
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2283
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2284
|
+
)
|
|
2285
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2286
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2287
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2288
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2289
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2290
|
+
else:
|
|
2291
|
+
cred = credential.Credential(
|
|
2292
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2293
|
+
)
|
|
2294
|
+
http_profile = HttpProfile(
|
|
2295
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2296
|
+
reqMethod="POST",
|
|
2297
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2298
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2299
|
+
)
|
|
2300
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2301
|
+
if g_param[OptionsDefine.Language]:
|
|
2302
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2303
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2304
|
+
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2305
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2306
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2307
|
+
model = models.RefundInstanceRequest()
|
|
2308
|
+
model.from_json_string(json.dumps(args))
|
|
2309
|
+
start_time = time.time()
|
|
2310
|
+
while True:
|
|
2311
|
+
rsp = client.RefundInstance(model)
|
|
2312
|
+
result = rsp.to_json_string()
|
|
2313
|
+
try:
|
|
2314
|
+
json_obj = json.loads(result)
|
|
2315
|
+
except TypeError as e:
|
|
2316
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2317
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2318
|
+
break
|
|
2319
|
+
cur_time = time.time()
|
|
2320
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2321
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2322
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2323
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2324
|
+
else:
|
|
2325
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2326
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2327
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2328
|
+
|
|
2329
|
+
|
|
2165
2330
|
def doDescribeBillSummaryByProduct(args, parsed_globals):
|
|
2166
2331
|
g_param = parse_global_arg(parsed_globals)
|
|
2167
2332
|
|
|
@@ -2352,17 +2517,19 @@ ACTION_MAP = {
|
|
|
2352
2517
|
"DescribeVoucherInfo": doDescribeVoucherInfo,
|
|
2353
2518
|
"DescribeBillResourceSummaryForOrganization": doDescribeBillResourceSummaryForOrganization,
|
|
2354
2519
|
"DescribeBillDetail": doDescribeBillDetail,
|
|
2520
|
+
"DescribeAllocationTree": doDescribeAllocationTree,
|
|
2355
2521
|
"DescribeBillSummary": doDescribeBillSummary,
|
|
2356
2522
|
"DeleteAllocationRule": doDeleteAllocationRule,
|
|
2357
2523
|
"DescribeBillSummaryByPayMode": doDescribeBillSummaryByPayMode,
|
|
2358
2524
|
"DescribeAllocationRuleDetail": doDescribeAllocationRuleDetail,
|
|
2359
2525
|
"DescribeDosageCosDetailByDate": doDescribeDosageCosDetailByDate,
|
|
2526
|
+
"RenewInstance": doRenewInstance,
|
|
2360
2527
|
"DescribeBillDownloadUrl": doDescribeBillDownloadUrl,
|
|
2361
2528
|
"CreateGatherRule": doCreateGatherRule,
|
|
2362
2529
|
"DescribeBillDetailForOrganization": doDescribeBillDetailForOrganization,
|
|
2363
2530
|
"DescribeAccountBalance": doDescribeAccountBalance,
|
|
2364
2531
|
"DescribeGatherRuleDetail": doDescribeGatherRuleDetail,
|
|
2365
|
-
"
|
|
2532
|
+
"CreateInstance": doCreateInstance,
|
|
2366
2533
|
"DescribeAllocationUnitDetail": doDescribeAllocationUnitDetail,
|
|
2367
2534
|
"DescribeBillAdjustInfo": doDescribeBillAdjustInfo,
|
|
2368
2535
|
"DescribeVoucherUsageDetails": doDescribeVoucherUsageDetails,
|
|
@@ -2377,6 +2544,7 @@ ACTION_MAP = {
|
|
|
2377
2544
|
"ModifyAllocationUnit": doModifyAllocationUnit,
|
|
2378
2545
|
"DescribeDealsByCond": doDescribeDealsByCond,
|
|
2379
2546
|
"DescribeCostDetail": doDescribeCostDetail,
|
|
2547
|
+
"RefundInstance": doRefundInstance,
|
|
2380
2548
|
"DescribeBillSummaryByProduct": doDescribeBillSummaryByProduct,
|
|
2381
2549
|
"ModifyAllocationRule": doModifyAllocationRule,
|
|
2382
2550
|
"DeleteAllocationTag": doDeleteAllocationTag,
|