def _uve_get_stats(stats): obj_stats = UveLoadbalancerStats() obj_stats.obj_name = stats['name'] obj_stats.uuid = stats['name'] obj_stats.status = stats['status'] for attr in dir(obj_stats): if attr in stats and stats[attr].isdigit(): setattr(obj_stats, attr, int(stats[attr])) return [obj_stats]
def _uve_get_stats(self, stats): obj_stats = UveLoadbalancerStats() obj_stats.obj_name = stats['name'] obj_stats.uuid = stats['name'] obj_stats.status = stats['status'] obj_stats.vrouter = stats['vrouter'] for attr in dir(obj_stats): if attr in stats and stats[attr].isdigit(): setattr(obj_stats, attr, int(stats[attr])) return [obj_stats]
def _uve_get_member_stats(stats): member_stats = [] for stat in stats: obj_stats = UveLoadbalancerStats() obj_stats.obj_name = stat['name'] obj_stats.uuid = stat['name'] obj_stats.status = stat['status'] for attr in dir(obj_stats): if attr in stat and stat[attr].isdigit(): setattr(obj_stats, attr, int(stat[attr])) member_stats.append(obj_stats) return member_stats
def _uve_get_member_stats(self, stats): member_stats = [] for stat in stats: obj_stats = UveLoadbalancerStats() obj_stats.obj_name = stat['name'] obj_stats.uuid = stat['name'] obj_stats.status = stat['status'] obj_stats.vrouter = stat['vrouter'] for attr in dir(obj_stats): if attr in stat and stat[attr].isdigit(): setattr(obj_stats, attr, int(stat[attr])) member_stats.append(obj_stats) return member_stats