Example #1
0
    def disassociate_portprofile(self, tenant_id, net_id, port_id, portprofile_id):
        """Disassociate port profile"""
        LOG.debug(_("disassociate_portprofile() called"))
        try:
            portprofile = cdb.get_portprofile(tenant_id, portprofile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id, portprofile_id=portprofile_id)

        cdb.remove_pp_binding(tenant_id, port_id, portprofile_id)
Example #2
0
    def associate_portprofile(self, tenant_id, net_id,
                              port_id, portprofile_id):
        """Associate port profile"""
        LOG.debug("associate_portprofile() called\n")
        try:
            portprofile = cdb.get_portprofile(tenant_id, portprofile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id,
                                           portprofile_id=portprofile_id)

        cdb.add_pp_binding(tenant_id, port_id, portprofile_id, False)
Example #3
0
    def disassociate_portprofile(self, tenant_id, net_id, port_id,
                                 portprofile_id):
        """Disassociate port profile"""
        LOG.debug("disassociate_portprofile() called\n")
        try:
            portprofile = cdb.get_portprofile(tenant_id, portprofile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id,
                                           portprofile_id=portprofile_id)

        cdb.remove_pp_binding(tenant_id, port_id, portprofile_id)
Example #4
0
 def rename_portprofile(self, tenant_id, profile_id, new_name):
     """Rename port profile"""
     LOG.debug(_("rename_portprofile() called"))
     try:
         portprofile = cdb.get_portprofile(tenant_id, profile_id)
     except Exception:
         raise cexc.PortProfileNotFound(tenant_id=tenant_id, portprofile_id=profile_id)
     portprofile = cdb.update_portprofile(tenant_id, profile_id, new_name)
     new_pp = cutil.make_portprofile_dict(
         tenant_id, portprofile[const.UUID], portprofile[const.PPNAME], portprofile[const.PPQOS]
     )
     return new_pp
Example #5
0
    def get_portprofile_details(self, tenant_id, profile_id):
        """Get port profile details"""
        LOG.debug(_("get_portprofile_details() called"))
        try:
            portprofile = cdb.get_portprofile(tenant_id, profile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id, portprofile_id=profile_id)

        new_pp = cutil.make_portprofile_dict(
            tenant_id, portprofile[const.UUID], portprofile[const.PPNAME], portprofile[const.PPQOS]
        )
        return new_pp
Example #6
0
    def delete_portprofile(self, tenant_id, profile_id):
        """Delete portprofile"""
        LOG.debug(_("delete_portprofile() called"))
        try:
            portprofile = cdb.get_portprofile(tenant_id, profile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id, portprofile_id=profile_id)

        plist = cdb.get_pp_binding(tenant_id, profile_id)
        if plist:
            raise cexc.PortProfileInvalidDelete(tenant_id=tenant_id, profile_id=profile_id)
        else:
            cdb.remove_portprofile(tenant_id, profile_id)
Example #7
0
 def rename_portprofile(self, tenant_id, profile_id, new_name):
     """Rename port profile"""
     LOG.debug("rename_portprofile() called\n")
     try:
         portprofile = cdb.get_portprofile(tenant_id, profile_id)
     except Exception:
         raise cexc.PortProfileNotFound(tenant_id=tenant_id,
                                        portprofile_id=profile_id)
     portprofile = cdb.update_portprofile(tenant_id, profile_id, new_name)
     new_pp = cutil.make_portprofile_dict(tenant_id,
                                          portprofile[const.UUID],
                                          portprofile[const.PPNAME],
                                          portprofile[const.PPQOS])
     return new_pp
Example #8
0
    def get_portprofile_details(self, tenant_id, profile_id):
        """Get port profile details"""
        LOG.debug("get_portprofile_details() called\n")
        try:
            portprofile = cdb.get_portprofile(tenant_id, profile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id,
                                           portprofile_id=profile_id)

        new_pp = cutil.make_portprofile_dict(tenant_id,
                                             portprofile[const.UUID],
                                             portprofile[const.PPNAME],
                                             portprofile[const.PPQOS])
        return new_pp
Example #9
0
    def delete_portprofile(self, tenant_id, profile_id):
        """Delete portprofile"""
        LOG.debug("delete_portprofile() called\n")
        try:
            portprofile = cdb.get_portprofile(tenant_id, profile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id,
                                           portprofile_id=profile_id)

        plist = cdb.get_pp_binding(tenant_id, profile_id)
        if plist:
            raise cexc.PortProfileInvalidDelete(tenant_id=tenant_id,
                                                profile_id=profile_id)
        else:
            cdb.remove_portprofile(tenant_id, profile_id)