text: # -*- coding: utf-8 -*-
  import os
  import json
  import tccli.options_define as OptionsDefine
  import tccli.format_output as FormatOutput
  from tccli.nice_command import NiceCommand
  import tccli.error_msg as ErrorMsg
  import tccli.help_template as HelpTemplate
  from tccli import __version__
  from tccli.utils import Utils
  from tccli.configure import Configure
  from tencentcloud.common import credential
  from tencentcloud.common.profile.http_profile import HttpProfile
  from tencentcloud.common.profile.client_profile import ClientProfile
  from tencentcloud.tcaplusdb.v20190823 import tcaplusdb_client as tcaplusdb_client_v20190823
  from tencentcloud.tcaplusdb.v20190823 import models as models_v20190823
  from tccli.services.tcaplusdb import v20190823
  from tccli.services.tcaplusdb.v20190823 import help as v20190823_help
  
  
  def doCreateCluster(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("CreateCluster", g_param[OptionsDefine.Version])
          return
  
      param = {
          "IdlType": argv.get("--IdlType"),
          "ClusterName": argv.get("--ClusterName"),
          "VpcId": argv.get("--VpcId"),
          "SubnetId": argv.get("--SubnetId"),
          "Password": argv.get("--Password"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.CreateClusterRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.CreateCluster(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDescribeUinInWhitelist(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeUinInWhitelist", g_param[OptionsDefine.Version])
          return
  
      param = {
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeUinInWhitelistRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeUinInWhitelist(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDescribeTablesInRecycle(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeTablesInRecycle", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "TableGroupIds": Utils.try_to_json(argv, "--TableGroupIds"),
          "Filters": Utils.try_to_json(argv, "--Filters"),
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeTablesInRecycleRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeTablesInRecycle(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doRollbackTables(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("RollbackTables", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "SelectedTables": Utils.try_to_json(argv, "--SelectedTables"),
          "RollbackTime": argv.get("--RollbackTime"),
          "Mode": argv.get("--Mode"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.RollbackTablesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.RollbackTables(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doModifyClusterName(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyClusterName", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "ClusterName": argv.get("--ClusterName"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyClusterNameRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyClusterName(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDeleteCluster(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DeleteCluster", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DeleteClusterRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DeleteCluster(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doModifyClusterPassword(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyClusterPassword", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "OldPassword": argv.get("--OldPassword"),
          "OldPasswordExpireTime": argv.get("--OldPasswordExpireTime"),
          "NewPassword": argv.get("--NewPassword"),
          "Mode": argv.get("--Mode"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyClusterPasswordRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyClusterPassword(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDeleteIdlFiles(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DeleteIdlFiles", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "IdlFiles": Utils.try_to_json(argv, "--IdlFiles"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DeleteIdlFilesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DeleteIdlFiles(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doRecoverRecycleTables(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("RecoverRecycleTables", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "SelectedTables": Utils.try_to_json(argv, "--SelectedTables"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.RecoverRecycleTablesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.RecoverRecycleTables(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doCreateBackup(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("CreateBackup", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "SelectedTables": Utils.try_to_json(argv, "--SelectedTables"),
          "Remark": argv.get("--Remark"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.CreateBackupRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.CreateBackup(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doCreateTables(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("CreateTables", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "IdlFiles": Utils.try_to_json(argv, "--IdlFiles"),
          "SelectedTables": Utils.try_to_json(argv, "--SelectedTables"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.CreateTablesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.CreateTables(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doModifyTableQuotas(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyTableQuotas", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "TableQuotas": Utils.try_to_json(argv, "--TableQuotas"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyTableQuotasRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyTableQuotas(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDescribeClusters(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeClusters", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterIds": Utils.try_to_json(argv, "--ClusterIds"),
          "Filters": Utils.try_to_json(argv, "--Filters"),
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeClustersRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeClusters(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDeleteTableGroup(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DeleteTableGroup", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "TableGroupId": argv.get("--TableGroupId"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DeleteTableGroupRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DeleteTableGroup(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doModifyTableGroupName(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyTableGroupName", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "TableGroupId": argv.get("--TableGroupId"),
          "TableGroupName": argv.get("--TableGroupName"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyTableGroupNameRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyTableGroupName(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doCreateTableGroup(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("CreateTableGroup", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "TableGroupName": argv.get("--TableGroupName"),
          "TableGroupId": argv.get("--TableGroupId"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.CreateTableGroupRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.CreateTableGroup(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDescribeRegions(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeRegions", g_param[OptionsDefine.Version])
          return
  
      param = {
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeRegionsRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeRegions(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDescribeTasks(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeTasks", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterIds": Utils.try_to_json(argv, "--ClusterIds"),
          "TaskIds": Utils.try_to_json(argv, "--TaskIds"),
          "Filters": Utils.try_to_json(argv, "--Filters"),
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeTasksRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeTasks(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDescribeTableGroups(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeTableGroups", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "TableGroupIds": Utils.try_to_json(argv, "--TableGroupIds"),
          "Filters": Utils.try_to_json(argv, "--Filters"),
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeTableGroupsRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeTableGroups(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doCompareIdlFiles(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("CompareIdlFiles", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "SelectedTables": Utils.try_to_json(argv, "--SelectedTables"),
          "ExistingIdlFiles": Utils.try_to_json(argv, "--ExistingIdlFiles"),
          "NewIdlFiles": Utils.try_to_json(argv, "--NewIdlFiles"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.CompareIdlFilesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.CompareIdlFiles(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDescribeIdlFileInfos(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeIdlFileInfos", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "TableGroupIds": Utils.try_to_json(argv, "--TableGroupIds"),
          "IdlFileIds": Utils.try_to_json(argv, "--IdlFileIds"),
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeIdlFileInfosRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeIdlFileInfos(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDeleteTables(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DeleteTables", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "SelectedTables": Utils.try_to_json(argv, "--SelectedTables"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DeleteTablesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DeleteTables(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doModifyTableMemos(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyTableMemos", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "TableMemos": Utils.try_to_json(argv, "--TableMemos"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyTableMemosRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyTableMemos(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doVerifyIdlFiles(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("VerifyIdlFiles", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "TableGroupId": argv.get("--TableGroupId"),
          "ExistingIdlFiles": Utils.try_to_json(argv, "--ExistingIdlFiles"),
          "NewIdlFiles": Utils.try_to_json(argv, "--NewIdlFiles"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.VerifyIdlFilesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.VerifyIdlFiles(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doModifyTables(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyTables", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "IdlFiles": Utils.try_to_json(argv, "--IdlFiles"),
          "SelectedTables": Utils.try_to_json(argv, "--SelectedTables"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyTablesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyTables(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doDescribeTables(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeTables", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "TableGroupIds": Utils.try_to_json(argv, "--TableGroupIds"),
          "SelectedTables": Utils.try_to_json(argv, "--SelectedTables"),
          "Filters": Utils.try_to_json(argv, "--Filters"),
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeTablesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeTables(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  def doClearTables(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ClearTables", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ClusterId": argv.get("--ClusterId"),
          "SelectedTables": Utils.try_to_json(argv, "--SelectedTables"),
  
      }
      cred = credential.Credential(g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey])
      http_profile = HttpProfile(
          reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
          reqMethod="POST",
          endpoint=g_param[OptionsDefine.Endpoint]
      )
      profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
      mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
      client = mod.TcaplusdbClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ClearTablesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ClearTables(model)
      result = rsp.to_json_string()
      jsonobj = None
      try:
          jsonobj = json.loads(result)
      except TypeError as e:
          jsonobj = json.loads(result.decode('utf-8')) # python3.3
      FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
  
  
  CLIENT_MAP = {
      "v20190823": tcaplusdb_client_v20190823,
  
  }
  
  MODELS_MAP = {
      "v20190823": models_v20190823,
  
  }
  
  ACTION_MAP = {
      "CreateCluster": doCreateCluster,
      "DescribeUinInWhitelist": doDescribeUinInWhitelist,
      "DescribeTablesInRecycle": doDescribeTablesInRecycle,
      "RollbackTables": doRollbackTables,
      "ModifyClusterName": doModifyClusterName,
      "DeleteCluster": doDeleteCluster,
      "ModifyClusterPassword": doModifyClusterPassword,
      "DeleteIdlFiles": doDeleteIdlFiles,
      "RecoverRecycleTables": doRecoverRecycleTables,
      "CreateBackup": doCreateBackup,
      "CreateTables": doCreateTables,
      "ModifyTableQuotas": doModifyTableQuotas,
      "DescribeClusters": doDescribeClusters,
      "DeleteTableGroup": doDeleteTableGroup,
      "ModifyTableGroupName": doModifyTableGroupName,
      "CreateTableGroup": doCreateTableGroup,
      "DescribeRegions": doDescribeRegions,
      "DescribeTasks": doDescribeTasks,
      "DescribeTableGroups": doDescribeTableGroups,
      "CompareIdlFiles": doCompareIdlFiles,
      "DescribeIdlFileInfos": doDescribeIdlFileInfos,
      "DeleteTables": doDeleteTables,
      "ModifyTableMemos": doModifyTableMemos,
      "VerifyIdlFiles": doVerifyIdlFiles,
      "ModifyTables": doModifyTables,
      "DescribeTables": doDescribeTables,
      "ClearTables": doClearTables,
  
  }
  
  AVAILABLE_VERSION_LIST = [
      v20190823.version,
  
  ]
  AVAILABLE_VERSIONS = {
       'v' + v20190823.version.replace('-', ''): {"help": v20190823_help.INFO,"desc": v20190823_help.DESC},
  
  }
  
  
  def tcaplusdb_action(argv, arglist):
      if "help" in argv:
          versions = sorted(AVAILABLE_VERSIONS.keys())
          opt_v = "--" + OptionsDefine.Version
          version = versions[-1]
          if opt_v in argv:
              version = 'v' + argv[opt_v].replace('-', '')
          if version not in versions:
              print("available versions: %s" % " ".join(AVAILABLE_VERSION_LIST))
              return
          action_str = ""
          docs = AVAILABLE_VERSIONS[version]["help"]
          desc = AVAILABLE_VERSIONS[version]["desc"]
          for action, info in docs.items():
              action_str += "        %s\n" % action
              action_str += Utils.split_str("        ", info["desc"], 120)
          helpstr = HelpTemplate.SERVICE % {"name": "tcaplusdb", "desc": desc, "actions": action_str}
          print(helpstr)
      else:
          print(ErrorMsg.FEW_ARG)
  
  
  def version_merge():
      help_merge = {}
      for v in AVAILABLE_VERSIONS:
          for action in AVAILABLE_VERSIONS[v]["help"]:
              if action not in help_merge:
                  help_merge[action] = {}
              help_merge[action]["cb"] = ACTION_MAP[action]
              help_merge[action]["params"] = []
              for param in AVAILABLE_VERSIONS[v]["help"][action]["params"]:
                  if param["name"] not in help_merge[action]["params"]:
                      help_merge[action]["params"].append(param["name"])
      return help_merge
  
  
  def register_arg(command):
      cmd = NiceCommand("tcaplusdb", tcaplusdb_action)
      command.reg_cmd(cmd)
      cmd.reg_opt("help", "bool")
      cmd.reg_opt(OptionsDefine.Version, "string")
      help_merge = version_merge()
  
      for actionName, action in help_merge.items():
          c = NiceCommand(actionName, action["cb"])
          cmd.reg_cmd(c)
          c.reg_opt("help", "bool")
          for param in action["params"]:
              c.reg_opt("--" + param, "string")
  
          for opt in OptionsDefine.ACTION_GLOBAL_OPT:
              stropt = "--" + opt
              c.reg_opt(stropt, "string")
  
  
  def parse_global_arg(argv):
      params = {}
      for opt in OptionsDefine.ACTION_GLOBAL_OPT:
          stropt = "--" + opt
          if stropt in argv:
              params[opt] = argv[stropt]
          else:
              params[opt] = None
      if params[OptionsDefine.Version]:
          params[OptionsDefine.Version] = "v" + params[OptionsDefine.Version].replace('-', '')
  
      config_handle = Configure()
      profile = config_handle.profile
      if ("--" + OptionsDefine.Profile) in argv:
          profile = argv[("--" + OptionsDefine.Profile)]
  
      is_conexist, conf_path = config_handle._profile_existed(profile + "." + config_handle.configure)
      is_creexist, cred_path = config_handle._profile_existed(profile + "." + config_handle.credential)
      config = {}
      cred = {}
      if is_conexist:
          config = config_handle._load_json_msg(conf_path)
      if is_creexist:
          cred = config_handle._load_json_msg(cred_path)
      if os.environ.get(OptionsDefine.ENV_SECRET_ID):
          cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
      if os.environ.get(OptionsDefine.ENV_SECRET_KEY):
          cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
      if os.environ.get(OptionsDefine.ENV_REGION):
          config[OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
  
      for param in params.keys():
          if param == OptionsDefine.Version:
              continue
          if params[param] is None:
              if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId]:
                  if param in cred:
                      params[param] = cred[param]
                  else:
                      raise Exception("%s is invalid" % param)
              else:
                  if param in config:
                      params[param] = config[param]
                  elif param == OptionsDefine.Region:
                      raise Exception("%s is invalid" % OptionsDefine.Region)
      try:
          if params[OptionsDefine.Version] is None:
              version = config["tcaplusdb"][OptionsDefine.Version]
              params[OptionsDefine.Version] = "v" + version.replace('-', '')
  
          if params[OptionsDefine.Endpoint] is None:
              params[OptionsDefine.Endpoint] = config["tcaplusdb"][OptionsDefine.Endpoint]
      except Exception as err:
          raise Exception("config file:%s error, %s" % (conf_path, str(err)))
      versions = sorted(AVAILABLE_VERSIONS.keys())
      if params[OptionsDefine.Version] not in versions:
          raise Exception("available versions: %s" % " ".join(AVAILABLE_VERSION_LIST))
      return params
  
  
  def show_help(action, version):
      docs = AVAILABLE_VERSIONS[version]["help"][action]
      desc = AVAILABLE_VERSIONS[version]["desc"]
      docstr = ""
      for param in docs["params"]:
          docstr += "        %s\n" % ("--" + param["name"])
          docstr += Utils.split_str("        ", param["desc"], 120)
  
      helpmsg = HelpTemplate.ACTION % {"name": action, "service": "tcaplusdb", "desc": desc, "params": docstr}
      print(helpmsg)
  
  
  def get_actions_info():
      config = Configure()
      new_version = max(AVAILABLE_VERSIONS.keys())
      version = new_version
      try:
          profile = config._load_json_msg(os.path.join(config.cli_path, "default.configure"))
          version = profile["tcaplusdb"]["version"]
          version = "v" + version.replace('-', '')
      except Exception:
          pass
      if version not in AVAILABLE_VERSIONS.keys():
          version = new_version
      return AVAILABLE_VERSIONS[version]["help"]
  