Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pynetbox/models/dcim.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,22 @@
from pynetbox.core.endpoint import DetailEndpoint, RODetailEndpoint
from pynetbox.core.query import Request
from pynetbox.core.response import JsonField, Record
from pynetbox.models.circuits import Circuits
from pynetbox.models.circuits import Circuits, CircuitTerminations
from pynetbox.models.ipam import IpAddresses


class TraceableRecord(Record):
def _get_obj_class(self, url):
uri_to_obj_class_map = {
"circuits/circuit-terminations": CircuitTerminations,
"dcim/cables": Cables,
"dcim/console-ports": ConsolePorts,
"dcim/console-server-ports": ConsoleServerPorts,
"dcim/front-ports": FrontPorts,
"dcim/interfaces": Interfaces,
"dcim/power-feeds": PowerFeeds,
"dcim/power-outlets": PowerOutlets,
"dcim/power-ports": PowerPorts,
"dcim/rear-ports": RearPorts,
}

Expand Down Expand Up @@ -154,6 +160,10 @@ class Interfaces(TraceableRecord):
interface_connection = InterfaceConnection


class PowerFeeds(TraceableRecord):
pass


class PowerOutlets(TraceableRecord):
device = Devices

Expand Down
3 changes: 2 additions & 1 deletion pynetbox/models/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
DeviceTypes,
FrontPorts,
Interfaces,
PowerFeeds,
PowerOutlets,
PowerPorts,
RackReservations,
Expand Down Expand Up @@ -48,7 +49,7 @@
"dcim.modulebaytemplate": None,
"dcim.moduletype": None,
"dcim.platform": None,
"dcim.powerfeed": None,
"dcim.powerfeed": PowerFeeds,
"dcim.poweroutlet": PowerOutlets,
"dcim.poweroutlettemplate": None,
"dcim.powerpanel": None,
Expand Down
Loading