diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-07 22:40:07 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-07 22:40:07 +0900 |
commit | 608d09c90e906ed43e9206e903443753f73d80b0 (patch) | |
tree | 390e62cdf724284e88b8effc6df810774f24f47e /cli | |
parent | 10d54c1095be1b74633a1b7e8b5cee1c9f568a66 (diff) |
rest: support show table with specified route family
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'cli')
-rwxr-xr-x | cli/gobgpcli | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/gobgpcli b/cli/gobgpcli index cdf5b56e..c4ca602f 100755 --- a/cli/gobgpcli +++ b/cli/gobgpcli @@ -258,7 +258,7 @@ class Show(object): return attrs def do_neighbor(self): - if len(self.args) != 2 and len(self.args) != 3: + if len(self.args) != 2 and len(self.args) != 3 and len(self.args) != 4: return 1 if len(self.args) == 2: return self._neighbor(neighbor=self.args[1]) @@ -274,6 +274,15 @@ class Show(object): try: r = requests.get(self.base_url + "/neighbor/" + self.args[1] + "/" + self.args[2]) + url = self.base_url + "/neighbor/" + self.args[1] + "/" + self.args[2] + if len(self.args) == 3: + if self.args[2].find(':') == -1: + url += "/ipv4" + else: + url += "/ipv6" + else: + url += "/" + self.args[3] + r = requests.get(url) except: print "Failed to connect to gobgpd. It runs?" sys.exit(1) |