code: def cli(env, identifier, immediate, comment, reason):
      
  
      mgr = SoftLayer.HardwareManager(env.client)
      hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware')
  
      if not (env.skip_confirmations or formatting.no_going_back(hw_id)):
          raise exceptions.CLIAbort('Aborted')
  
      mgr.cancel_hardware(hw_id, reason, comment, immediate)
docs: Cancel a dedicated server.