From a734f5487bba1cba5698fedeac823ac25dc0b1ba Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Fri, 11 Dec 2020 15:45:16 -0800 Subject: [PATCH] Added list_cxs function to TestGroupProfile --- py-json/realm.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/py-json/realm.py b/py-json/realm.py index b45d35ce..3a0294ab 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -2279,7 +2279,7 @@ class TestGroupProfile(LFCliBase): return False def list_groups(self): - test_groups = self.local_realm.json_get("/testgroups") + test_groups = self.local_realm.json_get("/testgroups/all") tg_list = [] if test_groups is not None: test_groups = test_groups["groups"] @@ -2289,8 +2289,16 @@ class TestGroupProfile(LFCliBase): return tg_list def list_cxs(self): - # TODO: List cxs in profile, use cx_list or query? - pass + test_groups = self.local_realm.json_get("/testgroups/all") + if test_groups is not None: + test_groups = test_groups["groups"] + for group in test_groups: + for k,v in group.items(): + if v['name'] == self.group_name: + return v['cross connects'] + + else: + return [] class FIOEndpProfile(LFCliBase):