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 (
ForeignKeytoRoom) – Room (related name:netboxes)type (
ForeignKeytoNetboxType) – Type (related name:netboxes)category (
ForeignKeytoCategory) – Category (related name:netboxes)organization (
ForeignKeytoOrganization) – Organization (related name:netboxes)master (
ForeignKeytoNetbox) – Master (related name:instances)groups (
ManyToManyFieldtoNetboxGroup) – Groups (related name:netboxes)profiles (
ManyToManyFieldtoManagementProfile) – Profiles (related name:netboxes)
Reverse relationships:
- Parameters:
events (Reverse
ForeignKeyfromEventQueue) – All events of this IP Device (related name ofnetbox)alerts (Reverse
ForeignKeyfromAlertQueue) – All alerts of this IP Device (related name ofnetbox)alert_history_set (Reverse
ForeignKeyfromAlertHistory) – All alert history set of this IP Device (related name ofnetbox)netboxprofile (Reverse
ForeignKeyfromNetboxProfile) – All netbox profiles of this IP Device (related name ofnetbox)instances (Reverse
ForeignKeyfromNetbox) – All instances of this IP Device (related name ofmaster)info_set (Reverse
ForeignKeyfromNetboxInfo) – All info set of this IP Device (related name ofnetbox)entities (Reverse
ForeignKeyfromNetboxEntity) – All entities of this IP Device (related name ofnetbox)netboxprefix (Reverse
OneToOneFieldfromNetboxPrefix) – The netbox prefix of this IP Device (related name ofnetbox)modules (Reverse
ForeignKeyfromModule) – All modules of this IP Device (related name ofnetbox)memory_set (Reverse
ForeignKeyfromMemory) – All memory set of this IP Device (related name ofnetbox)netboxcategory (Reverse
ForeignKeyfromNetboxCategory) – All netbox categorys of this IP Device (related name ofnetbox)vlans (Reverse
ForeignKeyfromVlan) – All vlans of this IP Device (related name ofnetbox)arp_set (Reverse
ForeignKeyfromArp) – All arp set of this IP Device (related name ofnetbox)from_adjancency_candidates (Reverse
ForeignKeyfromAdjacencyCandidate) – All from adjancency candidates of this IP Device (related name ofnetbox)to_adjacency_candidates (Reverse
ForeignKeyfromAdjacencyCandidate) – All to adjacency candidates of this IP Device (related name ofto_netbox)netbox_vtp_vlans (Reverse
ForeignKeyfromNetboxVtpVlan) – All netbox vtp vlans of this IP Device (related name ofnetbox)cam_set (Reverse
ForeignKeyfromCam) – All cam set of this IP Device (related name ofnetbox)interfaces (Reverse
ForeignKeyfromInterface) – All interfaces of this IP Device (related name ofnetbox)connected_to_interface (Reverse
ForeignKeyfromInterface) – All connected to interface of this IP Device (related name ofto_netbox)gateway_peer_sessions (Reverse
ForeignKeyfromGatewayPeerSession) – All gateway peer sessions of this IP Device (related name ofnetbox)sensors (Reverse
ForeignKeyfromSensor) – All sensors of this IP Device (related name ofnetbox)power_supplies_or_fans (Reverse
ForeignKeyfromPowerSupplyOrFan) – All power supplies or fans of this IP Device (related name ofnetbox)unrecognized_neighbors (Reverse
ForeignKeyfromUnrecognizedNeighbor) – All unrecognized neighbors of this IP Device (related name ofnetbox)job_log (Reverse
ForeignKeyfromIpdevpollJobLog) – All job log of this IP Device (related name ofnetbox)poe_groups (Reverse
ForeignKeyfromPOEGroup) – All poe groups of this IP Device (related name ofnetbox)poe_ports (Reverse
ForeignKeyfromPOEPort) – All poe ports of this IP Device (related name ofnetbox)node_positions (Reverse
ForeignKeyfromNetmapViewNodePosition) – All node positions of this IP Device (related name ofnetbox)services (Reverse
ForeignKeyfromService) – 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
ForeignKeyfromAlertHistoryAll alert history set of this IP Device (related name of
netbox)
- alerts
Type: Reverse
ForeignKeyfromAlertQueueAll alerts of this IP Device (related name of
netbox)
- arp_set
Type: Reverse
ForeignKeyfromArpAll arp set of this IP Device (related name of
netbox)
- cam_set
Type: Reverse
ForeignKeyfromCamAll cam set of this IP Device (related name of
netbox)
- category
Type:
ForeignKeytoCategoryCategory (related name:
netboxes)
- clean()
Custom validation
- connected_to_interface
Type: Reverse
ForeignKeyfromInterfaceAll connected to interface of this IP Device (related name of
to_netbox)
- data
Type:
HStoreFieldData
- deleted_at
Type:
DateTimeFieldDeleted at
- property device
Property to access the former device-field
Returns the first chassis device if any
- discovered
Type:
DateTimeFieldDiscovered
- entities
Type: Reverse
ForeignKeyfromNetboxEntityAll entities of this IP Device (related name of
netbox)
- events
Type: Reverse
ForeignKeyfromEventQueueAll events of this IP Device (related name of
netbox)
- from_adjancency_candidates
Type: Reverse
ForeignKeyfromAdjacencyCandidateAll from adjancency candidates of this IP Device (related name of
netbox)
- gateway_peer_sessions
Type: Reverse
ForeignKeyfromGatewayPeerSessionAll 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:
ManyToManyFieldtoNetboxGroupGroups (related name:
netboxes)
- has_unignored_unrecognized_neighbors()
Returns true if this netbox has unignored unrecognized neighbors
- info_set
Type: Reverse
ForeignKeyfromNetboxInfoAll info set of this IP Device (related name of
netbox)
- instances
Type: Reverse
ForeignKeyfromNetboxAll instances of this IP Device (related name of
master)
- interfaces
Type: Reverse
ForeignKeyfromInterfaceAll interfaces of this IP Device (related name of
netbox)
- ip
Type:
GenericIPAddressFieldIp
- 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
ForeignKeyfromIpdevpollJobLogAll 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:
ForeignKeytoNetboxMaster (related name:
instances)
- memory_set
Type: Reverse
ForeignKeyfromMemoryAll memory set of this IP Device (related name of
netbox)
- modules
Type: Reverse
ForeignKeyfromModuleAll modules of this IP Device (related name of
netbox)
- netbox_vtp_vlans
Type: Reverse
ForeignKeyfromNetboxVtpVlanAll netbox vtp vlans of this IP Device (related name of
netbox)
- netboxcategory_set
Type: Reverse
ForeignKeyfromNetboxCategoryAll netbox categorys of this IP Device (related name of
netbox)
- netboxprefix
Type: Reverse
OneToOneFieldfromNetboxPrefixThe netbox prefix of this IP Device (related name of
netbox)
- netboxprofile_set
Type: Reverse
ForeignKeyfromNetboxProfileAll netbox profiles of this IP Device (related name of
netbox)
- node_positions
Type: Reverse
ForeignKeyfromNetmapViewNodePositionAll node positions of this IP Device (related name of
netbox)
- objects = <django.db.models.manager.ManagerFromNetboxQuerySet object>
- organization
Type:
ForeignKeytoOrganizationOrganization (related name:
netboxes)
- organization_id
Internal field, use
organizationinstead.
- poe_groups
Type: Reverse
ForeignKeyfromPOEGroupAll poe groups of this IP Device (related name of
netbox)
- poe_ports
Type: Reverse
ForeignKeyfromPOEPortAll poe ports of this IP Device (related name of
netbox)
- power_supplies_or_fans
Type: Reverse
ForeignKeyfromPowerSupplyOrFanAll power supplies or fans of this IP Device (related name of
netbox)
- profiles
Type:
ManyToManyFieldtoManagementProfileProfiles (related name:
netboxes)
- room
Type:
ForeignKeytoRoomRoom (related name:
netboxes)
- sensors
Type: Reverse
ForeignKeyfromSensorAll sensors of this IP Device (related name of
netbox)
- services
Type: Reverse
ForeignKeyfromServiceAll services of this IP Device (related name of
netbox)
- sysname
Type:
VarcharFieldSysname
- to_adjacency_candidates
Type: Reverse
ForeignKeyfromAdjacencyCandidateAll to adjacency candidates of this IP Device (related name of
to_netbox)
- type
Type:
ForeignKeytoNetboxTypeType (related name:
netboxes)
- unrecognized_neighbors
Type: Reverse
ForeignKeyfromUnrecognizedNeighborAll unrecognized neighbors of this IP Device (related name of
netbox)
- up_since
Type:
DateTimeFieldUp since
- up_to_date
Type:
BooleanFieldUp to date
- ups_objects = <nav.models.manage.UpsManager object>
- vlans
Type: Reverse
ForeignKeyfromVlanAll 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 (
ForeignKeytoVendor) – Vendor (related name:netbox_types)
Reverse relationships:
- Parameters:
netboxes (Reverse
ForeignKeyfromNetbox) – All netboxes of this netbox type (related name oftype)
- exception DoesNotExist
- exception MultipleObjectsReturned
- description
Type:
VarcharFieldDescription
- 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:
VarcharFieldType name
- netboxes
Type: Reverse
ForeignKeyfromNetboxAll netboxes of this netbox type (related name of
type)
- objects = <django.db.models.Manager object>
- sysobjectid
Type:
VarcharFieldSysobjectid
- vendor
Type:
ForeignKeytoVendorVendor (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
ForeignKeyfromNetbox) – All netboxes of this category (related name ofcategory)netmap_views (Reverse
ManyToManyFieldfromNetmapView) – All netmap views of this category (related name ofcategories)netmap_view_categories (Reverse
ForeignKeyfromNetmapViewCategories) – All netmap view categories of this category (related name ofcategory)
- exception DoesNotExist
- exception MultipleObjectsReturned
- description
Type:
VarcharFieldDescription
- 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
ForeignKeyfromNetboxAll netboxes of this category (related name of
category)
- netmap_view_categories
Type: Reverse
ForeignKeyfromNetmapViewCategoriesAll netmap view categories of this category (related name of
category)
- netmap_views
Type: Reverse
ManyToManyFieldfromNetmapViewAll netmap views of this category (related name of
categories)
- objects = <django.db.models.Manager object>
- req_mgmt
Type:
BooleanFieldReq 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 (
ForeignKeytoNetbox) – Netbox (related name:interfaces)module (
ForeignKeytoModule) – Module (related name:interfaces)to_netbox (
ForeignKeytoNetbox) – To netbox (related name:connected_to_interface)to_interface (
ForeignKeytoInterface) – To interface (related name:connected_to_interface)
Reverse relationships:
- Parameters:
gwport_prefixes (Reverse
ForeignKeyfromGwPortPrefix) – All gwport prefixes of this interface (related name ofinterface)swport_vlans (Reverse
ForeignKeyfromSwPortVlan) – All swport vlans of this interface (related name ofinterface)swport_allowed_vlan (Reverse
OneToOneFieldfromSwPortAllowedVlan) – The swport allowed vlan of this interface (related name ofinterface)blocked_swports (Reverse
ForeignKeyfromSwPortBlocked) – All blocked swports of this interface (related name ofinterface)from_adjancency_candidates (Reverse
ForeignKeyfromAdjacencyCandidate) – All from adjancency candidates of this interface (related name ofinterface)to_adjacency_candidates (Reverse
ForeignKeyfromAdjacencyCandidate) – All to adjacency candidates of this interface (related name ofto_interface)connected_to_interface (Reverse
ForeignKeyfromInterface) – All connected to interface of this interface (related name ofto_interface)higher_layer (Reverse
ForeignKeyfromInterfaceStack) – All higher layer of this interface (related name ofhigher)lower_layer (Reverse
ForeignKeyfromInterfaceStack) – All lower layer of this interface (related name oflower)aggregators (Reverse
ForeignKeyfromInterfaceAggregate) – All aggregators of this interface (related name ofaggregator)bundled (Reverse
ForeignKeyfromInterfaceAggregate) – All bundled of this interface (related name ofinterface)routing_protocol_attributes (Reverse
ForeignKeyfromRoutingProtocolAttribute) – All routing protocol attributes of this interface (related name ofinterface)sensors (Reverse
ForeignKeyfromSensor) – All sensors of this interface (related name ofinterface)unrecognized_neighbors (Reverse
ForeignKeyfromUnrecognizedNeighbor) – All unrecognized neighbors of this interface (related name ofinterface)poe_ports (Reverse
ForeignKeyfromPOEPort) – All poe ports of this interface (related name ofinterface)arnold_identities (Reverse
ForeignKeyfromIdentity) – All arnold identities of this interface (related name ofinterface)patches (Reverse
ForeignKeyfromPatch) – 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
ForeignKeyfromInterfaceAggregateAll aggregators of this interface (related name of
aggregator)
- arnold_identities
Type: Reverse
ForeignKeyfromIdentityAll arnold identities of this interface (related name of
interface)
- property audit_logname
- baseport
Type:
IntegerFieldBaseport
- below_me()
Returns interfaces stacked with this one on a layer below
- blocked_swports
Type: Reverse
ForeignKeyfromSwPortBlockedAll blocked swports of this interface (related name of
interface)
- bundled
Type: Reverse
ForeignKeyfromInterfaceAggregateAll bundled of this interface (related name of
interface)
- connected_to_interface
Type: Reverse
ForeignKeyfromInterfaceAll connected to interface of this interface (related name of
to_interface)
- from_adjancency_candidates
Type: Reverse
ForeignKeyfromAdjacencyCandidateAll 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
intervaldays.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:
DateTimeFieldGone since
- gwport_prefixes
Type: Reverse
ForeignKeyfromGwPortPrefixAll 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
ForeignKeyfromInterfaceStackAll higher layer of this interface (related name of
higher)
- ifadminstatus
Type:
IntegerFieldIfadminstatus
Choices:
123
- ifalias
Type:
VarcharFieldIfalias
- ifconnectorpresent
Type:
BooleanFieldIfconnectorpresent
- ifdescr
Type:
VarcharFieldIfdescr
- ifindex
Type:
IntegerFieldIfindex
- iflastchange
Type:
IntegerFieldIflastchange
- ifname
Type:
VarcharFieldIfname
- ifoperstatus
Type:
IntegerFieldIfoperstatus
Choices:
1234567
- ifpromiscuousmode
Type:
BooleanFieldIfpromiscuousmode
- iftype
Type:
IntegerFieldIftype
- 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
ForeignKeyfromInterfaceStackAll lower layer of this interface (related name of
lower)
- media
Type:
VarcharFieldMedia
- module
Type:
ForeignKeytoModuleModule (related name:
interfaces)
- netbox
Type:
ForeignKeytoNetboxNetbox (related name:
interfaces)
- objects = <django.db.models.Manager object>
- patches
Type: Reverse
ForeignKeyfromPatchAll patches of this interface (related name of
interface)
- poe_ports
Type: Reverse
ForeignKeyfromPOEPortAll poe ports of this interface (related name of
interface)
- routing_protocol_attributes
Type: Reverse
ForeignKeyfromRoutingProtocolAttributeAll routing protocol attributes of this interface (related name of
interface)
- sensors
Type: Reverse
ForeignKeyfromSensorAll sensors of this interface (related name of
interface)
- classmethod sort_ports_by_ifname(ports)
- speed
Type:
FloatFieldSpeed
- swport_allowed_vlan
Type: Reverse
OneToOneFieldfromSwPortAllowedVlanThe swport allowed vlan of this interface (related name of
interface)
- swport_vlans
Type: Reverse
ForeignKeyfromSwPortVlanAll swport vlans of this interface (related name of
interface)
- to_adjacency_candidates
Type: Reverse
ForeignKeyfromAdjacencyCandidateAll to adjacency candidates of this interface (related name of
to_interface)
- to_interface
Type:
ForeignKeytoInterfaceTo interface (related name:
connected_to_interface)
- to_interface_id
Internal field, use
to_interfaceinstead.
- to_netbox
Type:
ForeignKeytoNetboxTo netbox (related name:
connected_to_interface)
- trunk
Type:
BooleanFieldTrunk
- unrecognized_neighbors
Type: Reverse
ForeignKeyfromUnrecognizedNeighborAll unrecognized neighbors of this interface (related name of
interface)
- vlan
Type:
IntegerFieldVlan
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 (
ForeignKeytoLocation) – Location (related name:rooms)
Reverse relationships:
- Parameters:
netboxes (Reverse
ForeignKeyfromNetbox) – All netboxes of this room (related name ofroom)cabling_set (Reverse
ForeignKeyfromCabling) – All cabling set of this room (related name ofroom)images (Reverse
ForeignKeyfromImage) – All images of this room (related name ofroom)
- exception DoesNotExist
- exception MultipleObjectsReturned
- cabling_set
Type: Reverse
ForeignKeyfromCablingAll cabling set of this room (related name of
room)
- data
Type:
HStoreFieldData
- description
Type:
VarcharFieldDescription
- get_absolute_url()
- images
Type: Reverse
ForeignKeyfromImageAll images of this room (related name of
room)
- property latitude
- location
Type:
ForeignKeytoLocationLocation (related name:
rooms)
- property longitude
- netboxes
Type: Reverse
ForeignKeyfromNetboxAll netboxes of this room (related name of
room)
- objects = <django.db.models.Manager object>
- position
Type:
PointFieldPosition
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 (
ForeignKeytoLocation) – Parent (related name:child_locations)
Reverse relationships:
- Parameters:
rooms (Reverse
ForeignKeyfromRoom) – All rooms of this location (related name oflocation)child_locations (Reverse
ForeignKeyfromLocation) – All child locations of this location (related name ofparent)images (Reverse
ForeignKeyfromImage) – All images of this location (related name oflocation)
- exception DoesNotExist
- exception MultipleObjectsReturned
- child_locations
Type: Reverse
ForeignKeyfromLocationAll child locations of this location (related name of
parent)
- data
Type:
HStoreFieldData
- description
Type:
VarcharFieldDescription
- get_absolute_url()
- get_all_rooms()
Return a queryset returning all rooms in this location and sublocations
- images
Type: Reverse
ForeignKeyfromImageAll images of this location (related name of
location)
- objects = <django.db.models.Manager object>
- parent
Type:
ForeignKeytoLocationParent (related name:
child_locations)
- rooms
Type: Reverse
ForeignKeyfromRoomAll 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 (
ForeignKeytoOrganization) – Parent (related name:child_organizations)
Reverse relationships:
- Parameters:
netboxes (Reverse
ForeignKeyfromNetbox) – All netboxes of this organization (related name oforganization)child_organizations (Reverse
ForeignKeyfromOrganization) – All child organizations of this organization (related name ofparent)vlans (Reverse
ForeignKeyfromVlan) – All vlans of this organization (related name oforganization)accounts (Reverse
ManyToManyFieldfromAccount) – All accounts of this organization (related name oforganizations)arnold_identities (Reverse
ForeignKeyfromIdentity) – All arnold identities of this organization (related name oforganization)
- exception DoesNotExist
- exception MultipleObjectsReturned
- accounts
Type: Reverse
ManyToManyFieldfromAccountAll accounts of this organization (related name of
organizations)
- arnold_identities
Type: Reverse
ForeignKeyfromIdentityAll arnold identities of this organization (related name of
organization)
- child_organizations
Type: Reverse
ForeignKeyfromOrganizationAll child organizations of this organization (related name of
parent)
- contact
Type:
VarcharFieldContact
- data
Type:
HStoreFieldData
- description
Type:
VarcharFieldDescription
- extract_emails()
Naively extract email addresses from the contact string
- netboxes
Type: Reverse
ForeignKeyfromNetboxAll netboxes of this organization (related name of
organization)
- objects = <django.db.models.Manager object>
- parent
Type:
ForeignKeytoOrganizationParent (related name:
child_organizations)
- vlans
Type: Reverse
ForeignKeyfromVlanAll vlans of this organization (related name of
organization)