Files
librenms-librenms/app/Models/MplsLspPath.php
Vitali Kari 00b148dbd3 Add MPLS Support (#10263)
* WIP - Add MPLS Support
This introduce the generic MPLS support
- New database tables for MPLS LSPs
- actually discovery and polling on NOKIA SR OS (Timetra) devices
- new routing->MPLS HTML pages

- ToDo MPLS LSP paths table and views
Suggestions and improvements are welcome

* add db schema

* some fixes

* add path table, discovery and polling

* add path views

* add test data

* Convert MPLS module to new style
Implement a SyncsModels trait to simplify code a lot

* abs() for negative value from snmp (bug?), test data

* fix db schema

* Fix up test data, remove uneeded data in json

* fix whitespace
2019-06-06 16:12:13 -05:00

51 lines
1.2 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use LibreNMS\Interfaces\Models\Keyable;
class MplsLspPath extends Model implements Keyable
{
protected $primaryKey = 'lsp_path_id';
public $timestamps = false;
protected $fillable = [
'lsp_id',
'path_oid',
'device_id',
'mplsLspPathRowStatus',
'mplsLspPathLastChange',
'mplsLspPathType',
'mplsLspPathBandwidth',
'mplsLspPathOperBandwidth',
'mplsLspPathAdminState',
'mplsLspPathOperState',
'mplsLspPathState',
'mplsLspPathFailCode',
'mplsLspPathFailNodeAddr',
'mplsLspPathMetric',
'mplsLspPathOperMetric',
'mplsLspPathTimeUp',
'mplsLspPathTimeDown',
'mplsLspPathTransitionCount',
];
// ---- Helper Functions ----
/**
* Get a string that can identify a unique instance of this model
* @return string
*/
public function getCompositeKey()
{
return $this->lsp_id . '-' . $this->path_oid;
}
// ---- Define Relationships ----
public function lsp()
{
return $this->belongsTo('App\Models\MplsLsp', 'lsp_id');
}
}