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.bm.v20180423 import bm_client as bm_client_v20180423
  from tencentcloud.bm.v20180423 import models as models_v20180423
  from tccli.services.bm import v20180423
  from tccli.services.bm.v20180423 import help as v20180423_help
  
  
  def doDescribeUserCmds(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeUserCmds", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
          "OrderField": Utils.try_to_json(argv, "--OrderField"),
          "Order": Utils.try_to_json(argv, "--Order"),
          "SearchKey": Utils.try_to_json(argv, "--SearchKey"),
          "CmdId": Utils.try_to_json(argv, "--CmdId"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeUserCmdsRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeUserCmds(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 doModifyPsaRegulation(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyPsaRegulation", g_param[OptionsDefine.Version])
          return
  
      param = {
          "PsaId": Utils.try_to_json(argv, "--PsaId"),
          "PsaName": Utils.try_to_json(argv, "--PsaName"),
          "RepairLimit": Utils.try_to_json(argv, "--RepairLimit"),
          "PsaDescription": Utils.try_to_json(argv, "--PsaDescription"),
          "TaskTypeIds": Utils.try_to_json(argv, "--TaskTypeIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyPsaRegulationRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyPsaRegulation(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 doDescribePsaRegulations(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribePsaRegulations", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Limit": Utils.try_to_json(argv, "--Limit"),
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "PsaIds": Utils.try_to_json(argv, "--PsaIds"),
          "PsaNames": Utils.try_to_json(argv, "--PsaNames"),
          "Tags": Utils.try_to_json(argv, "--Tags"),
          "OrderField": Utils.try_to_json(argv, "--OrderField"),
          "Order": Utils.try_to_json(argv, "--Order"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribePsaRegulationsRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribePsaRegulations(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 doModifyDeviceAutoRenewFlag(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyDeviceAutoRenewFlag", g_param[OptionsDefine.Version])
          return
  
      param = {
          "AutoRenewFlag": Utils.try_to_json(argv, "--AutoRenewFlag"),
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyDeviceAutoRenewFlagRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyDeviceAutoRenewFlag(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 doOfflineDevices(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("OfflineDevices", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.OfflineDevicesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.OfflineDevices(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 doModifyLanIp(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyLanIp", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceId": Utils.try_to_json(argv, "--InstanceId"),
          "VpcId": Utils.try_to_json(argv, "--VpcId"),
          "SubnetId": Utils.try_to_json(argv, "--SubnetId"),
          "LanIp": Utils.try_to_json(argv, "--LanIp"),
          "RebootDevice": Utils.try_to_json(argv, "--RebootDevice"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyLanIpRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyLanIp(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 doRunUserCmd(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("RunUserCmd", g_param[OptionsDefine.Version])
          return
  
      param = {
          "CmdId": Utils.try_to_json(argv, "--CmdId"),
          "UserName": Utils.try_to_json(argv, "--UserName"),
          "Password": Utils.try_to_json(argv, "--Password"),
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
          "CmdParam": Utils.try_to_json(argv, "--CmdParam"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.RunUserCmdRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.RunUserCmd(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 doDescribeCustomImageProcess(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeCustomImageProcess", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ImageId": Utils.try_to_json(argv, "--ImageId"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeCustomImageProcessRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeCustomImageProcess(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 doDescribeDeviceHardwareInfo(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeDeviceHardwareInfo", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeDeviceHardwareInfoRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeDeviceHardwareInfo(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 doDescribeUserCmdTasks(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeUserCmdTasks", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
          "OrderField": Utils.try_to_json(argv, "--OrderField"),
          "Order": Utils.try_to_json(argv, "--Order"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeUserCmdTasksRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeUserCmdTasks(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 doCreatePsaRegulation(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("CreatePsaRegulation", g_param[OptionsDefine.Version])
          return
  
      param = {
          "PsaName": Utils.try_to_json(argv, "--PsaName"),
          "TaskTypeIds": Utils.try_to_json(argv, "--TaskTypeIds"),
          "RepairLimit": Utils.try_to_json(argv, "--RepairLimit"),
          "PsaDescription": Utils.try_to_json(argv, "--PsaDescription"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.CreatePsaRegulationRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.CreatePsaRegulation(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 doDescribeDeviceClass(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeDeviceClass", 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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeDeviceClassRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeDeviceClass(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 doBuyDevices(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("BuyDevices", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Zone": Utils.try_to_json(argv, "--Zone"),
          "OsTypeId": Utils.try_to_json(argv, "--OsTypeId"),
          "RaidId": Utils.try_to_json(argv, "--RaidId"),
          "GoodsCount": Utils.try_to_json(argv, "--GoodsCount"),
          "VpcId": Utils.try_to_json(argv, "--VpcId"),
          "SubnetId": Utils.try_to_json(argv, "--SubnetId"),
          "DeviceClassCode": Utils.try_to_json(argv, "--DeviceClassCode"),
          "TimeUnit": Utils.try_to_json(argv, "--TimeUnit"),
          "TimeSpan": Utils.try_to_json(argv, "--TimeSpan"),
          "NeedSecurityAgent": Utils.try_to_json(argv, "--NeedSecurityAgent"),
          "NeedMonitorAgent": Utils.try_to_json(argv, "--NeedMonitorAgent"),
          "NeedEMRAgent": Utils.try_to_json(argv, "--NeedEMRAgent"),
          "NeedEMRSoftware": Utils.try_to_json(argv, "--NeedEMRSoftware"),
          "ApplyEip": Utils.try_to_json(argv, "--ApplyEip"),
          "EipPayMode": Utils.try_to_json(argv, "--EipPayMode"),
          "EipBandwidth": Utils.try_to_json(argv, "--EipBandwidth"),
          "IsZoning": Utils.try_to_json(argv, "--IsZoning"),
          "CpmPayMode": Utils.try_to_json(argv, "--CpmPayMode"),
          "ImageId": Utils.try_to_json(argv, "--ImageId"),
          "Password": Utils.try_to_json(argv, "--Password"),
          "AutoRenewFlag": Utils.try_to_json(argv, "--AutoRenewFlag"),
          "SysRootSpace": Utils.try_to_json(argv, "--SysRootSpace"),
          "SysSwaporuefiSpace": Utils.try_to_json(argv, "--SysSwaporuefiSpace"),
          "SysUsrlocalSpace": Utils.try_to_json(argv, "--SysUsrlocalSpace"),
          "SysDataSpace": Utils.try_to_json(argv, "--SysDataSpace"),
          "HyperThreading": Utils.try_to_json(argv, "--HyperThreading"),
          "LanIps": Utils.try_to_json(argv, "--LanIps"),
          "Aliases": Utils.try_to_json(argv, "--Aliases"),
          "CpuId": Utils.try_to_json(argv, "--CpuId"),
          "ContainRaidCard": Utils.try_to_json(argv, "--ContainRaidCard"),
          "MemSize": Utils.try_to_json(argv, "--MemSize"),
          "SystemDiskTypeId": Utils.try_to_json(argv, "--SystemDiskTypeId"),
          "SystemDiskCount": Utils.try_to_json(argv, "--SystemDiskCount"),
          "DataDiskTypeId": Utils.try_to_json(argv, "--DataDiskTypeId"),
          "DataDiskCount": Utils.try_to_json(argv, "--DataDiskCount"),
          "Tags": Utils.try_to_json(argv, "--Tags"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.BuyDevicesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.BuyDevices(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 doModifyUserCmd(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyUserCmd", g_param[OptionsDefine.Version])
          return
  
      param = {
          "CmdId": Utils.try_to_json(argv, "--CmdId"),
          "Alias": Utils.try_to_json(argv, "--Alias"),
          "OsType": Utils.try_to_json(argv, "--OsType"),
          "Content": Utils.try_to_json(argv, "--Content"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyUserCmdRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyUserCmd(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 doDeleteUserCmds(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DeleteUserCmds", g_param[OptionsDefine.Version])
          return
  
      param = {
          "CmdIds": Utils.try_to_json(argv, "--CmdIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DeleteUserCmdsRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DeleteUserCmds(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 doDescribeHostedDeviceOutBandInfo(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeHostedDeviceOutBandInfo", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
          "Zone": Utils.try_to_json(argv, "--Zone"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeHostedDeviceOutBandInfoRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeHostedDeviceOutBandInfo(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 doBindPsaTag(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("BindPsaTag", g_param[OptionsDefine.Version])
          return
  
      param = {
          "PsaId": Utils.try_to_json(argv, "--PsaId"),
          "TagKey": Utils.try_to_json(argv, "--TagKey"),
          "TagValue": Utils.try_to_json(argv, "--TagValue"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.BindPsaTagRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.BindPsaTag(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 doDeleteCustomImages(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DeleteCustomImages", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ImageIds": Utils.try_to_json(argv, "--ImageIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DeleteCustomImagesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DeleteCustomImages(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 doDeletePsaRegulation(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DeletePsaRegulation", g_param[OptionsDefine.Version])
          return
  
      param = {
          "PsaId": Utils.try_to_json(argv, "--PsaId"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DeletePsaRegulationRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DeletePsaRegulation(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 doCreateUserCmd(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("CreateUserCmd", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Alias": Utils.try_to_json(argv, "--Alias"),
          "OsType": Utils.try_to_json(argv, "--OsType"),
          "Content": Utils.try_to_json(argv, "--Content"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.CreateUserCmdRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.CreateUserCmd(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 doDescribeHardwareSpecification(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeHardwareSpecification", 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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeHardwareSpecificationRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeHardwareSpecification(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 doRebootDevices(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("RebootDevices", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.RebootDevicesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.RebootDevices(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 doDescribeOsInfo(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeOsInfo", g_param[OptionsDefine.Version])
          return
  
      param = {
          "DeviceClassCode": Utils.try_to_json(argv, "--DeviceClassCode"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeOsInfoRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeOsInfo(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 doDescribeOperationResult(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeOperationResult", g_param[OptionsDefine.Version])
          return
  
      param = {
          "TaskId": Utils.try_to_json(argv, "--TaskId"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeOperationResultRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeOperationResult(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 doModifyCustomImageAttribute(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyCustomImageAttribute", g_param[OptionsDefine.Version])
          return
  
      param = {
          "ImageId": Utils.try_to_json(argv, "--ImageId"),
          "ImageName": Utils.try_to_json(argv, "--ImageName"),
          "ImageDescription": Utils.try_to_json(argv, "--ImageDescription"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyCustomImageAttributeRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyCustomImageAttribute(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 doDescribeDevicePosition(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeDevicePosition", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
          "VpcId": Utils.try_to_json(argv, "--VpcId"),
          "SubnetId": Utils.try_to_json(argv, "--SubnetId"),
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
          "Alias": Utils.try_to_json(argv, "--Alias"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeDevicePositionRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeDevicePosition(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 = {
          "RegionId": Utils.try_to_json(argv, "--RegionId"),
  
      }
      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.BmClient(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 doDescribeUserCmdTaskInfo(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeUserCmdTaskInfo", g_param[OptionsDefine.Version])
          return
  
      param = {
          "TaskId": Utils.try_to_json(argv, "--TaskId"),
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
          "OrderField": Utils.try_to_json(argv, "--OrderField"),
          "Order": Utils.try_to_json(argv, "--Order"),
          "SearchKey": Utils.try_to_json(argv, "--SearchKey"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeUserCmdTaskInfoRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeUserCmdTaskInfo(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 doDescribeDevicePriceInfo(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeDevicePriceInfo", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
          "TimeUnit": Utils.try_to_json(argv, "--TimeUnit"),
          "TimeSpan": Utils.try_to_json(argv, "--TimeSpan"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeDevicePriceInfoRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeDevicePriceInfo(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 doReturnDevices(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ReturnDevices", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ReturnDevicesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ReturnDevices(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 doDescribeTaskOperationLog(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeTaskOperationLog", g_param[OptionsDefine.Version])
          return
  
      param = {
          "TaskId": Utils.try_to_json(argv, "--TaskId"),
          "OrderField": Utils.try_to_json(argv, "--OrderField"),
          "Order": Utils.try_to_json(argv, "--Order"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeTaskOperationLogRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeTaskOperationLog(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 doModifyPayModePre2Post(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyPayModePre2Post", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyPayModePre2PostRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyPayModePre2Post(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 doUnbindPsaTag(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("UnbindPsaTag", g_param[OptionsDefine.Version])
          return
  
      param = {
          "PsaId": Utils.try_to_json(argv, "--PsaId"),
          "TagKey": Utils.try_to_json(argv, "--TagKey"),
          "TagValue": Utils.try_to_json(argv, "--TagValue"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.UnbindPsaTagRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.UnbindPsaTag(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 doCreateSpotDevice(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("CreateSpotDevice", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Zone": Utils.try_to_json(argv, "--Zone"),
          "ComputeType": Utils.try_to_json(argv, "--ComputeType"),
          "OsTypeId": Utils.try_to_json(argv, "--OsTypeId"),
          "VpcId": Utils.try_to_json(argv, "--VpcId"),
          "SubnetId": Utils.try_to_json(argv, "--SubnetId"),
          "GoodsNum": Utils.try_to_json(argv, "--GoodsNum"),
          "SpotStrategy": Utils.try_to_json(argv, "--SpotStrategy"),
          "SpotPriceLimit": Utils.try_to_json(argv, "--SpotPriceLimit"),
          "Passwd": Utils.try_to_json(argv, "--Passwd"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.CreateSpotDeviceRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.CreateSpotDevice(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 doModifyDeviceAliases(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ModifyDeviceAliases", g_param[OptionsDefine.Version])
          return
  
      param = {
          "DeviceAliases": Utils.try_to_json(argv, "--DeviceAliases"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ModifyDeviceAliasesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ModifyDeviceAliases(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 doDescribeDeviceInventory(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeDeviceInventory", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Zone": Utils.try_to_json(argv, "--Zone"),
          "DeviceClassCode": Utils.try_to_json(argv, "--DeviceClassCode"),
          "VpcId": Utils.try_to_json(argv, "--VpcId"),
          "SubnetId": Utils.try_to_json(argv, "--SubnetId"),
          "CpuId": Utils.try_to_json(argv, "--CpuId"),
          "DiskType": Utils.try_to_json(argv, "--DiskType"),
          "DiskSize": Utils.try_to_json(argv, "--DiskSize"),
          "DiskNum": Utils.try_to_json(argv, "--DiskNum"),
          "Mem": Utils.try_to_json(argv, "--Mem"),
          "HaveRaidCard": Utils.try_to_json(argv, "--HaveRaidCard"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeDeviceInventoryRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeDeviceInventory(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 doDescribeDeviceOperationLog(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeDeviceOperationLog", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceId": Utils.try_to_json(argv, "--InstanceId"),
          "StartTime": Utils.try_to_json(argv, "--StartTime"),
          "EndTime": Utils.try_to_json(argv, "--EndTime"),
          "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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeDeviceOperationLogRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeDeviceOperationLog(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 doDescribeTaskInfo(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeTaskInfo", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
          "StartDate": Utils.try_to_json(argv, "--StartDate"),
          "EndDate": Utils.try_to_json(argv, "--EndDate"),
          "TaskStatus": Utils.try_to_json(argv, "--TaskStatus"),
          "OrderField": Utils.try_to_json(argv, "--OrderField"),
          "Order": Utils.try_to_json(argv, "--Order"),
          "TaskIds": Utils.try_to_json(argv, "--TaskIds"),
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
          "Aliases": Utils.try_to_json(argv, "--Aliases"),
          "TaskTypeIds": Utils.try_to_json(argv, "--TaskTypeIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeTaskInfoRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeTaskInfo(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 doRepairTaskControl(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("RepairTaskControl", g_param[OptionsDefine.Version])
          return
  
      param = {
          "TaskId": Utils.try_to_json(argv, "--TaskId"),
          "Operate": Utils.try_to_json(argv, "--Operate"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.RepairTaskControlRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.RepairTaskControl(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 doDescribeDevices(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeDevices", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
          "DeviceClassCode": Utils.try_to_json(argv, "--DeviceClassCode"),
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
          "WanIps": Utils.try_to_json(argv, "--WanIps"),
          "LanIps": Utils.try_to_json(argv, "--LanIps"),
          "Alias": Utils.try_to_json(argv, "--Alias"),
          "VagueIp": Utils.try_to_json(argv, "--VagueIp"),
          "DeadlineStartTime": Utils.try_to_json(argv, "--DeadlineStartTime"),
          "DeadlineEndTime": Utils.try_to_json(argv, "--DeadlineEndTime"),
          "AutoRenewFlag": Utils.try_to_json(argv, "--AutoRenewFlag"),
          "VpcId": Utils.try_to_json(argv, "--VpcId"),
          "SubnetId": Utils.try_to_json(argv, "--SubnetId"),
          "Tags": Utils.try_to_json(argv, "--Tags"),
          "DeviceType": Utils.try_to_json(argv, "--DeviceType"),
          "IsLuckyDevice": Utils.try_to_json(argv, "--IsLuckyDevice"),
          "OrderField": Utils.try_to_json(argv, "--OrderField"),
          "Order": Utils.try_to_json(argv, "--Order"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeDevicesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeDevices(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 doDescribeRepairTaskConstant(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeRepairTaskConstant", 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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeRepairTaskConstantRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeRepairTaskConstant(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 doSetOutBandVpnAuthPassword(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("SetOutBandVpnAuthPassword", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Password": Utils.try_to_json(argv, "--Password"),
          "Operate": Utils.try_to_json(argv, "--Operate"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.SetOutBandVpnAuthPasswordRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.SetOutBandVpnAuthPassword(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 doDescribeCustomImages(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeCustomImages", g_param[OptionsDefine.Version])
          return
  
      param = {
          "Offset": Utils.try_to_json(argv, "--Offset"),
          "Limit": Utils.try_to_json(argv, "--Limit"),
          "OrderField": Utils.try_to_json(argv, "--OrderField"),
          "Order": Utils.try_to_json(argv, "--Order"),
          "ImageId": Utils.try_to_json(argv, "--ImageId"),
          "SearchKey": Utils.try_to_json(argv, "--SearchKey"),
          "ImageStatus": Utils.try_to_json(argv, "--ImageStatus"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeCustomImagesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeCustomImages(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 doRecoverDevices(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("RecoverDevices", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.RecoverDevicesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.RecoverDevices(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 doDescribeDevicePartition(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeDevicePartition", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceId": Utils.try_to_json(argv, "--InstanceId"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeDevicePartitionRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeDevicePartition(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 doShutdownDevices(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ShutdownDevices", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ShutdownDevicesRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ShutdownDevices(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 doResetDevicePassword(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("ResetDevicePassword", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceIds": Utils.try_to_json(argv, "--InstanceIds"),
          "Password": Utils.try_to_json(argv, "--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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.ResetDevicePasswordRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.ResetDevicePassword(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 doDescribeDeviceClassPartition(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("DescribeDeviceClassPartition", g_param[OptionsDefine.Version])
          return
  
      param = {
          "DeviceClassCode": Utils.try_to_json(argv, "--DeviceClassCode"),
          "InstanceId": Utils.try_to_json(argv, "--InstanceId"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.DescribeDeviceClassPartitionRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.DescribeDeviceClassPartition(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 doCreateCustomImage(argv, arglist):
      g_param = parse_global_arg(argv)
      if "help" in argv:
          show_help("CreateCustomImage", g_param[OptionsDefine.Version])
          return
  
      param = {
          "InstanceId": Utils.try_to_json(argv, "--InstanceId"),
          "ImageName": Utils.try_to_json(argv, "--ImageName"),
          "ImageDescription": Utils.try_to_json(argv, "--ImageDescription"),
  
      }
      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.BmClient(cred, g_param[OptionsDefine.Region], profile)
      client._sdkVersion += ("_CLI_" + __version__)
      models = MODELS_MAP[g_param[OptionsDefine.Version]]
      model = models.CreateCustomImageRequest()
      model.from_json_string(json.dumps(param))
      rsp = client.CreateCustomImage(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 = {
      "v20180423": bm_client_v20180423,
  
  }
  
  MODELS_MAP = {
      "v20180423": models_v20180423,
  
  }
  
  ACTION_MAP = {
      "DescribeUserCmds": doDescribeUserCmds,
      "ModifyPsaRegulation": doModifyPsaRegulation,
      "DescribePsaRegulations": doDescribePsaRegulations,
      "ModifyDeviceAutoRenewFlag": doModifyDeviceAutoRenewFlag,
      "OfflineDevices": doOfflineDevices,
      "ModifyLanIp": doModifyLanIp,
      "RunUserCmd": doRunUserCmd,
      "DescribeCustomImageProcess": doDescribeCustomImageProcess,
      "DescribeDeviceHardwareInfo": doDescribeDeviceHardwareInfo,
      "DescribeUserCmdTasks": doDescribeUserCmdTasks,
      "CreatePsaRegulation": doCreatePsaRegulation,
      "DescribeDeviceClass": doDescribeDeviceClass,
      "BuyDevices": doBuyDevices,
      "ModifyUserCmd": doModifyUserCmd,
      "DeleteUserCmds": doDeleteUserCmds,
      "DescribeHostedDeviceOutBandInfo": doDescribeHostedDeviceOutBandInfo,
      "BindPsaTag": doBindPsaTag,
      "DeleteCustomImages": doDeleteCustomImages,
      "DeletePsaRegulation": doDeletePsaRegulation,
      "CreateUserCmd": doCreateUserCmd,
      "DescribeHardwareSpecification": doDescribeHardwareSpecification,
      "RebootDevices": doRebootDevices,
      "DescribeOsInfo": doDescribeOsInfo,
      "DescribeOperationResult": doDescribeOperationResult,
      "ModifyCustomImageAttribute": doModifyCustomImageAttribute,
      "DescribeDevicePosition": doDescribeDevicePosition,
      "DescribeRegions": doDescribeRegions,
      "DescribeUserCmdTaskInfo": doDescribeUserCmdTaskInfo,
      "DescribeDevicePriceInfo": doDescribeDevicePriceInfo,
      "ReturnDevices": doReturnDevices,
      "DescribeTaskOperationLog": doDescribeTaskOperationLog,
      "ModifyPayModePre2Post": doModifyPayModePre2Post,
      "UnbindPsaTag": doUnbindPsaTag,
      "CreateSpotDevice": doCreateSpotDevice,
      "ModifyDeviceAliases": doModifyDeviceAliases,
      "DescribeDeviceInventory": doDescribeDeviceInventory,
      "DescribeDeviceOperationLog": doDescribeDeviceOperationLog,
      "DescribeTaskInfo": doDescribeTaskInfo,
      "RepairTaskControl": doRepairTaskControl,
      "DescribeDevices": doDescribeDevices,
      "DescribeRepairTaskConstant": doDescribeRepairTaskConstant,
      "SetOutBandVpnAuthPassword": doSetOutBandVpnAuthPassword,
      "DescribeCustomImages": doDescribeCustomImages,
      "RecoverDevices": doRecoverDevices,
      "DescribeDevicePartition": doDescribeDevicePartition,
      "ShutdownDevices": doShutdownDevices,
      "ResetDevicePassword": doResetDevicePassword,
      "DescribeDeviceClassPartition": doDescribeDeviceClassPartition,
      "CreateCustomImage": doCreateCustomImage,
  
  }
  
  AVAILABLE_VERSION_LIST = [
      v20180423.version,
  
  ]
  AVAILABLE_VERSIONS = {
       'v' + v20180423.version.replace('-', ''): {"help": v20180423_help.INFO,"desc": v20180423_help.DESC},
  
  }
  
  
  def bm_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": "bm", "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("bm", bm_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)
  
      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["bm"][OptionsDefine.Version]
              params[OptionsDefine.Version] = "v" + version.replace('-', '')
  
          if params[OptionsDefine.Endpoint] is None:
              params[OptionsDefine.Endpoint] = config["bm"][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": "bm", "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["bm"]["version"]
          version = "v" + version.replace('-', '')
      except Exception:
          pass
      if version not in AVAILABLE_VERSIONS.keys():
          version = new_version
      return AVAILABLE_VERSIONS[version]["help"]
  