From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 1AA3A293B for ; Thu, 25 Oct 2018 07:20:37 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w9P5KbRs007551; Thu, 25 Oct 2018 14:20:37 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 0DCCDEA7CFC; Thu, 25 Oct 2018 14:20:37 +0900 (JST) Received: from localhost.localdomain (unknown [129.60.13.51]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id E7F33EA7C7B; Thu, 25 Oct 2018 14:20:36 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Thu, 25 Oct 2018 14:20:20 +0900 Message-Id: <20181025052023.17190-3-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20181025052023.17190-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20181025052023.17190-1-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 2/5] spp-ctl: add exit cmd support for spp_primary X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 05:20:38 -0000 From: Yasufumi Ogawa Spp-ctl does not support to exit spp_primary, but it is required using from `spp.py`. This update is to add a REST API for exiting the process. Signed-off-by: Yasufumi Ogawa --- src/spp-ctl/spp_proc.py | 4 ++++ src/spp-ctl/spp_webapi.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/spp-ctl/spp_proc.py b/src/spp-ctl/spp_proc.py index aa928f2..83c59ea 100644 --- a/src/spp-ctl/spp_proc.py +++ b/src/spp-ctl/spp_proc.py @@ -189,3 +189,7 @@ class PrimaryProc(SppProc): @exec_command def clear(self): return "clear" + + @exec_command + def do_exit(self): + return "exit" diff --git a/src/spp-ctl/spp_webapi.py b/src/spp-ctl/spp_webapi.py index 8332cab..8d0510c 100644 --- a/src/spp-ctl/spp_webapi.py +++ b/src/spp-ctl/spp_webapi.py @@ -395,6 +395,7 @@ class V1PrimaryHandler(BaseHandler): def set_route(self): self.route('/status', 'GET', callback=self.get_status) self.route('/status', 'DELETE', callback=self.clear_status) + self.route('/', 'DELETE', callback=self.do_exit) def _get_proc(self): proc = self.ctrl.procs.get(spp_proc.ID_PRIMARY) @@ -417,3 +418,8 @@ class V1PrimaryHandler(BaseHandler): def clear_status(self): proc = self._get_proc() proc.clear() + + def do_exit(self): + proc = self._get_proc() + self.ctrl.do_exit(proc.type, proc.id) + proc.do_exit() -- 2.7.4