mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
55 lines
1.3 KiB
PHP
55 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
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',
|
|
'mplsLspPathTunnelARHopListIndex',
|
|
'mplsLspPathTunnelCHopListIndex',
|
|
];
|
|
|
|
// ---- 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(): BelongsTo
|
|
{
|
|
return $this->belongsTo(\App\Models\MplsLsp::class, 'lsp_id');
|
|
}
|
|
}
|