Skip to main content

Extend the schema

Infrahub can be extended by providing your own schema (or models).

Default schema

The version of Infrahub we currently use for the demo only included a default schema, composed of 25+ models that are either mandatory for Infrahub to function like Account, StandardGroup, Repository or that are very generic like Tag.

Visualize the active schema

You can explore the current schema by visiting the schema page, you can find it in the left menu under the Unified Storage section.

Explore the current schemahttp://localhost:8000/api/schema

schema page screenshot

Check the schema documentation for more information/reference/schema

In order to model a network, we need to extend the current models to capture more information like: Device, Interface, IPAddress, BGPSession, Location, Role, Status etc.

A "base" schema with these types of models and more is available in the models/base directory

Infrastructure Base Schema
DCIM Base Schema
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
---
version: '1.0'
generics:
- name: Interface
namespace: Infra
description: "Generic Network Interface"
label: "Interface"
include_in_menu: true
icon: "mdi:ethernet"
menu_placement: "InfraDevice"
display_labels:
- name__value
order_by:
- name__value
uniqueness_constraints:
- ["device", "name__value"]
human_friendly_id: ["device__name__value", "name__value"]
attributes:
- name: name
kind: Text
- name: description
kind: Text
optional: true
- name: speed
kind: Number
- name: mtu
label: MTU
default_value: 1500
kind: Number
- name: enabled
kind: Boolean
default_value: true
- name: status
kind: Dropdown
optional: true
choices:
- name: active
label: Active
description: "Fully operational and currently in service"
color: "#7fbf7f"
- name: provisioning
label: Provisioning
description: "In the process of being set up and configured"
color: "#ffff7f"
- name: maintenance
label: Maintenance
description: "Undergoing routine maintenance or repairs"
color: "#ffd27f"
- name: drained
label: Drained
description: "Temporarily taken out of service"
color: "#bfbfbf"
- name: role
kind: Dropdown
optional: true
choices:
- name: backbone
label: Backbone
description: "Provide main data routes"
color: "#6a5acd"
- name: upstream
label: Upstream
description: "Connect to Internet service provider"
color: "#9090de"
- name: peering
label: Peering
description: "Connect with other networks via IX"
color: "#ffa07a"
- name: peer
label: Peer
description: "Equal-status connections for direct interchange"
color: "#faa446"
- name: server
label: Server
description: "Dedicated to interfaces connected to servers"
color: "#98b2d1"
- name: loopback
label: Loopback
description: "Internal interface"
color: "#93e9be"
- name: management
label: Management
description: "Dedicated network for control and monitoring"
color: "#ccc28a"
- name: uplink
label: Uplink
description: "Connect to higher device"
color: "#ff6b6b"
- name: leaf
label: Leaf
description: "Connect to leaf device"
color: "#e6e6fa"
- name: spare
label: Spare
description: "Reserve resources for future use"
color: "#d3d3d3"
relationships:
- name: device
peer: InfraDevice
identifier: "device__interface"
optional: false
cardinality: one
kind: Parent
- name: tags
peer: BuiltinTag
optional: true
cardinality: many
kind: Attribute
- name: LagInterface
namespace: Infra
description: "Generic Lag Interface"
include_in_menu: false
attributes:
- name: lacp
label: LACP
kind: Text
enum: ["Active", "Passive", "Disabled"]
- name: minimum_links
label: Mimimum links
kind: Number
default_value: 1
optional: false
- name: max_bundle
label: MaxBundle
kind: Number
optional: true
relationships:
- name: mlag
peer: InfraMlagInterface
cardinality: one
optional: true
kind: Attribute
identifier: mlag_member_lag_interface
- name: Endpoint
namespace: Infra
description: "Generic Endpoint to connect two objects together"
include_in_menu: false
label: "Endpoint"
relationships:
- name: connected_endpoint
peer: InfraEndpoint
optional: true
cardinality: one
kind: Attribute
identifier: connected__endpoint
- name: MlagInterface
namespace: Infra
description: "MLAG Interface"
label: "MLAG Interface"
icon: "mdi:ethernet"
include_in_menu: true
menu_placement: "InfraDevice"
attributes:
- name: mlag_id
label: MLAG Id
kind: Number
optional: false
relationships:
- name: mlag_domain
label: MLAG Domain
peer: InfraMlagDomain
kind: Attribute
cardinality: one
optional: false
nodes:
# -------------------- Device (Platforms, Device, Interfaces) --------------------
- name: Device
namespace: Infra
description: "Generic Device object"
label: "Device"
icon: "mdi:server"
default_filter: name__value
human_friendly_id: ["name__value"]
inherit_from:
- "CoreArtifactTarget"
order_by:
- name__value
display_labels:
- name__value
attributes:
- name: name
kind: Text
unique: true
- name: description
kind: Text
optional: true
- name: type
kind: Text
- name: status
kind: Dropdown
optional: true
choices:
- name: active
label: Active
description: "Fully operational and currently in service"
color: "#7fbf7f"
- name: provisioning
label: Provisioning
description: "In the process of being set up and configured"
color: "#ffff7f"
- name: maintenance
label: Maintenance
description: "Undergoing routine maintenance or repairs"
color: "#ffd27f"
- name: drained
label: Drained
description: "Temporarily taken out of service"
color: "#bfbfbf"
- name: role
kind: Dropdown
optional: true
choices:
- name: core
label: Core Router
description: "Central part of the network"
color: "#7f7fff"
- name: edge
label: Edge Router
description: "Network boundary with external networks"
color: "#bf7fbf"
- name: cpe
label: Customer Premise Equipment
description: "Devices located at the customer's premises"
color: "#bf7f7f"
- name: firewall
label: Firewall
description: "Ensures network security"
color: "#ffa07a"
- name: spine
label: Spine Router
description: "Aggregation router part of a Fabric"
color: "#aeeeee"
- name: leaf
label: Leaf Switch
description: "Top of Rack part of a Fabric"
color: "#e6e6fa"
relationships:
- name: site
label: Site
peer: LocationSite
optional: false
cardinality: one
kind: Attribute
identifier: "site__devices"
- name: interfaces
peer: InfraInterface
identifier: "device__interface"
optional: true
cardinality: many
kind: Component
- name: asn
peer: InfraAutonomousSystem
optional: true
cardinality: one
kind: Attribute
- name: tags
peer: BuiltinTag
optional: true
cardinality: many
kind: Attribute
- name: primary_address
peer: IpamIPAddress
label: Primary IP Address
optional: true
cardinality: one
kind: Attribute
- name: platform
peer: InfraPlatform
optional: true
cardinality: one
kind: Attribute
- name: mlag_domain
peer: InfraMlagDomain
optional: true
cardinality: one
kind: Attribute
- name: InterfaceL3
namespace: Infra
description: "Network Layer 3 Interface"
label: "Interface L3"
include_in_menu: false
display_labels:
- name__value
order_by:
- name__value
inherit_from:
- "InfraInterface"
- "InfraEndpoint"
- "CoreArtifactTarget"
attributes:
- name: lacp_rate
label: LACP Rate
kind: Text
enum:
- "Fast"
- "Normal"
default_value: "Normal"
- name: lacp_priority
label: LACP Priority
kind: Number
default_value: 32768
relationships:
- name: ip_addresses
peer: IpamIPAddress
optional: true
cardinality: many
kind: Component
- name: lag
peer: InfraLagInterfaceL3
optional: true
cardinality: one
kind: Attribute
- name: LagInterfaceL3
namespace: Infra
description: "Network Layer 3 Lag Interface"
label: "Lag Interface L3"
include_in_menu: false
display_labels:
- name__value
order_by:
- name__value
inherit_from:
- "InfraInterface"
- "InfraLagInterface"
- "CoreArtifactTarget"
relationships:
- name: members
label: Members
peer: InfraInterfaceL3
optional: true
cardinality: many
kind: Generic
- name: ip_addresses
peer: IpamIPAddress
optional: true
cardinality: many
kind: Component
- name: InterfaceL2
namespace: Infra
description: "Network Layer 2 Interface"
label: "Interface L2"
include_in_menu: false
display_labels:
- name__value
order_by:
- name__value
inherit_from:
- "InfraInterface"
- "InfraEndpoint"
- "CoreArtifactTarget"
attributes:
- name: l2_mode
label: Layer2 Mode
kind: Text
enum: ["Access", "Trunk", "Trunk (ALL)"]
- name: lacp_rate
label: LACP Rate
kind: Text
enum:
- "Fast"
- "Normal"
default_value: "Normal"
- name: lacp_priority
label: LACP Priority
kind: Number
default_value: 32768
relationships:
- name: lag
peer: InfraLagInterfaceL2
optional: true
cardinality: one
kind: Attribute
- name: untagged_vlan
label: Untagged VLAN
peer: InfraVLAN
optional: true
cardinality: one
kind: Component
identifier: interface_l2__untagged_vlan
- name: tagged_vlan
label: Tagged VLANs
peer: InfraVLAN
optional: true
cardinality: many
kind: Attribute
identifier: interface_l2__tagged_vlan
- name: LagInterfaceL2
namespace: Infra
description: "Network Layer 2 Lag Interface"
label: "Lag Interface L2"
icon: "mdi:ethernet"
include_in_menu: false
display_labels:
- name__value
order_by:
- name__value
inherit_from:
- "InfraInterface"
- "InfraLagInterface"
- "CoreArtifactTarget"
attributes:
- name: l2_mode
label: Layer2 Mode
kind: Text
enum: ["Access", "Trunk", "Trunk (ALL)"]
relationships:
- name: members
label: Members
peer: InfraInterfaceL2
optional: true
cardinality: many
kind: Generic
- name: untagged_vlan
label: Untagged VLAN
peer: InfraVLAN
optional: true
cardinality: one
kind: Component
identifier: interface_l2__untagged_vlan
- name: tagged_vlan
label: Tagged VLANs
peer: InfraVLAN
optional: true
cardinality: many
kind: Attribute
identifier: interface_l2__tagged_vlan
- name: Platform
namespace: Infra
description: "A Platform represents the type of software running on a device"
label: "Platform"
icon: "mdi:application-cog-outline"
menu_placement: "InfraDevice"
default_filter: name__value
human_friendly_id: ["name__value"]
order_by:
- name__value
display_labels:
- name__value
attributes:
- name: name
kind: Text
unique: true
- name: description
kind: Text
optional: true
- name: nornir_platform
kind: Text
optional: true
- name: napalm_driver
kind: Text
optional: true
- name: netmiko_device_type
kind: Text
optional: true
- name: ansible_network_os
kind: Text
optional: true
relationships:
- name: devices
peer: InfraDevice
optional: true
cardinality: many

