tccli 3.0.1156.1__py2.py3-none-any.whl → 3.0.1157.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
tccli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1156.1'
1
+ __version__ = '3.0.1157.1'
@@ -6018,6 +6018,16 @@
6018
6018
  "output_required": true,
6019
6019
  "type": "list",
6020
6020
  "value_allowed_null": true
6021
+ },
6022
+ {
6023
+ "disabled": false,
6024
+ "document": "角色RoleArn信息\n注意:此字段可能返回 null,表示取不到有效值。",
6025
+ "example": "qcs::cam::uin/10001:roleName/test_uin",
6026
+ "member": "string",
6027
+ "name": "RoleArn",
6028
+ "output_required": false,
6029
+ "type": "string",
6030
+ "value_allowed_null": true
6021
6031
  }
6022
6032
  ],
6023
6033
  "usage": "out"
@@ -2213,6 +2213,23 @@
2213
2213
  ],
2214
2214
  "usage": "in"
2215
2215
  },
2216
+ "InstanceDetail": {
2217
+ "document": "Instance表detail字段",
2218
+ "members": [
2219
+ {
2220
+ "disabled": false,
2221
+ "document": "告警策略是否可用\n注意:此字段可能返回 null,表示取不到有效值。",
2222
+ "example": "bool",
2223
+ "member": "bool",
2224
+ "name": "EnableAlarmStrategy",
2225
+ "output_required": false,
2226
+ "required": false,
2227
+ "type": "bool",
2228
+ "value_allowed_null": true
2229
+ }
2230
+ ],
2231
+ "usage": "both"
2232
+ },
2216
2233
  "InstanceInfo": {
2217
2234
  "document": "实例描述信息",
2218
2235
  "members": [
@@ -2705,6 +2722,16 @@
2705
2722
  "output_required": false,
2706
2723
  "type": "bool",
2707
2724
  "value_allowed_null": true
2725
+ },
2726
+ {
2727
+ "disabled": false,
2728
+ "document": "实例扩展信息\n注意:此字段可能返回 null,表示取不到有效值。",
2729
+ "example": "无",
2730
+ "member": "InstanceDetail",
2731
+ "name": "Details",
2732
+ "output_required": false,
2733
+ "type": "object",
2734
+ "value_allowed_null": true
2708
2735
  }
2709
2736
  ],
2710
2737
  "usage": "out"
@@ -1858,6 +1858,23 @@
1858
1858
  ],
1859
1859
  "type": "object"
1860
1860
  },
1861
+ "InstanceDetail": {
1862
+ "document": "Instance表detail字段",
1863
+ "members": [
1864
+ {
1865
+ "disabled": false,
1866
+ "document": "告警策略是否可用\t\n注意:此字段可能返回 null,表示取不到有效值。",
1867
+ "example": "bool",
1868
+ "member": "bool",
1869
+ "name": "EnableAlarmStrategy",
1870
+ "output_required": false,
1871
+ "required": false,
1872
+ "type": "bool",
1873
+ "value_allowed_null": true
1874
+ }
1875
+ ],
1876
+ "usage": "both"
1877
+ },
1861
1878
  "InstanceInfo": {
1862
1879
  "document": "实例描述信息",
1863
1880
  "members": [
@@ -2330,6 +2347,16 @@
2330
2347
  "output_required": false,
2331
2348
  "type": "string",
2332
2349
  "value_allowed_null": true
2350
+ },
2351
+ {
2352
+ "disabled": false,
2353
+ "document": "实例扩展信息\n注意:此字段可能返回 null,表示取不到有效值。",
2354
+ "example": "无",
2355
+ "member": "InstanceDetail",
2356
+ "name": "Details",
2357
+ "output_required": false,
2358
+ "type": "object",
2359
+ "value_allowed_null": true
2333
2360
  }
2334
2361
  ],
2335
2362
  "usage": "out"
@@ -4170,7 +4170,7 @@
4170
4170
  },
4171
4171
  {
4172
4172
  "disabled": false,
4173
- "document": "包年包月购买是否自动续费,默认为0。\n0标识默认续费方式,1表示自动续费,2表示手不自动续费。",
4173
+ "document": "包年包月购买是否自动续费,默认为0。\n0标识默认续费方式,1表示自动续费,2表示不自动续费。",
4174
4174
  "example": "0",
4175
4175
  "member": "int64",
4176
4176
  "name": "AutoRenewFlag",
@@ -9263,6 +9263,15 @@
9263
9263
  "name": "CompareTaskId",
9264
9264
  "required": true,
9265
9265
  "type": "string"
9266
+ },
9267
+ {
9268
+ "disabled": false,
9269
+ "document": "是否强制停止。如果填true,同步任务增量阶段会跳过一致性校验产生的binlog,达到快速恢复任务的效果",
9270
+ "example": "true",
9271
+ "member": "bool",
9272
+ "name": "ForceStop",
9273
+ "required": false,
9274
+ "type": "bool"
9266
9275
  }
