Example #1
0
 def create_portprofile(self, tenant_id, profile_name, qos):
     """Create port profile"""
     LOG.debug(_("create_portprofile() called"))
     portprofile = cdb.add_portprofile(tenant_id, profile_name, const.NO_VLAN_ID, qos)
     new_pp = cutil.make_portprofile_dict(
         tenant_id, portprofile[const.UUID], portprofile[const.PPNAME], portprofile[const.PPQOS]
     )
     return new_pp
Example #2
0
 def create_portprofile(self, tenant_id, profile_name, qos):
     """Create port profile"""
     LOG.debug("create_portprofile() called\n")
     portprofile = cdb.add_portprofile(tenant_id, profile_name,
                              const.NO_VLAN_ID, qos)
     new_pp = cutil.make_portprofile_dict(tenant_id,
                                          portprofile[const.UUID],
                                          portprofile[const.PPNAME],
                                          portprofile[const.PPQOS])
     return new_pp
Example #3
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 #4
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 #5
0
    def get_all_portprofiles(self, tenant_id):
        """Get all port profiles"""
        LOG.debug(_("get_all_portprofiles() called"))
        pplist = cdb.get_all_portprofiles()
        new_pplist = []
        for portprofile in pplist:
            new_pp = cutil.make_portprofile_dict(
                tenant_id, portprofile[const.UUID], portprofile[const.PPNAME], portprofile[const.PPQOS]
            )
            new_pplist.append(new_pp)

        return new_pplist
Example #6
0
    def get_all_portprofiles(self, tenant_id):
        """Get all port profiles"""
        LOG.debug("get_all_portprofiles() called\n")
        pplist = cdb.get_all_portprofiles()
        new_pplist = []
        for portprofile in pplist:
            new_pp = cutil.make_portprofile_dict(tenant_id,
                                                 portprofile[const.UUID],
                                                 portprofile[const.PPNAME],
                                                 portprofile[const.PPQOS])
            new_pplist.append(new_pp)

        return new_pplist
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