summaryrefslogtreecommitdiffhomepage
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rwxr-xr-xcli/gobgpcli11
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)