# -------------------- Circuits --------------------
- name: Circuit
namespace: Infra
description: "A Circuit represent a single physical link between two locations"
label: "Circuit"
icon: "mdi:cable-data"
default_filter: circuit_id__value
human_friendly_id: ["circuit_id__value"]
order_by:
- circuit_id__value
display_labels:
- circuit_id__value
attributes:
- name: circuit_id
kind: Text
unique: true
- name: description
kind: Text
optional: true
- name: vendor_id
kind: Text
optional: true
- name: status
kind: Dropdown
choices:
- name: active
label: Active
description: "Fully operational and currently in service"
color: "#7fbf7f"
- name: provisioning
label: Provisioning
description: "In the process of being set up and configured"
color: "#ffff7f"
- name: maintenance
label: Maintenance
description: "Undergoing routine maintenance or repairs"
color: "#ffd27f"
- name: drained
label: Drained
description: "Temporarily taken out of service"
color: "#bfbfbf"
- name: role
kind: Dropdown
choices:
- name: backbone
label: Backbone
description: "Provide main data routes"
color: "#6a5acd"
- name: upstream
label: Upstream
description: "Connect to Internet service provider"
color: "#9090de"
- name: peering
label: Peering
description: "Connect with other networks via an IX"
color: "#85db9b"
relationships:
- name: provider
label: "Provider (Organization)"
peer: OrganizationGeneric
optional: false
cardinality: one
kind: Attribute
- name: endpoints
peer: InfraCircuitEndpoint
optional: true
cardinality: many
kind: Component
- name: bgp_sessions
label: "BGP Sessions"
peer: InfraBGPSession
optional: true
cardinality: many
kind: Component
- name: CircuitEndpoint
namespace: Infra
description: "A Circuit endpoint is attached to each end of a circuit"
label: "Circuit Endpoint"
icon: "mdi:ethernet-cable"
menu_placement: "InfraCircuit"
include_in_menu: false
attributes:
- name: description
kind: Text
optional: true
inherit_from:
- "InfraEndpoint"
relationships:
- name: site
label: "Site"
peer: "LocationSite"
optional: true
cardinality: one
kind: Attribute
identifier: "site__circuit_endpoints"
- name: circuit
peer: InfraCircuit
optional: false
cardinality: one
kind: Parent
- name: MlagDomain
namespace: Infra
description: "Represents the group of devices that share interfaces in a multi chassis link aggregation group"
label: "MLAG Domain"
icon: "eos-icons:cluster-management"
menu_placement: "InfraDevice"
include_in_menu: true
display_labels:
- name__value
attributes:
- name: name
label: Name
description: Name of a group of devices forming an MLAG Group
kind: Text
optional: false
unique: true
- name: domain_id
label: Domain Id
description: Domain Id of a group of devices forming an MLAG Group
kind: Number
optional: false
relationships:
- name: devices
cardinality: many
peer: InfraDevice
kind: Attribute
optional: false
- name: peer_interfaces
cardinality: many
peer: InfraLagInterfaceL2
kind: Attribute
optional: false
- name: MlagInterfaceL2
namespace: Infra
description: "L2 MLAG Interface"
label: "MLAG Interface L2"
icon: "mdi:ethernet"
include_in_menu: false
display_labels:
- mlag_id__value
inherit_from:
- InfraMlagInterface
relationships:
- name: members
peer: InfraLagInterfaceL2
label: Members
kind: Attribute
optional: false
cardinality: many
identifier: mlag_member_lag_interface
- name: MlagInterfaceL3
namespace: Infra
description: "L3 MLAG Interface"
label: "MLAG Interface L3"
include_in_menu: false
display_labels:
- mlag_id__value
inherit_from:
- InfraMlagInterface
relationships:
- name: members
peer: InfraLagInterfaceL3
label: Members
kind: Attribute
optional: false
cardinality: many
identifier: mlag_member_lag_interface
IPAM Base Schema
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
---
version: '1.0'
nodes:
# -------------------- IPAM (VLAN, IP Address) --------------------
- name: IPPrefix
namespace: Ipam
include_in_menu: false
inherit_from:
- "BuiltinIPPrefix"
description: "IPv4 or IPv6 network"
icon: "mdi:ip-network"
label: "IP Prefix"
- name: IPAddress
namespace: Ipam
include_in_menu: false
inherit_from:
- "BuiltinIPAddress"
description: "IP Address"
icon: "mdi:ip-outline"
label: "IP Address"
relationships:
- name: interface
peer: InfraInterfaceL3
optional: true
cardinality: one
- name: VLAN
namespace: Infra
description: "A VLAN is a logical grouping of devices in the same broadcast domain"
label: "VLAN"
icon: "mdi:lan-pending" # mdi:lan
default_filter: name__value
human_friendly_id: ["name__value", "vlan_id__value"]
order_by:
- name__value
display_labels:
- name__value
attributes:
- name: name
kind: Text
unique: true
- name: description
kind: Text
optional: true
- name: vlan_id
kind: Number
- name: status
kind: Dropdown
choices:
- name: active
label: Active
description: "Fully operational and currently in service"
color: "#7fbf7f"
- name: provisioning
label: Provisioning
description: "In the process of being set up and configured"
color: "#ffff7f"
- name: maintenance
label: Maintenance
description: "Undergoing routine maintenance or repairs"
color: "#ffd27f"
- name: drained
label: Drained
description: "Temporarily taken out of service"
color: "#bfbfbf"
- name: role
kind: Dropdown
choices:
- name: server
label: Server
description: "Dedicated systems for managing networked resources"
color: "#c4bed7"
- name: management
label: Management
description: "Network segments for administrative and control tasks"
color: "#9af1e1"
- name: user
label: User
description: "Segments designed for end-user access and activities"
color: "#a0b78d"
relationships:
- name: site
label: "Site"
peer: "LocationSite"
optional: true
cardinality: one
kind: Attribute
identifier: "site__vlans"
- name: gateway
label: L3 Gateway
peer: InfraInterfaceL3
optional: true
cardinality: one
kind: Attribute
Location Base Schema
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
---
version: '1.0'
generics:
- name: Generic # Location
namespace: Location
description: "Generic hierarchical location"
label: "Location"
hierarchical: true
icon: "mingcute:location-line"
human_friendly_id: ["name__value"]
include_in_menu: true
attributes:
- name: name
kind: Text
unique: true
- name: description
kind: Text
optional: true

