def get_vip(self, context, id): vip_binding = vcns_db.get_vcns_edge_vip_binding(context.session, id) edge_id = vip_binding[vcns_const.EDGE_ID] vip_vseid = vip_binding['vip_vseid'] try: response = self.vcns.get_vip(edge_id, vip_vseid)[1] except vcns_exc.VcnsApiException: with excutils.save_and_reraise_exception(): LOG.exception(_("Failed to get vip on edge")) return self._restore_lb_vip(context, edge_id, response)
def update_vip(self, context, vip): vip_binding = vcns_db.get_vcns_edge_vip_binding( context.session, vip['id']) edge_id = vip_binding[vcns_const.EDGE_ID] vip_vseid = vip_binding.get('vip_vseid') app_profileid = vip_binding.get('app_profileid') vip_new = self._convert_lb_vip(context, edge_id, vip, app_profileid) try: self.vcns.update_vip(edge_id, vip_vseid, vip_new) except vcns_exc.VcnsApiException: with excutils.save_and_reraise_exception(): LOG.exception(_("Failed to update vip on edge: %s"), edge_id)
def delete_vip(self, context, id): vip_binding = vcns_db.get_vcns_edge_vip_binding( context.session, id) edge_id = vip_binding[vcns_const.EDGE_ID] vip_vseid = vip_binding['vip_vseid'] app_profileid = vip_binding['app_profileid'] try: self.vcns.delete_vip(edge_id, vip_vseid) self.vcns.delete_app_profile(edge_id, app_profileid) except vcns_exc.VcnsApiException: with excutils.save_and_reraise_exception(): LOG.exception(_("Failed to delete vip on edge: %s"), edge_id) vcns_db.delete_vcns_edge_vip_binding(context.session, id)