Пример #1
0
    def _get_if_entry(self, sub_id):
        """
        :param oid: The 1-based sub-identifier query.
        :return: the DB entry for the respective sub_id.
        """
        oid = self.get_oid(sub_id)
        if not oid:
            return

        if_table = ""
        # Once PORT_TABLE will be moved to CONFIG DB
        # we will get entry from CONFIG_DB for all cases
        db = mibs.APPL_DB
        if oid in self.oid_lag_name_map:
            if_table = mibs.lag_entry_table(self.oid_lag_name_map[oid])
        elif oid in self.mgmt_oid_name_map:
            if_table = mibs.mgmt_if_entry_table(self.mgmt_oid_name_map[oid])
            db = mibs.CONFIG_DB
        elif oid in self.vlan_oid_name_map:
            if_table = mibs.vlan_entry_table(self.vlan_oid_name_map[oid])
        elif oid in self.oid_name_map:
            if_table = mibs.if_entry_table(self.oid_name_map[oid])
        else:
            return None

        return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=True)
Пример #2
0
    def _get_if_entry(self, if_name):
        if_table = ""

        # Once PORT_TABLE will be moved to CONFIG DB
        # we will get entry from CONFIG_DB for all cases
        db = mibs.APPL_DB
        if if_name in self.if_name_map:
            if_table = mibs.if_entry_table(if_name)
        elif if_name in self.mgmt_oid_name_map.values():
            if_table = mibs.mgmt_if_entry_table(if_name)
            db = mibs.CONFIG_DB
        else:
            return None

        return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=True)
Пример #3
0
    def _get_if_entry(self, if_name):
        if_table = ""

        # Once PORT_TABLE will be moved to CONFIG DB
        # we will get entry from CONFIG_DB for all cases
        db = mibs.APPL_DB
        if if_name in self.if_name_map:
            if_table = mibs.if_entry_table(if_name)
        elif if_name in self.mgmt_oid_name_map.values():
            if_table = mibs.mgmt_if_entry_table(if_name)
            db = mibs.CONFIG_DB
        else:
            return None

        return self.db_conn.get_all(db, if_table, blocking=True)
Пример #4
0
    def _get_if_entry(self, sub_id):
        """
        :param oid: The 1-based sub-identifier query.
        :return: the DB entry for the respective sub_id.
        """
        oid = self.get_oid(sub_id)
        if not oid:
            return

        if_table = ""
        # Once PORT_TABLE will be moved to CONFIG DB
        # we will get entry from CONFIG_DB for all cases
        db = mibs.APPL_DB
        if oid in self.oid_lag_name_map:
            if_table = mibs.lag_entry_table(self.oid_lag_name_map[oid])
        elif oid in self.mgmt_oid_name_map:
            if_table = mibs.mgmt_if_entry_table(self.mgmt_oid_name_map[oid])
            db = mibs.CONFIG_DB
        elif oid in self.oid_name_map:
            if_table = mibs.if_entry_table(self.oid_name_map[oid])
        else:
            return None

        return self.db_conn.get_all(db, if_table, blocking=True)