nodes:
# -------------------- Location (Continent, Country, Site, Rack) --------------------
- name: Continent
namespace: Location
description: "A continent on planet earth."
menu_placement: "LocationGeneric"
icon: "jam:world"
inherit_from:
- "LocationGeneric"
generate_profile: false
default_filter: "name__value"
order_by:
- "name__value"
display_labels:
- "name__value"
children: "LocationCountry"
parent: ""
- name: Country
namespace: Location
description: "A country within a continent."
menu_placement: "LocationGeneric"
icon: "gis:search-country"
inherit_from:
- "LocationGeneric"
generate_profile: false
default_filter: "name__value"
order_by:
- "name__value"
display_labels:
- "name__value"
children: "LocationSite"
parent: "LocationContinent"
- name: Site
namespace: Location
description: "A site within a country."
menu_placement: "LocationGeneric"
icon: "ri:building-line"
inherit_from:
- "LocationGeneric"
default_filter: "name__value"
order_by:
- "name__value"
display_labels:
- "name__value"
children: "LocationRack"
parent: "LocationCountry"
attributes:
- name: city
kind: Text
optional: true
- name: address
kind: Text
optional: true
- name: contact
kind: Text
optional: true
relationships:
- name: devices
identifier: "site__devices"
cardinality: many
peer: InfraDevice
kind: Component
- name: vlans
identifier: "site__vlans"
cardinality: many
kind: Component
peer: InfraVLAN
- name: circuit_endpoints
identifier: "site__circuit_endpoints"
cardinality: many
kind: Component
peer: InfraCircuitEndpoint
- cardinality: many
kind: Attribute
name: tags
optional: true
peer: BuiltinTag
- name: Rack
namespace: Location
description: "A Rack represents a physical two- or four-post equipment rack in which devices can be installed"
label: "Rack"
icon: clarity:rack-server-solid
inherit_from:
- "LocationGeneric"
order_by:
- "site__name__value"
- "name__value"
display_labels:
- "name__value"
parent: "LocationSite"
children: ""
uniqueness_constraints:
- ["site", "name__value"]
human_friendly_id: ["site__name__value", "name__value"]
attributes:
- name: name
kind: Text
- name: description
kind: Text
optional: true
- name: height
kind: Text
- name: facility_id
label: Facility ID
kind: Text
optional: true
- name: serial_number
label: Serial Number
kind: Text
optional: true
- name: asset_tag
label: Asset Tag
kind: Text
optional: true
- name: status
kind: Dropdown
choices:
- name: active
label: Active
description: "Functional and ready for production"
color: "#009933"
- name: planned
label: Planned
description: "Not physically present yet"
color: "#cc66ff"
default_value: "active"
- name: role
kind: Dropdown
choices:
- name: compute
description: "Rack mainly composed of compute"
color: "#0099ff"
- name: storage
description: "Rack mainly composed of Storage devices"
color: "#993399"
- name: networking
description: "Rack mainly composed of Network devices"
color: "#ff6600"
optional: true
relationships:
- name: site
peer: LocationSite
optional: false
cardinality: one
kind: Attribute
- name: tags
peer: BuiltinTag
optional: true
cardinality: many
kind: Attribute
Organization Base Schema
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
---
version: '1.0'
generics:
- name: Generic # Organization
namespace: Organization
label: Organization
description: An organization represent a legal entity, a company.
default_filter: name__value
icon: mdi:domain
human_friendly_id: ["name__value"]
include_in_menu: true
attributes:
- name: name
kind: Text
unique: true
order_weight: 1000
- name: description
kind: Text
optional: true
order_weight: 1200
relationships:
- name: tags
peer: BuiltinTag
cardinality: many
kind: Attribute
optional: true
order_weight: 3000
- name: asn
label: "Autonomous System"
cardinality: many
optional: true
peer: InfraAutonomousSystem
order_weight: 2000