9267
9276
  ],
9268
9277
  "type": "object"
@@ -123,6 +123,58 @@ def doDescribeDBInstanceNodeProperty(args, parsed_globals):
123
123
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
124
124
 
125
125
 
126
+ def doDescribeDBInstanceParamTpl(args, parsed_globals):
127
+ g_param = parse_global_arg(parsed_globals)
128
+
129
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
130
+ cred = credential.CVMRoleCredential()
131
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
132
+ cred = credential.STSAssumeRoleCredential(
133
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
134
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
135
+ )
136
+ 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):
137
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
138
+ else:
139
+ cred = credential.Credential(
140
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
141
+ )
142
+ http_profile = HttpProfile(
143
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
144
+ reqMethod="POST",
145
+ endpoint=g_param[OptionsDefine.Endpoint],
146
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
147
+ )
148
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
149
+ if g_param[OptionsDefine.Language]:
150
+ profile.language = g_param[OptionsDefine.Language]
151
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
152
+ client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
153
+ client._sdkVersion += ("_CLI_" + __version__)
154
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
155
+ model = models.DescribeDBInstanceParamTplRequest()
156
+ model.from_json_string(json.dumps(args))
157
+ start_time = time.time()
158
+ while True:
159
+ rsp = client.DescribeDBInstanceParamTpl(model)
160
+ result = rsp.to_json_string()
161
+ try:
162
+ json_obj = json.loads(result)
163
+ except TypeError as e:
164
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
165
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
166
+ break
167
+ cur_time = time.time()
168
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
169
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
170
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
171
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
172
+ else:
173
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
174
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
175
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
176
+
177
+
126
178
  def doDescribeDBInstanceDeal(args, parsed_globals):
127
179
  g_param = parse_global_arg(parsed_globals)
128
180
 
@@ -539,7 +591,7 @@ def doFlushInstanceRouterConfig(args, parsed_globals):
539
591
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
540
592
 
541
593
 
542
- def doSetAutoRenew(args, parsed_globals):
594
+ def doUpgradeDBInstance(args, parsed_globals):
543
595
  g_param = parse_global_arg(parsed_globals)
544
596
 
545
597
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -568,11 +620,11 @@ def doSetAutoRenew(args, parsed_globals):
568
620
  client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
569
621
  client._sdkVersion += ("_CLI_" + __version__)
570
622
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
571
- model = models.SetAutoRenewRequest()
623
+ model = models.UpgradeDBInstanceRequest()
572
624
  model.from_json_string(json.dumps(args))
573
625
  start_time = time.time()
574
626
  while True:
575
- rsp = client.SetAutoRenew(model)
627
+ rsp = client.UpgradeDBInstance(model)
576
628
  result = rsp.to_json_string()
577
629
  try:
578
630
  json_obj = json.loads(result)
@@ -643,6 +695,58 @@ def doDescribeDBBackups(args, parsed_globals):
643
695
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
644
696
 
645
697
 
698
+ def doSetAutoRenew(args, parsed_globals):
699
+ g_param = parse_global_arg(parsed_globals)
700
+
701
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
702
+ cred = credential.CVMRoleCredential()
703
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
704
+ cred = credential.STSAssumeRoleCredential(
705
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
706
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
707
+ )
708
+ 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):
709
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
710
+ else:
711
+ cred = credential.Credential(
712
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
713
+ )
714
+ http_profile = HttpProfile(
715
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
716
+ reqMethod="POST",
717
+ endpoint=g_param[OptionsDefine.Endpoint],
718
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
719
+ )
720
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
721
+ if g_param[OptionsDefine.Language]:
722
+ profile.language = g_param[OptionsDefine.Language]
723
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
724
+ client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
725
+ client._sdkVersion += ("_CLI_" + __version__)
726
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
727
+ model = models.SetAutoRenewRequest()
728
+ model.from_json_string(json.dumps(args))
729
+ start_time = time.time()
730
+ while True:
731
+ rsp = client.SetAutoRenew(model)
732
+ result = rsp.to_json_string()
733
+ try:
734
+ json_obj = json.loads(result)
735
+ except TypeError as e:
736
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
737
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
738
+ break
739
+ cur_time = time.time()
740
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
741
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
742
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
743
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
744
+ else:
745
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
746
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
747
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
748
+
749
+
646
750
  def doIsolateDBInstance(args, parsed_globals):
647
751
  g_param = parse_global_arg(parsed_globals)
648
752
 
