code: def terminate_app(app_id, is_finished=False):
      
      state = constant.STATE_APP_TERMINATED if is_finished else constant.STATE_APP_TERMINATING
      app_update_state(app_id, state)
      if is_finished:
          delete_app_info(app_id)
docs: update app state to 'Terminated'