Central data models of NAV’s management subsystems
Netbox
- class nav.models.manage.Netbox(*args, **kwargs)
From NAV Wiki: The netbox table is the heart of the heart so to speak, the most central table of them all. The netbox tables contains information on all IP devices that NAV manages with adhering information and relations.
- Parameters:
id (AutoField) – Primary key: Id
ip (GenericIPAddressField) – Ip
sysname (VarcharField) – Sysname
up (CharField) – Up
up_since (DateTimeField) – Up since
up_to_date (BooleanField) – Up to date
discovered (DateTimeField) – Discovered
deleted_at (DateTimeField) – Deleted at
data (HStoreField) – Data
Relationship fields:
- Parameters:
room (
ForeignKey
toRoom
) – Room (related name:netboxes
)type (
ForeignKey
toNetboxType
) – Type (related name:netboxes
)category (
ForeignKey
toCategory
) – Category (related name:netboxes
)organization (
ForeignKey
toOrganization
) – Organization (related name:netboxes
)master (
ForeignKey
toNetbox
) – Master (related name:instances
)groups (
ManyToManyField
toNetboxGroup
) – Groups (related name:netboxes
)profiles (
ManyToManyField
toManagementProfile
) – Profiles (related name:netboxes
)
Reverse relationships:
- Parameters:
events (Reverse
ForeignKey
fromEventQueue
) – All events of this IP Device (related name ofnetbox
)alerts (Reverse
ForeignKey
fromAlertQueue
) – All alerts of this IP Device (related name ofnetbox
)alert_history_set (Reverse
ForeignKey
fromAlertHistory
) – All alert history set of this IP Device (related name ofnetbox
)netboxprofile (Reverse
ForeignKey
fromNetboxProfile
) – All netbox profiles of this IP Device (related name ofnetbox
)instances (Reverse
ForeignKey
fromNetbox
) – All instances of this IP Device (related name ofmaster
)info_set (Reverse
ForeignKey
fromNetboxInfo
) – All info set of this IP Device (related name ofnetbox
)entities (Reverse
ForeignKey
fromNetboxEntity
) – All entities of this IP Device (related name ofnetbox
)netboxprefix (Reverse
OneToOneField
fromNetboxPrefix
) – The netbox prefix of this IP Device (related name ofnetbox
)modules (Reverse
ForeignKey
fromModule
) – All modules of this IP Device (related name ofnetbox
)memory_set (Reverse
ForeignKey
fromMemory
) – All memory set of this IP Device (related name ofnetbox
)netboxcategory (Reverse
ForeignKey
fromNetboxCategory
) – All netbox categorys of this IP Device (related name ofnetbox
)vlans (Reverse
ForeignKey
fromVlan
) – All vlans of this IP Device (related name ofnetbox
)arp_set (Reverse
ForeignKey
fromArp
) – All arp set of this IP Device (related name ofnetbox
)from_adjancency_candidates (Reverse
ForeignKey
fromAdjacencyCandidate
) – All from adjancency candidates of this IP Device (related name ofnetbox
)to_adjacency_candidates (Reverse
ForeignKey
fromAdjacencyCandidate
) – All to adjacency candidates of this IP Device (related name ofto_netbox
)netbox_vtp_vlans (Reverse
ForeignKey
fromNetboxVtpVlan
) – All netbox vtp vlans of this IP Device (related name ofnetbox
)cam_set (Reverse
ForeignKey
fromCam
) – All cam set of this IP Device (related name ofnetbox
)interfaces (Reverse
ForeignKey
fromInterface
) – All interfaces of this IP Device (related name ofnetbox
)connected_to_interface (Reverse
ForeignKey
fromInterface
) – All connected to interface of this IP Device (related name ofto_netbox
)gateway_peer_sessions (Reverse
ForeignKey
fromGatewayPeerSession
) – All gateway peer sessions of this IP Device (related name ofnetbox
)sensors (Reverse
ForeignKey
fromSensor
) – All sensors of this IP Device (related name ofnetbox
)power_supplies_or_fans (Reverse
ForeignKey
fromPowerSupplyOrFan
) – All power supplies or fans of this IP Device (related name ofnetbox
)unrecognized_neighbors (Reverse
ForeignKey
fromUnrecognizedNeighbor
) – All unrecognized neighbors of this IP Device (related name ofnetbox
)job_log (Reverse
ForeignKey
fromIpdevpollJobLog
) – All job log of this IP Device (related name ofnetbox
)poe_groups (Reverse
ForeignKey
fromPOEGroup
) – All poe groups of this IP Device (related name ofnetbox
)poe_ports (Reverse
ForeignKey
fromPOEPort
) – All poe ports of this IP Device (related name ofnetbox
)node_positions (Reverse
ForeignKey
fromNetmapViewNodePosition
) – All node positions of this IP Device (related name ofnetbox
)services (Reverse
ForeignKey
fromService
) – All services of this IP Device (related name ofnetbox
)
- exception DoesNotExist
- exception MultipleObjectsReturned
- UP_CHOICES = (('y', 'up'), ('n', 'down'), ('s', 'shadow'))
- UP_DOWN = 'n'
- UP_SHADOW = 's'
- UP_UP = 'y'
- alert_history_set
Type: Reverse
ForeignKey
fromAlertHistory
All alert history set of this IP Device (related name of
netbox
)
- alerts
Type: Reverse
ForeignKey
fromAlertQueue
All alerts of this IP Device (related name of
netbox
)
- arp_set
Type: Reverse
ForeignKey
fromArp
All arp set of this IP Device (related name of
netbox
)
- cam_set
Type: Reverse
ForeignKey
fromCam
All cam set of this IP Device (related name of
netbox
)
- category
Type:
ForeignKey
toCategory
Category (related name:
netboxes
)
- clean()
Custom validation
- connected_to_interface
Type: Reverse
ForeignKey
fromInterface
All connected to interface of this IP Device (related name of
to_netbox
)
- data
Type:
HStoreField
Data
- deleted_at
Type:
DateTimeField
Deleted at
- property device
Property to access the former device-field
Returns the first chassis device if any
- discovered
Type:
DateTimeField
Discovered
- entities
Type: Reverse
ForeignKey
fromNetboxEntity
All entities of this IP Device (related name of
netbox
)
- events
Type: Reverse
ForeignKey
fromEventQueue
All events of this IP Device (related name of
netbox
)
- from_adjancency_candidates
Type: Reverse
ForeignKey
fromAdjacencyCandidate
All from adjancency candidates of this IP Device (related name of
netbox
)
- gateway_peer_sessions
Type: Reverse
ForeignKey
fromGatewayPeerSession
All gateway peer sessions of this IP Device (related name of
netbox
)
- get_absolute_url()
- get_availability()
Calculates and returns an availability data structure.
- get_chassis()
Returns a QuerySet of chassis devices seen on this netbox
- get_environment_sensors()
Returns the sensors to be displayed on the Environment Sensor tab
- get_fans()
- get_filtered_prefix()
Returns the netbox’ prefix address only when the prefix is not a scope, private or reserved prefix.
- get_function()
Returns the function description of this netbox.
- get_gwport_count()
Returns the number of all interfaces that have IP addresses.
- get_gwports()
Returns all interfaces that have IP addresses.
- get_gwports_sorted()
Returns gwports naturally sorted by interface name
- get_last_jobs()
Returns the last log entry for all jobs
- get_next_by_discovered(*, field=<django.db.models.DateTimeField: discovered>, is_next=True, **kwargs)
Finds next instance based on
discovered
. Seeget_next_by_FOO()
for more information.
- get_next_by_up_since(*, field=<django.db.models.DateTimeField: up_since>, is_next=True, **kwargs)
Finds next instance based on
up_since
. Seeget_next_by_FOO()
for more information.
- get_physical_ports()
Return all ports that are present.
- get_physical_ports_sorted()
Return all ports that are present sorted by interface name.
- get_powersupplies()
- get_preferred_snmp_management_profile(require_write=False) → ManagementProfile | None
Returns the snmp management profile with the highest available SNMP version.
- Parameters:
require_write – If True, only write-enabled profiles will be considered. If false, read-only profiles will be preferred, unless a write-enabled profile is the only available alternative.
- get_prefix()
Returns the prefix address for this netbox’ IP address.
- get_previous_by_discovered(*, field=<django.db.models.DateTimeField: discovered>, is_next=False, **kwargs)
Finds previous instance based on
discovered
. Seeget_previous_by_FOO()
for more information.
- get_previous_by_up_since(*, field=<django.db.models.DateTimeField: up_since>, is_next=False, **kwargs)
Finds previous instance based on
up_since
. Seeget_previous_by_FOO()
for more information.
- get_sensors()
Returns sensors associated with this netbox
- get_short_sysname()
Returns sysname without the domain suffix if specified in the DOMAIN_SUFFIX setting in nav.conf
- get_swport_count()
Returns the number of all interfaces that are switch ports.
- get_swports()
Returns all interfaces that are switch ports.
- get_swports_sorted()
Returns swports naturally sorted by interface name
- get_system_metrics()
Gets a list of available Graphite metrics related to this Netbox, except for ports and sensors, which are seen as separate.
- Returns:
A list of dicts describing the metrics, e.g.: {id:”nav.devices.some-gw.cpu.cpu1.loadavg1min”,
group=”cpu”, suffix=”cpu1.loadavg1min”}
- get_unresolved_alerts(kind=None)
Returns a queryset of unresolved alert states
- get_up_display(*, field=<django.db.models.CharField: up>)
Shows the label of the
up
. Seeget_FOO_display()
for more information.
- get_uplinks()
Returns a list of uplinks on this netbox. Requires valid vlan.
- get_uplinks_regarding_of_vlan()
- get_week_availability()
Gets the availability for this netbox for the last week
- groups
Type:
ManyToManyField
toNetboxGroup
Groups (related name:
netboxes
)
- has_unignored_unrecognized_neighbors()
Returns true if this netbox has unignored unrecognized neighbors
- info_set
Type: Reverse
ForeignKey
fromNetboxInfo
All info set of this IP Device (related name of
netbox
)
- instances
Type: Reverse
ForeignKey
fromNetbox
All instances of this IP Device (related name of
master
)
- interfaces
Type: Reverse
ForeignKey
fromInterface
All interfaces of this IP Device (related name of
netbox
)
- ip
Type:
GenericIPAddressField
Ip
- is_on_maintenance()
Returns True if this netbox is currently on maintenance
- is_snmp_down()
Returns True if this netbox has any unresolved snmp agent state alerts
- is_up()
Returns True if the Netbox isn’t known to be down or in shadow
- job_log
Type: Reverse
ForeignKey
fromIpdevpollJobLog
All job log of this IP Device (related name of
netbox
)
- last_downtime_ended()
Returns the end_time of the last known boxState alert.
- Returns:
A datetime object if a serviceState alert was found, otherwise None
- last_updated(job='inventory')
Returns the last updated timestamp of a particular job as a datetime object.
- master
Type:
ForeignKey
toNetbox
Master (related name:
instances
)
- memory_set
Type: Reverse
ForeignKey
fromMemory
All memory set of this IP Device (related name of
netbox
)
- modules
Type: Reverse
ForeignKey
fromModule
All modules of this IP Device (related name of
netbox
)
- netbox_vtp_vlans
Type: Reverse
ForeignKey
fromNetboxVtpVlan
All netbox vtp vlans of this IP Device (related name of
netbox
)
- netboxcategory_set
Type: Reverse
ForeignKey
fromNetboxCategory
All netbox categorys of this IP Device (related name of
netbox
)
- netboxprefix
Type: Reverse
OneToOneField
fromNetboxPrefix
The netbox prefix of this IP Device (related name of
netbox
)
- netboxprofile_set
Type: Reverse
ForeignKey
fromNetboxProfile
All netbox profiles of this IP Device (related name of
netbox
)
- node_positions
Type: Reverse
ForeignKey
fromNetmapViewNodePosition
All node positions of this IP Device (related name of
netbox
)
- objects = <django.db.models.manager.ManagerFromNetboxQuerySet object>
- organization
Type:
ForeignKey
toOrganization
Organization (related name:
netboxes
)
- organization_id
Internal field, use
organization
instead.
- poe_groups
Type: Reverse
ForeignKey
fromPOEGroup
All poe groups of this IP Device (related name of
netbox
)
- poe_ports
Type: Reverse
ForeignKey
fromPOEPort
All poe ports of this IP Device (related name of
netbox
)
- power_supplies_or_fans
Type: Reverse
ForeignKey
fromPowerSupplyOrFan
All power supplies or fans of this IP Device (related name of
netbox
)
- profiles
Type:
ManyToManyField
toManagementProfile
Profiles (related name:
netboxes
)
- room
Type:
ForeignKey
toRoom
Room (related name:
netboxes
)
- sensors
Type: Reverse
ForeignKey
fromSensor
All sensors of this IP Device (related name of
netbox
)
- services
Type: Reverse
ForeignKey
fromService
All services of this IP Device (related name of
netbox
)
- sysname
Type:
VarcharField
Sysname
- to_adjacency_candidates
Type: Reverse
ForeignKey
fromAdjacencyCandidate
All to adjacency candidates of this IP Device (related name of
to_netbox
)
- type
Type:
ForeignKey
toNetboxType
Type (related name:
netboxes
)
- unrecognized_neighbors
Type: Reverse
ForeignKey
fromUnrecognizedNeighbor
All unrecognized neighbors of this IP Device (related name of
netbox
)
- up_since
Type:
DateTimeField
Up since
- up_to_date
Type:
BooleanField
Up to date
- ups_objects = <nav.models.manage.UpsManager object>
- vlans
Type: Reverse
ForeignKey
fromVlan
All vlans of this IP Device (related name of
netbox
)
NetboxType
- class nav.models.manage.NetboxType(*args, **kwargs)
From NAV Wiki: The type table defines the type of a netbox, the sysobjectid being the unique identifier.
- Parameters:
id (AutoField) – Primary key: Id
name (VarcharField) – Type name
sysobjectid (VarcharField) – Sysobjectid
description (VarcharField) – Description
Relationship fields:
- Parameters:
vendor (
ForeignKey
toVendor
) – Vendor (related name:netbox_types
)
Reverse relationships:
- Parameters:
netboxes (Reverse
ForeignKey
fromNetbox
) – All netboxes of this netbox type (related name oftype
)
- exception DoesNotExist
- exception MultipleObjectsReturned
- description
Type:
VarcharField
Description
- get_enterprise_id()
Returns the type’s enterprise ID as an integer.
The type’s sysobjectid should always start with SNMPv2-SMI::enterprises (1.3.6.1.4.1). The next OID element will be an enterprise ID, while the remaining elements will describe the type specific to the vendor.
- name
Type:
VarcharField
Type name
- netboxes
Type: Reverse
ForeignKey
fromNetbox
All netboxes of this netbox type (related name of
type
)
- objects = <django.db.models.Manager object>
- sysobjectid
Type:
VarcharField
Sysobjectid
- vendor
Type:
ForeignKey
toVendor
Vendor (related name:
netbox_types
)
Category
- class nav.models.manage.Category(*args, **kwargs)
From NAV Wiki: The cat table defines the categories of a netbox (GW,GSW,SW,EDGE,WLAN,SRV,OTHER).
- Parameters:
id (CharField) – Primary key: Id
description (VarcharField) – Description
req_mgmt (BooleanField) – Req mgmt
Reverse relationships:
- Parameters:
netboxes (Reverse
ForeignKey
fromNetbox
) – All netboxes of this category (related name ofcategory
)netmap_views (Reverse
ManyToManyField
fromNetmapView
) – All netmap views of this category (related name ofcategories
)netmap_view_categories (Reverse
ForeignKey
fromNetmapViewCategories
) – All netmap view categories of this category (related name ofcategory
)
- exception DoesNotExist
- exception MultipleObjectsReturned
- description
Type:
VarcharField
Description
- is_edge()
Is this an edge switch?
- is_gsw()
Is this a routing switch?
- is_gw()
Is this a router?
- is_other()
Is this an uncategorized device?
- is_srv()
Is this a server?
- is_sw()
Is this a core switch?
- netboxes
Type: Reverse
ForeignKey
fromNetbox
All netboxes of this category (related name of
category
)
- netmap_view_categories
Type: Reverse
ForeignKey
fromNetmapViewCategories
All netmap view categories of this category (related name of
category
)
- netmap_views
Type: Reverse
ManyToManyField
fromNetmapView
All netmap views of this category (related name of
categories
)
- objects = <django.db.models.Manager object>
- req_mgmt
Type:
BooleanField
Req mgmt
Interface
- class nav.models.manage.Interface(*args, **kwargs)
The network interfaces, both physical and virtual, of a Netbox.
- Parameters:
id (AutoField) – Primary key: Id
ifindex (IntegerField) – Ifindex
ifname (VarcharField) – Ifname
ifdescr (VarcharField) – Ifdescr
iftype (IntegerField) – Iftype
speed (FloatField) – Speed
ifphysaddress (CharField) – Ifphysaddress
ifadminstatus (IntegerField) – Ifadminstatus
ifoperstatus (IntegerField) – Ifoperstatus
iflastchange (IntegerField) – Iflastchange
ifconnectorpresent (BooleanField) – Ifconnectorpresent
ifpromiscuousmode (BooleanField) – Ifpromiscuousmode
ifalias (VarcharField) – Ifalias
baseport (IntegerField) – Baseport
media (VarcharField) – Media
vlan (IntegerField) – Vlan
trunk (BooleanField) – Trunk
duplex (CharField) – Duplex
gone_since (DateTimeField) – Gone since
Relationship fields:
- Parameters:
netbox (
ForeignKey
toNetbox
) – Netbox (related name:interfaces
)module (
ForeignKey
toModule
) – Module (related name:interfaces
)to_netbox (
ForeignKey
toNetbox
) – To netbox (related name:connected_to_interface
)to_interface (
ForeignKey
toInterface
) – To interface (related name:connected_to_interface
)
Reverse relationships:
- Parameters:
gwport_prefixes (Reverse
ForeignKey
fromGwPortPrefix
) – All gwport prefixes of this interface (related name ofinterface
)swport_vlans (Reverse
ForeignKey
fromSwPortVlan
) – All swport vlans of this interface (related name ofinterface
)swport_allowed_vlan (Reverse
OneToOneField
fromSwPortAllowedVlan
) – The swport allowed vlan of this interface (related name ofinterface
)blocked_swports (Reverse
ForeignKey
fromSwPortBlocked
) – All blocked swports of this interface (related name ofinterface
)from_adjancency_candidates (Reverse
ForeignKey
fromAdjacencyCandidate
) – All from adjancency candidates of this interface (related name ofinterface
)to_adjacency_candidates (Reverse
ForeignKey
fromAdjacencyCandidate
) – All to adjacency candidates of this interface (related name ofto_interface
)connected_to_interface (Reverse
ForeignKey
fromInterface
) – All connected to interface of this interface (related name ofto_interface
)higher_layer (Reverse
ForeignKey
fromInterfaceStack
) – All higher layer of this interface (related name ofhigher
)lower_layer (Reverse
ForeignKey
fromInterfaceStack
) – All lower layer of this interface (related name oflower
)aggregators (Reverse
ForeignKey
fromInterfaceAggregate
) – All aggregators of this interface (related name ofaggregator
)bundled (Reverse
ForeignKey
fromInterfaceAggregate
) – All bundled of this interface (related name ofinterface
)routing_protocol_attributes (Reverse
ForeignKey
fromRoutingProtocolAttribute
) – All routing protocol attributes of this interface (related name ofinterface
)sensors (Reverse
ForeignKey
fromSensor
) – All sensors of this interface (related name ofinterface
)unrecognized_neighbors (Reverse
ForeignKey
fromUnrecognizedNeighbor
) – All unrecognized neighbors of this interface (related name ofinterface
)poe_ports (Reverse
ForeignKey
fromPOEPort
) – All poe ports of this interface (related name ofinterface
)arnold_identities (Reverse
ForeignKey
fromIdentity
) – All arnold identities of this interface (related name ofinterface
)patches (Reverse
ForeignKey
fromPatch
) – All patches of this interface (related name ofinterface
)
- ADM_DOWN = 2
- ADM_STATUS_CHOICES = ((1, 'up'), (2, 'down'), (3, 'testing'))
- ADM_TESTING = 3
- ADM_UP = 1
- DUPLEX_CHOICES = (('f', 'full duplex'), ('h', 'half duplex'))
- DUPLEX_FULL = 'f'
- DUPLEX_HALF = 'h'
- exception DoesNotExist
- ETHERNET_INTERFACE_TYPES = (6, 62, 69, 117)
- exception MultipleObjectsReturned
- OPER_DORMANT = 5
- OPER_DOWN = 2
- OPER_LOWERLAYERDOWN = 7
- OPER_NOTPRESENT = 6
- OPER_STATUS_CHOICES = ((1, 'up'), (2, 'down'), (3, 'testing'), (4, 'unknown'), (5, 'dormant'), (6, 'not present'), (7, 'lower layer down'))
- OPER_TESTING = 3
- OPER_UNKNOWN = 4
- OPER_UP = 1
- __init__(*args, **kwargs)
- above_me()
Returns interfaces stacked with this one on a layer above
- aggregators
Type: Reverse
ForeignKey
fromInterfaceAggregate
All aggregators of this interface (related name of
aggregator
)
- arnold_identities
Type: Reverse
ForeignKey
fromIdentity
All arnold identities of this interface (related name of
interface
)
- property audit_logname
- baseport
Type:
IntegerField
Baseport
- below_me()
Returns interfaces stacked with this one on a layer below
- blocked_swports
Type: Reverse
ForeignKey
fromSwPortBlocked
All blocked swports of this interface (related name of
interface
)
- bundled
Type: Reverse
ForeignKey
fromInterfaceAggregate
All bundled of this interface (related name of
interface
)
- connected_to_interface
Type: Reverse
ForeignKey
fromInterface
All connected to interface of this interface (related name of
to_interface
)
- from_adjancency_candidates
Type: Reverse
ForeignKey
fromAdjacencyCandidate
All from adjancency candidates of this interface (related name of
interface
)
- get_absolute_url()
- get_active_time(interval=600)
Time since last CAM activity on port, looking at CAM entries for the last
interval
days.Returns None if no activity is found, else number of days since last activity as a datetime.timedelta object.
- get_aggregator()
Returns the interface that is selected as an aggregator for me.
Naively selects the aggregator with the lowest ifIndex in cases where there are multiple aggregators (may happen on e.g. Juniper devices, due to stacking of logical units)
- get_allowed_vlan_ranges()
Returns the set of allowed vlans as a list of ranges
- Return type:
nav.util.NumberRange
- get_bundled_interfaces()
Returns the interfaces that are bundled on this interface
- get_duplex_display(*, field=<django.db.models.CharField: duplex>)
Shows the label of the
duplex
. Seeget_FOO_display()
for more information.
- get_ifadminstatus_display(*, field=<django.db.models.IntegerField: ifadminstatus>)
Shows the label of the
ifadminstatus
. Seeget_FOO_display()
for more information.
- get_ifoperstatus_display(*, field=<django.db.models.IntegerField: ifoperstatus>)
Shows the label of the
ifoperstatus
. Seeget_FOO_display()
for more information.
- get_last_cam_record()
Returns the newest cam record gotten from this switch port.
- get_link_display()
Returns a display value for this interface’s link status.
- get_next_by_gone_since(*, field=<django.db.models.DateTimeField: gone_since>, is_next=True, **kwargs)
Finds next instance based on
gone_since
. Seeget_next_by_FOO()
for more information.
- get_port_metrics()
Gets a list of available Graphite metrics related to this Interface.
- Returns:
A list of dicts describing the metrics, e.g.: {id:”nav.devices.some-gw.ports.gi1_1.ifInOctets”,
suffix:”ifInOctets”}
- get_previous_by_gone_since(*, field=<django.db.models.DateTimeField: gone_since>, is_next=False, **kwargs)
Finds previous instance based on
gone_since
. Seeget_previous_by_FOO()
for more information.
- get_sorted_vlans()
Returns a queryset of sorted swportvlans
- get_trunkvlans_as_range()
Converts the list of allowed vlans on trunk to a string of ranges. Ex: [1, 2, 3, 4, 7, 8, 10] -> “1-4,7-8,10”
- get_vlan_numbers()
List of VLAN numbers related to the port
- gone_since
Type:
DateTimeField
Gone since
- gwport_prefixes
Type: Reverse
ForeignKey
fromGwPortPrefix
All gwport prefixes of this interface (related name of
interface
)
- has_unignored_unrecognized_neighbors()
Returns True if this interface has unrecognized neighbors that are not ignored
- higher_layer
Type: Reverse
ForeignKey
fromInterfaceStack
All higher layer of this interface (related name of
higher
)
- ifadminstatus
Type:
IntegerField
Ifadminstatus
Choices:
1
2
3
- ifalias
Type:
VarcharField
Ifalias
- ifconnectorpresent
Type:
BooleanField
Ifconnectorpresent
- ifdescr
Type:
VarcharField
Ifdescr
- ifindex
Type:
IntegerField
Ifindex
- iflastchange
Type:
IntegerField
Iflastchange
- ifname
Type:
VarcharField
Ifname
- ifoperstatus
Type:
IntegerField
Ifoperstatus
Choices:
1
2
3
4
5
6
7
- ifpromiscuousmode
Type:
BooleanField
Ifpromiscuousmode
- iftype
Type:
IntegerField
Iftype
- is_admin_up()
Returns True if interface is administratively up
- is_degraded()
Returns True if this aggregator has been degraded, False if it has not, None if this interface is not a known aggregator.
- is_gwport()
Returns True if the interface has an IP address.
NOTE: This doesn’t necessarily mean the port forwards packets for other hosts.
- is_on_maintenace()
Returns True if the owning Netbox is on maintenance
- is_oper_up()
Returns True if interface is operationally up
- is_physical_port()
Returns true if this interface has a physical connector present
- is_swport()
Returns True if the interface is configured as a switch-port
- lower_layer
Type: Reverse
ForeignKey
fromInterfaceStack
All lower layer of this interface (related name of
lower
)
- media
Type:
VarcharField
Media
- module
Type:
ForeignKey
toModule
Module (related name:
interfaces
)
- netbox
Type:
ForeignKey
toNetbox
Netbox (related name:
interfaces
)
- objects = <django.db.models.Manager object>
- patches
Type: Reverse
ForeignKey
fromPatch
All patches of this interface (related name of
interface
)
- poe_ports
Type: Reverse
ForeignKey
fromPOEPort
All poe ports of this interface (related name of
interface
)
- routing_protocol_attributes
Type: Reverse
ForeignKey
fromRoutingProtocolAttribute
All routing protocol attributes of this interface (related name of
interface
)
- sensors
Type: Reverse
ForeignKey
fromSensor
All sensors of this interface (related name of
interface
)
- classmethod sort_ports_by_ifname(ports)
- speed
Type:
FloatField
Speed
- swport_allowed_vlan
Type: Reverse
OneToOneField
fromSwPortAllowedVlan
The swport allowed vlan of this interface (related name of
interface
)
- swport_vlans
Type: Reverse
ForeignKey
fromSwPortVlan
All swport vlans of this interface (related name of
interface
)
- to_adjacency_candidates
Type: Reverse
ForeignKey
fromAdjacencyCandidate
All to adjacency candidates of this interface (related name of
to_interface
)
- to_interface
Type:
ForeignKey
toInterface
To interface (related name:
connected_to_interface
)
- to_interface_id
Internal field, use
to_interface
instead.
- to_netbox
Type:
ForeignKey
toNetbox
To netbox (related name:
connected_to_interface
)
- trunk
Type:
BooleanField
Trunk
- unrecognized_neighbors
Type: Reverse
ForeignKey
fromUnrecognizedNeighbor
All unrecognized neighbors of this interface (related name of
interface
)
- vlan
Type:
IntegerField
Vlan
Room
- class nav.models.manage.Room(*args, **kwargs)
From NAV Wiki: The room table defines a wiring closes / network room / server room.
- Parameters:
id (CharField) – Primary key: Id
description (VarcharField) – Description
position (PointField) – Position
data (HStoreField) – Data
Relationship fields:
- Parameters:
location (
ForeignKey
toLocation
) – Location (related name:rooms
)
Reverse relationships:
- Parameters:
netboxes (Reverse
ForeignKey
fromNetbox
) – All netboxes of this room (related name ofroom
)cabling_set (Reverse
ForeignKey
fromCabling
) – All cabling set of this room (related name ofroom
)images (Reverse
ForeignKey
fromImage
) – All images of this room (related name ofroom
)
- exception DoesNotExist
- exception MultipleObjectsReturned
- cabling_set
Type: Reverse
ForeignKey
fromCabling
All cabling set of this room (related name of
room
)
- data
Type:
HStoreField
Data
- description
Type:
VarcharField
Description
- get_absolute_url()
- images
Type: Reverse
ForeignKey
fromImage
All images of this room (related name of
room
)
- property latitude
- location
Type:
ForeignKey
toLocation
Location (related name:
rooms
)
- property longitude
- netboxes
Type: Reverse
ForeignKey
fromNetbox
All netboxes of this room (related name of
room
)
- objects = <django.db.models.Manager object>
- position
Type:
PointField
Position
Location
- class nav.models.manage.Location(*args, **kwargs)
The location table defines a group of rooms; i.e. a campus.
- Parameters:
id (CharField) – Primary key: Id
description (VarcharField) – Description
data (HStoreField) – Data
Relationship fields:
- Parameters:
parent (
ForeignKey
toLocation
) – Parent (related name:child_locations
)
Reverse relationships:
- Parameters:
rooms (Reverse
ForeignKey
fromRoom
) – All rooms of this location (related name oflocation
)child_locations (Reverse
ForeignKey
fromLocation
) – All child locations of this location (related name ofparent
)images (Reverse
ForeignKey
fromImage
) – All images of this location (related name oflocation
)
- exception DoesNotExist
- exception MultipleObjectsReturned
- child_locations
Type: Reverse
ForeignKey
fromLocation
All child locations of this location (related name of
parent
)
- data
Type:
HStoreField
Data
- description
Type:
VarcharField
Description
- get_absolute_url()
- get_all_rooms()
Return a queryset returning all rooms in this location and sublocations
- images
Type: Reverse
ForeignKey
fromImage
All images of this location (related name of
location
)
- objects = <django.db.models.Manager object>
- parent
Type:
ForeignKey
toLocation
Parent (related name:
child_locations
)
- rooms
Type: Reverse
ForeignKey
fromRoom
All rooms of this location (related name of
location
)
Organization
- class nav.models.manage.Organization(*args, **kwargs)
From NAV Wiki: The org table defines an organization which is in charge of a given netbox and is the user of a given prefix.
- Parameters:
id (CharField) – Primary key: Id
description (VarcharField) – Description
contact (VarcharField) – Contact
data (HStoreField) – Data
Relationship fields:
- Parameters:
parent (
ForeignKey
toOrganization
) – Parent (related name:child_organizations
)
Reverse relationships:
- Parameters:
netboxes (Reverse
ForeignKey
fromNetbox
) – All netboxes of this organization (related name oforganization
)child_organizations (Reverse
ForeignKey
fromOrganization
) – All child organizations of this organization (related name ofparent
)vlans (Reverse
ForeignKey
fromVlan
) – All vlans of this organization (related name oforganization
)accounts (Reverse
ManyToManyField
fromAccount
) – All accounts of this organization (related name oforganizations
)arnold_identities (Reverse
ForeignKey
fromIdentity
) – All arnold identities of this organization (related name oforganization
)
- exception DoesNotExist
- exception MultipleObjectsReturned
- accounts
Type: Reverse
ManyToManyField
fromAccount
All accounts of this organization (related name of
organizations
)
- arnold_identities
Type: Reverse
ForeignKey
fromIdentity
All arnold identities of this organization (related name of
organization
)
- child_organizations
Type: Reverse
ForeignKey
fromOrganization
All child organizations of this organization (related name of
parent
)
- contact
Type:
VarcharField
Contact
- data
Type:
HStoreField
Data
- description
Type:
VarcharField
Description
- extract_emails()
Naively extract email addresses from the contact string
- netboxes
Type: Reverse
ForeignKey
fromNetbox
All netboxes of this organization (related name of
organization
)
- objects = <django.db.models.Manager object>
- parent
Type:
ForeignKey
toOrganization
Parent (related name:
child_organizations
)
- vlans
Type: Reverse
ForeignKey
fromVlan
All vlans of this organization (related name of
organization
)