nodes:
- name: Manufacturer
namespace: Organization
description: Device Manufacturer
default_filter: name__value
order_by: [name__value]
display_labels:
- name__value
icon: mdi:domain
inherit_from:
- OrganizationGeneric
generate_profile: false
include_in_menu: true
menu_placement: OrganizationGeneric
relationships:
- name: platform
peer: InfraPlatform
cardinality: many
optional: true
- name: Provider
namespace: Organization
description: Circuit or Location Provider
default_filter: name__value
order_by: [name__value]
display_labels:
- name__value
icon: mdi:domain
inherit_from:
- OrganizationGeneric
include_in_menu: true
menu_placement: OrganizationGeneric
relationships:
- name: location
peer: LocationSite
cardinality: many
optional: true
- name: circuit
peer: InfraCircuit
cardinality: many
optional: true
- name: Tenant
namespace: Organization
description: Customer
default_filter: name__value
order_by: [name__value]
display_labels:
- name__value
icon: mdi:domain
inherit_from:
- OrganizationGeneric
include_in_menu: true
menu_placement: OrganizationGeneric
relationships:
- name: location
peer: LocationSite
cardinality: many
optional: true
- name: circuit
peer: InfraCircuit
cardinality: many
optional: true
Routing Base Schema
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
---
version: '1.0'
nodes:
# -------------------- BGP (ASN, BGP Groups, BGP Sessions) --------------------
- name: AutonomousSystem
namespace: Infra
description: "An Autonomous System (AS) is a set of Internet routable IP prefixes belonging to a network"
label: "Autonomous System"
icon: "mdi:bank-circle-outline"
menu_placement: InfraBGPSession
default_filter: name__value
human_friendly_id: ["name__value", "asn__value"]
order_by: ["asn__value"]
display_labels:
- name__value
- asn__value
attributes:
- name: name
kind: Text
unique: true
- name: asn
kind: Number
unique: true
- name: description
kind: Text
optional: true
relationships:
- name: organization
peer: OrganizationGeneric
optional: false
cardinality: one
kind: Attribute
- name: BGPPeerGroup
namespace: Infra
description: "A BGP Peer Group is used to regroup parameters that are shared across multiple peers"
label: "BGP Peer Group"
icon: "mdi:view-grid-plus-outline"
menu_placement: InfraBGPSession
default_filter: name__value
human_friendly_id: ["name__value"]
order_by:
- name__value
display_labels:
- name__value
attributes:
- name: name
kind: Text
unique: true
- name: description
kind: Text
optional: true
- name: import_policies
kind: Text
optional: true
- name: export_policies
kind: Text
optional: true
relationships:
- name: local_as
identifier: bgppeergroup__local_as
peer: InfraAutonomousSystem
optional: true
cardinality: one
kind: Attribute
- name: remote_as
identifier: bgppeergroup__remote_as
peer: InfraAutonomousSystem
optional: true
cardinality: one
kind: Attribute
- name: BGPSession
namespace: Infra
description: "A BGP Session represent a point to point connection between two routers"
label: "BGP Session"
icon: "mdi:router"
inherit_from:
- "CoreArtifactTarget"
human_friendly_id: ["remote_as__asn__value", "remote_ip__address__value", "device__name__value"]
order_by:
- device__name__value
- remote_as__asn__value
attributes:
- name: type
kind: Text
enum: [EXTERNAL, INTERNAL]
- name: description
kind: Text
optional: true
- name: import_policies
kind: Text
optional: true
- name: export_policies
kind: Text
optional: true
- name: status
kind: Dropdown
choices:
- name: active
label: Active
description: "Fully operational and currently in service"
color: "#7fbf7f"
- name: provisioning
label: Provisioning
description: "In the process of being set up and configured"
color: "#ffff7f"
- name: maintenance
label: Maintenance
description: "Undergoing routine maintenance or repairs"
color: "#ffd27f"
- name: drained
label: Drained
description: "Temporarily taken out of service"
color: "#bfbfbf"
- name: role
kind: Dropdown
choices:
- name: backbone
label: Backbone
description: "Provide main data routes"
color: "#6a5acd"
- name: upstream
label: Upstream
description: "Connect to Internet service provider"
color: "#9090de"
- name: peering
label: Peering
description: "Connect with other networks via an IX"
color: "#85db9b"
relationships:
- name: local_as
identifier: bgpsession__local_as
peer: InfraAutonomousSystem
optional: true
cardinality: one
kind: Attribute
- name: remote_as
identifier: bgpsession__remote_as
peer: InfraAutonomousSystem
optional: false
cardinality: one
kind: Attribute
- name: local_ip
identifier: bgpsession__local_ip
peer: BuiltinIPAddress
optional: true
cardinality: one
kind: Attribute
- name: remote_ip
identifier: bgpsession__remote_ip
peer: BuiltinIPAddress
optional: false
cardinality: one
kind: Attribute
- name: device
peer: InfraDevice
optional: false
cardinality: one
- name: peer_group
peer: InfraBGPPeerGroup
optional: true
cardinality: one
kind: Attribute
- name: peer_session
peer: InfraBGPSession
optional: true
cardinality: one
kind: Attribute

