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:
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"
|
||||
Reference in New Issue
Block a user