Skip to main content

Query IPAM data

Read the computed values on IP prefixes and addresses, or follow the hierarchy relationships. Use these patterns for reporting, automation, or verification.

Query a prefix's computed values​

Every IpamIPPrefix exposes utilization, netmask, hostmask, network_address, and broadcast_address as read-only attributes, computed on read:

query {
IpamIPPrefix(prefix__value: "192.0.2.0/24") {
edges {
node {
prefix { value }
utilization { value }
netmask { value }
hostmask { value }
network_address { value }
broadcast_address { value }
}
}
}
}

Query an address's computed values​

IpamIPAddress has no equivalent sibling attributes — instead, the address attribute itself (kind IPHost) exposes computed sub-fields: ip, netmask, hostmask, prefixlen, and version.

query {
IpamIPAddress(address__value: "192.0.2.10/24") {
edges {
node {
address {
value
ip
netmask
hostmask
prefixlen
version
}
}
}
}
}

IP prefixes expose parent, children, ancestors, and descendants relationships. They are read-only — Infrahub manages them automatically.

query {
IpamIPPrefix(prefix__value: "10.0.0.0/16") {
edges {
node {
prefix { value }
parent {
node { prefix { value } }
}
children {
edges {
node { prefix { value } }
}
}
ancestors {
edges {
node { prefix { value } }
}
}
descendants {
edges {
node { prefix { value } }
}
}
}
}
}
}

Next​