Use the following command to load these new models into Infrahub

invoke demo.load-infra-schema
Expected Results
> invoke demo.load-infra-schema
--- abbreviated ---
schema 'models/base/dcim.yml' loaded successfully
schema 'models/base/ipam.yml' loaded successfully
schema 'models/base/location.yml' loaded successfully
schema 'models/base/organization.yml' loaded successfully
schema 'models/base/routing.yml' loaded successfully
5 schemas processed in 26.640 seconds.
Waiting for schema to sync across all workers
Schema updated on all workers.
--- abbreviated ---
[+] Restarting 1/1
✔ Container infrahub-infrahub-server-1 Started 1.5s
Validate that everything is correct

Reload the frontend to see the new menu corresponding to the new models we added to the schema.

Load some real data into the database

In order to have more meaningful data to explore, we'll use a sample topology of 6 devices as presented below that is leveraging all the new models we added to the schema.

Use the following command to load these new models into Infrahub:

invoke demo.load-infra-data
Expected Results
> invoke demo.load-infra-data
--- abbreviated ---
[13:27:39] INFO Create a new Branch and Change the IP addresses between edge1 and edge2 on the selected site infrastructure_edge.py:648
INFO - Creating branch: 'jfk1-update-edge-ips' infrastructure_edge.py:649
[13:27:43] INFO - Replaced jfk1-edge1-Ethernet1 IP to 10.1.0.32/31 infrastructure_edge.py:678
INFO - Replaced jfk1-edge2-Ethernet1 IP to 10.1.0.33/31 infrastructure_edge.py:687
INFO Create a new Branch and Delete Colt Transit Circuit infrastructure_edge.py:694
INFO - Creating branch: 'atl1-delete-upstream' infrastructure_edge.py:699
[13:27:47] INFO - Deleted Colt [DUFF-cf3a6ed2d959] infrastructure_edge.py:752
INFO - Deleted Colt [DUFF-4141a7be1f9a] infrastructure_edge.py:752
INFO Create a new Branch and introduce some conflicts infrastructure_edge.py:759
INFO - Creating branch: 'den1-maintenance-conflict' infrastructure_edge.py:769
[13:27:53] INFO Create a new Branch and introduce some conflicts on the platforms for node ADD and DELETE infrastructure_edge.py:802
INFO - Creating branch: 'platform-conflict' infrastructure_edge.py:809
Validate that everything is correct

You should now be able to see 10 devices when you visit the list of devices at http://localhost:8000/objects/InfraDevice