tccli 3.0.1084.1__py2.py3-none-any.whl → 3.0.1086.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 +1 -1
- tccli/examples/aiart/v20221229/QueryTextToImageProJob.md +30 -0
- tccli/examples/aiart/v20221229/SubmitTextToImageProJob.md +22 -0
- tccli/examples/billing/v20180709/DescribeCostDetail.md +36 -33
- tccli/examples/billing/v20180709/DescribeCostSummaryByProject.md +25 -80
- tccli/examples/billing/v20180709/DescribeCostSummaryByRegion.md +23 -14
- tccli/examples/billing/v20180709/DescribeCostSummaryByResource.md +53 -27
- tccli/examples/ccc/v20200210/CreateCompanyApply.md +36 -0
- tccli/examples/ccc/v20200210/DescribeCompanyList.md +33 -0
- tccli/examples/ccc/v20200210/ModifyCompanyApply.md +36 -0
- tccli/examples/ckafka/v20190819/CreateInstancePost.md +9 -6
- tccli/examples/ckafka/v20190819/CreatePrometheus.md +29 -0
- tccli/examples/ckafka/v20190819/DescribePrometheus.md +25 -0
- tccli/examples/cynosdb/v20190107/RollbackToNewCluster.md +62 -0
- tccli/examples/dlc/v20210125/QueryTaskCostDetail.md +20 -0
- tccli/examples/essbasic/v20210526/ChannelCreateReleaseFlow.md +1 -1
- tccli/examples/faceid/v20180301/GetFaceIdResult.md +4 -4
- tccli/examples/iotexplorer/v20190423/BindCloudStorageUser.md +22 -0
- tccli/examples/iotexplorer/v20190423/CreateIotVideoCloudStorage.md +22 -0
- tccli/examples/iotexplorer/v20190423/DeleteCloudStorageEvent.md +26 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStorage.md +27 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStorageDate.md +24 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStorageEvents.md +87 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStorageMultiThumbnail.md +28 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStorageOrder.md +25 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStoragePackageConsumeDetails.md +21 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStoragePackageConsumeStats.md +44 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStorageStreamData.md +24 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStorageThumbnail.md +24 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStorageThumbnailList.md +28 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStorageTime.md +43 -0
- tccli/examples/iotexplorer/v20190423/DescribeCloudStorageUsers.md +29 -0
- tccli/examples/iotexplorer/v20190423/DescribeDevicePackages.md +37 -0
- tccli/examples/iotexplorer/v20190423/DescribePackageConsumeTask.md +21 -0
- tccli/examples/iotexplorer/v20190423/DescribePackageConsumeTasks.md +39 -0
- tccli/examples/iotexplorer/v20190423/GenerateSignedVideoURL.md +22 -0
- tccli/examples/iotexplorer/v20190423/InheritCloudStorageUser.md +23 -0
- tccli/examples/iotexplorer/v20190423/ResetCloudStorage.md +21 -0
- tccli/examples/iotexplorer/v20190423/ResetCloudStorageEvent.md +22 -0
- tccli/examples/iotexplorer/v20190423/TransferCloudStorage.md +22 -0
- tccli/examples/monitor/v20180724/CreateExporterIntegration.md +626 -2
- tccli/examples/ocr/v20181119/ReconstructDocument.md +2263 -0
- tccli/examples/pts/v20210728/CreateEnvironment.md +18 -0
- tccli/examples/pts/v20210728/DeleteEnvironments.md +18 -0
- tccli/examples/pts/v20210728/DescribeEnvironments.md +18 -0
- tccli/examples/pts/v20210728/UpdateEnvironment.md +18 -0
- tccli/examples/redis/v20180412/DescribeInstanceEvents.md +45 -0
- tccli/examples/redis/v20180412/ModifyInstanceEvent.md +25 -0
- tccli/examples/ssl/v20191205/UploadCertificate.md +48 -3
- tccli/examples/tag/v20180813/DescribeProjects.md +1 -1
- tccli/examples/tione/v20211111/CreateModelService.md +3 -1
- tccli/examples/tione/v20211111/ModifyModelService.md +62 -228
- tccli/examples/vrs/v20200824/DetectEnvAndSoundQuality.md +12 -4
- tccli/examples/wedata/v20210820/BatchCreateIntegrationTaskAlarms.md +11 -11
- tccli/examples/wedata/v20210820/BatchForceSuccessIntegrationTaskInstances.md +2 -2
- tccli/examples/wedata/v20210820/BatchKillIntegrationTaskInstances.md +2 -2
- tccli/examples/wedata/v20210820/BatchMakeUpIntegrationTasks.md +2 -2
- tccli/examples/wedata/v20210820/BatchRerunIntegrationTaskInstances.md +5 -2
- tccli/examples/wedata/v20210820/CheckDuplicateRuleName.md +5 -5
- tccli/examples/wedata/v20210820/CheckDuplicateTemplateName.md +4 -4
- tccli/examples/wedata/v20210820/CheckIntegrationNodeNameExists.md +4 -4
- tccli/examples/wedata/v20210820/CheckIntegrationTaskNameExists.md +4 -4
- tccli/examples/wedata/v20210820/CheckTaskNameExist.md +3 -3
- tccli/examples/wedata/v20210820/CommitExportTask.md +4 -4
- tccli/examples/wedata/v20210820/CreateInLongAgent.md +6 -6
- tccli/examples/wedata/v20210820/CreateOrUpdateResource.md +2 -1
- tccli/examples/wedata/v20210820/CreateRuleTemplate.md +1 -1
- tccli/examples/wedata/v20210820/CreateTaskAlarmRegular.md +11 -11
- tccli/examples/wedata/v20210820/DeleteInLongAgent.md +3 -3
- tccli/examples/wedata/v20210820/DeleteIntegrationNode.md +2 -2
- tccli/examples/wedata/v20210820/DeleteOfflineTask.md +4 -4
- tccli/examples/wedata/v20210820/DeleteRule.md +1 -1
- tccli/examples/wedata/v20210820/DeleteRuleTemplate.md +1 -1
- tccli/examples/wedata/v20210820/DescribeClusterNamespaceList.md +6 -6
- tccli/examples/wedata/v20210820/DescribeDataBases.md +12 -8
- tccli/examples/wedata/v20210820/DescribeDataCheckStat.md +5 -5
- tccli/examples/wedata/v20210820/DescribeDataObjects.md +6 -3
- tccli/examples/wedata/v20210820/DescribeExecStrategy.md +20 -16
- tccli/examples/wedata/v20210820/DescribeInLongAgentTaskList.md +6 -6
- tccli/examples/wedata/v20210820/DescribeInLongAgentVpcList.md +3 -3
- tccli/examples/wedata/v20210820/DescribeInstances.md +6 -6
- tccli/examples/wedata/v20210820/DescribeIntegrationNode.md +61 -43
- tccli/examples/wedata/v20210820/DescribeIntegrationStatistics.md +13 -13
- tccli/examples/wedata/v20210820/DescribeIntegrationStatisticsAgentStatus.md +6 -6
- tccli/examples/wedata/v20210820/DescribeIntegrationStatisticsInstanceTrend.md +8 -10
- tccli/examples/wedata/v20210820/DescribeIntegrationStatisticsRecordsTrend.md +1 -1
- tccli/examples/wedata/v20210820/DescribeIntegrationStatisticsTaskStatus.md +5 -5
- tccli/examples/wedata/v20210820/DescribeIntegrationStatisticsTaskStatusTrend.md +8 -10
- tccli/examples/wedata/v20210820/DescribeMonitorsByPage.md +7 -7
- tccli/examples/wedata/v20210820/DescribeOfflineTaskToken.md +3 -3
- tccli/examples/wedata/v20210820/DescribeProdTasks.md +6 -5
- tccli/examples/wedata/v20210820/DescribeRealTimeTaskInstanceNodeInfo.md +9 -9
- tccli/examples/wedata/v20210820/DescribeRealTimeTaskSpeed.md +32 -26
- tccli/examples/wedata/v20210820/DescribeRule.md +118 -23
- tccli/examples/wedata/v20210820/DescribeRuleDataSources.md +11 -8
- tccli/examples/wedata/v20210820/DescribeRuleDimStat.md +3 -3
- tccli/examples/wedata/v20210820/DescribeRuleExecDetail.md +48 -41
- tccli/examples/wedata/v20210820/DescribeRuleExecExportResult.md +15 -10
- tccli/examples/wedata/v20210820/DescribeRuleExecLog.md +2 -2
- tccli/examples/wedata/v20210820/DescribeRuleExecResults.md +72 -4
- tccli/examples/wedata/v20210820/DescribeRuleExecResultsByPage.md +38 -33
- tccli/examples/wedata/v20210820/DescribeRuleExecStat.md +14 -14
- tccli/examples/wedata/v20210820/DescribeRuleGroup.md +50 -23
- tccli/examples/wedata/v20210820/DescribeRuleGroupExecResultsByPage.md +87 -14
- tccli/examples/wedata/v20210820/DescribeRuleGroupExecResultsByPageWithoutAuth.md +81 -12
- tccli/examples/wedata/v20210820/DescribeRuleGroupSubscription.md +12 -6
- tccli/examples/wedata/v20210820/DescribeRuleGroupTable.md +35 -27
- tccli/examples/wedata/v20210820/DescribeRuleGroupsByPage.md +51 -21
- tccli/examples/wedata/v20210820/DescribeRuleHistoryByPage.md +9 -9
- tccli/examples/wedata/v20210820/DescribeRuleTablesByPage.md +52 -35
- tccli/examples/wedata/v20210820/DescribeRuleTemplate.md +33 -16
- tccli/examples/wedata/v20210820/DescribeRuleTemplates.md +8 -8
- tccli/examples/wedata/v20210820/DescribeRuleTemplatesByPage.md +13 -13
- tccli/examples/wedata/v20210820/DescribeRulesByPage.md +123 -28
- tccli/examples/wedata/v20210820/DescribeStandardRuleDetailInfoList.md +3 -3
- tccli/examples/wedata/v20210820/DescribeTableInfoList.md +9 -2
- tccli/examples/wedata/v20210820/DescribeTaskInstance.md +35 -35
- tccli/examples/wedata/v20210820/DescribeTaskInstanceReportDetail.md +28 -26
- tccli/examples/wedata/v20210820/DescribeTaskLockStatus.md +7 -7
- tccli/examples/wedata/v20210820/DescribeTaskReport.md +6 -6
- tccli/examples/wedata/v20210820/DescribeTaskReportDetailList.md +17 -17
- tccli/examples/wedata/v20210820/DescribeTopTableStat.md +9 -9
- tccli/examples/wedata/v20210820/DescribeTrendStat.md +2 -2
- tccli/examples/wedata/v20210820/DryRunDIOfflineTask.md +10 -9
- tccli/examples/wedata/v20210820/GetIntegrationNodeColumnSchema.md +13 -11
- tccli/examples/wedata/v20210820/GetOfflineDIInstanceList.md +26 -26
- tccli/examples/wedata/v20210820/LockIntegrationTask.md +4 -4
- tccli/examples/wedata/v20210820/ModifyIntegrationNode.md +42 -41
- tccli/examples/wedata/v20210820/ModifyIntegrationTask.md +110 -58
- tccli/examples/wedata/v20210820/ModifyMonitorStatus.md +4 -4
- tccli/examples/wedata/v20210820/ModifyRule.md +24 -24
- tccli/examples/wedata/v20210820/ModifyRuleGroupSubscription.md +11 -13
- tccli/examples/wedata/v20210820/ModifyTaskAlarmRegular.md +45 -16
- tccli/examples/wedata/v20210820/ModifyTaskName.md +5 -5
- tccli/examples/wedata/v20210820/RestartInLongAgent.md +3 -3
- tccli/examples/wedata/v20210820/RobAndLockIntegrationTask.md +7 -7
- tccli/examples/wedata/v20210820/StopIntegrationTask.md +4 -4
- tccli/examples/wedata/v20210820/TaskLog.md +5 -15
- tccli/examples/wedata/v20210820/UnlockIntegrationTask.md +4 -4
- tccli/examples/wedata/v20210820/UpdateInLongAgent.md +5 -5
- tccli/services/aiart/aiart_client.py +106 -0
- tccli/services/aiart/v20221229/api.json +174 -0
- tccli/services/aiart/v20221229/examples.json +16 -0
- tccli/services/asr/v20190614/api.json +4 -4
- tccli/services/bi/v20220105/api.json +27 -0
- tccli/services/billing/v20180709/api.json +365 -130
- tccli/services/billing/v20180709/examples.json +4 -4
- tccli/services/ccc/ccc_client.py +159 -0
- tccli/services/ccc/v20200210/api.json +442 -0
- tccli/services/ccc/v20200210/examples.json +24 -0
- tccli/services/cdb/v20170320/api.json +3 -3
- tccli/services/cdwch/v20200915/api.json +13 -4
- tccli/services/cdwdoris/v20211228/api.json +127 -0
- tccli/services/cdwpg/v20201230/api.json +9 -0
- tccli/services/ckafka/ckafka_client.py +106 -0
- tccli/services/ckafka/v20190819/api.json +190 -12
- tccli/services/ckafka/v20190819/examples.json +17 -1
- tccli/services/clb/v20180317/api.json +2 -2
- tccli/services/cloudstudio/v20230508/api.json +40 -4
- tccli/services/cls/v20201016/api.json +30 -30
- tccli/services/csip/v20221121/api.json +76 -76
- tccli/services/cwp/v20180228/api.json +124 -8
- tccli/services/cynosdb/cynosdb_client.py +53 -0
- tccli/services/cynosdb/v20190107/api.json +255 -0
- tccli/services/cynosdb/v20190107/examples.json +8 -0
- tccli/services/dlc/dlc_client.py +53 -0
- tccli/services/dlc/v20210125/api.json +103 -4
- tccli/services/dlc/v20210125/examples.json +8 -0
- tccli/services/dsgc/v20190723/api.json +20 -0
- tccli/services/dts/v20211206/api.json +56 -2
- tccli/services/es/v20180416/api.json +127 -24
- tccli/services/ess/v20201111/api.json +20 -20
- tccli/services/essbasic/v20210526/api.json +14 -5
- tccli/services/essbasic/v20210526/examples.json +1 -1
- tccli/services/faceid/v20180301/api.json +23 -13
- tccli/services/faceid/v20180301/examples.json +1 -1
- tccli/services/iotexplorer/iotexplorer_client.py +1453 -234
- tccli/services/iotexplorer/v20190423/api.json +2179 -117
- tccli/services/iotexplorer/v20190423/examples.json +184 -0
- tccli/services/lcic/v20220817/api.json +62 -4
- tccli/services/live/v20180801/api.json +16 -0
- tccli/services/monitor/v20180724/examples.json +111 -3
- tccli/services/mps/v20190612/api.json +161 -27
- tccli/services/ms/v20180408/api.json +14 -14
- tccli/services/ocr/ocr_client.py +53 -0
- tccli/services/ocr/v20181119/api.json +276 -0
- tccli/services/ocr/v20181119/examples.json +8 -0
- tccli/services/pts/pts_client.py +212 -0
- tccli/services/pts/v20210728/api.json +96 -0
- tccli/services/pts/v20210728/examples.json +32 -0
- tccli/services/redis/redis_client.py +106 -0
- tccli/services/redis/v20180412/api.json +342 -0
- tccli/services/redis/v20180412/examples.json +16 -0
- tccli/services/ssl/v20191205/examples.json +9 -3
- tccli/services/tag/v20180813/examples.json +1 -1
- tccli/services/tdmq/v20200217/api.json +45 -0
- tccli/services/tione/v20211111/api.json +77 -3
- tccli/services/tione/v20211111/examples.json +2 -2
- tccli/services/tms/v20201229/api.json +1 -1
- tccli/services/tmt/v20180321/api.json +1 -1
- tccli/services/trtc/v20190722/api.json +1 -1
- tccli/services/tse/v20201207/api.json +286 -42
- tccli/services/tts/v20190823/api.json +19 -10
- tccli/services/vod/v20180717/api.json +6 -6
- tccli/services/vrs/v20200824/api.json +34 -33
- tccli/services/vrs/v20200824/examples.json +1 -1
- tccli/services/wedata/v20210820/api.json +621 -198
- tccli/services/wedata/v20210820/examples.json +146 -146
- {tccli-3.0.1084.1.dist-info → tccli-3.0.1086.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1084.1.dist-info → tccli-3.0.1086.1.dist-info}/RECORD +213 -174
- {tccli-3.0.1084.1.dist-info → tccli-3.0.1086.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1084.1.dist-info → tccli-3.0.1086.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1084.1.dist-info → tccli-3.0.1086.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/pts/pts_client.py
CHANGED
@@ -69,6 +69,58 @@ def doDescribeScenarioWithJobs(args, parsed_globals):
|
|
69
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
70
|
|
71
71
|
|
72
|
+
def doDeleteEnvironments(args, parsed_globals):
|
73
|
+
g_param = parse_global_arg(parsed_globals)
|
74
|
+
|
75
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
76
|
+
cred = credential.CVMRoleCredential()
|
77
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
78
|
+
cred = credential.STSAssumeRoleCredential(
|
79
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
80
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
81
|
+
)
|
82
|
+
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):
|
83
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
84
|
+
else:
|
85
|
+
cred = credential.Credential(
|
86
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
87
|
+
)
|
88
|
+
http_profile = HttpProfile(
|
89
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
90
|
+
reqMethod="POST",
|
91
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
92
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
93
|
+
)
|
94
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
95
|
+
if g_param[OptionsDefine.Language]:
|
96
|
+
profile.language = g_param[OptionsDefine.Language]
|
97
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
98
|
+
client = mod.PtsClient(cred, g_param[OptionsDefine.Region], profile)
|
99
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
100
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
+
model = models.DeleteEnvironmentsRequest()
|
102
|
+
model.from_json_string(json.dumps(args))
|
103
|
+
start_time = time.time()
|
104
|
+
while True:
|
105
|
+
rsp = client.DeleteEnvironments(model)
|
106
|
+
result = rsp.to_json_string()
|
107
|
+
try:
|
108
|
+
json_obj = json.loads(result)
|
109
|
+
except TypeError as e:
|
110
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
111
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
112
|
+
break
|
113
|
+
cur_time = time.time()
|
114
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
115
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
116
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
117
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
118
|
+
else:
|
119
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
120
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
121
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
|
+
|
123
|
+
|
72
124
|
def doUpdateFileScenarioRelation(args, parsed_globals):
|
73
125
|
g_param = parse_global_arg(parsed_globals)
|
74
126
|
|
@@ -953,6 +1005,58 @@ def doDescribeAlertRecords(args, parsed_globals):
|
|
953
1005
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
1006
|
|
955
1007
|
|
1008
|
+
def doDescribeEnvironments(args, parsed_globals):
|
1009
|
+
g_param = parse_global_arg(parsed_globals)
|
1010
|
+
|
1011
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1012
|
+
cred = credential.CVMRoleCredential()
|
1013
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1014
|
+
cred = credential.STSAssumeRoleCredential(
|
1015
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1016
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1017
|
+
)
|
1018
|
+
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):
|
1019
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1020
|
+
else:
|
1021
|
+
cred = credential.Credential(
|
1022
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1023
|
+
)
|
1024
|
+
http_profile = HttpProfile(
|
1025
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1026
|
+
reqMethod="POST",
|
1027
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1028
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1029
|
+
)
|
1030
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1031
|
+
if g_param[OptionsDefine.Language]:
|
1032
|
+
profile.language = g_param[OptionsDefine.Language]
|
1033
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1034
|
+
client = mod.PtsClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1036
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
+
model = models.DescribeEnvironmentsRequest()
|
1038
|
+
model.from_json_string(json.dumps(args))
|
1039
|
+
start_time = time.time()
|
1040
|
+
while True:
|
1041
|
+
rsp = client.DescribeEnvironments(model)
|
1042
|
+
result = rsp.to_json_string()
|
1043
|
+
try:
|
1044
|
+
json_obj = json.loads(result)
|
1045
|
+
except TypeError as e:
|
1046
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1047
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1048
|
+
break
|
1049
|
+
cur_time = time.time()
|
1050
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1051
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1052
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1053
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1054
|
+
else:
|
1055
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1056
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1057
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
|
+
|
1059
|
+
|
956
1060
|
def doDescribeAlertChannels(args, parsed_globals):
|
957
1061
|
g_param = parse_global_arg(parsed_globals)
|
958
1062
|
|
@@ -1265,6 +1369,58 @@ def doRestartCronJobs(args, parsed_globals):
|
|
1265
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
1370
|
|
1267
1371
|
|
1372
|
+
def doUpdateEnvironment(args, parsed_globals):
|
1373
|
+
g_param = parse_global_arg(parsed_globals)
|
1374
|
+
|
1375
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1376
|
+
cred = credential.CVMRoleCredential()
|
1377
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1378
|
+
cred = credential.STSAssumeRoleCredential(
|
1379
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1380
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1381
|
+
)
|
1382
|
+
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):
|
1383
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1384
|
+
else:
|
1385
|
+
cred = credential.Credential(
|
1386
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1387
|
+
)
|
1388
|
+
http_profile = HttpProfile(
|
1389
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1390
|
+
reqMethod="POST",
|
1391
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1392
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1393
|
+
)
|
1394
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1395
|
+
if g_param[OptionsDefine.Language]:
|
1396
|
+
profile.language = g_param[OptionsDefine.Language]
|
1397
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1398
|
+
client = mod.PtsClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1400
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
+
model = models.UpdateEnvironmentRequest()
|
1402
|
+
model.from_json_string(json.dumps(args))
|
1403
|
+
start_time = time.time()
|
1404
|
+
while True:
|
1405
|
+
rsp = client.UpdateEnvironment(model)
|
1406
|
+
result = rsp.to_json_string()
|
1407
|
+
try:
|
1408
|
+
json_obj = json.loads(result)
|
1409
|
+
except TypeError as e:
|
1410
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1411
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1412
|
+
break
|
1413
|
+
cur_time = time.time()
|
1414
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1415
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1416
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1417
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1418
|
+
else:
|
1419
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1420
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1421
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
|
+
|
1423
|
+
|
1268
1424
|
def doCreateAlertChannel(args, parsed_globals):
|
1269
1425
|
g_param = parse_global_arg(parsed_globals)
|
1270
1426
|
|
@@ -1629,6 +1785,58 @@ def doDescribeSampleLogs(args, parsed_globals):
|
|
1629
1785
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1630
1786
|
|
1631
1787
|
|
1788
|
+
def doCreateEnvironment(args, parsed_globals):
|
1789
|
+
g_param = parse_global_arg(parsed_globals)
|
1790
|
+
|
1791
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1792
|
+
cred = credential.CVMRoleCredential()
|
1793
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1794
|
+
cred = credential.STSAssumeRoleCredential(
|
1795
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1796
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1797
|
+
)
|
1798
|
+
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):
|
1799
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1800
|
+
else:
|
1801
|
+
cred = credential.Credential(
|
1802
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1803
|
+
)
|
1804
|
+
http_profile = HttpProfile(
|
1805
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1806
|
+
reqMethod="POST",
|
1807
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1808
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1809
|
+
)
|
1810
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1811
|
+
if g_param[OptionsDefine.Language]:
|
1812
|
+
profile.language = g_param[OptionsDefine.Language]
|
1813
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1814
|
+
client = mod.PtsClient(cred, g_param[OptionsDefine.Region], profile)
|
1815
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1816
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1817
|
+
model = models.CreateEnvironmentRequest()
|
1818
|
+
model.from_json_string(json.dumps(args))
|
1819
|
+
start_time = time.time()
|
1820
|
+
while True:
|
1821
|
+
rsp = client.CreateEnvironment(model)
|
1822
|
+
result = rsp.to_json_string()
|
1823
|
+
try:
|
1824
|
+
json_obj = json.loads(result)
|
1825
|
+
except TypeError as e:
|
1826
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1827
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1828
|
+
break
|
1829
|
+
cur_time = time.time()
|
1830
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1831
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1832
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1833
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1834
|
+
else:
|
1835
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1836
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1837
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1838
|
+
|
1839
|
+
|
1632
1840
|
def doDescribeScenarios(args, parsed_globals):
|
1633
1841
|
g_param = parse_global_arg(parsed_globals)
|
1634
1842
|
|
@@ -2317,6 +2525,7 @@ MODELS_MAP = {
|
|
2317
2525
|
|
2318
2526
|
ACTION_MAP = {
|
2319
2527
|
"DescribeScenarioWithJobs": doDescribeScenarioWithJobs,
|
2528
|
+
"DeleteEnvironments": doDeleteEnvironments,
|
2320
2529
|
"UpdateFileScenarioRelation": doUpdateFileScenarioRelation,
|
2321
2530
|
"UpdateCronJob": doUpdateCronJob,
|
2322
2531
|
"StartJob": doStartJob,
|
@@ -2334,12 +2543,14 @@ ACTION_MAP = {
|
|
2334
2543
|
"DescribeRequestSummary": doDescribeRequestSummary,
|
2335
2544
|
"DeleteScenarios": doDeleteScenarios,
|
2336
2545
|
"DescribeAlertRecords": doDescribeAlertRecords,
|
2546
|
+
"DescribeEnvironments": doDescribeEnvironments,
|
2337
2547
|
"DescribeAlertChannels": doDescribeAlertChannels,
|
2338
2548
|
"DescribeAvailableMetrics": doDescribeAvailableMetrics,
|
2339
2549
|
"DescribeLabelValues": doDescribeLabelValues,
|
2340
2550
|
"AbortCronJobs": doAbortCronJobs,
|
2341
2551
|
"UpdateJob": doUpdateJob,
|
2342
2552
|
"RestartCronJobs": doRestartCronJobs,
|
2553
|
+
"UpdateEnvironment": doUpdateEnvironment,
|
2343
2554
|
"CreateAlertChannel": doCreateAlertChannel,
|
2344
2555
|
"DescribeSampleBatchQuery": doDescribeSampleBatchQuery,
|
2345
2556
|
"DeleteJobs": doDeleteJobs,
|
@@ -2347,6 +2558,7 @@ ACTION_MAP = {
|
|
2347
2558
|
"DescribeErrorSummary": doDescribeErrorSummary,
|
2348
2559
|
"DescribeProjects": doDescribeProjects,
|
2349
2560
|
"DescribeSampleLogs": doDescribeSampleLogs,
|
2561
|
+
"CreateEnvironment": doCreateEnvironment,
|
2350
2562
|
"DescribeScenarios": doDescribeScenarios,
|
2351
2563
|
"DeleteCronJobs": doDeleteCronJobs,
|
2352
2564
|
"CopyScenario": doCopyScenario,
|
@@ -42,6 +42,13 @@
|
|
42
42
|
"output": "CreateCronJobResponse",
|
43
43
|
"status": "online"
|
44
44
|
},
|
45
|
+
"CreateEnvironment": {
|
46
|
+
"document": "创建环境",
|
47
|
+
"input": "CreateEnvironmentRequest",
|
48
|
+
"name": "创建环境",
|
49
|
+
"output": "CreateEnvironmentResponse",
|
50
|
+
"status": "online"
|
51
|
+
},
|
45
52
|
"CreateFile": {
|
46
53
|
"document": "创建文件",
|
47
54
|
"input": "CreateFileRequest",
|
@@ -77,6 +84,13 @@
|
|
77
84
|
"output": "DeleteCronJobsResponse",
|
78
85
|
"status": "online"
|
79
86
|
},
|
87
|
+
"DeleteEnvironments": {
|
88
|
+
"document": "删除环境",
|
89
|
+
"input": "DeleteEnvironmentsRequest",
|
90
|
+
"name": "删除环境",
|
91
|
+
"output": "DeleteEnvironmentsResponse",
|
92
|
+
"status": "online"
|
93
|
+
},
|
80
94
|
"DeleteFiles": {
|
81
95
|
"document": "删除文件",
|
82
96
|
"input": "DeleteFilesRequest",
|
@@ -140,6 +154,13 @@
|
|
140
154
|
"output": "DescribeCronJobsResponse",
|
141
155
|
"status": "online"
|
142
156
|
},
|
157
|
+
"DescribeEnvironments": {
|
158
|
+
"document": "查看环境列表",
|
159
|
+
"input": "DescribeEnvironmentsRequest",
|
160
|
+
"name": "查看环境列表",
|
161
|
+
"output": "DescribeEnvironmentsResponse",
|
162
|
+
"status": "online"
|
163
|
+
},
|
143
164
|
"DescribeErrorSummary": {
|
144
165
|
"document": "查询错误详情汇总信息",
|
145
166
|
"input": "DescribeErrorSummaryRequest",
|
@@ -280,6 +301,13 @@
|
|
280
301
|
"output": "UpdateCronJobResponse",
|
281
302
|
"status": "online"
|
282
303
|
},
|
304
|
+
"UpdateEnvironment": {
|
305
|
+
"document": "更新环境",
|
306
|
+
"input": "UpdateEnvironmentRequest",
|
307
|
+
"name": "更新环境",
|
308
|
+
"output": "UpdateEnvironmentResponse",
|
309
|
+
"status": "online"
|
310
|
+
},
|
283
311
|
"UpdateFileScenarioRelation": {
|
284
312
|
"document": "更新关联文件场景",
|
285
313
|
"input": "UpdateFileScenarioRelationRequest",
|
@@ -1149,6 +1177,23 @@
|
|
1149
1177
|
],
|
1150
1178
|
"type": "object"
|
1151
1179
|
},
|
1180
|
+
"CreateEnvironmentRequest": {
|
1181
|
+
"document": "CreateEnvironment请求参数结构体",
|
1182
|
+
"members": [],
|
1183
|
+
"type": "object"
|
1184
|
+
},
|
1185
|
+
"CreateEnvironmentResponse": {
|
1186
|
+
"document": "CreateEnvironment返回参数结构体",
|
1187
|
+
"members": [
|
1188
|
+
{
|
1189
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
1190
|
+
"member": "string",
|
1191
|
+
"name": "RequestId",
|
1192
|
+
"type": "string"
|
1193
|
+
}
|
1194
|
+
],
|
1195
|
+
"type": "object"
|
1196
|
+
},
|
1152
1197
|
"CreateFileRequest": {
|
1153
1198
|
"document": "CreateFile请求参数结构体",
|
1154
1199
|
"members": [
|
@@ -1952,6 +1997,23 @@
|
|
1952
1997
|
],
|
1953
1998
|
"type": "object"
|
1954
1999
|
},
|
2000
|
+
"DeleteEnvironmentsRequest": {
|
2001
|
+
"document": "DeleteEnvironments请求参数结构体",
|
2002
|
+
"members": [],
|
2003
|
+
"type": "object"
|
2004
|
+
},
|
2005
|
+
"DeleteEnvironmentsResponse": {
|
2006
|
+
"document": "DeleteEnvironments返回参数结构体",
|
2007
|
+
"members": [
|
2008
|
+
{
|
2009
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
2010
|
+
"member": "string",
|
2011
|
+
"name": "RequestId",
|
2012
|
+
"type": "string"
|
2013
|
+
}
|
2014
|
+
],
|
2015
|
+
"type": "object"
|
2016
|
+
},
|
1955
2017
|
"DeleteFilesRequest": {
|
1956
2018
|
"document": "DeleteFiles请求参数结构体",
|
1957
2019
|
"members": [
|
@@ -2517,6 +2579,23 @@
|
|
2517
2579
|
],
|
2518
2580
|
"type": "object"
|
2519
2581
|
},
|
2582
|
+
"DescribeEnvironmentsRequest": {
|
2583
|
+
"document": "DescribeEnvironments请求参数结构体",
|
2584
|
+
"members": [],
|
2585
|
+
"type": "object"
|
2586
|
+
},
|
2587
|
+
"DescribeEnvironmentsResponse": {
|
2588
|
+
"document": "DescribeEnvironments返回参数结构体",
|
2589
|
+
"members": [
|
2590
|
+
{
|
2591
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
2592
|
+
"member": "string",
|
2593
|
+
"name": "RequestId",
|
2594
|
+
"type": "string"
|
2595
|
+
}
|
2596
|
+
],
|
2597
|
+
"type": "object"
|
2598
|
+
},
|
2520
2599
|
"DescribeErrorSummaryRequest": {
|
2521
2600
|
"document": "DescribeErrorSummary请求参数结构体",
|
2522
2601
|
"members": [
|
@@ -6983,6 +7062,23 @@
|
|
6983
7062
|
],
|
6984
7063
|
"type": "object"
|
6985
7064
|
},
|
7065
|
+
"UpdateEnvironmentRequest": {
|
7066
|
+
"document": "UpdateEnvironment请求参数结构体",
|
7067
|
+
"members": [],
|
7068
|
+
"type": "object"
|
7069
|
+
},
|
7070
|
+
"UpdateEnvironmentResponse": {
|
7071
|
+
"document": "UpdateEnvironment返回参数结构体",
|
7072
|
+
"members": [
|
7073
|
+
{
|
7074
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
7075
|
+
"member": "string",
|
7076
|
+
"name": "RequestId",
|
7077
|
+
"type": "string"
|
7078
|
+
}
|
7079
|
+
],
|
7080
|
+
"type": "object"
|
7081
|
+
},
|
6986
7082
|
"UpdateFileScenarioRelationRequest": {
|
6987
7083
|
"document": "UpdateFileScenarioRelation请求参数结构体",
|
6988
7084
|
"members": [
|
@@ -48,6 +48,14 @@
|
|
48
48
|
"title": "创建定时任务"
|
49
49
|
}
|
50
50
|
],
|
51
|
+
"CreateEnvironment": [
|
52
|
+
{
|
53
|
+
"document": "创建环境",
|
54
|
+
"input": "POST / HTTP/1.1\nHost: pts.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateEnvironment\n<公共请求参数>\n\n{}",
|
55
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\"\n }\n}",
|
56
|
+
"title": "创建环境"
|
57
|
+
}
|
58
|
+
],
|
51
59
|
"CreateFile": [
|
52
60
|
{
|
53
61
|
"document": "",
|
@@ -88,6 +96,14 @@
|
|
88
96
|
"title": "删除定时任务"
|
89
97
|
}
|
90
98
|
],
|
99
|
+
"DeleteEnvironments": [
|
100
|
+
{
|
101
|
+
"document": "删除环境",
|
102
|
+
"input": "POST / HTTP/1.1\nHost: pts.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DeleteEnvironments\n<公共请求参数>\n\n{}",
|
103
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\"\n }\n}",
|
104
|
+
"title": "删除环境"
|
105
|
+
}
|
106
|
+
],
|
91
107
|
"DeleteFiles": [
|
92
108
|
{
|
93
109
|
"document": "",
|
@@ -160,6 +176,14 @@
|
|
160
176
|
"title": "DescribeCronJobs"
|
161
177
|
}
|
162
178
|
],
|
179
|
+
"DescribeEnvironments": [
|
180
|
+
{
|
181
|
+
"document": "环境列表查询",
|
182
|
+
"input": "POST / HTTP/1.1\nHost: pts.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeEnvironments\n<公共请求参数>\n\n{}",
|
183
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\"\n }\n}",
|
184
|
+
"title": "环境列表查询"
|
185
|
+
}
|
186
|
+
],
|
163
187
|
"DescribeErrorSummary": [
|
164
188
|
{
|
165
189
|
"document": "查询错误汇总信息",
|
@@ -320,6 +344,14 @@
|
|
320
344
|
"title": "更新定时任务"
|
321
345
|
}
|
322
346
|
],
|
347
|
+
"UpdateEnvironment": [
|
348
|
+
{
|
349
|
+
"document": "更新环境",
|
350
|
+
"input": "POST / HTTP/1.1\nHost: pts.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: UpdateEnvironment\n<公共请求参数>\n\n{}",
|
351
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\"\n }\n}",
|
352
|
+
"title": "更新环境"
|
353
|
+
}
|
354
|
+
],
|
323
355
|
"UpdateFileScenarioRelation": [
|
324
356
|
{
|
325
357
|
"document": "",
|
@@ -1317,6 +1317,58 @@ def doCreateInstanceAccount(args, parsed_globals):
|
|
1317
1317
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
1318
|
|
1319
1319
|
|
1320
|
+
def doModifyInstanceEvent(args, parsed_globals):
|
1321
|
+
g_param = parse_global_arg(parsed_globals)
|
1322
|
+
|
1323
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1324
|
+
cred = credential.CVMRoleCredential()
|
1325
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1326
|
+
cred = credential.STSAssumeRoleCredential(
|
1327
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1328
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1329
|
+
)
|
1330
|
+
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):
|
1331
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1332
|
+
else:
|
1333
|
+
cred = credential.Credential(
|
1334
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1335
|
+
)
|
1336
|
+
http_profile = HttpProfile(
|
1337
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1338
|
+
reqMethod="POST",
|
1339
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1340
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1341
|
+
)
|
1342
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1343
|
+
if g_param[OptionsDefine.Language]:
|
1344
|
+
profile.language = g_param[OptionsDefine.Language]
|
1345
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1346
|
+
client = mod.RedisClient(cred, g_param[OptionsDefine.Region], profile)
|
1347
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1348
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1349
|
+
model = models.ModifyInstanceEventRequest()
|
1350
|
+
model.from_json_string(json.dumps(args))
|
1351
|
+
start_time = time.time()
|
1352
|
+
while True:
|
1353
|
+
rsp = client.ModifyInstanceEvent(model)
|
1354
|
+
result = rsp.to_json_string()
|
1355
|
+
try:
|
1356
|
+
json_obj = json.loads(result)
|
1357
|
+
except TypeError as e:
|
1358
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1359
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1360
|
+
break
|
1361
|
+
cur_time = time.time()
|
1362
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1363
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1364
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1365
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1366
|
+
else:
|
1367
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1368
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1369
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1370
|
+
|
1371
|
+
|
1320
1372
|
def doUpgradeProxyVersion(args, parsed_globals):
|
1321
1373
|
g_param = parse_global_arg(parsed_globals)
|
1322
1374
|
|
@@ -3761,6 +3813,58 @@ def doDescribeInstanceZoneInfo(args, parsed_globals):
|
|
3761
3813
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3762
3814
|
|
3763
3815
|
|
3816
|
+
def doDescribeInstanceEvents(args, parsed_globals):
|
3817
|
+
g_param = parse_global_arg(parsed_globals)
|
3818
|
+
|
3819
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3820
|
+
cred = credential.CVMRoleCredential()
|
3821
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3822
|
+
cred = credential.STSAssumeRoleCredential(
|
3823
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3824
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3825
|
+
)
|
3826
|
+
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):
|
3827
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3828
|
+
else:
|
3829
|
+
cred = credential.Credential(
|
3830
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3831
|
+
)
|
3832
|
+
http_profile = HttpProfile(
|
3833
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3834
|
+
reqMethod="POST",
|
3835
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3836
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3837
|
+
)
|
3838
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3839
|
+
if g_param[OptionsDefine.Language]:
|
3840
|
+
profile.language = g_param[OptionsDefine.Language]
|
3841
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3842
|
+
client = mod.RedisClient(cred, g_param[OptionsDefine.Region], profile)
|
3843
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3844
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3845
|
+
model = models.DescribeInstanceEventsRequest()
|
3846
|
+
model.from_json_string(json.dumps(args))
|
3847
|
+
start_time = time.time()
|
3848
|
+
while True:
|
3849
|
+
rsp = client.DescribeInstanceEvents(model)
|
3850
|
+
result = rsp.to_json_string()
|
3851
|
+
try:
|
3852
|
+
json_obj = json.loads(result)
|
3853
|
+
except TypeError as e:
|
3854
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3855
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3856
|
+
break
|
3857
|
+
cur_time = time.time()
|
3858
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3859
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3860
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3861
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3862
|
+
else:
|
3863
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3864
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3865
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3866
|
+
|
3867
|
+
|
3764
3868
|
def doSwitchInstanceVip(args, parsed_globals):
|
3765
3869
|
g_param = parse_global_arg(parsed_globals)
|
3766
3870
|
|
@@ -4993,6 +5097,7 @@ ACTION_MAP = {
|
|
4993
5097
|
"ChangeInstanceRole": doChangeInstanceRole,
|
4994
5098
|
"DescribeInstanceNodeInfo": doDescribeInstanceNodeInfo,
|
4995
5099
|
"CreateInstanceAccount": doCreateInstanceAccount,
|
5100
|
+
"ModifyInstanceEvent": doModifyInstanceEvent,
|
4996
5101
|
"UpgradeProxyVersion": doUpgradeProxyVersion,
|
4997
5102
|
"DescribeInstanceMonitorTopNCmdTook": doDescribeInstanceMonitorTopNCmdTook,
|
4998
5103
|
"ModifyAutoBackupConfig": doModifyAutoBackupConfig,
|
@@ -5040,6 +5145,7 @@ ACTION_MAP = {
|
|
5040
5145
|
"DescribeSlowLog": doDescribeSlowLog,
|
5041
5146
|
"DescribeBackupDownloadRestriction": doDescribeBackupDownloadRestriction,
|
5042
5147
|
"DescribeInstanceZoneInfo": doDescribeInstanceZoneInfo,
|
5148
|
+
"DescribeInstanceEvents": doDescribeInstanceEvents,
|
5043
5149
|
"SwitchInstanceVip": doSwitchInstanceVip,
|
5044
5150
|
"DescribeReplicationGroup": doDescribeReplicationGroup,
|
5045
5151
|
"InquiryPriceRenewInstance": doInquiryPriceRenewInstance,
|