@@ -1007,6 +1111,58 @@ def doCreateAccountUser(args, parsed_globals):
1007
1111
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1008
1112
 
1009
1113
 
1114
+ def doModifyDBInstanceParamTpl(args, parsed_globals):
1115
+ g_param = parse_global_arg(parsed_globals)
1116
+
1117
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1118
+ cred = credential.CVMRoleCredential()
1119
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1120
+ cred = credential.STSAssumeRoleCredential(
1121
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1122
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1123
+ )
1124
+ 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):
1125
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1126
+ else:
1127
+ cred = credential.Credential(
1128
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1129
+ )
1130
+ http_profile = HttpProfile(
1131
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1132
+ reqMethod="POST",
1133
+ endpoint=g_param[OptionsDefine.Endpoint],
1134
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1135
+ )
1136
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1137
+ if g_param[OptionsDefine.Language]:
1138
+ profile.language = g_param[OptionsDefine.Language]
1139
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1140
+ client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
1141
+ client._sdkVersion += ("_CLI_" + __version__)
1142
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1143
+ model = models.ModifyDBInstanceParamTplRequest()
1144
+ model.from_json_string(json.dumps(args))
1145
+ start_time = time.time()
1146
+ while True:
1147
+ rsp = client.ModifyDBInstanceParamTpl(model)
1148
+ result = rsp.to_json_string()
1149
+ try:
1150
+ json_obj = json.loads(result)
1151
+ except TypeError as e:
1152
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1153
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1154
+ break
1155
+ cur_time = time.time()
1156
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1157
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1158
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1159
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1160
+ else:
1161
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1162
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1163
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1164
+
1165
+
1010
1166
  def doCreateDBInstanceHour(args, parsed_globals):
1011
1167
  g_param = parse_global_arg(parsed_globals)
1012
1168
 
@@ -1059,6 +1215,110 @@ def doCreateDBInstanceHour(args, parsed_globals):
1059
1215
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1060
1216
 
1061
1217
 
1218
+ def doCreateDBInstanceParamTpl(args, parsed_globals):
1219
+ g_param = parse_global_arg(parsed_globals)
1220
+
1221
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1222
+ cred = credential.CVMRoleCredential()
1223
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1224
+ cred = credential.STSAssumeRoleCredential(
1225
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1226
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1227
+ )
1228
+ 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):
1229
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1230
+ else:
1231
+ cred = credential.Credential(
1232
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1233
+ )
1234
+ http_profile = HttpProfile(
1235
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1236
+ reqMethod="POST",
1237
+ endpoint=g_param[OptionsDefine.Endpoint],
1238
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1239
+ )
1240
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1241
+ if g_param[OptionsDefine.Language]:
1242
+ profile.language = g_param[OptionsDefine.Language]
1243
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1244
+ client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
1245
+ client._sdkVersion += ("_CLI_" + __version__)
1246
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1247
+ model = models.CreateDBInstanceParamTplRequest()
1248
+ model.from_json_string(json.dumps(args))
1249
+ start_time = time.time()
1250
+ while True:
1251
+ rsp = client.CreateDBInstanceParamTpl(model)
1252
+ result = rsp.to_json_string()
1253
+ try:
1254
+ json_obj = json.loads(result)
1255
+ except TypeError as e:
1256
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1257
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1258
+ break
1259
+ cur_time = time.time()
1260
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1261
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1262
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1263
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1264
+ else:
1265
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1266
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1267
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1268
+
1269
+
1270
+ def doDropDBInstanceParamTpl(args, parsed_globals):
1271
+ g_param = parse_global_arg(parsed_globals)
1272
+
1273
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1274
+ cred = credential.CVMRoleCredential()
1275
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1276
+ cred = credential.STSAssumeRoleCredential(
1277
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1278
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1279
+ )
1280
+ 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):
1281
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1282
+ else:
1283
+ cred = credential.Credential(
1284
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1285
+ )
1286
+ http_profile = HttpProfile(
1287
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1288
+ reqMethod="POST",
1289
+ endpoint=g_param[OptionsDefine.Endpoint],
1290
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1291
+ )
1292
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1293
+ if g_param[OptionsDefine.Language]:
1294
+ profile.language = g_param[OptionsDefine.Language]
1295
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1296
+ client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
1297
+ client._sdkVersion += ("_CLI_" + __version__)
1298
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1299
+ model = models.DropDBInstanceParamTplRequest()
1300
+ model.from_json_string(json.dumps(args))
1301
+ start_time = time.time()
1302
+ while True:
1303
+ rsp = client.DropDBInstanceParamTpl(model)
1304
+ result = rsp.to_json_string()
1305
+ try:
1306
+ json_obj = json.loads(result)
1307
+ except TypeError as e:
1308
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1309
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1310
+ break
1311
+ cur_time = time.time()
1312
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1313
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1314
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1315
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1316
+ else:
1317
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1318
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1319
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1320
+
1321
+
1062
1322
  def doTerminateDBInstance(args, parsed_globals):
