Skip to content

Response shapes

Every tool returns a JSON object with target naming the appliance that answered, vdom naming the VDOM it was scoped to, count where a list is involved, and one named collection. The objects inside those collections are summaries rather than raw FortiOS records — a raw policy carries eighty-plus fields, most of them empty strings, unused IPv6 arrays, and internal UUIDs, and dropping them is the whole point.

One convention runs through all of it: conditional fields are absent, not null. A policy with no comment has no comment key. An interface with no address has no ip key. Reading a summary means checking for presence, not for emptiness, and it means a model never spends attention on a field that had nothing to say.

From list_address_objects and the addresses section of search_config.

FieldAlwaysMeaning
nameyesObject name
typeyesFortiOS type, defaulting to ipmask
valueyesOne readable value, resolved by type. May be null
commentnoPresent only when set
interfacenoThe associated-interface, when set

value resolves differently per type, which is the work this summary exists to do: ipmask and interface-subnet give CIDR, fqdn gives the hostname, iprange gives start-end, geography gives the country code, mac gives a comma-joined MAC list, and dynamic gives its sub-type or the literal external-connector.

From list_services and the services section of search_config.

FieldAlwaysMeaning
nameyesObject name
protocolyesTCP, UDP, TCP/UDP, ICMP, IPv6-ICMP, a named IP protocol, any, or unknown
portsnoObject keyed tcp, udp, sctp; only populated protocols appear
icmp_typenoICMP services only, when set
protocol_numbernoprotocol: IP services only
commentnoPresent only when set
categorynoPresent only when set

Port values are comma-joined strings rather than arrays, because FortiOS writes them space-separated and a range like 6000-6063 is a single value that would survive splitting badly. A :src-range qualifier — FortiOS appends one on services that also constrain the source port, as RLOGIN’s 513:512-1023 does — is stripped, since nothing downstream models source ports.

From list_policies and the policies section of search_config.

FieldAlwaysMeaning
idyespolicyid
orderyesZero-based evaluation position, carried explicitly so it survives filtering and re-serialization
nameyesPolicy name, or policy-<id> when unnamed
enabledyesBoolean. Defaults true when status is absent
actionyesaccept or deny. Defaults to deny
from / toyesSource and destination interface names, as lists
source / destinationyesAddress object and group names, as lists
serviceyesService object names, as list
natnoPresent and true only when source NAT is on
schedulenoPresent only when it is not always
lognoPresent only when logging is not disabled
commentnoFrom FortiOS’s comments, present only when set

The five list fields are always lists even when FortiOS returned a bare string, which it does for some relational fields on 7.0.x. A policy is accept or deny in action, and separately on or off in enabled; a disabled accept rule allows nothing.

From list_interfaces, list_vlans, and the interfaces section of search_config.

FieldAlwaysMeaning
nameyesInterface name
typeyesFortiOS type, defaulting to physical
statusyesup or down
vdomyesOwning VDOM, defaulting to root
ipnoHost address in CIDR. Absent when unaddressed, 0.0.0.0, or dynamically addressed
addressingnodhcp or pppoe, when the address is not static
notenoWhere to find the runtime address, alongside addressing
secondary_ipsnoList of additional host addresses
vlan_idnoPresent only when the tag is greater than zero
parentnoParent interface, for sub-interfaces
descriptionnoPresent only when set
management_accessnoFortiOS’s allowaccess string, such as ping https
mtunoPresent only when set

ip keeps the host address rather than collapsing to the network. FortiOS writes 203.0.113.10 255.255.255.0 here and the same dotted-mask format in an address object’s subnet, but the two mean different things, and collapsing this one invents addresses that do not exist.

A dynamically addressed interface reports addressing and note instead of ip, because the configuration genuinely holds no address for it. The two can also coexist: an interface set to DHCP that currently has a lease recorded in its configuration carries both.

The enclosing response from list_interfaces adds hidden_internal, a list of the names it omitted rather than a count of them.

From list_static_routes and the routes section of search_config.

FieldAlwaysMeaning
seq_numyesFortiOS seq-num
destinationyesCIDR, or null when the destination is a named object that could not be resolved
distanceyesAdministrative distance
priorityyesRoute priority
enabledyesBoolean. Defaults true
destination_address_objectnoName, or list of names, when the destination is named
blackholenoPresent and true only on blackhole routes
gatewaynoAbsent on blackhole routes and when the gateway is 0.0.0.0
interfacenoFortiOS device. Absent on blackhole routes
commentnoPresent only when set

list_static_routes resolves destination_address_object back to CIDR with a second lookup where the referenced object is a plain subnet, filling in destination and keeping the object name alongside it. When both are present they describe the same network two ways, and the object name is the one an operator will recognize.

From get_routing_table. Not a summary of a configuration object — these come from the monitor tree and have a different shape entirely.

FieldMeaning
destinationFortiOS ip_mask
gatewayNext hop, 0.0.0.0 on connected routes
interfaceOutgoing interface
typestatic, connect, dhcp, or a routing protocol name
distanceAdministrative distance
metricMetric

From find_device. The merged record, assembled from up to three monitor endpoints.

FieldAlwaysMeaning
macyesLowercased MAC, which is the join key
seen_inyesWhich sources contributed: dhcp, arp, wifi
ipnoFirst address any source reported
hostnamenoDHCP hostname, falling back to the vendor class identifier
interfacenoInterface the device was seen on
lease_expiresnoDHCP lease expiry, Unix seconds
ssidnoWireless clients only
signal_dbmnoWireless clients only
wirelessnoPresent and true only for wireless clients

Results are sorted by IP where known and by MAC otherwise, so a device with no address still has a stable position rather than floating.