第一次提交:阿龙电竞 Django 后端最新版本
This commit is contained in:
@@ -0,0 +1,255 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
# CAM签名/鉴权错误。
|
||||
AUTHFAILURE = 'AuthFailure'
|
||||
|
||||
# 鉴权错误
|
||||
AUTHFAILURE_UNAUTHORIZEDOPERATION = 'AuthFailure.UnauthorizedOperation'
|
||||
|
||||
# 调用 CVM 失败。
|
||||
FAILEDOPERATION_CVMERROR = 'FailedOperation.CVMError'
|
||||
|
||||
# 调用 Lighthouse 失败。
|
||||
FAILEDOPERATION_LIGHTHOUSEERROR = 'FailedOperation.LighthouseError'
|
||||
|
||||
# 内部错误。
|
||||
INTERNALERROR = 'InternalError'
|
||||
|
||||
# 无效的过滤器
|
||||
INVALIDFILTER = 'InvalidFilter'
|
||||
|
||||
# 参数错误。
|
||||
INVALIDPARAMETER = 'InvalidParameter'
|
||||
|
||||
# 参数冲突。
|
||||
INVALIDPARAMETER_CONFLICTPARAMETER = 'InvalidParameter.ConflictParameter'
|
||||
|
||||
# 无效用户名。
|
||||
INVALIDPARAMETER_INVALIDUSERNAME = 'InvalidParameter.InvalidUsername'
|
||||
|
||||
# 参数名称重复。
|
||||
INVALIDPARAMETER_PARAMETERNAMEDUPLICATED = 'InvalidParameter.ParameterNameDuplicated'
|
||||
|
||||
# 参数取值错误。
|
||||
INVALIDPARAMETERVALUE = 'InvalidParameterValue'
|
||||
|
||||
# Agent不支持此命令类型。
|
||||
INVALIDPARAMETERVALUE_AGENTUNSUPPORTEDCOMMANDTYPE = 'InvalidParameterValue.AgentUnsupportedCommandType'
|
||||
|
||||
# Command 内容无效。
|
||||
INVALIDPARAMETERVALUE_COMMANDCONTENTINVALID = 'InvalidParameterValue.CommandContentInvalid'
|
||||
|
||||
# Command 名称重复。
|
||||
INVALIDPARAMETERVALUE_COMMANDNAMEDUPLICATED = 'InvalidParameterValue.CommandNameDuplicated'
|
||||
|
||||
# ID 格式错误。
|
||||
INVALIDPARAMETERVALUE_ID = 'InvalidParameterValue.ID'
|
||||
|
||||
# ID 数组中,ID 格式错误或格式不一致。
|
||||
INVALIDPARAMETERVALUE_INCONSISTENTID = 'InvalidParameterValue.InconsistentID'
|
||||
|
||||
# 实例类型不一致。
|
||||
INVALIDPARAMETERVALUE_INCONSISTENTINSTANCE = 'InvalidParameterValue.InconsistentInstance'
|
||||
|
||||
# 实例ID与执行活动无关。
|
||||
INVALIDPARAMETERVALUE_INSTANCEISNOTRELATEDTOINVOCATION = 'InvalidParameterValue.InstanceIsNotRelatedToInvocation'
|
||||
|
||||
# CommandId 无效。
|
||||
INVALIDPARAMETERVALUE_INVALIDCOMMANDID = 'InvalidParameterValue.InvalidCommandId'
|
||||
|
||||
# Command 名称无效。
|
||||
INVALIDPARAMETERVALUE_INVALIDCOMMANDNAME = 'InvalidParameterValue.InvalidCommandName'
|
||||
|
||||
# 命令内容无效。
|
||||
INVALIDPARAMETERVALUE_INVALIDCONTENT = 'InvalidParameterValue.InvalidContent'
|
||||
|
||||
# Crontab 表达式无效。
|
||||
INVALIDPARAMETERVALUE_INVALIDCRONEXPRESSION = 'InvalidParameterValue.InvalidCronExpression'
|
||||
|
||||
# Filter 无效。
|
||||
INVALIDPARAMETERVALUE_INVALIDFILTER = 'InvalidParameterValue.InvalidFilter'
|
||||
|
||||
# 实例ID无效。
|
||||
INVALIDPARAMETERVALUE_INVALIDINSTANCEID = 'InvalidParameterValue.InvalidInstanceId'
|
||||
|
||||
# 不合法的执行活动ID。
|
||||
INVALIDPARAMETERVALUE_INVALIDINVOCATIONID = 'InvalidParameterValue.InvalidInvocationId'
|
||||
|
||||
# 不合法的执行任务ID。
|
||||
INVALIDPARAMETERVALUE_INVALIDINVOCATIONTASKID = 'InvalidParameterValue.InvalidInvocationTaskId'
|
||||
|
||||
# InvokerId 无效。
|
||||
INVALIDPARAMETERVALUE_INVALIDINVOKERID = 'InvalidParameterValue.InvalidInvokerId'
|
||||
|
||||
# OutputCOSBucketUrl 无效。
|
||||
INVALIDPARAMETERVALUE_INVALIDOUTPUTCOSBUCKETURL = 'InvalidParameterValue.InvalidOutputCOSBucketUrl'
|
||||
|
||||
# OutputCOSKeyPrefix 无效。
|
||||
INVALIDPARAMETERVALUE_INVALIDOUTPUTCOSKEYPREFIX = 'InvalidParameterValue.InvalidOutputCOSKeyPrefix'
|
||||
|
||||
# 无效的注册码ID。
|
||||
INVALIDPARAMETERVALUE_INVALIDREGISTERCODEID = 'InvalidParameterValue.InvalidRegisterCodeId'
|
||||
|
||||
# 无效的托管实例ID。
|
||||
INVALIDPARAMETERVALUE_INVALIDREGISTERINSTANCEID = 'InvalidParameterValue.InvalidRegisterInstanceId'
|
||||
|
||||
# 无效的场景 ID。
|
||||
INVALIDPARAMETERVALUE_INVALIDSCENEID = 'InvalidParameterValue.InvalidSceneId'
|
||||
|
||||
# 无效的场景名称。
|
||||
INVALIDPARAMETERVALUE_INVALIDSCENENAME = 'InvalidParameterValue.InvalidSceneName'
|
||||
|
||||
# 无效的时间格式。
|
||||
INVALIDPARAMETERVALUE_INVALIDTIMEFORMAT = 'InvalidParameterValue.InvalidTimeFormat'
|
||||
|
||||
# 用户名不合法。
|
||||
INVALIDPARAMETERVALUE_INVALIDUSERNAME = 'InvalidParameterValue.InvalidUsername'
|
||||
|
||||
# 命令执行路径不合法。
|
||||
INVALIDPARAMETERVALUE_INVALIDWORKINGDIRECTORY = 'InvalidParameterValue.InvalidWorkingDirectory'
|
||||
|
||||
# 调用时间已过期。
|
||||
INVALIDPARAMETERVALUE_INVOKETIMEEXPIRED = 'InvalidParameterValue.InvokeTimeExpired'
|
||||
|
||||
# 已启用自定义参数功能,但缺失自定义参数信息。
|
||||
INVALIDPARAMETERVALUE_LACKOFPARAMETERINFO = 'InvalidParameterValue.LackOfParameterInfo'
|
||||
|
||||
# 未提供 Parameters 信息。
|
||||
INVALIDPARAMETERVALUE_LACKOFPARAMETERS = 'InvalidParameterValue.LackOfParameters'
|
||||
|
||||
# 超过参数限制。
|
||||
INVALIDPARAMETERVALUE_LIMITEXCEEDED = 'InvalidParameterValue.LimitExceeded'
|
||||
|
||||
# 未启用自定义参数功能。
|
||||
INVALIDPARAMETERVALUE_PARAMETERDISABLED = 'InvalidParameterValue.ParameterDisabled'
|
||||
|
||||
# 参数为非法 json string 格式。
|
||||
INVALIDPARAMETERVALUE_PARAMETERINVALIDJSONFORMAT = 'InvalidParameterValue.ParameterInvalidJsonFormat'
|
||||
|
||||
# 参数 Key 包含非法字符。
|
||||
INVALIDPARAMETERVALUE_PARAMETERKEYCONTAINSINVALIDCHAR = 'InvalidParameterValue.ParameterKeyContainsInvalidChar'
|
||||
|
||||
# 参数 Key 重复。
|
||||
INVALIDPARAMETERVALUE_PARAMETERKEYDUPLICATED = 'InvalidParameterValue.ParameterKeyDuplicated'
|
||||
|
||||
# 参数 Key 过长。
|
||||
INVALIDPARAMETERVALUE_PARAMETERKEYLENEXCEEDED = 'InvalidParameterValue.ParameterKeyLenExceeded'
|
||||
|
||||
# 参数数目过多。
|
||||
INVALIDPARAMETERVALUE_PARAMETERNUMBEREXCEEDED = 'InvalidParameterValue.ParameterNumberExceeded'
|
||||
|
||||
# 参数 Value 非 string 类型。
|
||||
INVALIDPARAMETERVALUE_PARAMETERVALUENOTSTRING = 'InvalidParameterValue.ParameterValueNotString'
|
||||
|
||||
# 参数取值范围不合法。
|
||||
INVALIDPARAMETERVALUE_RANGE = 'InvalidParameterValue.Range'
|
||||
|
||||
# 未启用自定义参数功能。
|
||||
INVALIDPARAMETERVALUE_SUPPORTPARAMETERSONLYIFENABLEPARAMETER = 'InvalidParameterValue.SupportParametersOnlyIfEnableParameter'
|
||||
|
||||
# 参数取值过大。
|
||||
INVALIDPARAMETERVALUE_TOOLARGE = 'InvalidParameterValue.TooLarge'
|
||||
|
||||
# 长度超过限制。
|
||||
INVALIDPARAMETERVALUE_TOOLONG = 'InvalidParameterValue.TooLong'
|
||||
|
||||
# 参数取值过小。
|
||||
INVALIDPARAMETERVALUE_TOOSMALL = 'InvalidParameterValue.TooSmall'
|
||||
|
||||
# 超过配额限制。
|
||||
LIMITEXCEEDED = 'LimitExceeded'
|
||||
|
||||
# 填写的 Filter 取值过多。
|
||||
LIMITEXCEEDED_FILTERVALUEEXCEEDED = 'LimitExceeded.FilterValueExceeded'
|
||||
|
||||
# 缺少参数错误。
|
||||
MISSINGPARAMETER = 'MissingParameter'
|
||||
|
||||
# 操作被拒绝。
|
||||
OPERATIONDENIED = 'OperationDenied'
|
||||
|
||||
# 资源不存在。
|
||||
RESOURCENOTFOUND = 'ResourceNotFound'
|
||||
|
||||
# 命令不存在。
|
||||
RESOURCENOTFOUND_COMMANDNOTFOUND = 'ResourceNotFound.CommandNotFound'
|
||||
|
||||
# CosBucket不存在。
|
||||
RESOURCENOTFOUND_COSBUCKETNOTFOUNDCODE = 'ResourceNotFound.CosBucketNotFoundCode'
|
||||
|
||||
# 实例不存在。
|
||||
RESOURCENOTFOUND_INSTANCENOTFOUND = 'ResourceNotFound.InstanceNotFound'
|
||||
|
||||
# 执行活动未找到。
|
||||
RESOURCENOTFOUND_INVOCATIONNOTFOUND = 'ResourceNotFound.InvocationNotFound'
|
||||
|
||||
# 查询不到注册码。
|
||||
RESOURCENOTFOUND_REGISTERCODESNOTFOUNDCODE = 'ResourceNotFound.RegisterCodesNotFoundCode'
|
||||
|
||||
# 查询不到注册实例。
|
||||
RESOURCENOTFOUND_REGISTERINSTANCENOTFOUNDCODE = 'ResourceNotFound.RegisterInstanceNotFoundCode'
|
||||
|
||||
# 角色不存在。
|
||||
RESOURCENOTFOUND_ROLENOTFOUND = 'ResourceNotFound.RoleNotFound'
|
||||
|
||||
# 资源不可用。
|
||||
RESOURCEUNAVAILABLE = 'ResourceUnavailable'
|
||||
|
||||
# Agent 未安装。
|
||||
RESOURCEUNAVAILABLE_AGENTNOTINSTALLED = 'ResourceUnavailable.AgentNotInstalled'
|
||||
|
||||
# Agent 不在线。
|
||||
RESOURCEUNAVAILABLE_AGENTSTATUSNOTONLINE = 'ResourceUnavailable.AgentStatusNotOnline'
|
||||
|
||||
# 命令正在执行中。
|
||||
RESOURCEUNAVAILABLE_COMMANDINEXECUTING = 'ResourceUnavailable.CommandInExecuting'
|
||||
|
||||
# 命令已关联执行器。
|
||||
RESOURCEUNAVAILABLE_COMMANDININVOKER = 'ResourceUnavailable.CommandInInvoker'
|
||||
|
||||
# 实例未处于运行中。
|
||||
RESOURCEUNAVAILABLE_INSTANCESTATENOTRUNNING = 'ResourceUnavailable.InstanceStateNotRunning'
|
||||
|
||||
# 不存在的资源名称
|
||||
RESOURCEUNAVAILABLE_INVALIDRESOURCEQUOTARESOURCECODE = 'ResourceUnavailable.InvalidResourceQuotaResourceCode'
|
||||
|
||||
# Lighthouse 尚不支持指定的地域。
|
||||
RESOURCEUNAVAILABLE_LIGHTHOUSEUNSUPPORTEDREGION = 'ResourceUnavailable.LighthouseUnsupportedRegion'
|
||||
|
||||
# 用户配额已用完
|
||||
RESOURCEUNAVAILABLE_USERHASNOQUOTACODE = 'ResourceUnavailable.UserHasNoQuotaCode'
|
||||
|
||||
# 角色扮演未授权。
|
||||
UNAUTHORIZEDOPERATION_ASSUMEROLEUNAUTHORIZED = 'UnauthorizedOperation.AssumeRoleUnauthorized'
|
||||
|
||||
# CAM鉴权失败。
|
||||
UNAUTHORIZEDOPERATION_CAMAUTHFAILED = 'UnauthorizedOperation.CamAuthFailed'
|
||||
|
||||
# Token 无效。
|
||||
UNAUTHORIZEDOPERATION_INVALIDTOKEN = 'UnauthorizedOperation.InvalidToken'
|
||||
|
||||
# Multi-Factor Authentication(MFA) 过期。
|
||||
UNAUTHORIZEDOPERATION_MFAEXPIRED = 'UnauthorizedOperation.MFAExpired'
|
||||
|
||||
# Multi-Factor Authentication(MFA) 不存在。
|
||||
UNAUTHORIZEDOPERATION_MFANOTFOUND = 'UnauthorizedOperation.MFANotFound'
|
||||
|
||||
# 未知参数错误。
|
||||
UNKNOWNPARAMETER = 'UnknownParameter'
|
||||
|
||||
# 操作不支持。
|
||||
UNSUPPORTEDOPERATION = 'UnsupportedOperation'
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,710 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
|
||||
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
|
||||
from tencentcloud.common.abstract_client import AbstractClient
|
||||
from tencentcloud.tat.v20201028 import models
|
||||
|
||||
|
||||
class TatClient(AbstractClient):
|
||||
_apiVersion = '2020-10-28'
|
||||
_endpoint = 'tat.tencentcloudapi.com'
|
||||
_service = 'tat'
|
||||
|
||||
|
||||
def CancelInvocation(self, request):
|
||||
r"""取消一台或多台实例执行的命令
|
||||
|
||||
* 如果命令还未下发到agent,任务状态处于PENDING、DELIVERING、DELIVER_DELAYED,取消后任务状态是CANCELLED
|
||||
* 如果命令已下发到agent,任务状态处于RUNNING, 取消后任务状态是TERMINATED
|
||||
|
||||
:param request: Request instance for CancelInvocation.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.CancelInvocationRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.CancelInvocationResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CancelInvocation", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CancelInvocationResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CreateCommand(self, request):
|
||||
r"""此接口用于创建命令。
|
||||
|
||||
:param request: Request instance for CreateCommand.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.CreateCommandRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.CreateCommandResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreateCommand", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreateCommandResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CreateInvoker(self, request):
|
||||
r"""此接口用于创建执行器。
|
||||
|
||||
:param request: Request instance for CreateInvoker.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.CreateInvokerRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.CreateInvokerResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreateInvoker", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreateInvokerResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CreateRegisterCode(self, request):
|
||||
r"""接口用于创建注册码。
|
||||
|
||||
:param request: Request instance for CreateRegisterCode.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.CreateRegisterCodeRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.CreateRegisterCodeResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreateRegisterCode", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreateRegisterCodeResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeleteCommand(self, request):
|
||||
r"""此接口用于删除命令。
|
||||
如果命令与执行器关联,则无法被删除。
|
||||
|
||||
:param request: Request instance for DeleteCommand.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DeleteCommandRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DeleteCommandResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeleteCommand", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeleteCommandResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeleteCommands(self, request):
|
||||
r"""批量删除命令接口
|
||||
|
||||
:param request: Request instance for DeleteCommands.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DeleteCommandsRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DeleteCommandsResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeleteCommands", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeleteCommandsResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeleteInvoker(self, request):
|
||||
r"""此接口用于删除执行器。
|
||||
|
||||
:param request: Request instance for DeleteInvoker.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DeleteInvokerRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DeleteInvokerResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeleteInvoker", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeleteInvokerResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeleteRegisterCodes(self, request):
|
||||
r"""此接口用于批量删除注册码。
|
||||
|
||||
:param request: Request instance for DeleteRegisterCodes.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DeleteRegisterCodesRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DeleteRegisterCodesResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeleteRegisterCodes", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeleteRegisterCodesResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeleteRegisterInstance(self, request):
|
||||
r"""接口用于删除托管实例。
|
||||
|
||||
:param request: Request instance for DeleteRegisterInstance.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DeleteRegisterInstanceRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DeleteRegisterInstanceResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeleteRegisterInstance", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeleteRegisterInstanceResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeAutomationAgentStatus(self, request):
|
||||
r"""此接口用于查询自动化助手客户端的状态。
|
||||
|
||||
:param request: Request instance for DescribeAutomationAgentStatus.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeAutomationAgentStatusRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeAutomationAgentStatusResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeAutomationAgentStatus", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeAutomationAgentStatusResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeCommands(self, request):
|
||||
r"""此接口用于查询命令详情。
|
||||
|
||||
:param request: Request instance for DescribeCommands.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeCommandsRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeCommandsResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeCommands", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeCommandsResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeInvocationTasks(self, request):
|
||||
r"""此接口用于查询执行任务详情。
|
||||
|
||||
:param request: Request instance for DescribeInvocationTasks.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeInvocationTasksRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeInvocationTasksResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeInvocationTasks", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeInvocationTasksResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeInvocations(self, request):
|
||||
r"""此接口用于查询执行活动详情。
|
||||
|
||||
:param request: Request instance for DescribeInvocations.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeInvocationsRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeInvocationsResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeInvocations", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeInvocationsResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeInvokerRecords(self, request):
|
||||
r"""此接口用于查询执行器的执行记录。
|
||||
|
||||
:param request: Request instance for DescribeInvokerRecords.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeInvokerRecordsRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeInvokerRecordsResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeInvokerRecords", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeInvokerRecordsResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeInvokers(self, request):
|
||||
r"""此接口用于查询执行器信息。
|
||||
|
||||
:param request: Request instance for DescribeInvokers.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeInvokersRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeInvokersResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeInvokers", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeInvokersResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeQuotas(self, request):
|
||||
r"""此接口用于获取配额信息
|
||||
|
||||
:param request: Request instance for DescribeQuotas.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeQuotasRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeQuotasResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeQuotas", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeQuotasResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeRegions(self, request):
|
||||
r"""此接口用于查询 TAT 产品后台地域列表。
|
||||
RegionState 为 AVAILABLE,代表该地域的 TAT 后台服务已经可用;未返回,代表该地域的 TAT 后台服务尚不可用。
|
||||
|
||||
:param request: Request instance for DescribeRegions.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeRegionsRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeRegionsResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeRegions", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeRegionsResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeRegisterCodes(self, request):
|
||||
r"""接口用于查询注册码信息。
|
||||
|
||||
:param request: Request instance for DescribeRegisterCodes.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeRegisterCodesRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeRegisterCodesResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeRegisterCodes", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeRegisterCodesResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeRegisterInstances(self, request):
|
||||
r"""接口用于查询被托管的实例信息。
|
||||
|
||||
:param request: Request instance for DescribeRegisterInstances.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeRegisterInstancesRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeRegisterInstancesResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeRegisterInstances", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeRegisterInstancesResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeScenes(self, request):
|
||||
r"""此接口用于查询场景详情。
|
||||
|
||||
:param request: Request instance for DescribeScenes.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DescribeScenesRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DescribeScenesResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeScenes", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeScenesResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DisableInvoker(self, request):
|
||||
r"""此接口用于停止执行器。
|
||||
|
||||
:param request: Request instance for DisableInvoker.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DisableInvokerRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DisableInvokerResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DisableInvoker", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DisableInvokerResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DisableRegisterCodes(self, request):
|
||||
r"""此接口用于批量禁用注册码。
|
||||
|
||||
:param request: Request instance for DisableRegisterCodes.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.DisableRegisterCodesRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.DisableRegisterCodesResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DisableRegisterCodes", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DisableRegisterCodesResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def EnableInvoker(self, request):
|
||||
r"""此接口用于启用执行器。
|
||||
|
||||
:param request: Request instance for EnableInvoker.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.EnableInvokerRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.EnableInvokerResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("EnableInvoker", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.EnableInvokerResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def InvokeCommand(self, request):
|
||||
r"""在指定的实例上触发命令,调用成功返回执行活动ID(inv-xxxxxxxx),每个执行活动内部有一个或多个执行任务(invt-xxxxxxxx),每个执行任务代表命令在一台 CVM 或一台 Lighthouse 上的执行记录。
|
||||
|
||||
* 如果指定实例未安装 agent,或 agent 不在线,返回失败
|
||||
* 如果命令类型与 agent 运行环境不符,返回失败
|
||||
* 指定的实例需要处于 VPC 网络
|
||||
* 指定的实例需要处于 RUNNING 状态
|
||||
* 不可同时指定 CVM 和 Lighthouse
|
||||
|
||||
:param request: Request instance for InvokeCommand.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.InvokeCommandRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.InvokeCommandResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("InvokeCommand", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.InvokeCommandResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def ModifyCommand(self, request):
|
||||
r"""此接口用于修改命令。
|
||||
|
||||
:param request: Request instance for ModifyCommand.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.ModifyCommandRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.ModifyCommandResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("ModifyCommand", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.ModifyCommandResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def ModifyInvoker(self, request):
|
||||
r"""此接口用于修改执行器。
|
||||
|
||||
:param request: Request instance for ModifyInvoker.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.ModifyInvokerRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.ModifyInvokerResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("ModifyInvoker", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.ModifyInvokerResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def ModifyRegisterInstance(self, request):
|
||||
r"""接口用于修改托管实例信息。
|
||||
|
||||
:param request: Request instance for ModifyRegisterInstance.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.ModifyRegisterInstanceRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.ModifyRegisterInstanceResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("ModifyRegisterInstance", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.ModifyRegisterInstanceResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def PreviewReplacedCommandContent(self, request):
|
||||
r"""此接口用于预览自定义参数替换后的命令内容。不会触发真实执行。
|
||||
|
||||
:param request: Request instance for PreviewReplacedCommandContent.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.PreviewReplacedCommandContentRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.PreviewReplacedCommandContentResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("PreviewReplacedCommandContent", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.PreviewReplacedCommandContentResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def RunCommand(self, request):
|
||||
r"""执行命令,调用成功返回执行活动ID(inv-xxxxxxxx),每个执行活动内部有一个或多个执行任务(invt-xxxxxxxx),每个执行任务代表命令在一台 CVM 或一台 Lighthouse 上的执行记录。
|
||||
|
||||
* 如果指定实例未安装 agent,或 agent 不在线,返回失败
|
||||
* 如果命令类型与 agent 运行环境不符,返回失败
|
||||
* 指定的实例需要处于 VPC 网络
|
||||
* 指定的实例需要处于 `RUNNING` 状态
|
||||
* 不可同时指定 CVM 和 Lighthouse
|
||||
|
||||
:param request: Request instance for RunCommand.
|
||||
:type request: :class:`tencentcloud.tat.v20201028.models.RunCommandRequest`
|
||||
:rtype: :class:`tencentcloud.tat.v20201028.models.RunCommandResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("RunCommand", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.RunCommandResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
@@ -0,0 +1,565 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
|
||||
from tencentcloud.common.abstract_client_async import AbstractClient
|
||||
from tencentcloud.tat.v20201028 import models
|
||||
from typing import Dict
|
||||
|
||||
|
||||
class TatClient(AbstractClient):
|
||||
_apiVersion = '2020-10-28'
|
||||
_endpoint = 'tat.tencentcloudapi.com'
|
||||
_service = 'tat'
|
||||
|
||||
async def CancelInvocation(
|
||||
self,
|
||||
request: models.CancelInvocationRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CancelInvocationResponse:
|
||||
"""
|
||||
取消一台或多台实例执行的命令
|
||||
|
||||
* 如果命令还未下发到agent,任务状态处于PENDING、DELIVERING、DELIVER_DELAYED,取消后任务状态是CANCELLED
|
||||
* 如果命令已下发到agent,任务状态处于RUNNING, 取消后任务状态是TERMINATED
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CancelInvocation"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CancelInvocationResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CreateCommand(
|
||||
self,
|
||||
request: models.CreateCommandRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreateCommandResponse:
|
||||
"""
|
||||
此接口用于创建命令。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreateCommand"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreateCommandResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CreateInvoker(
|
||||
self,
|
||||
request: models.CreateInvokerRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreateInvokerResponse:
|
||||
"""
|
||||
此接口用于创建执行器。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreateInvoker"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreateInvokerResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CreateRegisterCode(
|
||||
self,
|
||||
request: models.CreateRegisterCodeRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreateRegisterCodeResponse:
|
||||
"""
|
||||
接口用于创建注册码。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreateRegisterCode"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreateRegisterCodeResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeleteCommand(
|
||||
self,
|
||||
request: models.DeleteCommandRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeleteCommandResponse:
|
||||
"""
|
||||
此接口用于删除命令。
|
||||
如果命令与执行器关联,则无法被删除。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeleteCommand"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeleteCommandResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeleteCommands(
|
||||
self,
|
||||
request: models.DeleteCommandsRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeleteCommandsResponse:
|
||||
"""
|
||||
批量删除命令接口
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeleteCommands"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeleteCommandsResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeleteInvoker(
|
||||
self,
|
||||
request: models.DeleteInvokerRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeleteInvokerResponse:
|
||||
"""
|
||||
此接口用于删除执行器。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeleteInvoker"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeleteInvokerResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeleteRegisterCodes(
|
||||
self,
|
||||
request: models.DeleteRegisterCodesRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeleteRegisterCodesResponse:
|
||||
"""
|
||||
此接口用于批量删除注册码。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeleteRegisterCodes"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeleteRegisterCodesResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeleteRegisterInstance(
|
||||
self,
|
||||
request: models.DeleteRegisterInstanceRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeleteRegisterInstanceResponse:
|
||||
"""
|
||||
接口用于删除托管实例。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeleteRegisterInstance"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeleteRegisterInstanceResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeAutomationAgentStatus(
|
||||
self,
|
||||
request: models.DescribeAutomationAgentStatusRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeAutomationAgentStatusResponse:
|
||||
"""
|
||||
此接口用于查询自动化助手客户端的状态。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeAutomationAgentStatus"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeAutomationAgentStatusResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeCommands(
|
||||
self,
|
||||
request: models.DescribeCommandsRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeCommandsResponse:
|
||||
"""
|
||||
此接口用于查询命令详情。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeCommands"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeCommandsResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeInvocationTasks(
|
||||
self,
|
||||
request: models.DescribeInvocationTasksRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeInvocationTasksResponse:
|
||||
"""
|
||||
此接口用于查询执行任务详情。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeInvocationTasks"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeInvocationTasksResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeInvocations(
|
||||
self,
|
||||
request: models.DescribeInvocationsRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeInvocationsResponse:
|
||||
"""
|
||||
此接口用于查询执行活动详情。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeInvocations"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeInvocationsResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeInvokerRecords(
|
||||
self,
|
||||
request: models.DescribeInvokerRecordsRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeInvokerRecordsResponse:
|
||||
"""
|
||||
此接口用于查询执行器的执行记录。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeInvokerRecords"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeInvokerRecordsResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeInvokers(
|
||||
self,
|
||||
request: models.DescribeInvokersRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeInvokersResponse:
|
||||
"""
|
||||
此接口用于查询执行器信息。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeInvokers"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeInvokersResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeQuotas(
|
||||
self,
|
||||
request: models.DescribeQuotasRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeQuotasResponse:
|
||||
"""
|
||||
此接口用于获取配额信息
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeQuotas"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeQuotasResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeRegions(
|
||||
self,
|
||||
request: models.DescribeRegionsRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeRegionsResponse:
|
||||
"""
|
||||
此接口用于查询 TAT 产品后台地域列表。
|
||||
RegionState 为 AVAILABLE,代表该地域的 TAT 后台服务已经可用;未返回,代表该地域的 TAT 后台服务尚不可用。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeRegions"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeRegionsResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeRegisterCodes(
|
||||
self,
|
||||
request: models.DescribeRegisterCodesRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeRegisterCodesResponse:
|
||||
"""
|
||||
接口用于查询注册码信息。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeRegisterCodes"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeRegisterCodesResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeRegisterInstances(
|
||||
self,
|
||||
request: models.DescribeRegisterInstancesRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeRegisterInstancesResponse:
|
||||
"""
|
||||
接口用于查询被托管的实例信息。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeRegisterInstances"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeRegisterInstancesResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeScenes(
|
||||
self,
|
||||
request: models.DescribeScenesRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeScenesResponse:
|
||||
"""
|
||||
此接口用于查询场景详情。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeScenes"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeScenesResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DisableInvoker(
|
||||
self,
|
||||
request: models.DisableInvokerRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DisableInvokerResponse:
|
||||
"""
|
||||
此接口用于停止执行器。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DisableInvoker"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DisableInvokerResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DisableRegisterCodes(
|
||||
self,
|
||||
request: models.DisableRegisterCodesRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DisableRegisterCodesResponse:
|
||||
"""
|
||||
此接口用于批量禁用注册码。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DisableRegisterCodes"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DisableRegisterCodesResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def EnableInvoker(
|
||||
self,
|
||||
request: models.EnableInvokerRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.EnableInvokerResponse:
|
||||
"""
|
||||
此接口用于启用执行器。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "EnableInvoker"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.EnableInvokerResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def InvokeCommand(
|
||||
self,
|
||||
request: models.InvokeCommandRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.InvokeCommandResponse:
|
||||
"""
|
||||
在指定的实例上触发命令,调用成功返回执行活动ID(inv-xxxxxxxx),每个执行活动内部有一个或多个执行任务(invt-xxxxxxxx),每个执行任务代表命令在一台 CVM 或一台 Lighthouse 上的执行记录。
|
||||
|
||||
* 如果指定实例未安装 agent,或 agent 不在线,返回失败
|
||||
* 如果命令类型与 agent 运行环境不符,返回失败
|
||||
* 指定的实例需要处于 VPC 网络
|
||||
* 指定的实例需要处于 RUNNING 状态
|
||||
* 不可同时指定 CVM 和 Lighthouse
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "InvokeCommand"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.InvokeCommandResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def ModifyCommand(
|
||||
self,
|
||||
request: models.ModifyCommandRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.ModifyCommandResponse:
|
||||
"""
|
||||
此接口用于修改命令。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "ModifyCommand"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.ModifyCommandResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def ModifyInvoker(
|
||||
self,
|
||||
request: models.ModifyInvokerRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.ModifyInvokerResponse:
|
||||
"""
|
||||
此接口用于修改执行器。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "ModifyInvoker"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.ModifyInvokerResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def ModifyRegisterInstance(
|
||||
self,
|
||||
request: models.ModifyRegisterInstanceRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.ModifyRegisterInstanceResponse:
|
||||
"""
|
||||
接口用于修改托管实例信息。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "ModifyRegisterInstance"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.ModifyRegisterInstanceResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def PreviewReplacedCommandContent(
|
||||
self,
|
||||
request: models.PreviewReplacedCommandContentRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.PreviewReplacedCommandContentResponse:
|
||||
"""
|
||||
此接口用于预览自定义参数替换后的命令内容。不会触发真实执行。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "PreviewReplacedCommandContent"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.PreviewReplacedCommandContentResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def RunCommand(
|
||||
self,
|
||||
request: models.RunCommandRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.RunCommandResponse:
|
||||
"""
|
||||
执行命令,调用成功返回执行活动ID(inv-xxxxxxxx),每个执行活动内部有一个或多个执行任务(invt-xxxxxxxx),每个执行任务代表命令在一台 CVM 或一台 Lighthouse 上的执行记录。
|
||||
|
||||
* 如果指定实例未安装 agent,或 agent 不在线,返回失败
|
||||
* 如果命令类型与 agent 运行环境不符,返回失败
|
||||
* 指定的实例需要处于 VPC 网络
|
||||
* 指定的实例需要处于 `RUNNING` 状态
|
||||
* 不可同时指定 CVM 和 Lighthouse
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "RunCommand"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.RunCommandResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
Reference in New Issue
Block a user