Refactor Infrahub config and rename schema folder
Move schema files into a dedicated 'schemas' directory and update .infrahub.yml to reference them along with adding sections for schemas, generators, and queries.
This commit is contained in:
148
infrahub/schemas/06_vlan_vrfs.yml
Normal file
148
infrahub/schemas/06_vlan_vrfs.yml
Normal file
@@ -0,0 +1,148 @@
|
||||
# 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: "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
|
||||
identifier: vlan__interfaces
|
||||
optional: true
|
||||
cardinality: many
|
||||
kind: Generic
|
||||
description: "Interfaces with this VLAN"
|
||||
|
||||
- name: svi
|
||||
peer: NetworkInterface
|
||||
identifier: vlan__svi
|
||||
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: "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"
|
||||
Reference in New Issue
Block a user