Example #1
0
def delete_vcns_edge_monitor_binding(session, id, edge_id):
    with session.begin(subtransactions=True):
        qry = session.query(vcns_models.VcnsEdgeMonitorBinding)
        if not qry.filter_by(monitor_id=id, edge_id=edge_id).delete():
            msg = _("Monitor Resource binding with id:%s not found!") % id
            LOG.exception(msg)
            raise nvp_exc.NvpServicePluginException(err_msg=msg)
Example #2
0
def get_vcns_edge_firewallrule_binding_by_vseid(
        session, edge_id, rule_vseid):
    with session.begin(subtransactions=True):
        try:
            return (session.query(vcns_models.VcnsEdgeFirewallRuleBinding).
                    filter_by(edge_id=edge_id, rule_vseid=rule_vseid).one())
        except exc.NoResultFound:
            msg = _("Rule Resource binding not found!")
            raise nvp_exc.NvpServicePluginException(err_msg=msg)
Example #3
0
def get_vcns_edge_pool_binding_by_vseid(session, edge_id, pool_vseid):
    with session.begin(subtransactions=True):
        try:
            qry = session.query(vcns_models.VcnsEdgePoolBinding)
            binding = qry.filter_by(edge_id=edge_id,
                                    pool_vseid=pool_vseid).one()
        except exc.NoResultFound:
            msg = (_("Pool Resource binding with edge_id:%(edge_id)s "
                     "pool_vseid:%(pool_vseid)s not found!") %
                   {'edge_id': edge_id, 'pool_vseid': pool_vseid})
            LOG.exception(msg)
            raise nvp_exc.NvpServicePluginException(err_msg=msg)
        return binding
Example #4
0
def delete_vcns_edge_firewallrule_binding(session, id):
    with session.begin(subtransactions=True):
        if not (session.query(vcns_models.VcnsEdgeFirewallRuleBinding).
                filter_by(rule_id=id).delete()):
            msg = _("Rule Resource binding with id:%s not found!") % id
            raise nvp_exc.NvpServicePluginException(err_msg=msg)