Skip to content

Commit 4dd9d43

Browse files
committed
change related parameter names, change nested endpoints
1 parent ce1e503 commit 4dd9d43

28 files changed

Lines changed: 324 additions & 108 deletions

app/Restify/CefSwitchingRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class CefSwitchingRepository extends Repository
1616

1717
public static string $model = CefSwitching::class;
1818

19+
public static string $uriKey = 'cef-switching';
20+
1921
public static string $id = 'cef_switching_id';
2022

2123
public static string $title = 'cef_path';

app/Restify/DeviceRepository.php

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace App\Restify;
44

55
use App\Models\Device;
6-
use App\Models\Location;
76
use Binaryk\LaravelRestify\Fields\BelongsTo;
87
use Binaryk\LaravelRestify\Fields\BelongsToMany;
98
use Binaryk\LaravelRestify\Fields\HasMany;
@@ -31,18 +30,49 @@ public static function related(): array
3130
'ports' => HasMany::make('ports', PortRepository::class),
3231
'sensors' => HasMany::make('sensors', SensorRepository::class),
3332
'processors' => HasMany::make('processors', ProcessorRepository::class),
34-
'mempools' => HasMany::make('mempools', MempoolRepository::class),
33+
'memory-pools' => HasMany::make('mempools', MempoolRepository::class)->label('memory-pools'),
3534
'storage' => HasMany::make('storage', StorageRepository::class),
3635
'services' => HasMany::make('services', ServiceRepository::class),
37-
'bgpPeers' => HasMany::make('bgpPeers', BgpPeerRepository::class),
36+
'bgp-peers' => HasMany::make('bgpPeers', BgpPeerRepository::class)->label('bgp-peers'),
3837
'components' => HasMany::make('components', ComponentRepository::class),
3938
'applications' => HasMany::make('applications', ApplicationRepository::class),
4039
'inventory' => HasMany::make('entityPhysical', InventoryRepository::class),
4140
'eventlogs' => HasMany::make('eventlogs', EventlogRepository::class),
4241
'syslogs' => HasMany::make('syslogs', SyslogRepository::class),
43-
'alertLogs' => HasMany::make('alertLogs', AlertLogRepository::class),
42+
'alert-logs' => HasMany::make('alertLogs', AlertLogRepository::class)->label('alert-logs'),
4443
'location' => BelongsTo::make('location', LocationRepository::class),
4544
'groups' => BelongsToMany::make('groups', DeviceGroupRepository::class),
45+
'alerts' => HasMany::make('alerts', AlertRepository::class),
46+
'outages' => HasMany::make('outages', DeviceOutageRepository::class),
47+
'links' => HasMany::make('links', LinkRepository::class),
48+
'vlans' => HasMany::make('vlans', VlanRepository::class),
49+
'vrfs' => HasMany::make('vrfs', VrfRepository::class),
50+
'vrf-lite' => HasMany::make('vrfLites', VrfLiteRepository::class)->label('vrf-lite'),
51+
'routes' => HasMany::make('routes', RouteRepository::class),
52+
'access-points' => HasMany::make('accessPoints', AccessPointRepository::class)->label('access-points'),
53+
'wireless-sensors' => HasMany::make('wirelessSensors', WirelessSensorRepository::class)->label('wireless-sensors'),
54+
'disk-io' => HasMany::make('diskIo', DiskIoRepository::class)->label('disk-io'),
55+
'service-level-agreements' => HasMany::make('slas', SlaRepository::class)->label('service-level-agreements'),
56+
'cef-switching' => HasMany::make('cefSwitching', CefSwitchingRepository::class)->label('cef-switching'),
57+
'spanning-trees' => HasMany::make('stpInstances', StpRepository::class)->label('spanning-trees'),
58+
'ipsec-tunnels' => HasMany::make('ipsecTunnels', IpsecTunnelRepository::class)->label('ipsec-tunnels'),
59+
'isis-adjacencies' => HasMany::make('isisAdjacencies', IsisAdjacencyRepository::class)->label('isis-adjacencies'),
60+
'ospf-instances' => HasMany::make('ospfInstances', OspfInstanceRepository::class)->label('ospf-instances'),
61+
'ospf-areas' => HasMany::make('ospfAreas', OspfAreaRepository::class)->label('ospf-areas'),
62+
'ospf-neighbors' => HasMany::make('ospfNbrs', OspfNbrRepository::class)->label('ospf-neighbors'),
63+
'ospf-ports' => HasMany::make('ospfPorts', OspfPortRepository::class)->label('ospf-ports'),
64+
'ospfv3-instances' => HasMany::make('ospfv3Instances', Ospfv3InstanceRepository::class)->label('ospfv3-instances'),
65+
'ospfv3-areas' => HasMany::make('ospfv3Areas', Ospfv3AreaRepository::class)->label('ospfv3-areas'),
66+
'ospfv3-neighbors' => HasMany::make('ospfv3Nbrs', Ospfv3NbrRepository::class)->label('ospfv3-neighbors'),
67+
'ospfv3-ports' => HasMany::make('ospfv3Ports', Ospfv3PortRepository::class)->label('ospfv3-ports'),
68+
'mpls-label-switched-paths' => HasMany::make('mplsLsps', MplsLspRepository::class)->label('mpls-label-switched-paths'),
69+
'mpls-label-switched-path-routes' => HasMany::make('mplsLspPaths', MplsLspPathRepository::class)->label('mpls-label-switched-path-routes'),
70+
'mpls-service-distribution-points' => HasMany::make('mplsSdps', MplsSdpRepository::class)->label('mpls-service-distribution-points'),
71+
'mpls-service-distribution-point-bindings' => HasMany::make('mplsSdpBinds', MplsSdpBindRepository::class)->label('mpls-service-distribution-point-bindings'),
72+
'mpls-service-access-points' => HasMany::make('mplsSaps', MplsSapRepository::class)->label('mpls-service-access-points'),
73+
'mpls-services' => HasMany::make('mplsServices', MplsServiceRepository::class)->label('mpls-services'),
74+
'mpls-tunnel-actual-route-hops' => HasMany::make('mplsTunnelArHops', MplsTunnelArHopRepository::class)->label('mpls-tunnel-actual-route-hops'),
75+
'mpls-tunnel-computed-hops' => HasMany::make('mplsTunnelCHops', MplsTunnelCHopRepository::class)->label('mpls-tunnel-computed-hops'),
4676
];
4777
}
4878

