Add network schema for devices, interfaces, VLANs, VRFs, BGP configurations, MLAG, EVPN, VXLAN, routing policies, and DCI connections
- Created device schema with attributes for hostname, role, platform, and management IP. - Added interface schema with various types, MTU, speed, and switchport modes. - Introduced VLAN and VRF schemas with relationships to devices and interfaces. - Implemented BGP configuration, peer groups, and neighbors with detailed attributes. - Established MLAG domain and interface schemas for multi-chassis link aggregation. - Developed EVPN and VXLAN schemas for overlay networking. - Created routing policy schemas including route maps and prefix lists. - Added DCI switch and connection schemas for inter-datacenter connectivity.
This commit is contained in:
111
infrahub/schema/01_organization.yml
Normal file
111
infrahub/schema/01_organization.yml
Normal file
@@ -0,0 +1,111 @@
|
||||
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
||||
---
|
||||
version: "1.0"
|
||||
|
||||
nodes:
|
||||
- name: Organization
|
||||
namespace: Core
|
||||
label: "Organization"
|
||||
icon: "mdi:domain"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["name__value"]
|
||||
display_label: "{{ record.name__value }}"
|
||||
order_by:
|
||||
- name__value
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "Organization name"
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Organization description"
|
||||
- name: asn_base
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 65000
|
||||
description: "Base ASN for BGP allocation (e.g., 65000)"
|
||||
relationships:
|
||||
- name: sites
|
||||
peer: LocationSite
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Sites belonging to this organization"
|
||||
- name: ip_namespaces
|
||||
peer: IpamNamespace
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "IP namespaces managed by this organization"
|
||||
|
||||
- name: Site
|
||||
namespace: Location
|
||||
label: "Site"
|
||||
icon: "mdi:office-building"
|
||||
include_in_menu: true
|
||||
menu_placement: "CoreOrganization"
|
||||
human_friendly_id: ["name__value"]
|
||||
display_label: "{{ record.name__value }}"
|
||||
order_by:
|
||||
- name__value
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "Site name (e.g., Paris-DC)"
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Site description"
|
||||
- name: location
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Physical location (e.g., Paris, France)"
|
||||
- name: facility_id
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Facility identifier"
|
||||
- name: status
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "active"
|
||||
choices:
|
||||
- name: active
|
||||
label: Active
|
||||
description: Site is operational
|
||||
color: "#7fbf7f"
|
||||
- name: planned
|
||||
label: Planned
|
||||
description: Site is being planned
|
||||
color: "#ffd966"
|
||||
- name: maintenance
|
||||
label: Maintenance
|
||||
description: Site under maintenance
|
||||
color: "#ff9999"
|
||||
- name: decommissioned
|
||||
label: Decommissioned
|
||||
description: Site decommissioned
|
||||
color: "#cccccc"
|
||||
relationships:
|
||||
- name: organization
|
||||
peer: CoreOrganization
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Parent organization"
|
||||
- name: datacenters
|
||||
peer: InfraDatacenter
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Datacenters at this site"
|
||||
- name: parent_prefix
|
||||
peer: IpamIPPrefix
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Parent IP prefix for this site"
|
||||
164
infrahub/schema/02_ipam.yml
Normal file
164
infrahub/schema/02_ipam.yml
Normal file
@@ -0,0 +1,164 @@
|
||||
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
||||
---
|
||||
version: "1.0"
|
||||
|
||||
nodes:
|
||||
- name: Namespace
|
||||
namespace: Ipam
|
||||
label: "IP Namespace"
|
||||
icon: "mdi:ip-network"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["name__value"]
|
||||
display_label: "{{ record.name__value }}"
|
||||
order_by:
|
||||
- name__value
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "Namespace name (e.g., Global, Tenant1)"
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Namespace description"
|
||||
relationships:
|
||||
- name: organization
|
||||
peer: CoreOrganization
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
|
||||
- name: IPPrefix
|
||||
namespace: Ipam
|
||||
label: "IP Prefix"
|
||||
icon: "mdi:ip-network-outline"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["prefix__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.prefix__value, record.description__value])) }}"
|
||||
order_by:
|
||||
- prefix__value
|
||||
attributes:
|
||||
- name: prefix
|
||||
kind: IPNetwork
|
||||
unique: true
|
||||
optional: false
|
||||
description: "IP Prefix (e.g., 10.1.0.0/24)"
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Prefix description"
|
||||
- name: prefix_type
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "pool"
|
||||
choices:
|
||||
- name: pool
|
||||
label: Pool
|
||||
description: IP address pool
|
||||
- name: loopback
|
||||
label: Loopback
|
||||
description: Loopback addresses
|
||||
- name: p2p
|
||||
label: Point-to-Point
|
||||
description: Point-to-point links
|
||||
- name: management
|
||||
label: Management
|
||||
description: Management network
|
||||
- name: tenant
|
||||
label: Tenant
|
||||
description: Tenant/VLAN network
|
||||
- name: vtep
|
||||
label: VTEP
|
||||
description: VXLAN VTEP addresses
|
||||
- name: mlag
|
||||
label: MLAG
|
||||
description: MLAG peer links
|
||||
- name: status
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "active"
|
||||
choices:
|
||||
- name: active
|
||||
label: Active
|
||||
- name: reserved
|
||||
label: Reserved
|
||||
- name: deprecated
|
||||
label: Deprecated
|
||||
relationships:
|
||||
- name: namespace
|
||||
peer: IpamNamespace
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
- name: parent
|
||||
peer: IpamIPPrefix
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Parent prefix"
|
||||
- name: children
|
||||
peer: IpamIPPrefix
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Child prefixes"
|
||||
- name: datacenter
|
||||
peer: InfraDatacenter
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Associated datacenter"
|
||||
- name: vrf
|
||||
peer: NetworkVRF
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
|
||||
- name: IPAddress
|
||||
namespace: Ipam
|
||||
label: "IP Address"
|
||||
icon: "mdi:ip"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["address__value"]
|
||||
display_label: "{{ record.address__value }}"
|
||||
order_by:
|
||||
- address__value
|
||||
attributes:
|
||||
- name: address
|
||||
kind: IPHost
|
||||
unique: true
|
||||
optional: false
|
||||
description: "IP Address with mask (e.g., 10.1.0.1/32)"
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "IP address description"
|
||||
- name: status
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "active"
|
||||
choices:
|
||||
- name: active
|
||||
label: Active
|
||||
- name: reserved
|
||||
label: Reserved
|
||||
- name: deprecated
|
||||
label: Deprecated
|
||||
relationships:
|
||||
- name: prefix
|
||||
peer: IpamIPPrefix
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
- name: interface
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Interface using this IP"
|
||||
- name: vrf
|
||||
peer: NetworkVRF
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
211
infrahub/schema/03_datacenter.yml
Normal file
211
infrahub/schema/03_datacenter.yml
Normal file
@@ -0,0 +1,211 @@
|
||||
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
||||
---
|
||||
version: "1.0"
|
||||
|
||||
nodes:
|
||||
- name: Datacenter
|
||||
namespace: Infra
|
||||
label: "Datacenter"
|
||||
icon: "mdi:server-network"
|
||||
include_in_menu: true
|
||||
menu_placement: "LocationSite"
|
||||
human_friendly_id: ["name__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.name__value, record.dc_id__value])) }}"
|
||||
order_by:
|
||||
- dc_id__value
|
||||
generate_template: false
|
||||
description: "Datacenter - Generator object that creates fabric topology"
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "Datacenter name (e.g., DC1, DC2)"
|
||||
- name: dc_id
|
||||
kind: Number
|
||||
unique: true
|
||||
optional: false
|
||||
description: "Numeric datacenter ID for IP addressing (e.g., 1, 2)"
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Datacenter description"
|
||||
|
||||
- name: parent_subnet
|
||||
kind: IPNetwork
|
||||
optional: false
|
||||
description: "Address space allocation"
|
||||
|
||||
# Topology Configuration
|
||||
- name: number_of_bays
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 2
|
||||
description: "Number of bays/racks (determines leaf count)"
|
||||
- name: spine_count
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 3
|
||||
description: "Number of spine switches"
|
||||
- name: border_leaf_count
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 2
|
||||
description: "Number of border leaf switches for DCI (0 if has_border_leafs=false)"
|
||||
|
||||
# BGP Configuration
|
||||
- name: bgp_base_asn
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 65000
|
||||
description: "Base ASN for BGP (e.g., 65000)"
|
||||
- name: spine_asn
|
||||
kind: Number
|
||||
optional: true
|
||||
description: "Spine ASN (auto-calculated: base + dc_id * 100)"
|
||||
|
||||
# MLAG Configuration
|
||||
- name: mlag_domain_id
|
||||
kind: Text
|
||||
optional: false
|
||||
default_value: "MLAG"
|
||||
description: "MLAG domain identifier"
|
||||
|
||||
# Interface Configuration
|
||||
- name: mtu
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 9214
|
||||
description: "Default MTU for fabric interfaces"
|
||||
|
||||
# DCI Configuration (Optional)
|
||||
- name: dci_enabled
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: false
|
||||
description: "Enable DCI connectivity (activates border leaf eth12). Default: false (eth12 shutdown)"
|
||||
- name: dci_remote_dc_id
|
||||
kind: Number
|
||||
optional: true
|
||||
description: "Remote datacenter ID for DCI peering (required when dci_enabled=true)"
|
||||
- name: has_border_leafs
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: true
|
||||
description: "Include border leaf switches (set false if no DCI capability needed)"
|
||||
|
||||
# Computed/Derived Attributes (read-only, set by generator)
|
||||
- name: leaf_pair_count
|
||||
kind: Number
|
||||
optional: true
|
||||
read_only: true
|
||||
description: "Computed: ceil(number_of_bays / 2)"
|
||||
- name: total_leaf_count
|
||||
kind: Number
|
||||
optional: true
|
||||
read_only: true
|
||||
description: "Computed: leaf_pair_count * 2"
|
||||
- name: total_access_count
|
||||
kind: Number
|
||||
optional: true
|
||||
read_only: true
|
||||
description: "Computed: number_of_bays"
|
||||
|
||||
# Status
|
||||
- name: status
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "planned"
|
||||
choices:
|
||||
- name: planned
|
||||
label: Planned
|
||||
color: "#ffd966"
|
||||
- name: active
|
||||
label: Active
|
||||
color: "#7fbf7f"
|
||||
- name: maintenance
|
||||
label: Maintenance
|
||||
color: "#ff9999"
|
||||
|
||||
relationships:
|
||||
- name: site
|
||||
peer: LocationSite
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Parent site"
|
||||
|
||||
- name: devices
|
||||
peer: NetworkDevice
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Component
|
||||
description: "All devices in this datacenter (generated)"
|
||||
|
||||
- name: ip_prefixes
|
||||
peer: IpamIPPrefix
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "IP prefixes for this datacenter (generated)"
|
||||
|
||||
- name: mlag_pairs
|
||||
peer: NetworkMLAGDomain
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "MLAG pairs in this datacenter (generated)"
|
||||
|
||||
- name: Bay
|
||||
namespace: Infra
|
||||
label: "Bay/Rack"
|
||||
icon: "mdi:server-outline"
|
||||
include_in_menu: true
|
||||
menu_placement: "InfraDatacenter"
|
||||
human_friendly_id: ["name__value"]
|
||||
display_label: "{{ record.name__value }}"
|
||||
order_by:
|
||||
- bay_id__value
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "Bay name (e.g., Bay-1-DC1)"
|
||||
- name: bay_id
|
||||
kind: Number
|
||||
optional: false
|
||||
description: "Bay numeric ID"
|
||||
- name: location
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Physical location in datacenter"
|
||||
- name: rack_units
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 42
|
||||
description: "Available rack units (U)"
|
||||
relationships:
|
||||
- name: datacenter
|
||||
peer: InfraDatacenter
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
- name: access_switch
|
||||
peer: NetworkDevice
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Access switch for this bay"
|
||||
- name: leaf_pair
|
||||
peer: NetworkMLAGDomain
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Leaf pair serving this bay"
|
||||
- name: hosts
|
||||
peer: NetworkDevice
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Host devices in this bay"
|
||||
197
infrahub/schema/04_device.yml
Normal file
197
infrahub/schema/04_device.yml
Normal file
@@ -0,0 +1,197 @@
|
||||
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
||||
---
|
||||
version: "1.0"
|
||||
|
||||
nodes:
|
||||
- name: Device
|
||||
namespace: Network
|
||||
label: "Network Device"
|
||||
icon: "mdi:router"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["hostname__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.hostname__value, record.role__value])) }}"
|
||||
order_by:
|
||||
- hostname__value
|
||||
generate_template: false
|
||||
attributes:
|
||||
- name: hostname
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "Device hostname (e.g., spine1-DC1)"
|
||||
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Device description"
|
||||
|
||||
- name: role
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
choices:
|
||||
- name: spine
|
||||
label: Spine
|
||||
description: "Spine switch (L3 core)"
|
||||
color: "#ff6b6b"
|
||||
- name: leaf
|
||||
label: Leaf
|
||||
description: "Leaf switch (ToR/Aggregation)"
|
||||
color: "#4ecdc4"
|
||||
- name: borderleaf
|
||||
label: Border Leaf
|
||||
description: "Border leaf (DCI gateway capable)"
|
||||
color: "#95e1d3"
|
||||
- name: access
|
||||
label: Access
|
||||
description: "Access switch (rack ToR)"
|
||||
color: "#ffe66d"
|
||||
- name: host
|
||||
label: Host
|
||||
description: "Host/Server device"
|
||||
color: "#f1faee"
|
||||
|
||||
- name: platform
|
||||
kind: Text
|
||||
optional: false
|
||||
default_value: "cEOS"
|
||||
description: "Device platform (e.g., cEOS, vEOS, EOS)"
|
||||
|
||||
- name: eos_version
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "EOS software version"
|
||||
|
||||
- name: serial_number
|
||||
kind: Text
|
||||
optional: true
|
||||
unique: true
|
||||
description: "Device serial number"
|
||||
|
||||
- name: model
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Device model (e.g., DCS-7050SX3-48YC8)"
|
||||
|
||||
- name: management_ip_template
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Template for generating the management IP address"
|
||||
|
||||
- name: management_ip
|
||||
kind: IPHost
|
||||
optional: true
|
||||
read_only: true
|
||||
description: "Management IP address"
|
||||
|
||||
- name: status
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "active"
|
||||
choices:
|
||||
- name: active
|
||||
label: Active
|
||||
color: "#7fbf7f"
|
||||
- name: planned
|
||||
label: Planned
|
||||
color: "#ffd966"
|
||||
- name: maintenance
|
||||
label: Maintenance
|
||||
color: "#ff9999"
|
||||
- name: failed
|
||||
label: Failed
|
||||
color: "#ff0000"
|
||||
- name: decommissioned
|
||||
label: Decommissioned
|
||||
color: "#cccccc"
|
||||
|
||||
# Role-specific attributes
|
||||
- name: spine_id
|
||||
kind: Number
|
||||
optional: true
|
||||
description: "Spine ID (1, 2, 3...)"
|
||||
|
||||
- name: leaf_id
|
||||
kind: Number
|
||||
optional: true
|
||||
description: "Leaf ID (1, 2, 3, 4...)"
|
||||
|
||||
- name: mlag_side
|
||||
kind: Dropdown
|
||||
optional: true
|
||||
choices:
|
||||
- name: left
|
||||
label: Left (Odd)
|
||||
- name: right
|
||||
label: Right (Even)
|
||||
description: "MLAG pairing side (left=odd, right=even)"
|
||||
|
||||
relationships:
|
||||
- name: datacenter
|
||||
peer: InfraDatacenter
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Parent datacenter"
|
||||
|
||||
- name: bay
|
||||
peer: InfraBay
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Bay location (for access/hosts)"
|
||||
|
||||
- name: site
|
||||
peer: LocationSite
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Site location"
|
||||
|
||||
- name: interfaces
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Component
|
||||
description: "Device interfaces"
|
||||
|
||||
- name: bgp_config
|
||||
peer: NetworkBGPConfig
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Component
|
||||
description: "BGP configuration"
|
||||
|
||||
- name: ospf_config
|
||||
peer: NetworkOSPFConfig
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Component
|
||||
description: "OSPF configuration"
|
||||
|
||||
- name: mlag_domain
|
||||
peer: NetworkMLAGDomain
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "MLAG domain membership"
|
||||
|
||||
- name: evpn_config
|
||||
peer: NetworkEVPNConfig
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Component
|
||||
description: "EVPN configuration"
|
||||
|
||||
- name: vlans
|
||||
peer: NetworkVLAN
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "VLANs configured on device"
|
||||
|
||||
- name: vrfs
|
||||
peer: NetworkVRF
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "VRFs configured on device"
|
||||
211
infrahub/schema/05_interfaces.yml
Normal file
211
infrahub/schema/05_interfaces.yml
Normal file
@@ -0,0 +1,211 @@
|
||||
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
||||
---
|
||||
version: "1.0"
|
||||
|
||||
nodes:
|
||||
- name: Interface
|
||||
namespace: Network
|
||||
label: "Interface"
|
||||
icon: "mdi:ethernet"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["device__hostname__value", "name__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.name__value, record.description__value])) }}"
|
||||
order_by:
|
||||
- device__hostname__value
|
||||
- name__value
|
||||
uniqueness_constraints:
|
||||
- ["device", "name__value"]
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
optional: false
|
||||
description: "Interface name (e.g., Ethernet1, Loopback0)"
|
||||
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Interface description"
|
||||
|
||||
- name: interface_type
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "ethernet"
|
||||
choices:
|
||||
- name: ethernet
|
||||
label: Ethernet
|
||||
description: "Physical Ethernet interface"
|
||||
- name: loopback
|
||||
label: Loopback
|
||||
description: "Loopback interface"
|
||||
- name: port_channel
|
||||
label: Port-Channel
|
||||
description: "Link aggregation group"
|
||||
- name: vlan
|
||||
label: VLAN (SVI)
|
||||
description: "VLAN interface"
|
||||
- name: vxlan
|
||||
label: VXLAN
|
||||
description: "VXLAN tunnel interface"
|
||||
- name: management
|
||||
label: Management
|
||||
description: "Management interface"
|
||||
|
||||
- name: enabled
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: true
|
||||
description: "Interface administrative status"
|
||||
|
||||
- name: mtu
|
||||
kind: Number
|
||||
optional: true
|
||||
default_value: 9214
|
||||
description: "Interface MTU"
|
||||
|
||||
- name: speed
|
||||
kind: Dropdown
|
||||
optional: true
|
||||
choices:
|
||||
- name: 1g
|
||||
label: 1 Gbps
|
||||
- name: 10g
|
||||
label: 10 Gbps
|
||||
- name: 25g
|
||||
label: 25 Gbps
|
||||
- name: 40g
|
||||
label: 40 Gbps
|
||||
- name: 100g
|
||||
label: 100 Gbps
|
||||
description: "Interface speed"
|
||||
|
||||
# Layer 2 Attributes
|
||||
- name: switchport_mode
|
||||
kind: Dropdown
|
||||
optional: true
|
||||
choices:
|
||||
- name: access
|
||||
label: Access
|
||||
- name: trunk
|
||||
label: Trunk
|
||||
- name: routed
|
||||
label: Routed (no switchport)
|
||||
description: "Switchport mode"
|
||||
|
||||
- name: trunk_groups
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Trunk groups (comma-separated)"
|
||||
|
||||
# Layer 3 Attributes
|
||||
- name: ip_unnumbered
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: false
|
||||
description: "Use IP unnumbered"
|
||||
|
||||
# Port-Channel Attributes
|
||||
- name: channel_id
|
||||
kind: Number
|
||||
optional: true
|
||||
description: "Port-channel ID"
|
||||
|
||||
- name: lacp_mode
|
||||
kind: Dropdown
|
||||
optional: true
|
||||
choices:
|
||||
- name: active
|
||||
label: Active
|
||||
- name: passive
|
||||
label: Passive
|
||||
- name: on
|
||||
label: On (no LACP)
|
||||
description: "LACP mode for port-channel"
|
||||
|
||||
# Loopback Attributes
|
||||
- name: loopback_id
|
||||
kind: Number
|
||||
optional: true
|
||||
description: "Loopback interface ID (0, 1, etc.)"
|
||||
|
||||
- name: loopback_purpose
|
||||
kind: Dropdown
|
||||
optional: true
|
||||
choices:
|
||||
- name: router_id
|
||||
label: Router ID (Loopback0)
|
||||
- name: vtep
|
||||
label: VTEP (Loopback1)
|
||||
- name: other
|
||||
label: Other
|
||||
description: "Loopback purpose"
|
||||
|
||||
relationships:
|
||||
- name: device
|
||||
peer: NetworkDevice
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
description: "Parent device"
|
||||
|
||||
- name: ip_addresses
|
||||
peer: IpamIPAddress
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "IP addresses assigned to interface"
|
||||
|
||||
- name: unnumbered_source
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Source interface for IP unnumbered"
|
||||
|
||||
- name: allowed_vlans
|
||||
peer: NetworkVLAN
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "VLANs allowed on trunk"
|
||||
|
||||
- name: port_channel
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Parent port-channel"
|
||||
|
||||
- name: member_interfaces
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Member interfaces (for port-channel)"
|
||||
|
||||
- name: connected_to
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Remote interface connection"
|
||||
|
||||
- name: mlag_config
|
||||
peer: NetworkMLAGInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Component
|
||||
description: "MLAG interface configuration"
|
||||
|
||||
- name: bgp_sessions
|
||||
peer: NetworkBGPNeighbor
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "BGP sessions on this interface"
|
||||
|
||||
- name: ospf_config
|
||||
peer: NetworkOSPFInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Component
|
||||
description: "OSPF interface configuration"
|
||||
146
infrahub/schema/06_vlan_vrfs.yml
Normal file
146
infrahub/schema/06_vlan_vrfs.yml
Normal file
@@ -0,0 +1,146 @@
|
||||
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
||||
---
|
||||
version: "1.0"
|
||||
|
||||
nodes:
|
||||
- name: VLAN
|
||||
namespace: Network
|
||||
label: "VLAN"
|
||||
icon: "mdi:lan"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["vlan_id__value", "name__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.vlan_id__value, record.name__value])) }}"
|
||||
order_by:
|
||||
- vlan_id__value
|
||||
attributes:
|
||||
- name: vlan_id
|
||||
kind: Number
|
||||
optional: false
|
||||
description: "VLAN ID (1-4094)"
|
||||
|
||||
- name: name
|
||||
kind: Text
|
||||
optional: false
|
||||
description: "VLAN name"
|
||||
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "VLAN description"
|
||||
|
||||
- name: trunk_groups
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Trunk groups (comma-separated, e.g., MLAGPEER)"
|
||||
|
||||
- name: status
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "active"
|
||||
choices:
|
||||
- name: active
|
||||
label: Active
|
||||
- name: suspended
|
||||
label: Suspended
|
||||
description: "VLAN status"
|
||||
|
||||
relationships:
|
||||
- name: devices
|
||||
peer: NetworkDevice
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Devices with this VLAN"
|
||||
|
||||
- name: interfaces
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Interfaces with this VLAN"
|
||||
|
||||
- name: svi
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "SVI interface for this VLAN"
|
||||
|
||||
- name: vrf
|
||||
peer: NetworkVRF
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "VRF for this VLAN"
|
||||
|
||||
- name: vxlan_tunnel
|
||||
peer: NetworkVXLANTunnel
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "VXLAN tunnel mapping"
|
||||
|
||||
- name: VRF
|
||||
namespace: Network
|
||||
label: "VRF"
|
||||
icon: "mdi:router-network"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["name__value"]
|
||||
display_label: "{{ record.name__value }}"
|
||||
order_by:
|
||||
- name__value
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "VRF name (e.g., default, tenant1)"
|
||||
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "VRF description"
|
||||
|
||||
- name: route_distinguisher
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Route Distinguisher (e.g., 65001:100)"
|
||||
|
||||
- name: rt_import
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Route Target Import (comma-separated)"
|
||||
|
||||
- name: rt_export
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Route Target Export (comma-separated)"
|
||||
|
||||
relationships:
|
||||
- name: devices
|
||||
peer: NetworkDevice
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Devices with this VRF"
|
||||
|
||||
- name: interfaces
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Interfaces in this VRF"
|
||||
|
||||
- name: ip_prefixes
|
||||
peer: IpamIPPrefix
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "IP prefixes in this VRF"
|
||||
|
||||
- name: vlans
|
||||
peer: NetworkVLAN
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "VLANs in this VRF"
|
||||
290
infrahub/schema/07_bgp.yml
Normal file
290
infrahub/schema/07_bgp.yml
Normal file
@@ -0,0 +1,290 @@
|
||||
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
||||
---
|
||||
version: "1.0"
|
||||
|
||||
nodes:
|
||||
- name: BGPConfig
|
||||
namespace: Network
|
||||
label: "BGP Configuration"
|
||||
icon: "mdi:routes"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["device__hostname__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.device__hostname__value, record.asn__value])) }}"
|
||||
order_by:
|
||||
- device__hostname__value
|
||||
attributes:
|
||||
- name: asn
|
||||
kind: Number
|
||||
optional: false
|
||||
description: "BGP AS Number"
|
||||
|
||||
- name: router_id
|
||||
kind: IPHost
|
||||
optional: false
|
||||
description: "BGP Router ID (usually Loopback0)"
|
||||
|
||||
- name: maximum_paths
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 3
|
||||
description: "Maximum paths for ECMP"
|
||||
|
||||
- name: distance_external
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 20
|
||||
description: "Administrative distance for eBGP routes"
|
||||
|
||||
- name: distance_internal
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 200
|
||||
description: "Administrative distance for iBGP routes"
|
||||
|
||||
- name: default_ipv4_unicast
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: false
|
||||
description: "Enable default IPv4 unicast address family"
|
||||
|
||||
- name: ebgp_admin_distance
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 200
|
||||
description: "eBGP admin distance override"
|
||||
|
||||
relationships:
|
||||
- name: device
|
||||
peer: NetworkDevice
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
description: "Parent device"
|
||||
|
||||
- name: peer_groups
|
||||
peer: NetworkBGPPeerGroup
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Component
|
||||
description: "BGP peer groups"
|
||||
|
||||
- name: neighbors
|
||||
peer: NetworkBGPNeighbor
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Component
|
||||
description: "BGP neighbors"
|
||||
|
||||
- name: address_families
|
||||
peer: NetworkBGPAddressFamily
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Component
|
||||
description: "BGP address families"
|
||||
|
||||
- name: route_maps
|
||||
peer: NetworkRouteMap
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Route maps used in BGP"
|
||||
|
||||
- name: prefix_lists
|
||||
peer: NetworkPrefixList
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Prefix lists used in BGP"
|
||||
|
||||
- name: BGPPeerGroup
|
||||
namespace: Network
|
||||
label: "BGP Peer Group"
|
||||
icon: "mdi:account-group"
|
||||
include_in_menu: false
|
||||
human_friendly_id: ["bgp_config__device__hostname__value", "name__value"]
|
||||
display_label: "{{ record.name__value }}"
|
||||
order_by:
|
||||
- name__value
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
optional: false
|
||||
description: "Peer group name (e.g., SPINE_Underlay)"
|
||||
|
||||
- name: remote_asn
|
||||
kind: Number
|
||||
optional: true
|
||||
description: "Remote AS number (for eBGP)"
|
||||
|
||||
- name: send_community
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: true
|
||||
description: "Send community attributes"
|
||||
|
||||
- name: maximum_routes
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 12000
|
||||
description: "Maximum routes from peers"
|
||||
|
||||
- name: peer_type
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "ebgp"
|
||||
choices:
|
||||
- name: ebgp
|
||||
label: eBGP
|
||||
- name: ibgp
|
||||
label: iBGP
|
||||
description: "Peer type"
|
||||
|
||||
- name: next_hop_self
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: false
|
||||
description: "Set next-hop self for routes"
|
||||
|
||||
relationships:
|
||||
- name: bgp_config
|
||||
peer: NetworkBGPConfig
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
|
||||
- name: update_source
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Update source interface"
|
||||
|
||||
- name: neighbors
|
||||
peer: NetworkBGPNeighbor
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Neighbors in this peer group"
|
||||
|
||||
- name: BGPNeighbor
|
||||
namespace: Network
|
||||
label: "BGP Neighbor"
|
||||
icon: "mdi:account-network"
|
||||
include_in_menu: false
|
||||
human_friendly_id: ["bgp_config__device__hostname__value", "neighbor_ip__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.neighbor_ip__value, record.description__value])) }}"
|
||||
order_by:
|
||||
- neighbor_ip__value
|
||||
attributes:
|
||||
- name: neighbor_ip
|
||||
kind: IPHost
|
||||
optional: false
|
||||
description: "Neighbor IP address"
|
||||
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Neighbor description"
|
||||
|
||||
- name: enabled
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: true
|
||||
description: "Neighbor enabled"
|
||||
|
||||
- name: peer_type
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "ebgp"
|
||||
choices:
|
||||
- name: ebgp
|
||||
label: eBGP
|
||||
- name: ibgp
|
||||
label: iBGP
|
||||
description: "Peer type"
|
||||
|
||||
relationships:
|
||||
- name: bgp_config
|
||||
peer: NetworkBGPConfig
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
|
||||
- name: peer_group
|
||||
peer: NetworkBGPPeerGroup
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Peer group membership"
|
||||
|
||||
- name: local_interface
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Local interface for session"
|
||||
|
||||
- name: remote_device
|
||||
peer: NetworkDevice
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Remote device (if known)"
|
||||
|
||||
- name: BGPAddressFamily
|
||||
namespace: Network
|
||||
label: "BGP Address Family"
|
||||
icon: "mdi:family-tree"
|
||||
include_in_menu: false
|
||||
human_friendly_id: ["bgp_config__device__hostname__value", "afi__value", "safi__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.afi__value, record.safi__value])) }}"
|
||||
attributes:
|
||||
- name: afi
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
choices:
|
||||
- name: ipv4
|
||||
label: IPv4
|
||||
- name: ipv6
|
||||
label: IPv6
|
||||
- name: l2vpn
|
||||
label: L2VPN
|
||||
description: "Address Family Identifier"
|
||||
|
||||
- name: safi
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
choices:
|
||||
- name: unicast
|
||||
label: Unicast
|
||||
- name: multicast
|
||||
label: Multicast
|
||||
- name: evpn
|
||||
label: EVPN
|
||||
description: "Sub-Address Family Identifier"
|
||||
|
||||
- name: activated
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: true
|
||||
description: "Address family activated"
|
||||
|
||||
- name: redistribute_connected
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: false
|
||||
description: "Redistribute connected routes"
|
||||
|
||||
relationships:
|
||||
- name: bgp_config
|
||||
peer: NetworkBGPConfig
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
|
||||
- name: route_map
|
||||
peer: NetworkRouteMap
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Route map for redistribution"
|
||||
151
infrahub/schema/08_mlag_evpn_vxlan.yml
Normal file
151
infrahub/schema/08_mlag_evpn_vxlan.yml
Normal file
@@ -0,0 +1,151 @@
|
||||
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
||||
---
|
||||
version: "1.0"
|
||||
|
||||
nodes:
|
||||
- name: MLAGDomain
|
||||
namespace: Network
|
||||
label: "MLAG Domain"
|
||||
icon: "mdi:link-variant"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["domain_id__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.domain_id__value, record.status__value])) }}"
|
||||
order_by:
|
||||
- domain_id__value
|
||||
attributes:
|
||||
- name: domain_id
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "MLAG domain identifier (e.g., MLAG-leaf1-2)"
|
||||
|
||||
- name: local_interface
|
||||
kind: Text
|
||||
optional: false
|
||||
default_value: "Vlan4094"
|
||||
description: "Local interface for MLAG peer link"
|
||||
|
||||
- name: peer_interface
|
||||
kind: Text
|
||||
optional: false
|
||||
default_value: "Vlan4094"
|
||||
description: "Peer interface for MLAG peer link"
|
||||
|
||||
- name: peer_address
|
||||
kind: IPHost
|
||||
optional: false
|
||||
description: "Peer IP address for MLAG link"
|
||||
|
||||
- name: status
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "active"
|
||||
choices:
|
||||
- name: active
|
||||
label: Active
|
||||
- name: inactive
|
||||
label: Inactive
|
||||
description: "MLAG domain status"
|
||||
|
||||
relationships:
|
||||
- name: devices
|
||||
peer: NetworkDevice
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Devices in this MLAG domain"
|
||||
|
||||
- name: interfaces
|
||||
peer: NetworkMLAGInterface
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Component
|
||||
description: "MLAG-enabled interfaces"
|
||||
|
||||
- name: MLAGInterface
|
||||
namespace: Network
|
||||
label: "MLAG Interface"
|
||||
icon: "mdi:ethernet-plus"
|
||||
include_in_menu: false
|
||||
human_friendly_id: ["interface__device__hostname__value", "interface__name__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.interface__device__hostname__value, record.interface__name__value])) }}"
|
||||
attributes:
|
||||
- name: mlag_id
|
||||
kind: Number
|
||||
optional: false
|
||||
description: "MLAG interface ID"
|
||||
|
||||
relationships:
|
||||
- name: mlag_domain
|
||||
peer: NetworkMLAGDomain
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
|
||||
- name: interface
|
||||
peer: NetworkInterface
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Physical interface"
|
||||
|
||||
- name: EVPNConfig
|
||||
namespace: Network
|
||||
label: "EVPN Configuration"
|
||||
icon: "mdi:wan"
|
||||
include_in_menu: false
|
||||
human_friendly_id: ["device__hostname__value"]
|
||||
display_label: "{{ record.device__hostname__value }}"
|
||||
attributes:
|
||||
- name: vni_auto
|
||||
kind: Boolean
|
||||
optional: false
|
||||
default_value: true
|
||||
description: "Automatically generate VNIs"
|
||||
|
||||
relationships:
|
||||
- name: device
|
||||
peer: NetworkDevice
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
|
||||
- name: VXLANTunnel
|
||||
namespace: Network
|
||||
label: "VXLAN Tunnel"
|
||||
icon: "mdi:tunnel"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["name__value"]
|
||||
display_label: "{{ record.name__value }}"
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
default_value: "Vxlan1"
|
||||
description: "VXLAN tunnel interface name"
|
||||
|
||||
- name: source_ip
|
||||
kind: IPHost
|
||||
optional: false
|
||||
description: "Source IP for VXLAN tunnel (Loopback1)"
|
||||
|
||||
- name: udp_port
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 4789
|
||||
description: "VXLAN UDP port"
|
||||
|
||||
relationships:
|
||||
- name: device
|
||||
peer: NetworkDevice
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
|
||||
- name: vlans
|
||||
peer: NetworkVLAN
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "VLANs mapped to this VXLAN tunnel"
|
||||
239
infrahub/schema/09_routing_policies.yml
Normal file
239
infrahub/schema/09_routing_policies.yml
Normal file
@@ -0,0 +1,239 @@
|
||||
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
||||
---
|
||||
version: "1.0"
|
||||
|
||||
nodes:
|
||||
- name: RouteMap
|
||||
namespace: Network
|
||||
label: "Route Map"
|
||||
icon: "mdi:map-marker-path"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["name__value"]
|
||||
display_label: "{{ record.name__value }}"
|
||||
order_by:
|
||||
- name__value
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "Route map name (e.g., LOOPBACK)"
|
||||
|
||||
- name: sequence
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 10
|
||||
description: "Sequence number"
|
||||
|
||||
- name: action
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "permit"
|
||||
choices:
|
||||
- name: permit
|
||||
label: Permit
|
||||
- name: deny
|
||||
label: Deny
|
||||
description: "Action (permit/deny)"
|
||||
|
||||
relationships:
|
||||
- name: devices
|
||||
peer: NetworkDevice
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Devices using this route map"
|
||||
|
||||
- name: prefix_lists
|
||||
peer: NetworkPrefixList
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Prefix lists matched by this route map"
|
||||
|
||||
- name: PrefixList
|
||||
namespace: Network
|
||||
label: "Prefix List"
|
||||
icon: "mdi:format-list-numbered"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["name__value"]
|
||||
display_label: "{{ record.name__value }}"
|
||||
order_by:
|
||||
- name__value
|
||||
attributes:
|
||||
- name: name
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "Prefix list name (e.g., LOOPBACK)"
|
||||
|
||||
- name: sequence
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 10
|
||||
description: "Sequence number"
|
||||
|
||||
- name: action
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "permit"
|
||||
choices:
|
||||
- name: permit
|
||||
label: Permit
|
||||
- name: deny
|
||||
label: Deny
|
||||
description: "Action (permit/deny)"
|
||||
|
||||
- name: prefix
|
||||
kind: IPNetwork
|
||||
optional: false
|
||||
description: "IP prefix to match"
|
||||
|
||||
- name: match_type
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "exact"
|
||||
choices:
|
||||
- name: exact
|
||||
label: Exact Match
|
||||
- name: ge
|
||||
label: Greater or Equal
|
||||
- name: le
|
||||
label: Less or Equal
|
||||
description: "Match type"
|
||||
|
||||
- name: greater_equal
|
||||
kind: Number
|
||||
optional: true
|
||||
description: "Greater or equal prefix length"
|
||||
|
||||
- name: less_equal
|
||||
kind: Number
|
||||
optional: true
|
||||
description: "Less or equal prefix length"
|
||||
|
||||
relationships:
|
||||
- name: devices
|
||||
peer: NetworkDevice
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Devices using this prefix list"
|
||||
|
||||
- name: OSPFConfig
|
||||
namespace: Network
|
||||
label: "OSPF Configuration"
|
||||
icon: "mdi:router"
|
||||
include_in_menu: false
|
||||
human_friendly_id: ["device__hostname__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.device__hostname__value, record.process_id__value])) }}"
|
||||
attributes:
|
||||
- name: process_id
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 100
|
||||
description: "OSPF process ID"
|
||||
|
||||
- name: router_id
|
||||
kind: IPHost
|
||||
optional: false
|
||||
description: "OSPF router ID"
|
||||
|
||||
- name: max_paths
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 3
|
||||
description: "Maximum paths for ECMP"
|
||||
|
||||
relationships:
|
||||
- name: device
|
||||
peer: NetworkDevice
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
|
||||
- name: areas
|
||||
peer: NetworkOSPFArea
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Component
|
||||
description: "OSPF areas"
|
||||
|
||||
- name: OSPFArea
|
||||
namespace: Network
|
||||
label: "OSPF Area"
|
||||
icon: "mdi:circle-outline"
|
||||
include_in_menu: false
|
||||
human_friendly_id: ["ospf_config__device__hostname__value", "area_id__value"]
|
||||
display_label: "{{ record.area_id__value }}"
|
||||
attributes:
|
||||
- name: area_id
|
||||
kind: Text
|
||||
optional: false
|
||||
default_value: "0.0.0.0"
|
||||
description: "OSPF area ID (e.g., 0.0.0.0)"
|
||||
|
||||
- name: area_type
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "standard"
|
||||
choices:
|
||||
- name: standard
|
||||
label: Standard
|
||||
- name: stub
|
||||
label: Stub
|
||||
- name: nssa
|
||||
label: NSSA
|
||||
description: "Area type"
|
||||
|
||||
relationships:
|
||||
- name: ospf_config
|
||||
peer: NetworkOSPFConfig
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
|
||||
- name: interfaces
|
||||
peer: NetworkOSPFInterface
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Component
|
||||
description: "Interfaces in this area"
|
||||
|
||||
- name: OSPFInterface
|
||||
namespace: Network
|
||||
label: "OSPF Interface"
|
||||
icon: "mdi:ethernet"
|
||||
include_in_menu: false
|
||||
human_friendly_id: ["interface__device__hostname__value", "interface__name__value"]
|
||||
display_label: "{{ record.interface__name__value }}"
|
||||
attributes:
|
||||
- name: network_type
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "point-to-point"
|
||||
choices:
|
||||
- name: point-to-point
|
||||
label: Point-to-Point
|
||||
- name: broadcast
|
||||
label: Broadcast
|
||||
description: "OSPF network type"
|
||||
|
||||
- name: cost
|
||||
kind: Number
|
||||
optional: true
|
||||
description: "OSPF cost"
|
||||
|
||||
relationships:
|
||||
- name: area
|
||||
peer: NetworkOSPFArea
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
|
||||
- name: interface
|
||||
peer: NetworkInterface
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Physical interface"
|
||||
219
infrahub/schema/10_dci.yml
Normal file
219
infrahub/schema/10_dci.yml
Normal file
@@ -0,0 +1,219 @@
|
||||
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
||||
---
|
||||
version: "1.0"
|
||||
|
||||
nodes:
|
||||
- name: DCISwitch
|
||||
namespace: Network
|
||||
label: "DCI Interconnect Switch"
|
||||
icon: "mdi:transit-connection-variant"
|
||||
include_in_menu: true
|
||||
human_friendly_id: ["hostname__value"]
|
||||
display_label: "{{ record.hostname__value }}"
|
||||
order_by:
|
||||
- hostname__value
|
||||
description: "DCI switch connects multiple datacenters - NOT auto-generated, manually configured"
|
||||
attributes:
|
||||
- name: hostname
|
||||
kind: Text
|
||||
unique: true
|
||||
optional: false
|
||||
description: "DCI switch hostname (e.g., DCI)"
|
||||
|
||||
- name: description
|
||||
kind: Text
|
||||
optional: true
|
||||
default_value: "DCI Interconnect Switch"
|
||||
description: "DCI switch description"
|
||||
|
||||
- name: platform
|
||||
kind: Text
|
||||
optional: false
|
||||
default_value: "cEOS"
|
||||
description: "Device platform"
|
||||
|
||||
- name: eos_version
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "EOS software version"
|
||||
|
||||
- name: serial_number
|
||||
kind: Text
|
||||
optional: true
|
||||
unique: true
|
||||
description: "Device serial number"
|
||||
|
||||
- name: management_ip
|
||||
kind: IPHost
|
||||
optional: true
|
||||
description: "Management IP address (e.g., 10.255.0.253)"
|
||||
|
||||
- name: loopback0_ip
|
||||
kind: IPHost
|
||||
optional: false
|
||||
description: "Loopback0 IP for BGP router-id (e.g., 10.253.0.1/32)"
|
||||
|
||||
- name: status
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "active"
|
||||
choices:
|
||||
- name: active
|
||||
label: Active
|
||||
color: "#7fbf7f"
|
||||
- name: planned
|
||||
label: Planned
|
||||
color: "#ffd966"
|
||||
- name: maintenance
|
||||
label: Maintenance
|
||||
color: "#ff9999"
|
||||
- name: decommissioned
|
||||
label: Decommissioned
|
||||
color: "#cccccc"
|
||||
|
||||
relationships:
|
||||
- name: organization
|
||||
peer: CoreOrganization
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Parent organization"
|
||||
|
||||
- name: connected_datacenters
|
||||
peer: InfraDatacenter
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Datacenters interconnected by this DCI switch"
|
||||
|
||||
- name: interfaces
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Component
|
||||
description: "DCI switch interfaces"
|
||||
|
||||
- name: bgp_config
|
||||
peer: NetworkBGPConfig
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Component
|
||||
description: "BGP configuration for DCI"
|
||||
|
||||
- name: dci_connections
|
||||
peer: NetworkDCIConnection
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Component
|
||||
description: "DCI connections to border leafs"
|
||||
|
||||
- name: DCIConnection
|
||||
namespace: Network
|
||||
label: "DCI Connection"
|
||||
icon: "mdi:cable-data"
|
||||
include_in_menu: true
|
||||
menu_placement: "NetworkDCISwitch"
|
||||
human_friendly_id: ["dci_switch__hostname__value", "border_leaf__hostname__value"]
|
||||
display_label: "{{ ' - '.join(filter(None, [record.dci_switch__hostname__value, record.border_leaf__hostname__value, record.status__value])) }}"
|
||||
order_by:
|
||||
- dci_switch__hostname__value
|
||||
description: "Represents a P2P connection between DCI switch and a border leaf"
|
||||
attributes:
|
||||
- name: connection_name
|
||||
kind: Text
|
||||
optional: true
|
||||
description: "Connection identifier (e.g., DCI-to-borderleaf1-DC1)"
|
||||
|
||||
- name: status
|
||||
kind: Dropdown
|
||||
optional: false
|
||||
default_value: "shutdown"
|
||||
choices:
|
||||
- name: active
|
||||
label: Active
|
||||
description: "Connection is enabled and operational"
|
||||
color: "#7fbf7f"
|
||||
- name: shutdown
|
||||
label: Shutdown
|
||||
description: "Connection administratively disabled"
|
||||
color: "#cccccc"
|
||||
- name: maintenance
|
||||
label: Maintenance
|
||||
description: "Connection under maintenance"
|
||||
color: "#ff9999"
|
||||
description: "Connection operational status (shutdown until dci_enabled=true)"
|
||||
|
||||
- name: dci_interface_name
|
||||
kind: Text
|
||||
optional: false
|
||||
description: "DCI switch interface (e.g., Ethernet1)"
|
||||
|
||||
- name: border_interface_name
|
||||
kind: Text
|
||||
optional: false
|
||||
default_value: "Ethernet12"
|
||||
description: "Border leaf interface (always Ethernet12)"
|
||||
|
||||
- name: dci_ip
|
||||
kind: IPHost
|
||||
optional: false
|
||||
description: "DCI side IP address (e.g., 10.254.0.1/31)"
|
||||
|
||||
- name: border_ip
|
||||
kind: IPHost
|
||||
optional: false
|
||||
description: "Border leaf side IP address (e.g., 10.254.0.0/31)"
|
||||
|
||||
- name: subnet
|
||||
kind: IPNetwork
|
||||
optional: false
|
||||
description: "P2P subnet (e.g., 10.254.0.0/31)"
|
||||
|
||||
- name: mtu
|
||||
kind: Number
|
||||
optional: false
|
||||
default_value: 9214
|
||||
description: "Interface MTU"
|
||||
|
||||
relationships:
|
||||
- name: dci_switch
|
||||
peer: NetworkDCISwitch
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Parent
|
||||
description: "Parent DCI switch"
|
||||
|
||||
- name: border_leaf
|
||||
peer: NetworkDevice
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Connected border leaf device"
|
||||
|
||||
- name: datacenter
|
||||
peer: InfraDatacenter
|
||||
optional: false
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Datacenter of the border leaf"
|
||||
|
||||
- name: dci_interface
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "DCI switch interface object"
|
||||
|
||||
- name: border_interface
|
||||
peer: NetworkInterface
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "Border leaf interface object (eth12)"
|
||||
|
||||
- name: bgp_session
|
||||
peer: NetworkBGPNeighbor
|
||||
optional: true
|
||||
cardinality: one
|
||||
kind: Attribute
|
||||
description: "BGP session for this connection"
|
||||
Reference in New Issue
Block a user