1063
1323
  g_param = parse_global_arg(parsed_globals)
1064
1324
 
@@ -2203,7 +2463,7 @@ def doModifyInstanceParams(args, parsed_globals):
2203
2463
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2204
2464
 
2205
2465
 
2206
- def doUpgradeDBInstance(args, parsed_globals):
2466
+ def doDescribeDBInstanceParamTplDetail(args, parsed_globals):
2207
2467
  g_param = parse_global_arg(parsed_globals)
2208
2468
 
2209
2469
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2232,11 +2492,11 @@ def doUpgradeDBInstance(args, parsed_globals):
2232
2492
  client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
2233
2493
  client._sdkVersion += ("_CLI_" + __version__)
2234
2494
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2235
- model = models.UpgradeDBInstanceRequest()
2495
+ model = models.DescribeDBInstanceParamTplDetailRequest()
2236
2496
  model.from_json_string(json.dumps(args))
2237
2497
  start_time = time.time()
2238
2498
  while True:
2239
- rsp = client.UpgradeDBInstance(model)
2499
+ rsp = client.DescribeDBInstanceParamTplDetail(model)
2240
2500
  result = rsp.to_json_string()
2241
2501
  try:
2242
2502
  json_obj = json.loads(result)
@@ -2582,6 +2842,7 @@ MODELS_MAP = {
2582
2842
  ACTION_MAP = {
2583
2843
  "TerminateDBInstances": doTerminateDBInstances,
2584
2844
  "DescribeDBInstanceNodeProperty": doDescribeDBInstanceNodeProperty,
2845
+ "DescribeDBInstanceParamTpl": doDescribeDBInstanceParamTpl,
2585
2846
  "DescribeDBInstanceDeal": doDescribeDBInstanceDeal,
2586
2847
  "DescribeCurrentOp": doDescribeCurrentOp,
2587
2848
  "DescribeClientConnections": doDescribeClientConnections,
@@ -2590,8 +2851,9 @@ ACTION_MAP = {
2590
2851
  "SetPassword": doSetPassword,
2591
2852
  "SetAccountUserPrivilege": doSetAccountUserPrivilege,
2592
2853
  "FlushInstanceRouterConfig": doFlushInstanceRouterConfig,
2593
- "SetAutoRenew": doSetAutoRenew,
2854
+ "UpgradeDBInstance": doUpgradeDBInstance,
2594
2855
  "DescribeDBBackups": doDescribeDBBackups,
2856
+ "SetAutoRenew": doSetAutoRenew,
2595
2857
  "IsolateDBInstance": doIsolateDBInstance,
2596
2858
  "SetBackupRules": doSetBackupRules,
2597
2859
  "InquirePriceModifyDBInstanceSpec": doInquirePriceModifyDBInstanceSpec,
@@ -2599,7 +2861,10 @@ ACTION_MAP = {
2599
2861
  "RenameInstance": doRenameInstance,
2600
2862
  "DescribeAsyncRequestInfo": doDescribeAsyncRequestInfo,
2601
2863
  "CreateAccountUser": doCreateAccountUser,
2864
+ "ModifyDBInstanceParamTpl": doModifyDBInstanceParamTpl,
2602
2865
  "CreateDBInstanceHour": doCreateDBInstanceHour,
2866
+ "CreateDBInstanceParamTpl": doCreateDBInstanceParamTpl,
2867
+ "DropDBInstanceParamTpl": doDropDBInstanceParamTpl,
2603
2868
  "TerminateDBInstance": doTerminateDBInstance,
2604
2869
  "RenewDBInstances": doRenewDBInstances,
2605
2870
  "CreateBackupDownloadTask": doCreateBackupDownloadTask,
@@ -2622,7 +2887,7 @@ ACTION_MAP = {
2622
2887
  "DescribeSlowLog": doDescribeSlowLog,
2623
2888
  "SetInstanceMaintenance": doSetInstanceMaintenance,
2624
2889
  "ModifyInstanceParams": doModifyInstanceParams,
2625
- "UpgradeDBInstance": doUpgradeDBInstance,
2890
+ "DescribeDBInstanceParamTplDetail": doDescribeDBInstanceParamTplDetail,
2626
2891
  "KillOps": doKillOps,
2627
2892
  "EnableTransparentDataEncryption": doEnableTransparentDataEncryption,
2628
2893
  "CreateBackupDBInstance": doCreateBackupDBInstance,