Schemas
Documents the YAML schema files that define the data model.
Every kind in the data model is defined in a YAML file under schemas/ and loaded with infrahubctl schema load schemas (inv load-schema). The GraphQL kind is the schema namespace joined to its name โ Dcim + Device becomes DcimDevice. Generics load as GraphQL interfaces; nodes load as GraphQL object types.
Regenerate the typed protocol classes after any schema change (see the command below).
Schema filesโ
| File | Defines |
|---|---|
base/dcim.yml | Dcim.GenericDevice, Dcim.PhysicalDevice, Dcim.Device, interface generics/nodes, Dcim.DeviceType (incl. containerlab_interface_mapping), Dcim.Platform (incl. containerlab_os, containerlab_image) |
base/ipam.yml | Ipam.IPAddress, Ipam.Prefix base definitions |
base/location.yml | Location.Generic, Location.Hosting base definitions |
base/organization.yml | Organization.Generic, Organization.Manufacturer, Organization.Provider |
logical_design.yml | Network.Fabric (incl. cloudvision_managed), Network.Pod, Network.BuildingBlock |
device_design.yml | Network.DeviceDesign generic plus the fabric/pod/rack device-design nodes |
dcim_extensions.yml | Network.Link, including role=dci and DCI link fields, plus device extensions (role, BGP ASN relationship, node_id, loopback/mgmt, pod/rack relations) and the interface role/description/ip_address extensions |
dci.yml | NetworkFabric.dci_pool DCI addressing source |
l3ls_extensions.yml | L3LS fabric attributes (routing protocols, MTU, spanning-tree, EVPN overlay) and pod/rack/VRF/MLAG extensions |
location_extensions.yml | Location.Hall, Location.Rack (rack_type, leaf counts, generation_complete) |
ipam_extensions.yml | Ipam.Prefix role and status dropdowns |
management.yml | Network.DnsServer, Network.NtpServer, Network.LocalUser |
generator.yml | Generator.Target generic (checksum tracking) |
vlan/vlan.yml | Ipam.VLAN, Ipam.L2Domain |
vrf/vrf.yml | Ipam.VRF, Ipam.RouteTarget |
evpn/evpn_services.yml | Evpn.Tenant, Evpn.Svi, Evpn.L2Vlan |
evpn/evpn_gateway.yml | Evpn.Domain, Evpn.GatewayGroup, plus fabric/pod/device EVPN Gateway relationship extensions |
lag/lag.yml | Interface.Lag, Generic.InterfaceBundle |
mlag/mlag.yml | Generic.MlagDomain, Mlag.Domain, Mlag.Interface |
routing/routing.yml | Routing.BGPPeerGroup, Routing.BGPNeighbor, prefix lists, route maps, static routes |
compute/compute.yml | Compute.GenericUnit, Compute.PhysicalServer, virtualization hosts |
avd/avd.yml | Avd.Evpn |
cv/cv.yml | Cloudvision.Workspace โ CloudVision workspace tracking for proposed-change validation |
objects/objects.yml | Avd.Artifact, Avd.HostvarFile, Avd.StructuredConfigFile |
The device and interface role dropdowns that the fabric uses are defined in dcim_extensions.yml, not in the base dcim.yml โ the extension redefines the base lists.
Network fabric hierarchyโ
NetworkFabric โ Network.Fabricโ
Top-level container for a datacenter fabric. Inherits Network.BuildingBlock and CoreArtifactTarget; parents NetworkPod.
- Attributes:
name(unique),index, interface-sorting methods,mgmt_gateway,avd_hostvars_ready. L3LS attributes (vial3ls_extensions.yml):underlay_routing_protocol(ebgp/ospf),overlay_routing_protocol(ebgp/ibgp),p2p_uplinks_mtu,spanning_tree_mode,virtual_router_mac, EVPN/underlay/MLAG passwords,anta_enabled. - Relationships:
device_designs->NetworkFabricDeviceDesign(super-spine sizing),fabric_ip_pools->CoreResourcePool,uplink_pool/vtep_pool/loopback_pool/dci_pool->CoreIPPrefixPool,asn_pool/node_id_pool->CoreNumberPool,mgmt_pool->CoreIPAddressPool,avd_evpn->AvdEvpn,dns_servers/ntp_servers/local_users-> management kinds.fabric_ip_poolsis the preferred source for Management, Loopback, Loopback VTEP, Fabric Point-to-Point, DCI, and Fabric Supernet pools. Legacy fabric pool relationships remain optional fallback inputs during migration.
NetworkPod โ Network.Podโ
A pod within a fabric. Inherits Network.BuildingBlock and Generator.Target; parented by NetworkFabric.
- Attributes:
name(unique),index,role(fabric,cpu,storage), interface-sorting methods,checksum(fromGenerator.Target). - Relationships:
device_designsโNetworkPodDeviceDesign(spine sizing),racksโLocationRack,devicesโDcimDevice(the pod's spines),mlag_peer_pool/mlag_l3_poolโCoreIPAddressPool.
NetworkBuildingBlock โ Network.BuildingBlock (generic)โ
Hierarchical base for NetworkFabric and NetworkPod. Attributes: name (unique), index.
Device design entities โ Network.DeviceDesign (generic)โ
Normalized description of the devices a container should produce, defined in device_design.yml. Instead of a fixed <role>_switch_template relationship plus an amount_of_<role>s attribute per role, each container relates to many device design entities โ one per device role โ through a device_designs relationship.
NetworkDeviceDesign(generic):role(super_spine,spine,leaf,l2leaf),device_quantity(Number โฅ 1), anddevice_templateโCoreObjectTemplate(cardinality one;on_delete: no-action, so the shared template survives a design deletion).roleis authoritative for generation.- Concrete nodes, each inheriting the generic and parented by one container:
NetworkFabricDeviceDesignโ parentNetworkFabric(super-spine designs)NetworkPodDeviceDesignโ parentNetworkPod(spine designs)NetworkRackDeviceDesignโ parentLocationRack(leaf / l2leaf designs)
- Ownership: each container's
device_designsis aComponent(many,on_delete: cascade) โ deleting the container deletes its designs; the templates are untouched. - Identity: a design is unique per
(container, role);human_friendly_idis"<container-name>__<role>". "None of a role" is the absence of a design (replacingamount_of_*: 0).
In seed data, designs are nested under their container. A rack with an MLAG leaf
pair and a single L2 leaf looks like this (from objects/10a_l3ls_multipod_rack.yml):
- name: "Rack-A2-1"
index: 1
rack_type: compute
pod: Pod-A2
parent: "Hall-A1"
device_designs:
data:
- role: leaf
device_quantity: 2
device_template: leaf-switch-compute
- role: l2leaf
device_quantity: 1
device_template: l2leaf-switch
member_of_groups: ["racks"]
Omit a role's entry to get none of that device type โ a rack with no l2leaf
design gets no L2 leaves. Fabric and pod designs follow the same shape with
role: super_spine and role: spine respectively.
Adding a new device design for a supported role is data, not a schema change. Device designs are the only source of device sizing: the fabric, pod, and rack generators read device_designs exclusively, and the legacy paired fields they replaced (amount_of_super_spines / super_spine_switch_template, amount_of_spines / spine_switch_template, amount_of_leafs / leaf_switch_template, amount_of_l2leafs / l2leaf_switch_template) no longer exist in the schema.
NetworkLink โ Network.Linkโ
A cabled connection between interfaces. Inherits Dcim.Connector, so it has name and medium (mmf, smf, copper) and relates to connected_endpoints โ DcimEndpoint. A DCI connection is a normal NetworkLink with role=dci, not a separate schema node.
- DCI attributes:
role(dci) andinclude_in_underlay_protocol(Boolean, defaulttrue). BGP ASNs are taken from each endpoint device's ownasn, not stored on the link. - Relationships: inherited
connected_endpoints; no DCI-specific endpoint, pool, subnet, endpoint IP, speed, BFD, MTU, external-network, or EVPN Gateway fields are added. - Addressing source: the hostvars generator allocates one
/31per valid DCI-role link fromNetworkFabric.fabric_ip_poolsroledci, then the legacyNetworkFabric.dci_poolfallback, then a deterministic Fabric Supernet-derived fallback when the required DCI prefix-pool role is missing.
Devices and interfacesโ
DcimDevice โ Dcim.Deviceโ
The concrete network device (switch). Inherits Dcim.GenericDevice, Dcim.PhysicalDevice, and CoreArtifactTarget.
- Attributes:
name(unique),description,os_version,status(active,provisioning,maintenance,drained). Fabric extensions (viadcim_extensions.yml):role(super_spine,spine,leaf,border_leaf,l2leaf),index,node_id. - Relationships:
interfacesโDcimInterface,device_typeโDcimDeviceType,platformโDcimPlatform,primary_address/loopback_ip/mgmt_ipโIpamIPAddress,podโNetworkPod,rackโLocationRack,asnโRoutingAsn(device BGP ASN),avd_artifactโAvdArtifact,mlag_domainโMlagDomain, plus routing relations (bgp_peer_groups,bgp_neighbors,prefix_lists,route_maps,static_routes).
Interface kindsโ
DcimInterface (Dcim.Interface) is the interface generic; the concrete nodes are InterfacePhysical (Interface.Physical), InterfaceVirtual (Interface.Virtual), and InterfaceLag (Interface.Lag). GraphQL queries that select any interface root on DcimInterface.
DcimInterfaceattributes:name,description,mtu,status,role. The fabricrolelist (viadcim_extensions.yml) isuplink,access,spine,super_spine,leaf,loopback,server,peering,storage,mlag_peer.DcimInterfacerelationships:deviceโDcimGenericDevice(parent),ip_addressโIpamIPAddress,untagged_vlan/tagged_vlanโIpamVLAN.- Layer-2/3 behaviour comes from the
Interface.Layer2(l2_mode) andInterface.Layer3(ip_addresses,dot1q_id,mac_address) generics.
DcimDeviceType โ Dcim.DeviceTypeโ
A device model. Attributes: name (unique), part_number, height, full_depth, weight. Relationships: manufacturer โ OrganizationManufacturer, platform โ DcimPlatform.
OrganizationManufacturer โ Organization.Manufacturerโ
A device manufacturer. Inherits Organization.Generic; attributes name (unique), description; relates to device_type โ DcimDeviceType.
Locationsโ
LocationHall โ Location.Hallโ
A datacenter hall. Inherits Location.Generic; parents LocationRack. Attributes: name, shortname, description, index.
LocationRack โ Location.Rackโ
A physical rack. Inherits Location.Generic, Location.Hosting, and Generator.Target; parented by LocationHall.
- Attributes:
name,index,rack_type(compute,storage),mlag,generation_complete,checksum. - Relationships:
device_designsโNetworkRackDeviceDesign(leaf and l2leaf sizing),podโNetworkPod,devicesโDcimPhysicalDevice.
IPAMโ
IpamIPAddress โ Ipam.IPAddressโ
An IP address. Inherits BuiltinIPAddress. Relationships: interface โ Interface.Layer3, vrf โ IpamVRF.
IpamPrefix โ Ipam.Prefixโ
An IP prefix. Inherits BuiltinIPPrefix.
role(required, viaipam_extensions.yml):supernet,pod_super_spine_spine,pod_leaf_spine,loopback,loopback-vtep,technical,management,backfill.status(viaipam_extensions.yml):active,deprecated,reserved.- Relationships:
gatewayโIpamIPAddress,vlanโIpamVLAN,vrfโIpamVRF,locationโLocation.Hosting.
IpamVLAN โ Ipam.VLANโ
A VLAN. Attributes: name, vlan_id, status, role (server, management, user). Relationships: l2domain โ IpamL2Domain (required), prefixes โ IpamPrefix.
IpamL2Domain โ Ipam.L2Domainโ
A layer-2 domain grouping VLANs. Attributes: name. Relationships: vlans โ IpamVLAN.
IpamVRF โ Ipam.VRFโ
A VRF. Attributes: name (unique), vrf_rd, vrf_vni, vtep_diagnostic_loopback. Relationships: namespace โ BuiltinIPNamespace, import_rt / export_rt โ IpamRouteTarget, tenant โ EvpnTenant, svis โ EvpnSvi.
IpamRouteTarget โ Ipam.RouteTargetโ
A route target. Attributes: name (unique), description. Relationships: vrf โ IpamVRF.
EVPN servicesโ
EvpnTenant โ Evpn.Tenantโ
An EVPN tenant. Attributes: name (unique), mac_vrf_vni_base, description. Relationships: fabrics โ NetworkFabric, vrfs โ IpamVRF, l2vlans โ EvpnL2Vlan (component).
EvpnSvi โ Evpn.Sviโ
An SVI. Attributes: name, svi_id, ip_address_virtual, enabled. Relationships: vrf โ IpamVRF (parent), vlan โ IpamVLAN, rack_tags โ LocationRack, avd_tags โ AvdTag.
EvpnL2Vlan โ Evpn.L2Vlanโ
An L2-only VLAN attached to a tenant. Attributes: name, vlan_id, vni_override. Relationships: tenant โ EvpnTenant (parent), vlan โ IpamVLAN.
EvpnDomain โ Evpn.Domainโ
An EVPN domain owned by one NetworkFabric. Attributes: name, domain_id, and optional description. Relationships: fabric -> NetworkFabric (parent), pods -> NetworkPod, local_gateway_groups -> EvpnGatewayGroup (component children), and remote_gateway_groups -> EvpnGatewayGroup. domain_id and name are unique per fabric. The hostvar generator uses EvpnGatewayGroup.local_domain.domain_id as the local EVPN Gateway D-PATH domain ID and EvpnGatewayGroup.remote_domain.domain_id as the remote D-PATH domain ID.
EvpnGatewayGroup โ Evpn.GatewayGroupโ
EVPN Multi-Domain Gateway intent shared by one or more Border Leaf devices in a selected Pod. Attributes include resiliency_model (only all_active_multihoming), EVPN L2/L3 enablement flags, D-PATH enablement, All-Active Multihoming enablement, and Ethernet Segment identifier/RT import values. Relationships: local_domain -> EvpnDomain (parent), pod -> NetworkPod (required non-owning context), remote_domain -> EvpnDomain, and members -> DcimDevice. The selected Pod must have evpn_domain set to the same object as local_domain, remote_domain must differ from local_domain, and group names are unique by [local_domain, pod, name__value]. Its schema-valid HFID uses the selected Pod and group name, while the display label and ordering include native local_domain, pod, remote_domain, and name fields. Reviewers distinguish the parent local domain from the EVPN Domain relationship view through EvpnDomain.local_gateway_groups; no computed or denormalized helper attribute is added solely for local-domain display.
NetworkFabric.evpn_domains, NetworkPod.evpn_domain, NetworkPod.evpn_gateway_groups, and DcimDevice.evpn_gateway_group are additive relationships from evpn/evpn_gateway.yml. Both EvpnDomain and EvpnGatewayGroup set include_in_menu: false because the custom EVPN Services menu exposes one Domains item for EvpnDomain; gateway groups are reached from EVPN Domain relationship views.
Computeโ
ComputePhysicalServer โ Compute.PhysicalServerโ
A physical server. Inherits Compute.GenericUnit, Dcim.GenericDevice, and Generator.Target. Attributes: name, role (compute, gpu), status. Relationships: rack โ LocationRack, interfaces โ DcimInterface.
AVDโ
AvdArtifact โ Avd.Artifactโ
Per-device container linking a device to its stored hostvars and structured config. Attributes: name (unique). Relationships: device โ DcimDevice (required), hostvar_file โ AvdHostvarFile (component), structured_config_file โ AvdStructuredConfigFile (component). See AvdArtifact & File Storage.
AvdHostvarFile โ Avd.HostvarFile ยท AvdStructuredConfigFile โ Avd.StructuredConfigFileโ
Child file nodes holding the per-device hostvars and structured-config JSON. Both inherit CoreFileObject (providing content, content_type, checksum) and are parented by AvdArtifact.
AvdEvpn โ Avd.Evpnโ
AVD EVPN fabric-wide settings. Attributes include ebgp_multihop and overlay_bgp_rtc. Relationships: fabric โ NetworkFabric.
AvdTag โ Avd.Tagโ
AVD-specific fabric tag object. Attributes: name, description. Relationships: racks โ LocationRack; reciprocal rack assignments emit PyAVD node-group filter.tags, and SVI avd_tags emit PyAVD SVI tags.
CloudVisionโ
CloudvisionWorkspace โ Cloudvision.Workspaceโ
Tracks one CloudVision workspace created by the cv-config-validation check for a proposed change and fabric, defined in cv/cv.yml. Excluded from the UI menu (include_in_menu: false); identified by workspace_id.
- Attributes:
name(display name),workspace_id(unique โ the CloudVision workspace UUID),proposed_change_id,workspace_url,thread_id(theCoreChangeThreadused for lifecycle comments),change_control_idandchange_control_url(set when a change control exists),last_submission_error,last_submission_attempt_at,submitted_at, andstatus. - Relationships:
fabricโNetworkFabric(cardinality one).
The workspace ID is derived deterministically from the proposed-change ID and the fabric name, so re-running validation updates the same workspace rather than creating another. See Checks and CloudVision Validation.
Fabrics opt in through NetworkFabric.cloudvision_managed (Boolean, default false) in logical_design.yml; the check skips everything else when it is false.
Generator targetโ
GeneratorTarget โ Generator.Target (generic)โ
Mixed into kinds that can be generator targets (NetworkPod, LocationRack, ComputePhysicalServer). Provides checksum (optional), which stores a hash of related node IDs for idempotent regeneration.
Dropdown referenceโ
Device role (DcimDevice.role): super_spine, spine, leaf, border_leaf, l2leaf, l2spine, l3spine, p, pe, rr.
Interface role (DcimInterface.role): uplink, access, spine, super_spine, leaf, loopback, vtep_loopback, server, peering, storage, mlag_peer.
Pod role (NetworkPod.role): fabric, cpu, storage.
Rack type (LocationRack.rack_type): compute, storage.
Underlay routing protocol (NetworkFabric.underlay_routing_protocol): ebgp, ospf, none, isis-ldp.
Overlay routing protocol (NetworkFabric.overlay_routing_protocol): ebgp, ibgp.
Spanning-tree mode (NetworkFabric.spanning_tree_mode): mstp, rstp, rapid-pvst, none.
CloudVision workspace status (CloudvisionWorkspace.status): pending, built, submitted, abandoned, submit_failed.
Prefix role (IpamPrefix.role): fabric_supernet, fabric_point_to_point, dci, mlag, mlag_peering, supernet, pod_super_spine_spine, pod_leaf_spine, loopback, loopback-vtep, technical, management, backfill.
Prefix status (IpamPrefix.status): active, deprecated, reserved.
Role-driven pool collectionsโ
NetworkFabric.fabric_ip_pools is the preferred fabric-scope IP pool collection. It accepts CoreResourcePool members so Management address pools and Loopback, Loopback VTEP, Fabric Point-to-Point, DCI, and Fabric Supernet prefix pools can be managed through one relationship. Legacy fabric relationships remain optional during migration and are used only as fallback inputs.
NetworkPod.pod_ip_pools is the preferred pod-scope IP pool collection. It accepts pod-specific Loopback, Loopback VTEP, Fabric Point-to-Point, MLAG, and MLAG Peering pools. Management remains fabric-scoped.
Pool purpose is resolved from the IpamPrefix.role values on each pool's resources. A pool with mixed authoritative roles, duplicate role coverage in one fabric or pod, a non-IP pool in these collections, or a pod prefix outside the matching fabric prefix is invalid.
Sourceโ
-
schemas/โ all schema definitions. -
schemas/base/dcim.ymlโ baseDcim.GenericDevice/Dcim.PhysicalDevice/Dcim.Device, interfaces,DcimDeviceType; project device extensions (role, BGP ASN relationship, relations) andNetwork.Linklive inschemas/dcim_extensions.yml. -
schemas/logical_design.ymlโNetwork.Fabric,Network.Pod. -
schemas/base/location.yml+schemas/location_extensions.ymlโLocation.Hall,Location.Rack. -
schemas/base/ipam.yml+schemas/ipam_extensions.ymlโ IPAM nodes (thePrefixrole/statusdropdowns live in the extension). -
schemas/avd/avd.ymlโAvd.Evpn,Avd.Tag. -
schemas/objects/objects.ymlโAvd.Artifact,Avd.HostvarFile,Avd.StructuredConfigFile(see AvdArtifact & File Storage for the full reference). -
schemas/cv/cv.ymlโCloudvision.Workspace. -
schemas/device_design.ymlโNetwork.DeviceDesignand the per-container design nodes. -
Generated protocols:
src/solution_arista_avd/protocols.pyโ regenerate after any schema change with:uv run infrahubctl protocols --schemas schemas --out src/solution_arista_avd/protocols.pyNote the
--outflag (not--output) and the explicit path โ the default would dropschema_protocols.pyin the current directory instead of overwriting the checked-in file.