app/Restify/DiskIoRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class DiskIoRepository extends Repository
1616

1717
public static string $model = DiskIo::class;
1818

19+
public static string $uriKey = 'disk-io';
20+
1921
public static string $id = 'diskio_id';
2022

2123
public static string $title = 'diskio_descr';

app/Restify/Ipv4MacRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class Ipv4MacRepository extends Repository
1515

1616
public static string $model = Ipv4Mac::class;
1717

18+
public static string $uriKey = 'ipv4-mac-addresses';
19+
1820
public static string $title = 'ipv4_address';
1921

2022

app/Restify/Ipv6NdRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class Ipv6NdRepository extends Repository
1616
{
1717
public static string $model = Ipv6Nd::class;
1818

19+
public static string $uriKey = 'ipv6-neighbor-discovery';
20+
1921
public static string $title = 'ipv6_address';
2022

2123

app/Restify/MempoolRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class MempoolRepository extends Repository
1616

1717
public static string $model = Mempool::class;
1818

19+
public static string $uriKey = 'memory-pools';
20+
1921
public static string $id = 'mempool_id';
2022

2123
public static string $title = 'mempool_descr';

app/Restify/MplsLspPathRepository.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class MplsLspPathRepository extends Repository
1616

1717
public static string $model = MplsLspPath::class;
1818

19+
public static string $uriKey = 'mpls-label-switched-path-routes';
20+
1921
public static string $id = 'lsp_path_id';
2022

2123
public static string $title = 'mplsLspPathType';
@@ -27,7 +29,7 @@ public static function related(): array
2729
{
2830
return [
2931
'device' => BelongsTo::make('device', DeviceRepository::class),
30-
'lsp' => BelongsTo::make('lsp', MplsLspRepository::class),
32+
'label-switched-path' => BelongsTo::make('lsp', MplsLspRepository::class)->label('label-switched-path'),
3133
];
3234
}
3335

app/Restify/MplsLspRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class MplsLspRepository extends Repository
1616

1717
public static string $model = MplsLsp::class;
1818

19+
public static string $uriKey = 'mpls-label-switched-paths';
20+
1921
public static string $id = 'lsp_id';
2022

2123
public static string $title = 'mplsLspName';

app/Restify/MplsSapRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class MplsSapRepository extends Repository
1616

1717
public static string $model = MplsSap::class;
1818

19+
public static string $uriKey = 'mpls-service-access-points';
20+
1921
public static string $id = 'sap_id';
2022

2123
public static string $title = 'sapDescription';

app/Restify/MplsSdpBindRepository.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class MplsSdpBindRepository extends Repository
1616

1717
public static string $model = MplsSdpBind::class;
1818

19+
public static string $uriKey = 'mpls-service-distribution-point-bindings';
20+
1921
public static string $id = 'bind_id';
2022

2123
public static string $title = 'bind_id';
@@ -26,7 +28,7 @@ public static function related(): array
2628
{
2729
return [
2830
'device' => BelongsTo::make('device', DeviceRepository::class),
29-
'sdp' => BelongsTo::make('sdp', MplsSdpRepository::class),
31+
'service-distribution-point' => BelongsTo::make('sdp', MplsSdpRepository::class)->label('service-distribution-point'),
3032
'service' => BelongsTo::make('service', MplsServiceRepository::class),
3133
];
3234
}

0 commit comments

Comments
 (0)