interface.query¶
Query Interfaces with query-filters and query-options
options.extra.retrieve_names_only (bool): Only return interface names.
No Additional Items
Tuple Validation
Parameter 1: filters
filters
Type: array Default: []List of filters for query results. See API documentation for "Query Methods" for more guidance.
No Additional ItemsEach item of this array must be:
[
[
"name",
"=",
"bob"
]
]
[
[
"OR",
[
[
[
"name",
"=",
"bob"
]
],
[
[
"name",
"=",
"larry"
]
]
]
]
]
Parameter 2: options
options
Type: objectQuery options customize the results returned by a query method. More complete documentation with examples are covered in the "Query methods" section of the TrueNAS API documentation.
No Additional PropertiesExtra
Type: object Default: {}Extra options are defined on a per-endpoint basis and are described in the documentation for the associated query method.
Order By
Type: array of string Default: []An array of field names describing the manner in which query results should be ordered. The field names may also have one of more of the following special prefixes: -
(reverse sort direction), nulls_first:
(place any null values at the head of the results list), nulls_last:
(place any null values at the tail of the results list).
Each item of this array must be:
[
"size",
"-devname",
"nulls_first:-expiretime"
]
Select
Type: array Default: []An array of field names specifying the exact fields to include in the query return. The dot character .
may be used to explicitly select only subkeys of the query result.
Each item of this array must be:
No Additional Items
Each item of this array must be:
[
"username",
"Authentication.status"
]
Count
Type: boolean Default: falseReturn a numeric value representing the number of items that match the specified query-filters
.
Get
Type: boolean Default: falseReturn the JSON object of the first result matching the specified query-filters
. The query fails if there specified query-filters
return no results.
Offset
Type: integer Default: 0This specifies the beginning offset of the results array. When combined with the limit
query-option it may be used to implement pagination of large results arrays. WARNING: some query methods provide volatile results and the onus is on the developer to understand whether pagination is appropriate for a particular query API method.
Limit
Type: integer Default: 0This specifies the maximum number of results matching the specified query-filters
to return. When combined wtih the offset
query-option it may be used to implement pagination of large results arrays.
WARNING: Some query methods provide volatile results and the onus is on the developer to understand whether pagination is appropriate for a particular query API method.
Force Sql Filters
Type: boolean Default: falseResult
No Additional Items
Each item of this array must be:
InterfaceQueryResultItem
Type: objectId
Type: stringUnique identifier for the network interface.
Name
Type: stringName of the network interface.
Fake
Type: booleanWhether this is a fake/simulated interface for testing purposes.
Type
Type: stringType of interface (PHYSICAL, BRIDGE, LINK_AGGREGATION, VLAN, etc.).
InterfaceEntryState
Type: objectCurrent runtime state information for the interface.
No Additional PropertiesName
Type: stringCurrent name of the network interface.
Orig Name
Type: stringOriginal name of the network interface before any renaming.
Description
Type: stringHuman-readable description of the network interface.
Mtu
Type: integerMaximum transmission unit size for the interface.
Cloned
Type: booleanWhether the interface is a cloned/virtual interface.
Flags
Type: array of stringList of interface flags indicating various states and capabilities. Common flags include UP, DOWN, RUNNING, MULTICAST, BROADCAST, LOOPBACK, and POINTOPOINT.
No Additional ItemsEach item of this array must be:
Nd6 Flags
Type: arrayIPv6 neighbor discovery flags. These control IPv6 autoconfiguration behavior and include flags like AUTOLINKLOCAL, ACCEPTRTADV, and PERFORMNUD.
No Additional ItemsEach item of this array must be:
Capabilities
Type: arrayList of hardware capabilities supported by the interface. Common capabilities include VLANMTU, JUMBOMTU, VLANHWTAGGING, VLANHWCSUM, and TSO4.
No Additional ItemsEach item of this array must be:
Link State
Type: stringCurrent link state of the interface (up, down, etc.).
Media Type
Type: stringType of media/connection for the interface. Examples include Ethernet, 802.11, or loopback.
Media Subtype
Type: stringSubtype of media/connection for the interface. Examples include 1000baseT, 100baseTX, or autoselect.
Active Media Type
Type: stringCurrently active media type. This may differ from configured media_type during autonegotiation.
Active Media Subtype
Type: stringCurrently active media subtype. This reflects the actual negotiated connection speed and type.
Supported Media
Type: arrayList of supported media types for the interface. Contains media descriptors like '1000baseT <full-duplex>' or 'autoselect'.
No Additional ItemsEach item of this array must be:
Media Options
Available media options for the interface. Options may include 'full-duplex', 'half-duplex', 'flowcontrol', or 'rxpause'.
No Additional Items
Each item of this array must be:
Link Address
Type: stringMAC address of the interface.
Permanent Link Address
Permanent MAC address of the interface if different from current.
Hardware Link Address
Type: stringHardware MAC address of the interface.
Rx Queues
Type: integerNumber of receive queues configured for the interface.
Tx Queues
Type: integerNumber of transmit queues configured for the interface.
Aliases
Type: array of objectList of IP address aliases configured on the interface.
No Additional ItemsEach item of this array must be:
InterfaceEntryStateAlias
Type: objectNo Additional Properties
Type
Type: stringThe type of IP address (INET for IPv4, INET6 for IPv6).
Address
Type: stringThe IP address value.
Netmask
Broadcast
Type: stringVrrp Config
Default: []VRRP (Virtual Router Redundancy Protocol) configuration for the interface.
No Additional Items
Each item of this array must be:
Protocol
Link aggregation protocol used (LACP, FAILOVER, etc.).
Ports
Type: array of object Default: []List of ports that are members of this link aggregation group.
No Additional ItemsEach item of this array must be:
InterfaceEntryStatePort
Type: objectNo Additional Properties
Name
Type: stringThe name of the port interface.
Flags
Type: array of stringList of flags associated with the port.
No Additional ItemsEach item of this array must be:
Xmit Hash Policy
Default: nullTransmit hash policy for load balancing in link aggregation. LAYER2 uses MAC addresses, LAYER2+3 adds IP addresses, and LAYER3+4 includes TCP/UDP ports for distribution.
Lacpdu Rate
Default: nullLACP data unit transmission rate. SLOW sends LACPDUs every 30 seconds, FAST sends every 1 second for quicker link failure detection.
Parent
Parent interface for VLAN configuration.
Tag
VLAN tag number.
Pcp
Priority Code Point for VLAN traffic prioritization. Values 0-7 map to different QoS priority levels, with 0 being lowest and 7 highest priority.
Aliases
Type: array of objectList of IP address aliases configured on the interface.
No Additional ItemsEach item of this array must be:
InterfaceEntryAlias
Type: objectNo Additional Properties
Type
Type: stringThe type of IP address (INET for IPv4, INET6 for IPv6).
Address
Type: stringThe IP address value.
Netmask
The network mask for the IP address, either as a string or CIDR notation integer.
Ipv4 Dhcp
Type: booleanWhether IPv4 DHCP is enabled for automatic IP address assignment.
Ipv6 Auto
Type: booleanWhether IPv6 autoconfiguration is enabled.
Description
Type: stringHuman-readable description of the interface.
Mtu
Maximum transmission unit size for the interface.
Vlan Parent Interface
Parent interface for VLAN configuration.
Vlan Tag
VLAN tag number for VLAN interfaces.
Vlan Pcp
Priority Code Point for VLAN traffic prioritization.
Lag Protocol
Type: stringLink aggregation protocol (LACP, FAILOVER, LOADBALANCE, etc.).
Lag Ports
Type: array of stringList of interface names that are members of this link aggregation group.
No Additional ItemsEach item of this array must be:
Bridge Members
Type: array of stringList of interface names that are members of this bridge.
No Additional ItemsEach item of this array must be:
Enable Learning
Type: booleanWhether MAC address learning is enabled for bridge interfaces.
Additional Properties of any type are allowed.
Type: objectInterfaceQueryResultItem
Type: objectId
Type: stringUnique identifier for the network interface.
Name
Type: stringName of the network interface.
Fake
Type: booleanWhether this is a fake/simulated interface for testing purposes.
Type
Type: stringType of interface (PHYSICAL, BRIDGE, LINK_AGGREGATION, VLAN, etc.).
Current runtime state information for the interface.
Aliases
Type: arrayList of IP address aliases configured on the interface.
No Additional ItemsEach item of this array must be:
Ipv4 Dhcp
Type: booleanWhether IPv4 DHCP is enabled for automatic IP address assignment.
Ipv6 Auto
Type: booleanWhether IPv6 autoconfiguration is enabled.
Description
Type: stringHuman-readable description of the interface.
Mtu
Maximum transmission unit size for the interface.
Vlan Parent Interface
Parent interface for VLAN configuration.
Vlan Tag
VLAN tag number for VLAN interfaces.
Vlan Pcp
Priority Code Point for VLAN traffic prioritization.
Lag Protocol
Type: stringLink aggregation protocol (LACP, FAILOVER, LOADBALANCE, etc.).
Lag Ports
Type: array of stringList of interface names that are members of this link aggregation group.
No Additional ItemsEach item of this array must be:
Bridge Members
Type: array of stringList of interface names that are members of this bridge.
No Additional ItemsEach item of this array must be:
Enable Learning
Type: booleanWhether MAC address learning is enabled for bridge interfaces.
Additional Properties of any type are allowed.
Type: objectRequired roles: NETWORK_INTERFACE_READ