mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 18:38:25 +00:00
5672d10a79
* Add ISIS discovery and polling for iosxe devices * remove ModuleModelObserver * add php stan exclusions as they are already present for the base module * change port_id to cached lookup * Create model object instead of using arrays and set properties directly * remove unneeded space... * remove null from non nullable field * revert to extending from ciscowlc rather than os * remove OS module * remove phpstan exclusions and fix errors * add spacing... * add spacing.... * add spacing * again... * Add tests * Update Iosxe.php * Update IsisAdjacency.php * Create 2022_04_08_085504_isis_adjacencies_table_add_index.php * Update db_schema.yaml * Update iosxe_asr920.json * Update Iosxe.php * Update Iosxe.php * Update junos_mx5t_isis.json Co-authored-by: Tony Murray <murraytony@gmail.com>
66 lines
1.7 KiB
PHP
66 lines
1.7 KiB
PHP
<?php
|
|
/**
|
|
* IsisAdjacency.php
|
|
*
|
|
* -Description-
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
* @link http://librenms.org
|
|
*
|
|
* @copyright 2021 Otto Reinikainen
|
|
* @author Otto Reinikainen <otto@ottorei.fi>
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use LibreNMS\Interfaces\Models\Keyable;
|
|
|
|
class IsisAdjacency extends PortRelatedModel implements Keyable
|
|
{
|
|
use HasFactory;
|
|
|
|
//public $primaryKey = 'id';
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'device_id',
|
|
'index',
|
|
'port_id',
|
|
'ifIndex',
|
|
'isisCircAdminState',
|
|
'isisISAdjState',
|
|
'isisISAdjNeighSysType',
|
|
'isisISAdjNeighSysID',
|
|
'isisISAdjNeighPriority',
|
|
'isisISAdjLastUpTime',
|
|
'isisISAdjAreaAddress',
|
|
'isisISAdjIPAddrType',
|
|
'isisISAdjIPAddrAddress',
|
|
];
|
|
|
|
// ---- Define Relationships ----
|
|
|
|
public function device()
|
|
{
|
|
return $this->belongsTo(\App\Models\Port::class, 'device_id');
|
|
}
|
|
|
|
public function getCompositeKey()
|
|
{
|
|
return $this->ifIndex . $this->index;
|
|
}
|
|
}
|