text: # -*- coding: utf8 -*-
  # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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.tke.v20180525 import models
  
  
  class TkeClient(AbstractClient):
      _apiVersion = '2018-05-25'
      _endpoint = 'tke.tencentcloudapi.com'
  
  
      def AddExistedInstances(self, request):
          """添加已经存在的实例到集群
  
          :param request: Request instance for AddExistedInstances.
          :type request: :class:`tencentcloud.tke.v20180525.models.AddExistedInstancesRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.AddExistedInstancesResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("AddExistedInstances", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.AddExistedInstancesResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def CreateCluster(self, request):
          """创建集群
  
          :param request: Request instance for CreateCluster.
          :type request: :class:`tencentcloud.tke.v20180525.models.CreateClusterRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.CreateClusterResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("CreateCluster", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.CreateClusterResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def CreateClusterAsGroup(self, request):
          """为已经存在的集群创建伸缩组
  
          :param request: Request instance for CreateClusterAsGroup.
          :type request: :class:`tencentcloud.tke.v20180525.models.CreateClusterAsGroupRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.CreateClusterAsGroupResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("CreateClusterAsGroup", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.CreateClusterAsGroupResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def CreateClusterEndpoint(self, request):
          """创建集群访问端口(独立集群开启内网/外网访问，托管集群支持开启内网访问)
  
          :param request: Request instance for CreateClusterEndpoint.
          :type request: :class:`tencentcloud.tke.v20180525.models.CreateClusterEndpointRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.CreateClusterEndpointResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("CreateClusterEndpoint", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.CreateClusterEndpointResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def CreateClusterEndpointVip(self, request):
          """创建托管集群外网访问端口（老的方式，仅支持托管集群外网端口）
  
          :param request: Request instance for CreateClusterEndpointVip.
          :type request: :class:`tencentcloud.tke.v20180525.models.CreateClusterEndpointVipRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.CreateClusterEndpointVipResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("CreateClusterEndpointVip", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.CreateClusterEndpointVipResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def CreateClusterInstances(self, request):
          """扩展(新建)集群节点
  
          :param request: Request instance for CreateClusterInstances.
          :type request: :class:`tencentcloud.tke.v20180525.models.CreateClusterInstancesRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.CreateClusterInstancesResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("CreateClusterInstances", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.CreateClusterInstancesResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def CreateClusterRoute(self, request):
          """创建集群路由
  
          :param request: Request instance for CreateClusterRoute.
          :type request: :class:`tencentcloud.tke.v20180525.models.CreateClusterRouteRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.CreateClusterRouteResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("CreateClusterRoute", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.CreateClusterRouteResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def CreateClusterRouteTable(self, request):
          """创建集群路由表
  
          :param request: Request instance for CreateClusterRouteTable.
          :type request: :class:`tencentcloud.tke.v20180525.models.CreateClusterRouteTableRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.CreateClusterRouteTableResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("CreateClusterRouteTable", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.CreateClusterRouteTableResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DeleteCluster(self, request):
          """删除集群(YUNAPI V3版本)
  
          :param request: Request instance for DeleteCluster.
          :type request: :class:`tencentcloud.tke.v20180525.models.DeleteClusterRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DeleteClusterResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DeleteCluster", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DeleteClusterResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DeleteClusterAsGroups(self, request):
          """删除集群伸缩组
  
          :param request: Request instance for DeleteClusterAsGroups.
          :type request: :class:`tencentcloud.tke.v20180525.models.DeleteClusterAsGroupsRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DeleteClusterAsGroupsResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DeleteClusterAsGroups", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DeleteClusterAsGroupsResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DeleteClusterEndpoint(self, request):
          """删除集群访问端口(独立集群开启内网/外网访问，托管集群支持开启内网访问)
  
          :param request: Request instance for DeleteClusterEndpoint.
          :type request: :class:`tencentcloud.tke.v20180525.models.DeleteClusterEndpointRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DeleteClusterEndpointResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DeleteClusterEndpoint", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DeleteClusterEndpointResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DeleteClusterEndpointVip(self, request):
          """删除托管集群外网访问端口（老的方式，仅支持托管集群外网端口）
  
          :param request: Request instance for DeleteClusterEndpointVip.
          :type request: :class:`tencentcloud.tke.v20180525.models.DeleteClusterEndpointVipRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DeleteClusterEndpointVipResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DeleteClusterEndpointVip", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DeleteClusterEndpointVipResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DeleteClusterInstances(self, request):
          """删除集群中的实例
  
          :param request: Request instance for DeleteClusterInstances.
          :type request: :class:`tencentcloud.tke.v20180525.models.DeleteClusterInstancesRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DeleteClusterInstancesResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DeleteClusterInstances", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DeleteClusterInstancesResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DeleteClusterRoute(self, request):
          """删除集群路由
  
          :param request: Request instance for DeleteClusterRoute.
          :type request: :class:`tencentcloud.tke.v20180525.models.DeleteClusterRouteRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DeleteClusterRouteResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DeleteClusterRoute", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DeleteClusterRouteResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DeleteClusterRouteTable(self, request):
          """删除集群路由表
  
          :param request: Request instance for DeleteClusterRouteTable.
          :type request: :class:`tencentcloud.tke.v20180525.models.DeleteClusterRouteTableRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DeleteClusterRouteTableResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DeleteClusterRouteTable", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DeleteClusterRouteTableResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeClusterAsGroupOption(self, request):
          """集群弹性伸缩配置
  
          :param request: Request instance for DescribeClusterAsGroupOption.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeClusterAsGroupOptionRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeClusterAsGroupOptionResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeClusterAsGroupOption", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeClusterAsGroupOptionResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeClusterAsGroups(self, request):
          """集群关联的伸缩组列表
  
          :param request: Request instance for DescribeClusterAsGroups.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeClusterAsGroupsRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeClusterAsGroupsResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeClusterAsGroups", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeClusterAsGroupsResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeClusterEndpointStatus(self, request):
          """查询集群访问端口状态(独立集群开启内网/外网访问，托管集群支持开启内网访问)
  
          :param request: Request instance for DescribeClusterEndpointStatus.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeClusterEndpointStatusRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeClusterEndpointStatusResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeClusterEndpointStatus", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeClusterEndpointStatusResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeClusterEndpointVipStatus(self, request):
          """查询集群开启端口流程状态(仅支持托管集群外网端口)
  
          :param request: Request instance for DescribeClusterEndpointVipStatus.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeClusterEndpointVipStatusRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeClusterEndpointVipStatusResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeClusterEndpointVipStatus", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeClusterEndpointVipStatusResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeClusterInstances(self, request):
          """查询集群下节点实例信息
  
          :param request: Request instance for DescribeClusterInstances.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeClusterInstancesRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeClusterInstancesResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeClusterInstances", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeClusterInstancesResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeClusterRouteTables(self, request):
          """查询集群路由表
  
          :param request: Request instance for DescribeClusterRouteTables.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeClusterRouteTablesRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeClusterRouteTablesResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeClusterRouteTables", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeClusterRouteTablesResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeClusterRoutes(self, request):
          """查询集群路由
  
          :param request: Request instance for DescribeClusterRoutes.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeClusterRoutesRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeClusterRoutesResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeClusterRoutes", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeClusterRoutesResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeClusterSecurity(self, request):
          """集群的密钥信息
  
          :param request: Request instance for DescribeClusterSecurity.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeClusterSecurityRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeClusterSecurityResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeClusterSecurity", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeClusterSecurityResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeClusters(self, request):
          """查询集群列表
  
          :param request: Request instance for DescribeClusters.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeClustersRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeClustersResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeClusters", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeClustersResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeExistedInstances(self, request):
          """查询已经存在的节点，判断是否可以加入集群
  
          :param request: Request instance for DescribeExistedInstances.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeExistedInstancesRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeExistedInstancesResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeExistedInstances", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeExistedInstancesResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeImages(self, request):
          """获取镜像信息
  
          :param request: Request instance for DescribeImages.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeImagesRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeImagesResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeImages", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeImagesResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeRegions(self, request):
          """获取容器服务支持的所有地域
  
          :param request: Request instance for DescribeRegions.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeRegionsRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeRegionsResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeRegions", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeRegionsResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def DescribeRouteTableConflicts(self, request):
          """查询路由表冲突列表
  
          :param request: Request instance for DescribeRouteTableConflicts.
          :type request: :class:`tencentcloud.tke.v20180525.models.DescribeRouteTableConflictsRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.DescribeRouteTableConflictsResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("DescribeRouteTableConflicts", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.DescribeRouteTableConflictsResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ModifyClusterAsGroupAttribute(self, request):
          """修改集群伸缩组属性
  
          :param request: Request instance for ModifyClusterAsGroupAttribute.
          :type request: :class:`tencentcloud.tke.v20180525.models.ModifyClusterAsGroupAttributeRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.ModifyClusterAsGroupAttributeResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ModifyClusterAsGroupAttribute", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ModifyClusterAsGroupAttributeResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ModifyClusterAttribute(self, request):
          """修改集群属性
  
          :param request: Request instance for ModifyClusterAttribute.
          :type request: :class:`tencentcloud.tke.v20180525.models.ModifyClusterAttributeRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.ModifyClusterAttributeResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ModifyClusterAttribute", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ModifyClusterAttributeResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)
  
  
      def ModifyClusterEndpointSP(self, request):
          """修改托管集群外网端口的安全策略（老的方式，仅支持托管集群外网端口）
  
          :param request: Request instance for ModifyClusterEndpointSP.
          :type request: :class:`tencentcloud.tke.v20180525.models.ModifyClusterEndpointSPRequest`
          :rtype: :class:`tencentcloud.tke.v20180525.models.ModifyClusterEndpointSPResponse`
  
          """
          try:
              params = request._serialize()
              body = self.call("ModifyClusterEndpointSP", params)
              response = json.loads(body)
              if "Error" not in response["Response"]:
                  model = models.ModifyClusterEndpointSPResponse()
                  model._deserialize(response["Response"])
                  return model
              else:
                  code = response["Response"]["Error"]["Code"]
                  message = response["Response"]["Error"]["Message"]
                  reqid = response["Response"]["RequestId"]
                  raise TencentCloudSDKException(code, message, reqid)
          except Exception as e:
              if isinstance(e, TencentCloudSDKException):
                  raise
              else:
                  raise TencentCloudSDKException(e.message, e.message)