diff --git a/.metadata.yml b/.metadata.yml index 8b6cae72..1f289a51 100644 --- a/.metadata.yml +++ b/.metadata.yml @@ -41,7 +41,7 @@ experimental/infiniband: experimental/optical_transport: dependencies: - base - - extensions/modules + - extensions/device_module - extensions/cable description: > Comprehensive optical transport network schemas for DWDM/WDM systems (ADVA FSP 3000 and similar @@ -54,14 +54,17 @@ experimental/optical_transport: experimental/location_extended: dependencies: - base - description: - This schema extension is the most detailed when it comes to location, - you'll find all the layers you can think of. + exclusive_with: + - extensions/rack + description: >- + This schema extension is the most detailed when it comes to location, you'll find all the + layers you can think of. It defines its own hierarchical Location.Rack, incompatible with + the flat one extensions/rack defines, so load one or the other, not both. name: Location Extended experimental/modules_linecards: dependencies: - base - - extensions/modules + - extensions/device_module description: This schema extension allows you to capture Linecard related information like the version. You can insert the Linecard into a Dcim Physical Device and @@ -71,7 +74,7 @@ experimental/modules_linecards: experimental/modules_routing_engine: dependencies: - base - - extensions/modules + - extensions/device_module description: This schema extension allows you to capture Routing Engine related information like the version. You can insert the Routing Engine into a Dcim Physical @@ -87,17 +90,10 @@ experimental/security: - base description: This schema extension contains models for implementing detailed security. name: Security -experimental/tenancy: - dependencies: - - base - - extensions/circuit - description: - This schema extension introduces tenancy for some of the schema nodes - (circuits...) - name: Tenancy experimental/topology: dependencies: - base + - extensions/vlan description: A schema for defining and managing network topology, strategies, and services. @@ -109,6 +105,14 @@ experimental/vlan-translation: This schema extension is based on Juniper VLAN MAP, and not yet test out for other vendors. name: VLAN Translation +extensions/aggregate: + dependencies: + - base + description: + This schema extension contains models to capture IP aggregates assigned by + a Regional Internet Registry (RIR). It introduces an Aggregate node (top-level IPv4/IPv6 + prefix) and an RIR node (registry or private entity managing address space). + name: Aggregate extensions/cable: dependencies: - base @@ -119,7 +123,6 @@ extensions/cable: extensions/circuit: dependencies: - base - - extensions/location_minimal description: This schema extension contains Circuits and ways to connect them with your infrastructure! The circuit could be a fiber connecting two sites, you would @@ -163,12 +166,13 @@ extensions/dwdm: channel number but via the wavelength and/or the frequency. This model provides a unique entry in Infrahub for those. name: DWDM -extensions/firewall_policer: +experimental/firewall_policer: dependencies: - base description: - This schema extension contains models for VMs. You might consider Cluster - or/and Hypervisor extension to go with! + This schema extension contains models for traffic policers and the classes + and rules that reference them, so you can describe rate limiting alongside + the interfaces it is applied to. name: Firewall Policer extensions/hosting_cluster: dependencies: @@ -199,10 +203,27 @@ extensions/lag: extensions/location_minimal: dependencies: - base - description: - This schema extension is minimal but will provide you with basic items - to store location related data. + exclusive_with: + - extensions/location_site + description: >- + This schema extension is minimal but will provide you with basic items to store location + related data, as a Region -> Country -> Site hierarchy. It defines the same Location.Site + node as extensions/location_site, so load one or the other, not both. Note that + LocationGeneric.name is unique across every location kind, so a name used at one tier + cannot be reused at another; a single-country deployment therefore enters the hierarchy at + Country (with Region as the national node) rather than duplicating a country under several + regions. name: Location Minimal +extensions/location_site: + dependencies: + - base + exclusive_with: + - extensions/location_minimal + description: >- + This schema extension introduces a standalone Location.Site node (with facility, + physical address, timezone, and status). It defines the same Site node as + extensions/location_minimal, so load one or the other, not both. + name: Location Site extensions/mlag: dependencies: - base @@ -219,28 +240,36 @@ extensions/mlag: - Add support for layer 3 overlay for MLAG interfaces (loopback, peer address ...) - Create virtual relationship so MLAG interfaces can be seen on the devices in the domain name: MLAG -extensions/modules: +extensions/device_module: dependencies: - base description: | - This schema extension allows you to capture Device Modules related information like the serial number or the status. You can insert the Module into a Dcim Physical Device. + This schema extension lets you capture module bays on a Dcim Physical Device and the modules installed into them (e.g. fan trays, line cards). A device can have any number of module bays, and each bay can optionally hold one module. - NOTE: This extension doesn't contain any Nodes, you can use the extension module_linecards or modules_routing_engine to use it - name: Modules + NOTE: This extension ships a standard Module/ModuleType node pair ready to use, alongside the generic Module/ModuleType you can build your own flavors on top of (see the device_psu_module, modules_linecards, or modules_routing_engine extensions). + name: Device Modules +extensions/device_psu_module: + dependencies: + - base + - extensions/device_module + description: | + This schema extension adds a PSU (Power Supply Unit) flavor on top of the generic Module/ModuleType from extensions/device_module, so you can track power supplies installed in a device's module bays alongside PSU-specific attributes like wattage and hot-swap capability. + name: Device PSU Module extensions/patch_panel: dependencies: - base + - extensions/device_module description: | - This schema extension allows you to capture patch panel related information like rear/front interfaces and mapping between them. You can insert the patch panel into a rack and leverage the device type model. Finally you can also capture information about potential modules you would insert into your patch panel. + This schema extension allows you to capture patch panel related information like rear/front interfaces and mapping between them. You can insert the patch panel into a rack and leverage the device type model. Cassettes and other inserts are tracked as regular device modules in module bays, through extensions/device_module. NOTE: This extension is compatible with all sort of connectors, meaning you can plug cable, circuits, cross-connect to front & rear interfaces! name: Patch Panel extensions/peering_ixp: dependencies: - base - - extensions/routing - extensions/routing_bgp - extensions/routing_bgp_community + - extensions/routing_policies_bgp description: This schema extension contains all you need to model anything revolving around internet peering (Exchange points ...)! @@ -253,18 +282,33 @@ extensions/physical_disk: NOTE: This extension is compatible with all sort of device. You can apply the generic "DeviceWithPhysicalDisks" to particular model to enable disks tracking. You might also link that schema to location for instance to capture spares. name: Physical Disk +extensions/rack: + dependencies: + - base + - extensions/location_site + exclusive_with: + - experimental/location_extended + description: >- + This schema extension introduces a Rack model representing a physical equipment + rack installed at a site. Racks can be placed at a LocationSite and can host devices + and other equipment. LocationRack needs a Location.Site: extensions/location_site is + declared above as the smallest provider, but extensions/location_minimal provides the + same node as part of its hierarchy and satisfies the rack equally, load whichever + suits, never both. LocationRack is also defined, hierarchically and incompatibly, by + experimental/location_extended, so load one or the other, not both. + name: Rack extensions/qinq: dependencies: - base - extensions/vlan description: - This schema extension brings extensions to VLAN model in order to support - QinQ. + This schema extension adds the Service VLAN and Customer VLAN nodes needed + to model QinQ on top of the VLAN extension. name: QinQ extensions/routing: dependencies: - base - - extensions/vlan + - extensions/vrf description: This schema extension contains generics to create Routing Protocol "Instance". The idea is to create one Routing Protocol instance per IpamVRF + @@ -287,13 +331,12 @@ extensions/routing_bgp: extensions/routing_bgp_community: dependencies: - base - - extensions/routing + - extensions/routing_policies description: This schema extension adds the BGP Communities models. name: Routing BGP Community extensions/routing_bgp_rr: dependencies: - base - - extensions/routing - extensions/routing_bgp description: This schema extension extend the BGP extension to add BGP Route Reflector @@ -323,9 +366,7 @@ extensions/routing_policies: extensions/routing_policies_aggregate: dependencies: - base - - extensions/routing - extensions/routing_policies - - extensions/routing_aggregate description: This extension is using the Routing Policies extensions and the Routing Aggregate one together. @@ -333,7 +374,6 @@ extensions/routing_policies_aggregate: extensions/routing_policies_bgp: dependencies: - base - - extensions/routing - extensions/routing_policies - extensions/routing_bgp description: @@ -343,7 +383,6 @@ extensions/routing_policies_bgp: extensions/routing_policies_ospf: dependencies: - base - - extensions/routing - extensions/routing_policies - extensions/routing_ospf description: @@ -353,7 +392,6 @@ extensions/routing_policies_ospf: extensions/routing_policies_pim: dependencies: - base - - extensions/routing - extensions/routing_policies - extensions/routing_pim description: @@ -380,21 +418,18 @@ extensions/snmp: - base description: This schema extension contains models for SNMP Communities and SNMP - Clients. As you can see this extension is not linked to Tenancy or Device, as - you could decide to link the Community to different models based on your use case. + Clients. A community links to the devices it is configured on; any further + wiring, to a tenant for instance, is left to you. name: SNMP -extensions/topology: +extensions/tenancy: dependencies: - base description: - This schema extension introduces abstract network pods and services - running in the pods, such as MPLS and EVPN. - name: Topology -extensions/users: - dependencies: - - base - description: This schema extension contains models for account management. - name: Users + This schema extension introduces a Tenant node that can own devices, IP + prefixes/addresses, and hosting locations. See the comment at the bottom of + `tenancy.yml` for an example of how to extend tenancy onto optional extension + nodes such as `DcimCircuit`. + name: Tenancy extensions/vlan: dependencies: - base diff --git a/base/dcim.yml b/base/dcim.yml index a35d6a97..74edd0b9 100644 --- a/base/dcim.yml +++ b/base/dcim.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: @@ -18,64 +23,70 @@ generics: - name: name kind: Text unique: true + optional: false order_weight: 1000 - name: description kind: Text optional: true - order_weight: 2000 - - name: os_version - kind: Text - optional: true - order_weight: 2200 + order_weight: 1100 relationships: - name: interfaces peer: DcimInterface - optional: true + kind: Component cardinality: many + optional: true identifier: device__interface - kind: Component + order_weight: 1650 - name: tags peer: BuiltinTag - optional: true - cardinality: many kind: Attribute + cardinality: many + optional: true order_weight: 2000 - name: primary_address peer: IpamIPAddress label: Primary IP Address - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: device__primary_address order_weight: 1700 - name: platform peer: DcimPlatform - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: device__platform order_weight: 1250 - - name: PhysicalDevice namespace: Dcim description: Generic holding attributes and relationships relevant for physical device. include_in_menu: false attributes: + # Duplicated from DcimGenericDevice because generics cannot inherit generics. + # DcimModuleBay.computed_name (extensions/device_module) renders + # {{ device__name__value }} against peer DcimPhysicalDevice, so name must resolve here. + # allow_override lets DcimPatchPanel and DcimOpticalMultiplexer restate it. + - name: name + kind: Text + unique: true + allow_override: any + optional: false + order_weight: 1000 - name: position - label: Position (U) - description: Lowest unit. kind: Number + label: Position (U) optional: true - order_weight: 1500 - - name: serial + description: Lowest unit. + order_weight: 1550 + - name: serial_number kind: Text optional: true - order_weight: 1500 + order_weight: 1400 - name: rack_face - label: Rack Face - description: On which face of the rack the device is mounted. kind: Dropdown - optional: false + label: Rack Face default_value: front - order_weight: 1515 choices: - name: front label: Front @@ -83,21 +94,24 @@ generics: - name: rear label: Rear description: Device mounted on the rear face of the rack. + optional: false + description: On which face of the rack the device is mounted. + order_weight: 1600 relationships: - name: device_type peer: DcimDeviceType - optional: true - cardinality: one kind: Attribute - order_weight: 1200 + cardinality: one + optional: true + order_weight: 1150 - name: location - label: Location peer: LocationHosting - optional: false - cardinality: one + label: Location kind: Attribute + cardinality: one + optional: false + identifier: physical_device__location order_weight: 1500 - - name: Endpoint namespace: Dcim description: Generic Endpoint to receive a connector. @@ -105,11 +119,13 @@ generics: relationships: - name: connector peer: DcimConnector - optional: true - cardinality: one - order_weight: 1500 kind: Attribute - + cardinality: one + optional: true + identifier: connector__endpoint + order_weight: 1600 + # connected_endpoints is kind Attribute so both ends render inline on the connector form. + # A high-fan-out connector kind should override the relationship back to Generic. - name: Connector namespace: Dcim description: Generic Connector to link two endpoints together. @@ -117,29 +133,32 @@ generics: relationships: - name: connected_endpoints peer: DcimEndpoint - optional: true + kind: Attribute cardinality: many - order_weight: 1500 - kind: Generic + optional: true + identifier: connector__endpoint - # Interfaces + order_weight: 1500 - name: Interface namespace: Dcim - description: "Generic Network Interface" + description: Generic Network Interface label: Interface - include_in_menu: false - display_label: name__value + icon: mdi:ethernet + include_in_menu: true + menu_placement: DcimDevice + human_friendly_id: + - device__name__value + - name__value order_by: - device__name__value - name__value + display_label: name__value uniqueness_constraints: - [device, name__value] - human_friendly_id: - - device__name__value - - name__value attributes: - name: name kind: Text + optional: false description: "Name of the interface" order_weight: 1000 - name: description @@ -147,104 +166,93 @@ generics: optional: true description: "A brief description of the interface" order_weight: 1100 - - name: mtu - label: MTU - kind: Number - default_value: 1514 - order_weight: 1300 - name: status kind: Dropdown - description: "The status of the interface" + default_value: "active" choices: - name: provisioning label: Provisioning description: "Interface is being provisioned." - color: "#A9DFBF" # light pastel green + color: "#f0ad4e" - name: free label: Free description: "Interface is unused." - color: "#CDEACC" # slightly darker pastel green + color: "#c8e6c9" - name: active label: Active description: "Interface is active and operational." - color: "#A9CCE3" # pastel blue + color: "#00d25b" - name: maintenance label: Maintenance description: "Interface is under maintenance." - color: "#FFF2CC" # pastel yellow + color: "#ff9800" - name: disabled label: Disabled description: "Interface has been disabled." - color: "#D3D3D3" # light grey - - name: deleted - label: Deleted - description: "Interface has been deleted." - color: "#FAD7A0" # pastel orange - - name: outage - label: Outage - description: "Interface is currently experiencing an outage." - color: "#F4CCCC" # pastel red - default_value: "active" + color: "#6c757d" + optional: false + description: "The status of the interface" order_weight: 1200 - name: role kind: Dropdown - optional: true - description: "The role of the interface in the network" choices: - - name: lag - label: Lag - description: "Interface LAG." - color: "#A9DFBF" # light pastel green - name: core label: Core Interface description: "Central part of the network." - color: "#A9CCE3" # pastel blue - - name: cust + color: "#A9CCE3" + - name: customer label: Customer Interface description: "Interface dedicated to customer connections." - color: "#D2B4DE" # pastel purple + color: "#D2B4DE" - name: access label: Access Interfaces description: "Interface connecting endpoint devices." - color: "#B4E0DC" # pastel teal + color: "#B4E0DC" - name: management label: Management Interface description: "Interface dedicated to device management." - color: "#E3DAC9" # pastel cream + color: "#E3DAC9" - name: peering label: Peering Interface description: "Interface dedicated to peering with other networks." - color: "#C4B7E6" # pastel purple + color: "#C4B7E6" - name: upstream label: Upstream Interface description: "Interface dedicated to upstream traffic between networks." - color: "#B2D4E6" # pastel sky blue - order_weight: 1250 + color: "#B2D4E6" + optional: true + description: "The role of the interface in the network" + order_weight: 1300 + - name: mtu + kind: Number + label: MTU + default_value: 1500 + optional: true + description: "Maximum transmission unit, in bytes (IP payload, not frame size)." + order_weight: 1350 relationships: - name: device peer: DcimGenericDevice - identifier: device__interface - optional: false - cardinality: one kind: Parent - order_weight: 1025 - - name: tags - peer: BuiltinTag - optional: true - cardinality: many - kind: Attribute - order_weight: 3000 + cardinality: one + optional: false + identifier: device__interface + order_weight: 900 - name: Layer2 namespace: Interface - include_in_menu: false description: "Layer 2 specific attributes for network interfaces" label: "Layer 2 Interface" + include_in_menu: false attributes: + - name: mac_address + kind: MacAddress + label: MAC Address + optional: true + order_weight: 1400 - name: l2_mode - label: Layer2 Mode kind: Dropdown - optional: true + label: Layer2 Mode choices: - name: access label: Access @@ -255,33 +263,23 @@ generics: - name: trunk_all label: Trunk (All) description: "Trunk all mode" + optional: true description: "Layer 2 mode of the interface" - order_weight: 1500 + order_weight: 1450 - name: Layer3 namespace: Interface - include_in_menu: false description: "Layer 3 specific attributes for network interfaces" label: "Layer 3 Interface" - attributes: - - name: dot1q_id - label: VLAN ID (dot1q) - kind: Number - description: "Dot1Q VLAN ID" - order_weight: 1600 - optional: true - - name: mac_address - label: Mac Address - kind: Text - optional: true - order_weight: 1550 + include_in_menu: false relationships: - name: ip_addresses - label: IP Addresses peer: IpamIPAddress - cardinality: many + label: IP Addresses kind: Attribute + cardinality: many optional: true + identifier: ip_address__interface description: "List of IP addresses associated with the interface" order_weight: 1150 @@ -291,169 +289,147 @@ generics: include_in_menu: false relationships: - name: sub_interfaces - label: "Sub-interface(s)" peer: InterfaceVirtual - identifier: "sub__interface" - optional: true - cardinality: many + label: "Sub-interface(s)" kind: Attribute + cardinality: many + optional: true + identifier: "sub__interface" description: "Sub-interfaces of this interface" order_weight: 1750 nodes: - # -------------------- Device (Types, Platforms, Device, Interfaces ) -------------------- - name: DeviceType namespace: Dcim description: A model of device label: Device Type icon: mdi:poll + include_in_menu: true + menu_placement: DcimDevice human_friendly_id: - name__value - display_label: name__value order_by: - manufacturer__name__value - name__value - uniqueness_constraints: - - [manufacturer, name__value] + display_label: name__value attributes: - name: name kind: Text unique: true + optional: false order_weight: 1000 - name: description kind: Text optional: true order_weight: 1100 - name: part_number + kind: Text label: Part Number optional: true - kind: Text order_weight: 1200 - name: height + kind: Number label: Height (U) - optional: false default_value: 1 - kind: Number + optional: false order_weight: 1400 - name: full_depth + kind: Boolean label: Full Depth default_value: true - kind: Boolean + optional: false order_weight: 1500 - name: weight + kind: Number label: Weight (kg) optional: true - kind: Number order_weight: 1600 relationships: - - name: platform - peer: DcimPlatform - cardinality: one - kind: Attribute - order_weight: 1300 - name: manufacturer peer: OrganizationManufacturer - cardinality: one kind: Attribute - order_weight: 1250 + cardinality: one optional: false - - name: tags - peer: BuiltinTag - optional: true - cardinality: many - kind: Attribute - order_weight: 2000 - + identifier: manufacturer__device_type + order_weight: 1250 - name: Platform namespace: Dcim description: A Platform represent the type of software running on a device. label: Platform icon: mdi:application-cog-outline + include_in_menu: true + menu_placement: DcimDevice human_friendly_id: - name__value - display_label: name__value order_by: - manufacturer__name__value - name__value - uniqueness_constraints: - - [name__value] + display_label: name__value attributes: - name: name kind: Text unique: true + optional: false order_weight: 1000 - name: description kind: Text optional: true - order_weight: 1200 - - name: nornir_platform - kind: Text - optional: true - order_weight: 1500 - - name: napalm_driver - kind: Text - optional: true - order_weight: 1600 - - name: netmiko_device_type - kind: Text - optional: true - order_weight: 1700 - - name: ansible_network_os - kind: Text - optional: true - order_weight: 1800 - - name: containerlab_os - kind: Text - optional: true - order_weight: 1900 + order_weight: 1100 relationships: - name: devices peer: DcimGenericDevice - optional: true + kind: Generic cardinality: many + optional: true + identifier: device__platform order_weight: 1350 - name: manufacturer peer: OrganizationManufacturer - cardinality: one kind: Attribute + cardinality: one + identifier: manufacturer__platform + optional: true order_weight: 1300 - - name: Device + namespace: Dcim + description: A configurable network device including routers, switches... label: Network Device - description: A configurable network device for managing and directing data traffic, including routers, switches... icon: clarity:network-switch-solid - # generate_template: true - namespace: Dcim + include_in_menu: true inherit_from: - CoreArtifactTarget - DcimGenericDevice - DcimPhysicalDevice + generate_template: true attributes: - name: status kind: Dropdown - optional: false - order_weight: 1100 + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: "#7fbf7f" + color: "#00d25b" + - name: reserved + label: Reserved + description: Reserved for future use, not yet active. + color: "#4d90fe" - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: "#ffff7f" + color: "#f0ad4e" - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: "#ffd27f" - - name: drained - label: Drained - description: Temporarily taken out of service. - color: "#bfbfbf" + color: "#ff9800" + - name: deprecated + label: Deprecated + description: No longer in use and scheduled for removal. + color: "#e04040" + optional: false + order_weight: 1200 - name: role kind: Dropdown - optional: true - order_weight: 1400 choices: - name: core label: Core Router @@ -479,33 +455,37 @@ nodes: label: Tor Switch description: Tor switch part of a Fabric. color: "#e8e7fd" - + optional: true + order_weight: 1300 - name: Physical namespace: Interface - label: Physical Interface description: "Physical network port on a device" + label: Physical Interface + include_in_menu: false inherit_from: - DcimInterface - InterfaceLayer2 - InterfaceLayer3 - DcimEndpoint - InterfaceHasSubInterface - include_in_menu: false - name: Virtual namespace: Interface - label: Virtual Interface description: "Virtual interface like VLAN or Loopback" + label: Virtual Interface + include_in_menu: false inherit_from: - DcimInterface - InterfaceLayer2 - InterfaceLayer3 - # - InterfaceHasSubInterface # Depending if you want your virtual interfaces to have sub interface - include_in_menu: false + # Uncomment if your virtual interfaces should be able to carry sub-interfaces. + # - InterfaceHasSubInterface relationships: - name: parent_interface peer: InterfaceHasSubInterface - cardinality: one kind: Attribute + cardinality: one identifier: "sub__interface" + optional: true description: "Parent interface to which this sub-interface belongs" + order_weight: 1600 diff --git a/base/ipam.yml b/base/ipam.yml index 0b3ef6ec..bdd6cbf8 100644 --- a/base/ipam.yml +++ b/base/ipam.yml @@ -1,114 +1,175 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" -nodes: - # -------------------- IPAM (Prefix, IP Address) -------------------- - - name: IPAddress +generics: + # Placeholder generics defined here so that inheritance can be declared in the base schema. + # Extensions cannot add inheritance to existing nodes, so these stubs let extensions override + # them without requiring users to modify their schema manually. + - name: VLANGroupScope namespace: Ipam - description: IP Address - label: IP Address - icon: mdi:ip + label: VLAN Group Scope + description: >- + Mixin for objects that can scope a VLAN group (e.g. Region, Site). The reverse + relationship is added by extensions/vlan. + include_in_menu: false + + - name: PrefixScope + namespace: Ipam + label: Prefix Scope + description: Mixin for objects that can scope IP prefixes (e.g. Region, Site). include_in_menu: false - order_by: - - address__value - display_label: address__value - inherit_from: - - BuiltinIPAddress - uniqueness_constraints: - - [address__value, ip_namespace] - human_friendly_id: - - address__value - - ip_namespace__name__value - attributes: - - name: fqdn - label: FQDN - kind: Text - optional: true - # https://stackoverflow.com/questions/11809631/fully-qualified-domain-name-validation - regex: (?=^.{1,253}$)(^(((?!-)[a-zA-Z0-9-]{1,63}(? Country -> Site hierarchy. It defines the same Location.Site node as extensions/location_site, so load one or the other, not both. Note that LocationGeneric.name is unique across every location kind, so a name used at one tier cannot be reused at another; a single-country deployment therefore enters the hierarchy at Country (with Region as the national node) rather than duplicating a country under several regions. | +| **[Location Site](./reference/location_site.mdx)** | This schema extension introduces a standalone Location.Site node (with facility, physical address, timezone, and status). It defines the same Site node as extensions/location_minimal, so load one or the other, not both. | | **[MLAG](./reference/mlag.mdx)** | This schema extension contains the foundations to capture Multi-Chassis Link Aggregation Group (MLAG). It comes on top of the LAG extension. In this implementation, a MLAG interface is essentially a LAG interface but linked to a MLAG domain (instead of a device). The MLAG domain regroup devices together (usually 2) and is built over LAG interfaces used as peer-link between the devices. MLAG interfaces defined at the MLAG domain level are then spread across all devices in the domain. Note: This is a very minimalist implementation of MLAG, the goal is to make it easy to blend with existing models you might have. For example, if you are operating in a data center fabric environment you might already have a LeafGroup or similar concept. In that case you can have your LeafGroup inherit from GenericMlagDomain and add the necessary relationships/attributes. Next steps: - Add support for layer 3 overlay for MLAG interfaces (loopback, peer address ...) - Create virtual relationship so MLAG interfaces can be seen on the devices in the domain | -| **[Modules](./reference/modules.mdx)** | This schema extension allows you to capture Device Modules related information like the serial number or the status. You can insert the Module into a Dcim Physical Device. NOTE: This extension doesn't contain any Nodes, you can use the extension module_linecards or modules_routing_engine to use it | -| **[Patch Panel](./reference/patch_panel.mdx)** | This schema extension allows you to capture patch panel related information like rear/front interfaces and mapping between them. You can insert the patch panel into a rack and leverage the device type model. Finally you can also capture information about potential modules you would insert into your patch panel. NOTE: This extension is compatible with all sort of connectors, meaning you can plug cable, circuits, cross-connect to front & rear interfaces! | +| **[Patch Panel](./reference/patch_panel.mdx)** | This schema extension allows you to capture patch panel related information like rear/front interfaces and mapping between them. You can insert the patch panel into a rack and leverage the device type model. Cassettes and other inserts are tracked as regular device modules in module bays, through extensions/device_module. NOTE: This extension is compatible with all sort of connectors, meaning you can plug cable, circuits, cross-connect to front & rear interfaces! | | **[Peering IXP](./reference/peering_ixp.mdx)** | This schema extension contains all you need to model anything revolving around internet peering (Exchange points ...)! | | **[Physical Disk](./reference/physical_disk.mdx)** | Simple schema allowing you to capture physical disks information for the sake of inventory and lifecycle management. NOTE: This extension is compatible with all sort of device. You can apply the generic "DeviceWithPhysicalDisks" to particular model to enable disks tracking. You might also link that schema to location for instance to capture spares. | -| **[QinQ](./reference/qinq.mdx)** | This schema extension brings extensions to VLAN model in order to support QinQ. | +| **[QinQ](./reference/qinq.mdx)** | This schema extension adds the Service VLAN and Customer VLAN nodes needed to model QinQ on top of the VLAN extension. | +| **[Rack](./reference/rack.mdx)** | This schema extension introduces a Rack model representing a physical equipment rack installed at a site. Racks can be placed at a LocationSite and can host devices and other equipment. LocationRack needs a Location.Site: extensions/location_site is declared above as the smallest provider, but extensions/location_minimal provides the same node as part of its hierarchy and satisfies the rack equally, load whichever suits, never both. LocationRack is also defined, hierarchically and incompatibly, by experimental/location_extended, so load one or the other, not both. | | **[Routing](./reference/routing.mdx)** | This schema extension contains generics to create Routing Protocol "Instance". The idea is to create one Routing Protocol instance per IpamVRF + DcimDevice pair. | | **[Routing Aggregate](./reference/routing_aggregate.mdx)** | This schema extension contains all you need to model the Aggregate Routing Protocol. | | **[Routing BGP](./reference/routing_bgp.mdx)** | This schema extension contains all you need to model your BGP platform. | @@ -139,9 +143,8 @@ This list provides an overview of the schemas available in this repository. Each | **[Routing Policies BGP](./reference/routing_policies_bgp.mdx)** | This extension is using the Routing Policies extensions and the Routing BGP one together. | | **[Routing Policies OSPF](./reference/routing_policies_ospf.mdx)** | This extension is using the Routing Policies extensions and the Routing OSPF one together. | | **[SFP](./reference/sfp.mdx)** | This schema extension gives you all the models you need to document Small Form-factor Pluggable (SFP). You can either plug it into an interface or attach it to a location (e.g. it's a spare SFP stored in a rack). Improvements: - As of now there is no verification with type / form factor / protocol / distance ... - You could plug any SFP into any equipment interface (e.g. a virtual interface ...) - You could link a SFP to an interface AND a location ... | -| **[SNMP](./reference/snmp.mdx)** | This schema extension contains models for SNMP Communities and SNMP Clients. As you can see this extension is not linked to Tenancy or Device, as you could decide to link the Community to different models based on your use case. | -| **[Topology](./reference/topology.mdx)** | This schema extension introduces abstract network pods and services running in the pods, such as MPLS and EVPN. | -| **[Users](./reference/users.mdx)** | This schema extension contains models for account management. | +| **[SNMP](./reference/snmp.mdx)** | This schema extension contains models for SNMP Communities and SNMP Clients. A community links to the devices it is configured on; any further wiring, to a tenant for instance, is left to you. | +| **[Tenancy](./reference/tenancy.mdx)** | This schema extension introduces a Tenant node that can own devices, IP prefixes/addresses, and hosting locations. See the comment at the bottom of `tenancy.yml` for an example of how to extend tenancy onto optional extension nodes such as `DcimCircuit`. | | **[VLAN](./reference/vlan.mdx)** | This schema extension contains models to support VLANs in you network. | | **[VRF](./reference/vrf.mdx)** | This schema extension contains models to support VRF in your network. | | **[VRRP](./reference/vrrp.mdx)** | This schema extension contains models for VRRP. | diff --git a/docs/docs/reference/aggregate.mdx b/docs/docs/reference/aggregate.mdx new file mode 100644 index 00000000..5b9ce714 --- /dev/null +++ b/docs/docs/reference/aggregate.mdx @@ -0,0 +1,126 @@ +--- +title: Aggregate +--- + +This schema extension contains models to capture IP aggregates assigned by a Regional Internet Registry (RIR). It introduces an Aggregate node (top-level IPv4/IPv6 prefix) and an RIR node (registry or private entity managing address space). + +## Details + +- **Dependencies:** + - [base](dcim) + +## Nodes + +### Aggregate + +- **Label:** Aggregate +- **Description:** An aggregate is a top-level IPv4 or IPv6 prefix assigned by a RIR. +- **Namespace:** Ipam +- **Icon:** mdi:ip-network +- **Uniqueness Constraints:** + - prefix__value +- **Human Friendly ID:** prefix__value +- **Inherit From:** BuiltinIPPrefix + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| description | | Text | True | | | +| date_added | | DateTime | True | | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| rir | OrganizationRIR | False | one | Attribute | + +### RIR + +- **Label:** RIR +- **Description:** A Regional Internet Registry (ARIN, RIPE, APNIC, LACNIC, AFRINIC) or a private entity managing private address space. +- **Namespace:** Organization +- **Icon:** mdi:certificate +- **Inherit From:** OrganizationGeneric + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| private | Indicates this RIR manages private (RFC 1918 / RFC 4193) address space. | Boolean | False | False | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| aggregates | IpamAggregate | True | many | Generic | + +## Code + +```yaml +version: '1.0' +nodes: +- name: Aggregate + namespace: Ipam + description: An aggregate is a top-level IPv4 or IPv6 prefix assigned by a RIR. + label: Aggregate + icon: mdi:ip-network + include_in_menu: true + menu_placement: BuiltinIPAM + inherit_from: + - BuiltinIPPrefix + human_friendly_id: + - prefix__value + order_by: + - prefix__value + display_label: prefix__value + uniqueness_constraints: + - - prefix__value + attributes: + - name: description + kind: Text + optional: true + order_weight: 1100 + - name: date_added + kind: DateTime + label: Date Added + optional: true + order_weight: 1200 + relationships: + - name: rir + peer: OrganizationRIR + label: RIR + kind: Attribute + cardinality: one + optional: false + identifier: aggregate__rir + order_weight: 1000 +- name: RIR + namespace: Organization + description: A Regional Internet Registry (ARIN, RIPE, APNIC, LACNIC, AFRINIC) or + a private entity managing private address space. + label: RIR + icon: mdi:certificate + include_in_menu: true + menu_placement: OrganizationGeneric + inherit_from: + - OrganizationGeneric + attributes: + - name: private + kind: Boolean + label: Private + default_value: false + optional: false + description: Indicates this RIR manages private (RFC 1918 / RFC 4193) address + space. + order_weight: 1300 + relationships: + - name: aggregates + peer: IpamAggregate + kind: Generic + cardinality: many + optional: true + identifier: aggregate__rir + order_weight: 1400 + +``` \ No newline at end of file diff --git a/docs/docs/reference/cable.mdx b/docs/docs/reference/cable.mdx index b3cdc514..fc414626 100644 --- a/docs/docs/reference/cable.mdx +++ b/docs/docs/reference/cable.mdx @@ -17,15 +17,16 @@ This schema extension contains a basic Cable model allowing you to connect two e - **Description:** Physical cable connecting two endpoints - **Namespace:** Dcim - **Icon:** mdi:cable-data +- **Human Friendly ID:** label__value - **Inherit From:** DcimConnector #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| status | | Dropdown | True | | connected, planned | -| cable_type | | Dropdown | True | | cat3, cat5, cat5e, cat6, cat6a, cat7, cat7a, cat8, mmf-om1, mmf-om2, mmf-om3, mmf-om4, mmf-om5, smf-os1, smf-os2, dac-passive, dac-active, aoc, coaxial, mrj21-trunk, power, usb | -| color | | Dropdown | True | | dark-red, red, pink, rose, fuchsia, purple, dark-purple, indigo, blue, light-blue, cyan, teal, aqua, dark-green, green, light-green, lime, yellow, amber, orange, dark-orange, brown, light-grey, grey, dark-grey, black | +| status | | Dropdown | False | connected | connected, planned | +| cable_type | | Dropdown | True | | cat3, cat5, cat5e, cat6, cat6a, cat7, cat7a, cat8, mmf_om1, mmf_om2, mmf_om3, mmf_om4, mmf_om5, smf_os1, smf_os2, dac_passive, dac_active, aoc, coaxial, mrj21_trunk, power, usb | +| color | | Dropdown | True | | dark_red, red, pink, rose, fuchsia, purple, dark_purple, indigo, blue, light_blue, cyan, teal, aqua, dark_green, green, light_green, lime, yellow, amber, orange, dark_orange, brown, light_grey, grey, dark_grey, black | | label | | Text | True | | | | length | | Number | True | | | @@ -39,26 +40,32 @@ nodes: description: Physical cable connecting two endpoints label: Cable icon: mdi:cable-data + include_in_menu: true + menu_placement: DcimDevice inherit_from: - DcimConnector + human_friendly_id: + - label__value + order_by: + - label__value + display_label: label__value attributes: - name: status kind: Dropdown - optional: true - order_weight: 1000 + default_value: connected choices: - name: connected label: Connected - description: Fully operational and currently in connected - color: '#7fbf7f' + description: Fully operational and currently connected + color: '#00d25b' - name: planned label: Planned description: In the process of being set up - color: '#ffff7f' + color: '#2196f3' + optional: false + order_weight: 1200 - name: cable_type kind: Dropdown - optional: true - order_weight: 1100 choices: - name: cat3 label: CAT3 @@ -92,39 +99,39 @@ nodes: label: CAT8 description: Category 8 twisted pair cable. color: '#99ccff' - - name: mmf-om1 + - name: mmf_om1 label: Multimode Fiber OM1 description: "Multimode fiber (62.5/125 \xB5m)." color: '#ff9933' - - name: mmf-om2 + - name: mmf_om2 label: Multimode Fiber OM2 description: "Multimode fiber (50/125 \xB5m)." color: '#ff9933' - - name: mmf-om3 + - name: mmf_om3 label: Multimode Fiber OM3 description: "Optimized multimode fiber (50/125 \xB5m)." color: '#ff9933' - - name: mmf-om4 + - name: mmf_om4 label: Multimode Fiber OM4 description: "Enhanced multimode fiber (50/125 \xB5m)." color: '#ff9933' - - name: mmf-om5 + - name: mmf_om5 label: Multimode Fiber OM5 description: "Wideband multimode fiber (50/125 \xB5m)." color: '#ff9933' - - name: smf-os1 + - name: smf_os1 label: Singlemode Fiber OS1 description: Standard singlemode fiber. color: '#ffcc00' - - name: smf-os2 + - name: smf_os2 label: Singlemode Fiber OS2 description: Improved singlemode fiber. color: '#ffcc00' - - name: dac-passive + - name: dac_passive label: Passive DAC description: Direct Attach Copper (Passive). color: '#a0a0a0' - - name: dac-active + - name: dac_active label: Active DAC description: Direct Attach Copper (Active). color: '#a0a0a0' @@ -136,7 +143,7 @@ nodes: label: Coaxial description: Coaxial cable for broadband. color: '#000000' - - name: mrj21-trunk + - name: mrj21_trunk label: MRJ21 Trunk description: High-density copper cable. color: '#000000' @@ -148,12 +155,12 @@ nodes: label: USB description: Universal Serial Bus cable. color: '#000000' + optional: true + order_weight: 1100 - name: color kind: Dropdown - optional: true - order_weight: 1300 choices: - - name: dark-red + - name: dark_red label: Dark Red color: '#aa1409' - name: red @@ -171,7 +178,7 @@ nodes: - name: purple label: Purple color: '#9c27b0' - - name: dark-purple + - name: dark_purple label: Dark Purple color: '#673ab7' - name: indigo @@ -180,7 +187,7 @@ nodes: - name: blue label: Blue color: '#2196f3' - - name: light-blue + - name: light_blue label: Light Blue color: '#03a9f4' - name: cyan @@ -192,13 +199,13 @@ nodes: - name: aqua label: Aqua color: '#00ffff' - - name: dark-green + - name: dark_green label: Dark Green color: '#2f6a31' - name: green label: Green color: '#4caf50' - - name: light-green + - name: light_green label: Light Green color: '#8bc34a' - name: lime @@ -213,31 +220,34 @@ nodes: - name: orange label: Orange color: '#ff9800' - - name: dark-orange + - name: dark_orange label: Dark Orange color: '#ff5722' - name: brown label: Brown color: '#795548' - - name: light-grey + - name: light_grey label: Light Grey color: '#c0c0c0' - name: grey label: Grey color: '#9e9e9e' - - name: dark-grey + - name: dark_grey label: Dark Grey color: '#607d8b' - name: black label: Black color: '#111111' + optional: true + order_weight: 1300 - name: label kind: Text + unique: true optional: true - order_weight: 1200 + order_weight: 1000 - name: length - label: Length (in cm) kind: Number + label: Length (in cm) optional: true order_weight: 1350 diff --git a/docs/docs/reference/circuit.mdx b/docs/docs/reference/circuit.mdx index e5aa7911..50014182 100644 --- a/docs/docs/reference/circuit.mdx +++ b/docs/docs/reference/circuit.mdx @@ -8,7 +8,6 @@ This schema extension contains Circuits and ways to connect them with your infra - **Dependencies:** - [base](dcim) - - [extensions/location_minimal](location_minimal) ## Nodes @@ -24,27 +23,27 @@ This schema extension contains Circuits and ways to connect them with your infra | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| circuit_id | | Text | | | | +| circuit_id | | Text | False | | | | description | | Text | True | | | -| circuit_type | Specifies the type of circuit. | Dropdown | | | upstream, peering, dark_fiber, mpls | -| status | | Dropdown | | | active, provisioning, maintenance, drained | +| commit_rate | | Number | True | | | +| circuit_type | Specifies the type of circuit. | Dropdown | True | | internet_access, point_to_point, peering, dark_fiber, mpls | +| status | | Dropdown | False | active | active, provisioning, maintenance, drained | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | | provider | OrganizationProvider | False | one | Attribute | -| location | LocationHosting | True | one | Attribute | -| enpoints | DcimCircuitEndpoint | True | many | Component | +| endpoints | DcimCircuitEndpoint | True | many | Component | ### CircuitEndpoint - **Label:** Circuit Endpoint -- **Description:** A circuit endpoint, could be a position in a MMR... +- **Description:** One of the two terminations (A or Z) of a circuit, at the location where the provider hands the circuit off. - **Namespace:** Dcim - **Icon:** mdi:ethernet - **Uniqueness Constraints:** - - circuit, name__value + - circuit, side__value - **Human Friendly ID:** circuit__circuit_id__value, name__value - **Inherit From:** DcimEndpoint @@ -52,8 +51,9 @@ This schema extension contains Circuits and ways to connect them with your infra | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | Name of the circuit endoint, could be a MMR position for instance. | Text | | | | -| status | | Dropdown | True | | active, provisioning, maintenance, drained | +| side | | Dropdown | False | | a, z | +| name | | Text | False | | | +| status | | Dropdown | False | active | active, provisioning, maintenance, drained | | description | | Text | True | | | #### Relationships @@ -77,7 +77,7 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| circuits | DcimCircuit | True | many | | +| circuits | DcimCircuit | True | many | Generic | ### LocationHosting @@ -85,7 +85,7 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| circuits | DcimCircuit | True | many | | +| circuit_endpoints | DcimCircuitEndpoint | True | many | Generic | ## Code @@ -97,6 +97,7 @@ nodes: description: A Circuit represent service operated by a provider. label: Circuit icon: mdi:cable-data + include_in_menu: true human_friendly_id: - circuit_id__value order_by: @@ -106,125 +107,161 @@ nodes: - name: circuit_id kind: Text unique: true + optional: false + order_weight: 1000 - name: description kind: Text optional: true + order_weight: 1100 + - name: commit_rate + kind: Number + label: Commit Rate (Kbps) + optional: true + order_weight: 1400 - name: circuit_type kind: Dropdown - description: Specifies the type of circuit. choices: - - name: upstream - label: Upstream - description: Connection to an upstream provider or Internet service provider - (ISP) + - name: internet_access + label: Internet Access + description: Broadband or dedicated internet access circuit. color: '#1e90ff' + - name: point_to_point + label: Point to Point + description: Dedicated layer 2 or layer 3 link between two sites. + color: '#a0c878' - name: peering label: Peering - description: Connection to another network for exchange of traffic + description: Connection to another network for exchange of traffic. color: '#20b2aa' - name: dark_fiber label: Dark Fiber - description: Leased, unlit fiber for customer management and operation - color: '#333333' + description: Leased, unlit fiber managed and operated by the customer. + color: '#555555' - name: mpls label: MPLS - description: Multi-Protocol Label Switching circuit for QoS-based routing + description: Multi-Protocol Label Switching circuit for QoS-based routing. color: '#7f00ff' + optional: true + description: Specifies the type of circuit. + order_weight: 1300 - name: status kind: Dropdown + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: '#7fbf7f' + color: '#00d25b' - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: '#ffff7f' + color: '#f0ad4e' - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: '#ffd27f' + color: '#ff9800' - name: drained label: Drained description: Temporarily taken out of service. - color: '#bfbfbf' + color: '#9e9e9e' + optional: false + order_weight: 1200 relationships: - name: provider peer: OrganizationProvider - optional: false - cardinality: one kind: Attribute - - name: location - label: Location - peer: LocationHosting - optional: true cardinality: one - kind: Attribute + optional: false + identifier: circuit__provider order_weight: 1500 - - name: enpoints + - name: endpoints peer: DcimCircuitEndpoint - optional: true - cardinality: many kind: Component + cardinality: many + optional: true + identifier: circuit__endpoint + order_weight: 1600 - name: CircuitEndpoint namespace: Dcim - description: A circuit endpoint, could be a position in a MMR... + description: One of the two terminations (A or Z) of a circuit, at the location + where the provider hands the circuit off. label: Circuit Endpoint - inherit_from: - - DcimEndpoint icon: mdi:ethernet + include_in_menu: true menu_placement: DcimCircuit + inherit_from: + - DcimEndpoint human_friendly_id: - circuit__circuit_id__value - name__value - uniqueness_constraints: - - - circuit - - name__value order_by: - name__value display_label: name__value + uniqueness_constraints: + - - circuit + - side__value attributes: + - name: side + kind: Dropdown + label: Side + choices: + - name: a + label: A + description: A-side of the circuit. + - name: z + label: Z + description: Z-side of the circuit. + optional: false + order_weight: 950 - name: name kind: Text - description: Name of the circuit endoint, could be a MMR position for instance. + read_only: true + computed_attribute: + kind: Jinja2 + jinja2_template: '{{ circuit__circuit_id__value }}_{{ side__value | upper }}' + optional: false order_weight: 1000 - name: status kind: Dropdown - optional: true + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: '#7fbf7f' + color: '#00d25b' - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: '#ffff7f' + color: '#f0ad4e' - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: '#ffd27f' + color: '#ff9800' - name: drained label: Drained description: Temporarily taken out of service. - color: '#bfbfbf' + color: '#9e9e9e' + optional: false + order_weight: 1200 - name: description kind: Text optional: true + order_weight: 1100 relationships: - name: circuit peer: DcimCircuit - order_weight: 900 - optional: false - cardinality: one kind: Parent + cardinality: one + optional: false + identifier: circuit__endpoint + order_weight: 900 - name: location - label: Location peer: LocationHosting - optional: false - cardinality: one + label: Location kind: Attribute + cardinality: one + optional: false + identifier: circuit_endpoint__location order_weight: 1500 extensions: nodes: @@ -232,13 +269,19 @@ extensions: relationships: - name: circuits peer: DcimCircuit + kind: Generic cardinality: many optional: true + identifier: circuit__provider + order_weight: 1300 - kind: LocationHosting relationships: - - name: circuits - peer: DcimCircuit + - name: circuit_endpoints + peer: DcimCircuitEndpoint + kind: Generic cardinality: many optional: true + identifier: circuit_endpoint__location + order_weight: 1700 ``` \ No newline at end of file diff --git a/docs/docs/reference/circuit_contract.mdx b/docs/docs/reference/circuit_contract.mdx index 5b9becc6..aa9c421a 100644 --- a/docs/docs/reference/circuit_contract.mdx +++ b/docs/docs/reference/circuit_contract.mdx @@ -18,7 +18,6 @@ This schema extension provides models for managing Circuit Contracts, enabling s - **Description:** A contract document associated with a circuit service, including terms, costs, and validity period. - **Namespace:** Dcim - **Icon:** mdi:file-sign -- **Display Label:** Contract (Circuit `{{ circuit__circuit_id__value }}`) - **Human Friendly ID:** name__value - **Inherit From:** CoreFileObject @@ -52,7 +51,7 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| contract | DcimCircuitContract | True | one | | +| contract | DcimCircuitContract | True | one | Generic | ## Code @@ -61,13 +60,14 @@ version: '1.0' nodes: - name: CircuitContract namespace: Dcim - inherit_from: - - CoreFileObject description: A contract document associated with a circuit service, including terms, costs, and validity period. label: Circuit Contract icon: mdi:file-sign + include_in_menu: true menu_placement: DcimCircuit + inherit_from: + - CoreFileObject human_friendly_id: - name__value order_by: @@ -76,23 +76,26 @@ nodes: attributes: - name: name kind: Text + read_only: true computed_attribute: kind: Jinja2 jinja2_template: contract_{{ circuit__circuit_id__value }} - read_only: true optional: false + order_weight: 1000 - name: contract_start kind: DateTime optional: false + order_weight: 1200 - name: contract_end kind: DateTime optional: false + order_weight: 1300 - name: monthly_cost kind: Number optional: true + order_weight: 1400 - name: currency kind: Dropdown - optional: true choices: - name: usd label: USD @@ -103,12 +106,15 @@ nodes: - name: gbp label: GBP description: British Pound Sterling + optional: true + order_weight: 1450 relationships: - name: circuit peer: DcimCircuit kind: Attribute cardinality: one optional: false + identifier: circuit__contract order_weight: 950 extensions: nodes: @@ -116,7 +122,10 @@ extensions: relationships: - name: contract peer: DcimCircuitContract + kind: Generic cardinality: one optional: true + identifier: circuit__contract + order_weight: 1550 ``` \ No newline at end of file diff --git a/docs/docs/reference/circuit_service.mdx b/docs/docs/reference/circuit_service.mdx index b2b0aaeb..fe04d595 100644 --- a/docs/docs/reference/circuit_service.mdx +++ b/docs/docs/reference/circuit_service.mdx @@ -36,7 +36,7 @@ For example you have a MPLS network supported by a provider connecting multiple | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | | provider | OrganizationProvider | False | one | Attribute | -| circuit_endpoints | CircuitEndpoint | True | many | Component | +| circuit_endpoints | DcimCircuitEndpoint | True | many | Component | ## Extensions @@ -54,7 +54,7 @@ In this context "extensions" refer to modifications or additions to the existing | ---- | ---- | -------- | ----------- | ---- | | circuit_services | CircuitService | True | many | | -### CircuitEndpoint +### DcimCircuitEndpoint #### Relationships @@ -96,7 +96,7 @@ nodes: cardinality: one kind: Attribute - name: circuit_endpoints - peer: CircuitEndpoint + peer: DcimCircuitEndpoint optional: true cardinality: many kind: Component @@ -108,7 +108,7 @@ extensions: peer: CircuitService cardinality: many optional: true - - kind: CircuitEndpoint + - kind: DcimCircuitEndpoint relationships: - name: circuit_service peer: CircuitService diff --git a/docs/docs/reference/cluster.mdx b/docs/docs/reference/cluster.mdx index 864af9e3..047eb08d 100644 --- a/docs/docs/reference/cluster.mdx +++ b/docs/docs/reference/cluster.mdx @@ -14,7 +14,6 @@ This schema extension contains the foundations to capture clusters. With this on ### Generic -- **Label:** Clusters - **Description:** A cluster of machines hosting services or other machines. - **Namespace:** Cluster - **Icon:** mdi:dots-hexagon @@ -24,14 +23,14 @@ This schema extension contains the foundations to capture clusters. With this on | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | Name of the cluster. | Text | | | | +| name | Name of the cluster. | Text | False | | | | description | | Text | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| location | LocationGeneric | False | many | Attribute | +| locations | LocationGeneric | False | many | Attribute | | tags | BuiltinTag | True | many | Attribute | ### GenericComputeUnitNodes @@ -43,7 +42,7 @@ This schema extension contains the foundations to capture clusters. With this on | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| nodes | ComputeGenericUnit | | many | Component | +| nodes | ComputeGenericUnit | True | many | Component | ## Extensions @@ -59,7 +58,7 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| worker_in_cluster | ClusterGenericComputeUnitNodes | True | one | | +| worker_in_cluster | ClusterGenericComputeUnitNodes | True | one | Generic | ### LocationGeneric @@ -77,8 +76,8 @@ generics: - name: Generic namespace: Cluster description: A cluster of machines hosting services or other machines. - label: Clusters icon: mdi:dots-hexagon + include_in_menu: false human_friendly_id: - name__value order_by: @@ -87,25 +86,27 @@ generics: attributes: - name: name kind: Text - description: Name of the cluster. unique: true + optional: false + description: Name of the cluster. order_weight: 1000 - name: description kind: Text optional: true + order_weight: 1100 relationships: - - name: location - label: Location + - name: locations peer: LocationGeneric - optional: false - cardinality: many + label: Locations kind: Attribute + cardinality: many + optional: false order_weight: 1400 - name: tags peer: BuiltinTag - optional: true - cardinality: many kind: Attribute + cardinality: many + optional: true order_weight: 2000 - name: GenericComputeUnitNodes namespace: Cluster @@ -114,30 +115,35 @@ generics: include_in_menu: false relationships: - name: nodes - label: Nodes - identifier: worker_in_cluster - cardinality: many peer: ComputeGenericUnit + label: Nodes kind: Component + cardinality: many + identifier: worker_in_cluster + optional: true + order_weight: 1500 extensions: nodes: - kind: ComputeGenericUnit relationships: - name: worker_in_cluster - identifier: worker_in_cluster - label: Worker in cluster peer: ClusterGenericComputeUnitNodes + kind: Generic + label: Worker in cluster cardinality: one - description: This device is a worker node of the specified cluster. optional: true + identifier: worker_in_cluster + description: This device is a worker node of the specified cluster. + order_weight: 1900 - kind: LocationGeneric relationships: - name: clusters - label: Clusters peer: ClusterGeneric - cardinality: many + label: Clusters kind: Component - description: All clusters available on that location. + cardinality: many optional: true + description: All clusters available on that location. + order_weight: 1650 ``` \ No newline at end of file diff --git a/docs/docs/reference/compute.mdx b/docs/docs/reference/compute.mdx index ee856bc7..50a770b7 100644 --- a/docs/docs/reference/compute.mdx +++ b/docs/docs/reference/compute.mdx @@ -23,7 +23,7 @@ With this schema extension in place you will be able to capture all your physica | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| status | | Dropdown | False | | active, provisioning, maintenance, drained | +| status | | Dropdown | False | active | active, provisioning, maintenance, drained | ### VirtualMachine @@ -52,6 +52,7 @@ With this schema extension in place you will be able to capture all your physica ### GenericUnit +- **Label:** Compute - **Description:** A generic unit that can compute (e.g. server, vm ...). - **Namespace:** Compute @@ -74,23 +75,28 @@ generics: - name: GenericUnit namespace: Compute description: A generic unit that can compute (e.g. server, vm ...). - include_in_menu: false + label: Compute + include_in_menu: true - name: HostVirtualMachine namespace: Virtualization description: A generic unit that can host VM include_in_menu: false relationships: - name: virtual_machines - cardinality: many peer: VirtualizationVirtualMachine kind: Component + cardinality: many optional: true + identifier: host__virtual_machine + order_weight: 1450 nodes: - name: PhysicalServer namespace: Compute description: A physical server with fixed resources and specific hardware characteristics. label: Physical Server icon: mdi:server + include_in_menu: true + menu_placement: ComputeGenericUnit inherit_from: - ComputeGenericUnit - DcimGenericDevice @@ -99,65 +105,71 @@ nodes: attributes: - name: status kind: Dropdown - optional: false - order_weight: 1100 + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: '#7fbf7f' + color: '#00d25b' - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: '#ffff7f' + color: '#f0ad4e' - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: '#ffd27f' + color: '#ff9800' - name: drained label: Drained description: Temporarily taken out of service. - color: '#bfbfbf' + color: '#9e9e9e' + optional: false + order_weight: 1200 - name: VirtualMachine namespace: Virtualization description: A virtual machine hosted on a server or a cluster. label: Virtual Machine icon: carbon:virtual-machine + menu_placement: ComputeGenericUnit + include_in_menu: true inherit_from: - ComputeGenericUnit - DcimGenericDevice attributes: - name: role kind: Dropdown - optional: true - description: Role of the virtual machine. - order_weight: 1400 choices: - name: application + label: Application color: '#7f7fff' - name: storage + label: Storage color: '#bf7fbf' + optional: true + description: Role of the virtual machine. + order_weight: 1300 - name: vcpu kind: Number optional: true - order_weight: 1900 description: Number of CPU cores assigned to the VM. + order_weight: 1400 - name: memory kind: Number optional: true - order_weight: 1900 description: Amount of memory (in GB) assigned to the VM. + order_weight: 1450 - name: disk kind: Number optional: true - order_weight: 1900 description: Disk space (in GB) assigned to the VM. + order_weight: 1500 relationships: - name: host peer: VirtualizationHostVirtualMachine - optional: false - cardinality: one kind: Attribute - order_weight: 1500 + cardinality: one + optional: false + identifier: host__virtual_machine + order_weight: 1350 ``` \ No newline at end of file diff --git a/docs/docs/reference/cross_connect.mdx b/docs/docs/reference/cross_connect.mdx index 5ae365af..3ef6e933 100644 --- a/docs/docs/reference/cross_connect.mdx +++ b/docs/docs/reference/cross_connect.mdx @@ -26,9 +26,9 @@ This extension contains schema to capture Cross Connect. You can see it as "a ca | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| identifier | | Text | | | | +| identifier | | Text | False | | | | description | | Text | True | | | -| status | | Dropdown | True | | connected, planned, reserved | +| status | | Dropdown | False | planned | connected, planned, reserved | #### Relationships @@ -47,55 +47,58 @@ nodes: description: Cross-connect between different endpoints within a datacenter. label: Cross-Connect icon: streamline:arrow-crossover-right-solid + include_in_menu: true inherit_from: - DcimConnector - order_by: - - provider__name__value - display_label: '{{ identifier__value }} (Provider: {{ provider__name__value }})' human_friendly_id: - provider__name__value - identifier__value + order_by: + - provider__name__value + display_label: '{{ identifier__value }} (Provider: {{ provider__name__value }})' uniqueness_constraints: - - identifier__value - provider attributes: - name: identifier kind: Text - order_weight: 900 + optional: false + order_weight: 1000 - name: description kind: Text optional: true - order_weight: 1300 + order_weight: 1100 - name: status kind: Dropdown - optional: true - order_weight: 1200 + default_value: planned choices: - name: connected label: Connected - description: Fully operational and currently in connected - color: '#7fbf7f' + description: Fully operational and currently connected + color: '#00d25b' - name: planned label: Planned description: In the process of being set up - color: '#ffff7f' + color: '#2196f3' - name: reserved label: Reserved description: Fully connected and reserved for a future use - color: '#9090de' + color: '#4d90fe' + optional: false + order_weight: 1200 relationships: - name: location - label: Location peer: LocationHosting - optional: false - cardinality: one + label: Location kind: Attribute - order_weight: 1100 + cardinality: one + optional: false + order_weight: 1400 - name: provider peer: OrganizationProvider - optional: false - cardinality: one kind: Attribute - order_weight: 1000 + cardinality: one + optional: false + order_weight: 1300 ``` \ No newline at end of file diff --git a/docs/docs/reference/dcim.mdx b/docs/docs/reference/dcim.mdx index 9d6691bf..49d628a4 100644 --- a/docs/docs/reference/dcim.mdx +++ b/docs/docs/reference/dcim.mdx @@ -16,28 +16,24 @@ Basic DCIM schema to capture devices, racks, interfaces, and related information - **Description:** A model of device - **Namespace:** Dcim - **Icon:** mdi:poll -- **Uniqueness Constraints:** - - manufacturer, name__value - **Human Friendly ID:** name__value #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | description | | Text | True | | | | part_number | | Text | True | | | | height | | Number | False | 1 | | -| full_depth | | Boolean | | True | | +| full_depth | | Boolean | False | True | | | weight | | Number | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| platform | DcimPlatform | | one | Attribute | | manufacturer | OrganizationManufacturer | False | one | Attribute | -| tags | BuiltinTag | True | many | Attribute | ### Platform @@ -45,33 +41,26 @@ Basic DCIM schema to capture devices, racks, interfaces, and related information - **Description:** A Platform represent the type of software running on a device. - **Namespace:** Dcim - **Icon:** mdi:application-cog-outline -- **Uniqueness Constraints:** - - name__value - **Human Friendly ID:** name__value #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | description | | Text | True | | | -| nornir_platform | | Text | True | | | -| napalm_driver | | Text | True | | | -| netmiko_device_type | | Text | True | | | -| ansible_network_os | | Text | True | | | -| containerlab_os | | Text | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| devices | DcimGenericDevice | True | many | | -| manufacturer | OrganizationManufacturer | | one | Attribute | +| devices | DcimGenericDevice | True | many | Generic | +| manufacturer | OrganizationManufacturer | True | one | Attribute | ### Device - **Label:** Network Device -- **Description:** A configurable network device for managing and directing data traffic, including routers, switches... +- **Description:** A configurable network device including routers, switches... - **Namespace:** Dcim - **Icon:** clarity:network-switch-solid - **Inherit From:** CoreArtifactTarget, DcimGenericDevice, DcimPhysicalDevice @@ -80,7 +69,7 @@ Basic DCIM schema to capture devices, racks, interfaces, and related information | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| status | | Dropdown | False | | active, provisioning, maintenance, drained | +| status | | Dropdown | False | active | active, reserved, provisioning, maintenance, deprecated | | role | | Dropdown | True | | core, edge, cpe, spine, leaf, tor | ### Physical @@ -101,7 +90,7 @@ Basic DCIM schema to capture devices, racks, interfaces, and related information | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| parent_interface | InterfaceHasSubInterface | | one | Attribute | +| parent_interface | InterfaceHasSubInterface | True | one | Attribute | ## Generics @@ -117,9 +106,8 @@ Basic DCIM schema to capture devices, racks, interfaces, and related information | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | description | | Text | True | | | -| os_version | | Text | True | | | #### Relationships @@ -139,8 +127,9 @@ Basic DCIM schema to capture devices, racks, interfaces, and related information | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | +| name | | Text | False | | | | position | Lowest unit. | Number | True | | | -| serial | | Text | True | | | +| serial_number | | Text | True | | | | rack_face | On which face of the rack the device is mounted. | Dropdown | False | front | front, rear | #### Relationships @@ -170,13 +159,14 @@ Basic DCIM schema to capture devices, racks, interfaces, and related information | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| connected_endpoints | DcimEndpoint | True | many | Generic | +| connected_endpoints | DcimEndpoint | True | many | Attribute | ### Interface - **Label:** Interface - **Description:** Generic Network Interface - **Namespace:** Dcim +- **Icon:** mdi:ethernet - **Uniqueness Constraints:** - device, name__value - **Human Friendly ID:** device__name__value, name__value @@ -185,18 +175,17 @@ Basic DCIM schema to capture devices, racks, interfaces, and related information | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | Name of the interface | Text | | | | +| name | Name of the interface | Text | False | | | | description | A brief description of the interface | Text | True | | | -| mtu | | Number | | 1514 | | -| status | The status of the interface | Dropdown | | active | provisioning, free, active, maintenance, disabled, deleted, outage | -| role | The role of the interface in the network | Dropdown | True | | lag, core, cust, access, management, peering, upstream | +| status | The status of the interface | Dropdown | False | active | provisioning, free, active, maintenance, disabled | +| role | The role of the interface in the network | Dropdown | True | | core, customer, access, management, peering, upstream | +| mtu | Maximum transmission unit, in bytes (IP payload, not frame size). | Number | True | 1500 | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | | device | DcimGenericDevice | False | one | Parent | -| tags | BuiltinTag | True | many | Attribute | ### Layer2 @@ -208,6 +197,7 @@ Basic DCIM schema to capture devices, racks, interfaces, and related information | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | +| mac_address | | MacAddress | True | | | | l2_mode | Layer 2 mode of the interface | Dropdown | True | | access, trunk, trunk_all | ### Layer3 @@ -216,13 +206,6 @@ Basic DCIM schema to capture devices, racks, interfaces, and related information - **Description:** Layer 3 specific attributes for network interfaces - **Namespace:** Interface -#### Attributes - -| name | description | kind | optional | default_value | choices | -| ---- | ----------- | ---- | -------- | ------------- | ------- | -| dot1q_id | Dot1Q VLAN ID | Number | True | | | -| mac_address | | Text | True | | | - #### Relationships | name | peer | optional | cardinality | kind | @@ -250,6 +233,7 @@ generics: description: Generic Device object. label: Device icon: mdi:server + include_in_menu: false human_friendly_id: - name__value order_by: @@ -259,40 +243,40 @@ generics: - name: name kind: Text unique: true + optional: false order_weight: 1000 - name: description kind: Text optional: true - order_weight: 2000 - - name: os_version - kind: Text - optional: true - order_weight: 2200 + order_weight: 1100 relationships: - name: interfaces peer: DcimInterface - optional: true + kind: Component cardinality: many + optional: true identifier: device__interface - kind: Component + order_weight: 1650 - name: tags peer: BuiltinTag - optional: true - cardinality: many kind: Attribute + cardinality: many + optional: true order_weight: 2000 - name: primary_address peer: IpamIPAddress label: Primary IP Address - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: device__primary_address order_weight: 1700 - name: platform peer: DcimPlatform - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: device__platform order_weight: 1250 - name: PhysicalDevice namespace: Dcim @@ -300,23 +284,26 @@ generics: device. include_in_menu: false attributes: + - name: name + kind: Text + unique: true + allow_override: any + optional: false + order_weight: 1000 - name: position - label: Position (U) - description: Lowest unit. kind: Number + label: Position (U) optional: true - order_weight: 1500 - - name: serial + description: Lowest unit. + order_weight: 1550 + - name: serial_number kind: Text optional: true - order_weight: 1500 + order_weight: 1400 - name: rack_face - label: Rack Face - description: On which face of the rack the device is mounted. kind: Dropdown - optional: false + label: Rack Face default_value: front - order_weight: 1515 choices: - name: front label: Front @@ -324,19 +311,23 @@ generics: - name: rear label: Rear description: Device mounted on the rear face of the rack. + optional: false + description: On which face of the rack the device is mounted. + order_weight: 1600 relationships: - name: device_type peer: DcimDeviceType - optional: true - cardinality: one kind: Attribute - order_weight: 1200 + cardinality: one + optional: true + order_weight: 1150 - name: location - label: Location peer: LocationHosting - optional: false - cardinality: one + label: Location kind: Attribute + cardinality: one + optional: false + identifier: physical_device__location order_weight: 1500 - name: Endpoint namespace: Dcim @@ -345,10 +336,11 @@ generics: relationships: - name: connector peer: DcimConnector - optional: true - cardinality: one - order_weight: 1500 kind: Attribute + cardinality: one + optional: true + identifier: connector__endpoint + order_weight: 1600 - name: Connector namespace: Dcim description: Generic Connector to link two endpoints together. @@ -356,28 +348,32 @@ generics: relationships: - name: connected_endpoints peer: DcimEndpoint - optional: true + kind: Attribute cardinality: many + optional: true + identifier: connector__endpoint order_weight: 1500 - kind: Generic - name: Interface namespace: Dcim description: Generic Network Interface label: Interface - include_in_menu: false - display_label: name__value + icon: mdi:ethernet + include_in_menu: true + menu_placement: DcimDevice + human_friendly_id: + - device__name__value + - name__value order_by: - device__name__value - name__value + display_label: name__value uniqueness_constraints: - - device - name__value - human_friendly_id: - - device__name__value - - name__value attributes: - name: name kind: Text + optional: false description: Name of the interface order_weight: 1000 - name: description @@ -385,59 +381,41 @@ generics: optional: true description: A brief description of the interface order_weight: 1100 - - name: mtu - label: MTU - kind: Number - default_value: 1514 - order_weight: 1300 - name: status kind: Dropdown - description: The status of the interface + default_value: active choices: - name: provisioning label: Provisioning description: Interface is being provisioned. - color: '#A9DFBF' + color: '#f0ad4e' - name: free label: Free description: Interface is unused. - color: '#CDEACC' + color: '#c8e6c9' - name: active label: Active description: Interface is active and operational. - color: '#A9CCE3' + color: '#00d25b' - name: maintenance label: Maintenance description: Interface is under maintenance. - color: '#FFF2CC' + color: '#ff9800' - name: disabled label: Disabled description: Interface has been disabled. - color: '#D3D3D3' - - name: deleted - label: Deleted - description: Interface has been deleted. - color: '#FAD7A0' - - name: outage - label: Outage - description: Interface is currently experiencing an outage. - color: '#F4CCCC' - default_value: active + color: '#6c757d' + optional: false + description: The status of the interface order_weight: 1200 - name: role kind: Dropdown - optional: true - description: The role of the interface in the network choices: - - name: lag - label: Lag - description: Interface LAG. - color: '#A9DFBF' - name: core label: Core Interface description: Central part of the network. color: '#A9CCE3' - - name: cust + - name: customer label: Customer Interface description: Interface dedicated to customer connections. color: '#D2B4DE' @@ -457,31 +435,38 @@ generics: label: Upstream Interface description: Interface dedicated to upstream traffic between networks. color: '#B2D4E6' - order_weight: 1250 + optional: true + description: The role of the interface in the network + order_weight: 1300 + - name: mtu + kind: Number + label: MTU + default_value: 1500 + optional: true + description: Maximum transmission unit, in bytes (IP payload, not frame size). + order_weight: 1350 relationships: - name: device peer: DcimGenericDevice - identifier: device__interface - optional: false - cardinality: one kind: Parent - order_weight: 1025 - - name: tags - peer: BuiltinTag - optional: true - cardinality: many - kind: Attribute - order_weight: 3000 + cardinality: one + optional: false + identifier: device__interface + order_weight: 900 - name: Layer2 namespace: Interface - include_in_menu: false description: Layer 2 specific attributes for network interfaces label: Layer 2 Interface + include_in_menu: false attributes: + - name: mac_address + kind: MacAddress + label: MAC Address + optional: true + order_weight: 1400 - name: l2_mode - label: Layer2 Mode kind: Dropdown - optional: true + label: Layer2 Mode choices: - name: access label: Access @@ -492,32 +477,22 @@ generics: - name: trunk_all label: Trunk (All) description: Trunk all mode + optional: true description: Layer 2 mode of the interface - order_weight: 1500 + order_weight: 1450 - name: Layer3 namespace: Interface - include_in_menu: false description: Layer 3 specific attributes for network interfaces label: Layer 3 Interface - attributes: - - name: dot1q_id - label: VLAN ID (dot1q) - kind: Number - description: Dot1Q VLAN ID - order_weight: 1600 - optional: true - - name: mac_address - label: Mac Address - kind: Text - optional: true - order_weight: 1550 + include_in_menu: false relationships: - name: ip_addresses - label: IP Addresses peer: IpamIPAddress - cardinality: many + label: IP Addresses kind: Attribute + cardinality: many optional: true + identifier: ip_address__interface description: List of IP addresses associated with the interface order_weight: 1150 - name: HasSubInterface @@ -526,12 +501,12 @@ generics: include_in_menu: false relationships: - name: sub_interfaces - label: Sub-interface(s) peer: InterfaceVirtual - identifier: sub__interface - optional: true - cardinality: many + label: Sub-interface(s) kind: Attribute + cardinality: many + optional: true + identifier: sub__interface description: Sub-interfaces of this interface order_weight: 1750 nodes: @@ -540,152 +515,132 @@ nodes: description: A model of device label: Device Type icon: mdi:poll + include_in_menu: true + menu_placement: DcimDevice human_friendly_id: - name__value - display_label: name__value order_by: - manufacturer__name__value - name__value - uniqueness_constraints: - - - manufacturer - - name__value + display_label: name__value attributes: - name: name kind: Text unique: true + optional: false order_weight: 1000 - name: description kind: Text optional: true order_weight: 1100 - name: part_number + kind: Text label: Part Number optional: true - kind: Text order_weight: 1200 - name: height + kind: Number label: Height (U) - optional: false default_value: 1 - kind: Number + optional: false order_weight: 1400 - name: full_depth + kind: Boolean label: Full Depth default_value: true - kind: Boolean + optional: false order_weight: 1500 - name: weight + kind: Number label: Weight (kg) optional: true - kind: Number order_weight: 1600 relationships: - - name: platform - peer: DcimPlatform - cardinality: one - kind: Attribute - order_weight: 1300 - name: manufacturer peer: OrganizationManufacturer - cardinality: one kind: Attribute - order_weight: 1250 + cardinality: one optional: false - - name: tags - peer: BuiltinTag - optional: true - cardinality: many - kind: Attribute - order_weight: 2000 + identifier: manufacturer__device_type + order_weight: 1250 - name: Platform namespace: Dcim description: A Platform represent the type of software running on a device. label: Platform icon: mdi:application-cog-outline + include_in_menu: true + menu_placement: DcimDevice human_friendly_id: - name__value - display_label: name__value order_by: - manufacturer__name__value - name__value - uniqueness_constraints: - - - name__value + display_label: name__value attributes: - name: name kind: Text unique: true + optional: false order_weight: 1000 - name: description kind: Text optional: true - order_weight: 1200 - - name: nornir_platform - kind: Text - optional: true - order_weight: 1500 - - name: napalm_driver - kind: Text - optional: true - order_weight: 1600 - - name: netmiko_device_type - kind: Text - optional: true - order_weight: 1700 - - name: ansible_network_os - kind: Text - optional: true - order_weight: 1800 - - name: containerlab_os - kind: Text - optional: true - order_weight: 1900 + order_weight: 1100 relationships: - name: devices peer: DcimGenericDevice - optional: true + kind: Generic cardinality: many + optional: true + identifier: device__platform order_weight: 1350 - name: manufacturer peer: OrganizationManufacturer - cardinality: one kind: Attribute + cardinality: one + identifier: manufacturer__platform + optional: true order_weight: 1300 - name: Device + namespace: Dcim + description: A configurable network device including routers, switches... label: Network Device - description: A configurable network device for managing and directing data traffic, - including routers, switches... icon: clarity:network-switch-solid - namespace: Dcim + include_in_menu: true inherit_from: - CoreArtifactTarget - DcimGenericDevice - DcimPhysicalDevice + generate_template: true attributes: - name: status kind: Dropdown - optional: false - order_weight: 1100 + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: '#7fbf7f' + color: '#00d25b' + - name: reserved + label: Reserved + description: Reserved for future use, not yet active. + color: '#4d90fe' - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: '#ffff7f' + color: '#f0ad4e' - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: '#ffd27f' - - name: drained - label: Drained - description: Temporarily taken out of service. - color: '#bfbfbf' + color: '#ff9800' + - name: deprecated + label: Deprecated + description: No longer in use and scheduled for removal. + color: '#e04040' + optional: false + order_weight: 1200 - name: role kind: Dropdown - optional: true - order_weight: 1400 choices: - name: core label: Core Router @@ -711,32 +666,36 @@ nodes: label: Tor Switch description: Tor switch part of a Fabric. color: '#e8e7fd' + optional: true + order_weight: 1300 - name: Physical namespace: Interface - label: Physical Interface description: Physical network port on a device + label: Physical Interface + include_in_menu: false inherit_from: - DcimInterface - InterfaceLayer2 - InterfaceLayer3 - DcimEndpoint - InterfaceHasSubInterface - include_in_menu: false - name: Virtual namespace: Interface - label: Virtual Interface description: Virtual interface like VLAN or Loopback + label: Virtual Interface + include_in_menu: false inherit_from: - DcimInterface - InterfaceLayer2 - InterfaceLayer3 - include_in_menu: false relationships: - name: parent_interface peer: InterfaceHasSubInterface - cardinality: one kind: Attribute + cardinality: one identifier: sub__interface + optional: true description: Parent interface to which this sub-interface belongs + order_weight: 1600 ``` \ No newline at end of file diff --git a/docs/docs/reference/device_module.mdx b/docs/docs/reference/device_module.mdx new file mode 100644 index 00000000..8c00ec82 --- /dev/null +++ b/docs/docs/reference/device_module.mdx @@ -0,0 +1,386 @@ +--- +title: Device Modules +--- + +This schema extension lets you capture module bays on a Dcim Physical Device and the modules installed into them (e.g. fan trays, line cards). A device can have any number of module bays, and each bay can optionally hold one module. + +NOTE: This extension ships a standard Module/ModuleType node pair ready to use, alongside the generic Module/ModuleType you can build your own flavors on top of (see the device_psu_module, modules_linecards, or modules_routing_engine extensions). + +## Details + +- **Dependencies:** + - [base](dcim) + +## Nodes + +### ModuleBay + +- **Label:** Module Bay +- **Description:** A physical bay on a device that can receive a module. +- **Namespace:** Dcim +- **Icon:** mdi:tray +- **Uniqueness Constraints:** + - device, name__value +- **Human Friendly ID:** computed_name__value + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| computed_name | Name computed from the device and bay name. | Text | False | | | +| name | Name of the bay, e.g. 'slot 1' or 'psu 1'. | Text | False | | | +| position | Numeric position of the bay within the device (e.g. slot 1, 2, 3). | Number | True | | | +| description | | Text | True | | | +| role | The role of the module bay, indicating the type of module it is intended to receive. | Dropdown | True | | supervisor, line_card, power_supply, fan | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| device | DcimPhysicalDevice | False | one | Parent | +| installed_module | DcimGenericModule | True | one | Attribute | + +### Module + +- **Label:** Module +- **Description:** Standard module installed in a device. +- **Namespace:** Dcim +- **Icon:** mdi:expansion-card +- **Inherit From:** DcimGenericModule + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| computed_name | Name computed from the module bay and module type. | Text | False | | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| module_type | DcimModuleType | False | one | Attribute | + +### ModuleType + +- **Label:** Module Type +- **Description:** Standard module type, defining common specifications for a Module. +- **Namespace:** Dcim +- **Icon:** mdi:database-cog +- **Inherit From:** DcimGenericModuleType + +## Generics + +### GenericModule + +- **Label:** Module +- **Description:** A generic module, such as a Linecard or Routing Engine, installed in a module bay. +- **Namespace:** Dcim +- **Icon:** mdi:expansion-card +- **Human Friendly ID:** computed_name__value + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| computed_name | Name computed from the module bay; concrete module kinds may refine it. | Text | False | | | +| serial_number | Serial number of the module, if known. | Text | True | | | +| description | | Text | True | | | +| status | Operational status of the module. | Dropdown | False | active | provisioning, active, maintenance, failed, rma | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| module_bay | DcimModuleBay | False | one | Attribute | + +### GenericModuleType + +- **Label:** Module Type +- **Description:** A generic module type, with common specifications like part number and manufacturer. +- **Namespace:** Dcim +- **Icon:** mdi:database-cog +- **Uniqueness Constraints:** + - name__value, manufacturer +- **Human Friendly ID:** name__value + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| name | Name of the module type. | Text | False | | | +| description | Description of the module type. | Text | True | | | +| part_number | Part number of the module. | Text | True | | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| manufacturer | OrganizationManufacturer | False | one | Attribute | + +## Extensions + +:::note + +In this context "extensions" refer to modifications or additions to the existing schema, such as adding new attributes, relationships, or other schema elements. + +::: + +### DcimPhysicalDevice + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| module_bays | DcimModuleBay | True | many | Component | + +## Code + +```yaml +version: '1.0' +generics: +- name: GenericModule + namespace: Dcim + description: A generic module, such as a Linecard or Routing Engine, installed in + a module bay. + label: Module + icon: mdi:expansion-card + include_in_menu: true + human_friendly_id: + - computed_name__value + display_label: computed_name__value + attributes: + - name: computed_name + kind: Text + unique: true + read_only: true + optional: false + allow_override: any + computed_attribute: + kind: Jinja2 + jinja2_template: '{{ module_bay__computed_name__value }}' + description: Name computed from the module bay; concrete module kinds may refine + it. + order_weight: 1000 + - name: serial_number + kind: Text + optional: true + description: Serial number of the module, if known. + order_weight: 1400 + - name: description + kind: Text + optional: true + order_weight: 1100 + - name: status + kind: Dropdown + default_value: active + choices: + - name: provisioning + label: Provisioning + description: Module is being installed and provisioned. + color: '#f0ad4e' + - name: active + label: Active + description: Module is installed and operational. + color: '#00d25b' + - name: maintenance + label: Maintenance + description: Module is under maintenance. + color: '#ff9800' + - name: failed + label: Failed + description: Module is still installed but is not operational. + color: '#e04040' + - name: rma + label: RMA + description: Module has failed and is being returned to the manufacturer. + color: '#6c757d' + optional: false + description: Operational status of the module. + order_weight: 1200 + relationships: + - name: module_bay + peer: DcimModuleBay + label: Module Bay + kind: Attribute + cardinality: one + optional: false + identifier: module_bay__module + order_weight: 900 +- name: GenericModuleType + namespace: Dcim + description: A generic module type, with common specifications like part number + and manufacturer. + label: Module Type + icon: mdi:database-cog + include_in_menu: true + menu_placement: DcimGenericModule + human_friendly_id: + - name__value + order_by: + - manufacturer__name__value + - name__value + display_label: name__value + uniqueness_constraints: + - - name__value + - manufacturer + attributes: + - name: name + kind: Text + unique: true + optional: false + description: Name of the module type. + order_weight: 1000 + - name: description + kind: Text + optional: true + description: Description of the module type. + order_weight: 1100 + - name: part_number + kind: Text + label: Part Number + optional: true + description: Part number of the module. + order_weight: 1200 + relationships: + - name: manufacturer + peer: OrganizationManufacturer + kind: Attribute + cardinality: one + optional: false + identifier: manufacturer__moduletype + description: Manufacturer of the module type. + order_weight: 1250 +nodes: +- name: ModuleBay + namespace: Dcim + description: A physical bay on a device that can receive a module. + label: Module Bay + icon: mdi:tray + include_in_menu: true + menu_placement: DcimDevice + human_friendly_id: + - computed_name__value + order_by: + - device__name__value + - name__value + display_label: computed_name__value + uniqueness_constraints: + - - device + - name__value + attributes: + - name: computed_name + kind: Text + unique: true + read_only: true + computed_attribute: + kind: Jinja2 + jinja2_template: '{{ device__name__value }} > {{ name__value }}' + optional: false + description: Name computed from the device and bay name. + order_weight: 800 + - name: name + kind: Text + optional: false + description: Name of the bay, e.g. 'slot 1' or 'psu 1'. + order_weight: 1000 + - name: position + kind: Number + optional: true + parameters: + min_value: 1 + description: Numeric position of the bay within the device (e.g. slot 1, 2, 3). + order_weight: 1050 + - name: description + kind: Text + optional: true + order_weight: 1100 + - name: role + kind: Dropdown + optional: true + description: The role of the module bay, indicating the type of module it is intended + to receive. + order_weight: 1300 + choices: + - name: supervisor + label: Supervisor + description: Bay intended for a supervisor / routing engine module. + color: '#A9CCE3' + - name: line_card + label: Line Card + description: Bay intended for a line card module. + color: '#B4E0DC' + - name: power_supply + label: Power Supply + description: Bay intended for a power supply module. + color: '#E3DAC9' + - name: fan + label: Fan + description: Bay intended for a fan module. + color: '#D2B4DE' + relationships: + - name: device + peer: DcimPhysicalDevice + label: Device + kind: Parent + cardinality: one + optional: false + identifier: device__module_bays + order_weight: 900 + - name: installed_module + peer: DcimGenericModule + label: Installed Module + kind: Attribute + cardinality: one + optional: true + identifier: module_bay__module + order_weight: 1200 +- name: Module + namespace: Dcim + description: Standard module installed in a device. + label: Module + icon: mdi:expansion-card + include_in_menu: false + inherit_from: + - DcimGenericModule + attributes: + - name: computed_name + kind: Text + unique: true + read_only: true + computed_attribute: + kind: Jinja2 + jinja2_template: '{{ module_bay__computed_name__value }} ({{ module_type__name__value + }})' + optional: false + description: Name computed from the module bay and module type. + order_weight: 1000 + relationships: + - name: module_type + peer: DcimModuleType + kind: Attribute + cardinality: one + optional: false + order_weight: 950 +- name: ModuleType + namespace: Dcim + description: Standard module type, defining common specifications for a Module. + label: Module Type + icon: mdi:database-cog + include_in_menu: false + inherit_from: + - DcimGenericModuleType +extensions: + nodes: + - kind: DcimPhysicalDevice + relationships: + - name: module_bays + peer: DcimModuleBay + label: Module Bays + kind: Component + cardinality: many + optional: true + identifier: device__module_bays + description: Module bays available on this device. + order_weight: 1750 + +``` \ No newline at end of file diff --git a/docs/docs/reference/device_psu_module.mdx b/docs/docs/reference/device_psu_module.mdx new file mode 100644 index 00000000..71c3a897 --- /dev/null +++ b/docs/docs/reference/device_psu_module.mdx @@ -0,0 +1,108 @@ +--- +title: Device PSU Module +--- + +This schema extension adds a PSU (Power Supply Unit) flavor on top of the generic Module/ModuleType from extensions/device_module, so you can track power supplies installed in a device's module bays alongside PSU-specific attributes like wattage and hot-swap capability. + +## Details + +- **Dependencies:** + - [base](dcim) + - [extensions/device_module](device_module) + +## Nodes + +### PSUModule + +- **Label:** PSU Module +- **Description:** Power Supply Unit (PSU) installed in a device. +- **Namespace:** Dcim +- **Icon:** mdi:power-plug +- **Inherit From:** DcimGenericModule + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| computed_name | Name computed from the module bay and module type. | Text | False | | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| module_type | DcimPSUModuleType | False | one | Attribute | + +### PSUModuleType + +- **Label:** PSU Module Type +- **Description:** PSU module type, defining common specifications such as wattage and hot-swap capability. +- **Namespace:** Dcim +- **Icon:** mdi:database-cog +- **Inherit From:** DcimGenericModuleType + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| wattage | Wattage in watts. | Number | True | | | +| hot_swappable | Whether the PSU can be replaced without powering down the device. | Boolean | False | False | | + +## Code + +```yaml +version: '1.0' +nodes: +- name: PSUModule + namespace: Dcim + description: Power Supply Unit (PSU) installed in a device. + label: PSU Module + icon: mdi:power-plug + include_in_menu: false + inherit_from: + - DcimGenericModule + attributes: + - name: computed_name + kind: Text + unique: true + read_only: true + computed_attribute: + kind: Jinja2 + jinja2_template: '{{ module_bay__computed_name__value }} ({{ module_type__name__value + }})' + optional: false + description: Name computed from the module bay and module type. + order_weight: 1000 + relationships: + - name: module_type + peer: DcimPSUModuleType + kind: Attribute + cardinality: one + optional: false + order_weight: 950 +- name: PSUModuleType + namespace: Dcim + description: PSU module type, defining common specifications such as wattage and + hot-swap capability. + label: PSU Module Type + icon: mdi:database-cog + include_in_menu: false + inherit_from: + - DcimGenericModuleType + attributes: + - name: wattage + kind: Number + label: Wattage (W) + optional: true + parameters: + min_value: 1 + description: Wattage in watts. + order_weight: 1300 + - name: hot_swappable + kind: Boolean + label: Hot-Swappable + default_value: false + optional: false + description: Whether the PSU can be replaced without powering down the device. + order_weight: 1350 + +``` \ No newline at end of file diff --git a/docs/docs/reference/dwdm.mdx b/docs/docs/reference/dwdm.mdx index db6c99c4..60718db8 100644 --- a/docs/docs/reference/dwdm.mdx +++ b/docs/docs/reference/dwdm.mdx @@ -25,8 +25,8 @@ This schema extension contains models for OADM (Optical Add Drop Multiplexer) su | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | -| wdm_type | Type of WDM (e.g CWDM. DWDM) | Dropdown | False | dwdm | cwdm, dwdm | +| name | | Text | False | | | +| wdm_type | Type of WDM technology (e.g. CWDM, DWDM) | Dropdown | False | dwdm | cwdm, dwdm | | description | | Text | True | | | #### Relationships @@ -39,6 +39,7 @@ This schema extension contains models for OADM (Optical Add Drop Multiplexer) su ### OadmFrontInterface - **Label:** Optical Multiplexer Front Interfaces +- **Description:** Client-side interface of an optical add-drop multiplexer, carrying a single channel. - **Namespace:** Dcim - **Uniqueness Constraints:** - optical_multiplexer, name__value @@ -55,6 +56,7 @@ This schema extension contains models for OADM (Optical Add Drop Multiplexer) su ### OadmRearInterface - **Label:** Optical Multiplexer Rear Interfaces +- **Description:** Line-side interface of an optical add-drop multiplexer, carrying the multiplexed signal. - **Namespace:** Dcim - **Uniqueness Constraints:** - optical_multiplexer, name__value @@ -82,10 +84,10 @@ This schema extension contains models for OADM (Optical Add Drop Multiplexer) su | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| channel | WDM channel number. | Number | | | | -| wdm_type | Type of WDM (e.g CWDM. DWDM) | Dropdown | False | dwdm | cwdm, dwdm | -| wavelength | Wavelength of the channel in nm. | Text | | | | -| frequency | Frequency of the channel in GHz. | Text | | | | +| channel | WDM channel number. | Number | False | | | +| wdm_type | Type of WDM technology (e.g. CWDM, DWDM) | Dropdown | False | dwdm | cwdm, dwdm | +| wavelength | Wavelength of the channel in nm. | Text | False | | | +| frequency | Frequency of the channel in GHz. | Text | False | | | ### WdmSFP @@ -99,7 +101,7 @@ This schema extension contains models for OADM (Optical Add Drop Multiplexer) su | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| wdm_type | Type of WDM (e.g CWDM. DWDM) | Dropdown | False | dwdm | cwdm, dwdm | +| wdm_type | Type of WDM technology (e.g. CWDM, DWDM) | Dropdown | False | dwdm | cwdm, dwdm | #### Relationships @@ -112,6 +114,7 @@ This schema extension contains models for OADM (Optical Add Drop Multiplexer) su ### GenericOadmInterface - **Label:** Optical Multiplexer Interfaces +- **Description:** Generic interface of an optical add-drop multiplexer, front or rear. - **Namespace:** Dcim - **Icon:** mdi:ethernet @@ -119,9 +122,9 @@ This schema extension contains models for OADM (Optical Add Drop Multiplexer) su | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | description | | Text | True | | | -| connector_type | | Dropdown | | | FC, LC, LC_PC, LC_UPC, LC_APC, LSH, LSH_PC, LSH_UPC, LSH_APC, LX_5, LX_5_PC, LX_5_UPC, LX_5_APC, MPO, MTRJ, SC, SC_PC, SC_UPC, SC_APC, ST, CS, SN, SMA_905, SMA_906, URM_P2 | +| connector_type | | Dropdown | False | | fc, lc, lc_pc, lc_upc, lc_apc, lsh, lsh_pc, lsh_upc, lsh_apc, lx_5, lx_5_pc, lx_5_upc, lx_5_apc, mpo, mtrj, sc, sc_pc, sc_upc, sc_apc, st, cs, sn, sma_905, sma_906, urm_p2, urm_p4, urm_p8, splice | ## Code @@ -129,130 +132,143 @@ This schema extension contains models for OADM (Optical Add Drop Multiplexer) su version: '1.0' generics: - name: GenericOadmInterface - label: Optical Multiplexer Interfaces - menu_placement: DcimOpticalMultiplexer namespace: Dcim + description: Generic interface of an optical add-drop multiplexer, front or rear. + label: Optical Multiplexer Interfaces icon: mdi:ethernet + include_in_menu: true + menu_placement: DcimOpticalMultiplexer attributes: - name: name kind: Text + optional: false order_weight: 1000 - name: description kind: Text optional: true - order_weight: 2000 + order_weight: 1100 - name: connector_type kind: Dropdown - order_weight: 1100 choices: - - name: FC + - name: fc label: FC description: Standardized fiber optic connector used primarily in datacom and telecom applications. - - name: LC + - name: lc label: LC description: Compact fiber optic connector with a push-pull mechanism. - - name: LC_PC + - name: lc_pc label: LC/PC description: Polished LC connector providing physical contact (PC). - - name: LC_UPC + - name: lc_upc label: LC/UPC description: Ultra-Physical Contact (UPC) variant of the LC connector with enhanced polish. - - name: LC_APC + - name: lc_apc label: LC/APC description: Angled Physical Contact (APC) version of the LC connector with a slanted fiber end-face. - - name: LSH + - name: lsh label: LSH description: European fiber optic connector offering high durability. - - name: LSH_PC + - name: lsh_pc label: LSH/PC description: Physical Contact version of LSH with standard polish. - - name: LSH_UPC + - name: lsh_upc label: LSH/UPC description: Ultra-Physical Contact variant of LSH, minimizing return loss with a superior polish. - - name: LSH_APC + - name: lsh_apc label: LSH/APC description: Angled Physical Contact version of LSH, designed to reduce back reflections. - - name: LX_5 + - name: lx_5 label: LX.5 description: Miniaturized fiber optic connector similar to LC but with an additional shutter mechanism. - - name: LX_5_PC + - name: lx_5_pc label: LX.5/PC description: Physical Contact version of LX.5. - - name: LX_5_UPC + - name: lx_5_upc label: LX.5/UPC description: Ultra-Physical Contact variant of LX.5. - - name: LX_5_APC + - name: lx_5_apc label: LX.5/APC description: Angled Physical Contact version of LX.5. - - name: MPO + - name: mpo label: MPO description: Multi-fiber Push-On connector typically used in data centers for high-speed applications. - - name: MTRJ + - name: mtrj label: MTRJ description: Male-to-female fiber optic connector with two fibers. - - name: SC + - name: sc label: SC description: Square fiber optic connector with push-pull lock. - - name: SC_PC + - name: sc_pc label: SC/PC description: Physical Contact SC connector with a polished end-face. - - name: SC_UPC + - name: sc_upc label: SC/UPC description: Ultra-Physical Contact variant of SC. - - name: SC_APC + - name: sc_apc label: SC/APC description: Angled Physical Contact version of SC. - - name: ST + - name: st label: ST description: Bayonet-style fiber optic connector primarily used in industrial and military applications. - - name: CS + - name: cs label: CS description: Compact connector with a high-density duplex configuration. - - name: SN + - name: sn label: SN description: Small-form connector with dual fibers. - - name: SMA_905 + - name: sma_905 label: SMA 905 description: Stainless steel fiber optic connector. - - name: SMA_906 + - name: sma_906 label: SMA 906 description: Variant of SMA 905 with similar durability, frequently used in high-vibration settings. - - name: URM_P2 + - name: urm_p2 label: URM-P2 description: Specialized fiber optic connector for industrial and harsh environments. + - name: urm_p4 + label: URM-P4 + description: Similar to URM-P2 but designed for higher performance. + - name: urm_p8 + label: URM-P8 + description: Enhanced version of URM connectors with higher protection. + - name: splice + label: Splice + description: Permanent fiber connection method where two fiber ends are fused. + optional: false + order_weight: 1200 nodes: - name: OpticalMultiplexer - label: Optical Multiplexer + namespace: Dcim description: An OADM (Optical Add Drop Multiplexer) supporting various WDM (Wavelength Division Multiplexing) technologies. + label: Optical Multiplexer icon: mdi:transit-connection-variant - namespace: Dcim + include_in_menu: true + inherit_from: + - DcimPhysicalDevice human_friendly_id: - name__value order_by: - name__value display_label: name__value - inherit_from: - - DcimPhysicalDevice attributes: - name: name kind: Text unique: true + optional: false order_weight: 1000 - name: wdm_type kind: Dropdown - description: Type of WDM (e.g CWDM. DWDM) - order_weight: 1110 - optional: false + default_value: dwdm choices: - name: cwdm label: CWDM (Coarse Wavelength Division Multiplexing) @@ -263,85 +279,100 @@ nodes: description: Supports dense wavelengths and amplification for long-distance communication. color: '#9933cc' - default_value: dwdm + optional: false + description: Type of WDM technology (e.g. CWDM, DWDM) + order_weight: 1300 - name: description kind: Text optional: true - order_weight: 2000 + order_weight: 1100 relationships: - name: front_interfaces peer: DcimOadmFrontInterface - identifier: front_interfaces - optional: true - cardinality: many kind: Component + cardinality: many + optional: true + identifier: optical_multiplexer__front_interfaces + order_weight: 1350 - name: rear_interface peer: DcimOadmRearInterface - identifier: rear_interfaces - optional: true - cardinality: one kind: Component + cardinality: one + optional: true + identifier: optical_multiplexer__rear_interface + order_weight: 1450 - name: OadmFrontInterface + namespace: Dcim + description: Client-side interface of an optical add-drop multiplexer, carrying + a single channel. label: Optical Multiplexer Front Interfaces + include_in_menu: true menu_placement: DcimGenericOadmInterface - namespace: Dcim + inherit_from: + - DcimEndpoint + - DcimGenericOadmInterface human_friendly_id: - optical_multiplexer__name__value - name__value - display_label: '{{ optical_multiplexer__name__value }} > {{ name__value }}' order_by: - optical_multiplexer__name__value - name__value + display_label: '{{ optical_multiplexer__name__value }} > {{ name__value }}' uniqueness_constraints: - - optical_multiplexer - name__value - inherit_from: - - DcimEndpoint - - DcimGenericOadmInterface relationships: - name: optical_multiplexer peer: DcimOpticalMultiplexer - order_weight: 900 - identifier: front_interfaces - optional: false - cardinality: one kind: Parent + cardinality: one + optional: false + identifier: optical_multiplexer__front_interfaces + order_weight: 900 - name: channels peer: DcimWdmChannel - order_weight: 1200 - optional: true - cardinality: many kind: Attribute + cardinality: many + optional: true + identifier: oadm_interface__channels + order_weight: 1300 - name: OadmRearInterface + namespace: Dcim + description: Line-side interface of an optical add-drop multiplexer, carrying the + multiplexed signal. label: Optical Multiplexer Rear Interfaces + include_in_menu: true menu_placement: DcimGenericOadmInterface - namespace: Dcim + inherit_from: + - DcimEndpoint + - DcimGenericOadmInterface human_friendly_id: - optical_multiplexer__name__value - name__value - display_label: '{{ optical_multiplexer__name__value }} > {{ name__value }}' order_by: - optical_multiplexer__name__value - name__value + display_label: '{{ optical_multiplexer__name__value }} > {{ name__value }}' uniqueness_constraints: - - optical_multiplexer - name__value - inherit_from: - - DcimEndpoint - - DcimGenericOadmInterface relationships: - name: optical_multiplexer peer: DcimOpticalMultiplexer - order_weight: 900 - identifier: rear_interface - optional: false - cardinality: one kind: Parent + cardinality: one + optional: false + identifier: optical_multiplexer__rear_interface + order_weight: 900 - name: WdmChannel namespace: Dcim description: A WDM channel with its wavelength and frequency. label: WDM Channel icon: game-icons:laser-warning + include_in_menu: true + human_friendly_id: + - wdm_type__value + - channel__value order_by: - wdm_type__value - channel__value @@ -353,18 +384,15 @@ nodes: - wdm_type__value - - channel__value - wdm_type__value - human_friendly_id: - - wdm_type__value - - channel__value attributes: - name: channel kind: Number + optional: false description: WDM channel number. + order_weight: 1000 - name: wdm_type kind: Dropdown - description: Type of WDM (e.g CWDM. DWDM) - order_weight: 1110 - optional: false + default_value: dwdm choices: - name: cwdm label: CWDM (Coarse Wavelength Division Multiplexing) @@ -375,29 +403,34 @@ nodes: description: Supports dense wavelengths and amplification for long-distance communication. color: '#9933cc' - default_value: dwdm + optional: false + description: Type of WDM technology (e.g. CWDM, DWDM) + order_weight: 1100 - name: wavelength - label: Wavelength (nm) kind: Text + label: Wavelength (nm) + optional: false description: Wavelength of the channel in nm. + order_weight: 1200 - name: frequency - label: Frequency (GHz) kind: Text + label: Frequency (GHz) + optional: false description: Frequency of the channel in GHz. + order_weight: 1300 - name: WdmSFP namespace: Dcim - inherit_from: - - DcimGenericSFP description: SFP with configuration for Wavelength Division Multiplexing. label: WDM SFP icon: mdi:laser-pointer + include_in_menu: true menu_placement: DcimGenericSFP + inherit_from: + - DcimGenericSFP attributes: - name: wdm_type kind: Dropdown - description: Type of WDM (e.g CWDM. DWDM) - order_weight: 1110 - optional: false + default_value: dwdm choices: - name: cwdm label: CWDM (Coarse Wavelength Division Multiplexing) @@ -408,14 +441,17 @@ nodes: description: Supports dense wavelengths and amplification for long-distance communication. color: '#9933cc' - default_value: dwdm + optional: false + description: Type of WDM technology (e.g. CWDM, DWDM) + order_weight: 1150 relationships: - name: wdm_channel - label: WDM Channel peer: DcimWdmChannel + label: WDM Channel kind: Attribute cardinality: one optional: false - order_weight: 1150 + identifier: wdm_sfp__channel + order_weight: 1250 ``` \ No newline at end of file diff --git a/docs/docs/reference/firewall_policer.mdx b/docs/docs/reference/firewall_policer.mdx index da563f61..426dfc6a 100644 --- a/docs/docs/reference/firewall_policer.mdx +++ b/docs/docs/reference/firewall_policer.mdx @@ -2,7 +2,7 @@ title: Firewall Policer --- -This schema extension contains models for VMs. You might consider Cluster or/and Hypervisor extension to go with! +This schema extension contains models for traffic policers and the classes and rules that reference them, so you can describe rate limiting alongside the interfaces it is applied to. ## Details diff --git a/docs/docs/reference/hosting_cluster.mdx b/docs/docs/reference/hosting_cluster.mdx index ad01f0ce..adc3f831 100644 --- a/docs/docs/reference/hosting_cluster.mdx +++ b/docs/docs/reference/hosting_cluster.mdx @@ -25,8 +25,8 @@ A rather generic cluster built with compute units (e.g. servers) and able to hos | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| cluster_type | Type of the cluster. | Dropdown | | | aws, kvm, gcp, vmware | -| status | | Dropdown | False | | active, provisioning, maintenance, drained | +| technology | Underlying virtualisation or clustering technology. | Dropdown | False | | vmware, kvm, hyper_v, xen, nutanix, openstack, kubernetes, public_cloud | +| status | | Dropdown | False | active | active, provisioning, maintenance, drained | ## Code @@ -35,52 +35,68 @@ version: '1.0' nodes: - name: Hosting namespace: Cluster - label: Hosting Cluster description: A cluster hosting virtual machines. + label: Hosting Cluster icon: mdi:dots-hexagon - menu_placement: ClusterGeneric + include_in_menu: true + menu_placement: ComputeGenericUnit inherit_from: - ClusterGeneric - VirtualizationHostVirtualMachine - ClusterGenericComputeUnitNodes attributes: - - name: cluster_type + - name: technology kind: Dropdown - order_weight: 1200 - description: Type of the cluster. + label: Technology choices: - - name: aws - label: Amazon Web Service - color: '#b90028' - - name: kvm - label: KVM - color: '#0082e2' - - name: gcp - label: Google Cloud Platform - color: '#e29200' - name: vmware - label: VMware + label: VMware vSphere color: '#3d8600' - - name: status - kind: Dropdown + - name: kvm + label: KVM / QEMU + color: '#0082e2' + - name: hyper_v + label: Hyper-V + color: '#00adef' + - name: xen + label: Xen / XenServer + color: '#f5821f' + - name: nutanix + label: Nutanix AHV + color: '#024da1' + - name: openstack + label: OpenStack + color: '#ed1944' + - name: kubernetes + label: Kubernetes + color: '#326ce5' + - name: public_cloud + label: Public Cloud + color: '#888888' optional: false + description: Underlying virtualisation or clustering technology. order_weight: 1300 + - name: status + kind: Dropdown + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: '#7fbf7f' + color: '#00d25b' - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: '#ffff7f' + color: '#f0ad4e' - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: '#ffd27f' + color: '#ff9800' - name: drained label: Drained description: Temporarily taken out of service. - color: '#bfbfbf' + color: '#9e9e9e' + optional: false + order_weight: 1200 ``` \ No newline at end of file diff --git a/docs/docs/reference/interface_breakout.mdx b/docs/docs/reference/interface_breakout.mdx index 0de9a759..7985a9f3 100644 --- a/docs/docs/reference/interface_breakout.mdx +++ b/docs/docs/reference/interface_breakout.mdx @@ -42,29 +42,30 @@ extensions: attributes: - name: breakout_capability kind: Boolean - optional: false default_value: false + optional: false description: Indicates if the port supports breakout capability + order_weight: 1800 relationships: - name: breakout_child_interfaces peer: InterfacePhysical label: Breakout child interface(s) - optional: true - cardinality: many kind: Attribute + cardinality: many + optional: true identifier: physical__breakout direction: outbound description: Interfaces resulting from the breakout - order_weight: 1650 + order_weight: 1850 - name: breakout_parent_interface peer: InterfacePhysical label: Breakout parent interface - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true identifier: physical__breakout direction: inbound description: Interface from which breakout is created - order_weight: 1700 + order_weight: 1900 ``` \ No newline at end of file diff --git a/docs/docs/reference/ipam.mdx b/docs/docs/reference/ipam.mdx index a332b9cb..2faab193 100644 --- a/docs/docs/reference/ipam.mdx +++ b/docs/docs/reference/ipam.mdx @@ -10,6 +10,31 @@ Basic IPAM schema to capture IP addresses, subnets, and related information. ## Nodes +### Prefix + +- **Label:** Prefix +- **Description:** IPv4 or IPv6 network (with mask) +- **Namespace:** Ipam +- **Icon:** mdi:ip-network +- **Uniqueness Constraints:** + - prefix__value, ip_namespace +- **Human Friendly ID:** ip_namespace__name__value, prefix__value +- **Inherit From:** BuiltinIPPrefix + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| status | | Dropdown | False | active | active, reserved, deprecated | +| description | | Text | True | | | +| role | | Dropdown | True | | management, link, customer, backbone | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| scope | IpamPrefixScope | True | one | Attribute | + ### IPAddress - **Label:** IP Address @@ -18,160 +43,208 @@ Basic IPAM schema to capture IP addresses, subnets, and related information. - **Icon:** mdi:ip - **Uniqueness Constraints:** - address__value, ip_namespace -- **Human Friendly ID:** address__value, ip_namespace__name__value +- **Human Friendly ID:** ip_namespace__name__value, address__value - **Inherit From:** BuiltinIPAddress #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | +| description | | Text | True | | | +| status | | Dropdown | False | active | active, reserved, deprecated | +| role | | Dropdown | True | | loopback, secondary, anycast | | fqdn | | Text | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| interface | InterfaceLayer3 | True | one | | +| primary_of | DcimGenericDevice | True | many | Attribute | +| interface | InterfaceLayer3 | True | one | Attribute | -### Prefix +## Generics -- **Label:** Prefix -- **Description:** IPv4 or IPv6 network (with mask) +### VLANGroupScope + +- **Label:** VLAN Group Scope +- **Description:** Mixin for objects that can scope a VLAN group (e.g. Region, Site). The reverse relationship is added by extensions/vlan. - **Namespace:** Ipam -- **Icon:** mdi:ip-network -- **Uniqueness Constraints:** - - prefix__value, ip_namespace -- **Human Friendly ID:** prefix__value, ip_namespace__name__value -- **Inherit From:** BuiltinIPPrefix -#### Attributes +### PrefixScope -| name | description | kind | optional | default_value | choices | -| ---- | ----------- | ---- | -------- | ------------- | ------- | -| status | | Dropdown | | | active, deprecated, reserved | -| role | | Dropdown | True | | loopback, management, public, server, supernet, technical, loopback-vtep | +- **Label:** Prefix Scope +- **Description:** Mixin for objects that can scope IP prefixes (e.g. Region, Site). +- **Namespace:** Ipam #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| organization | OrganizationGeneric | True | one | Attribute | -| location | LocationHosting | True | one | Attribute | -| gateway | IpamIPAddress | True | one | Attribute | +| prefixes | IpamPrefix | True | many | Generic | ## Code ```yaml version: '1.0' -nodes: -- name: IPAddress +generics: +- name: VLANGroupScope namespace: Ipam - description: IP Address - label: IP Address - icon: mdi:ip + label: VLAN Group Scope + description: Mixin for objects that can scope a VLAN group (e.g. Region, Site). + The reverse relationship is added by extensions/vlan. + include_in_menu: false +- name: PrefixScope + namespace: Ipam + label: Prefix Scope + description: Mixin for objects that can scope IP prefixes (e.g. Region, Site). include_in_menu: false - order_by: - - address__value - display_label: address__value - inherit_from: - - BuiltinIPAddress - uniqueness_constraints: - - - address__value - - ip_namespace - human_friendly_id: - - address__value - - ip_namespace__name__value - attributes: - - name: fqdn - label: FQDN - kind: Text - optional: true - regex: (?=^.{1,253}$)(^(((?!-)[a-zA-Z0-9-]{1,63}(? Country -> Site hierarchy. It defines the same Location.Site node as extensions/location_site, so load one or the other, not both. Note that LocationGeneric.name is unique across every location kind, so a name used at one tier cannot be reused at another; a single-country deployment therefore enters the hierarchy at Country (with Region as the national node) rather than duplicating a country under several regions. ## Details @@ -11,174 +11,117 @@ This schema extension is minimal but will provide you with basic items to store ## Nodes -### Country +### Region -- **Label:** Country +- **Label:** Region +- **Description:** A geographical region grouping countries and sites. - **Namespace:** Location -- **Icon:** gis:search-country -- **Inherit From:** LocationGeneric - -#### Attributes - -| name | description | kind | optional | default_value | choices | -| ---- | ----------- | ---- | -------- | ------------- | ------- | -| timezone | | Text | True | | | +- **Icon:** carbon:cics-region-target +- **Inherit From:** LocationGeneric, IpamPrefixScope -### Metro +### Country -- **Label:** Metro +- **Label:** Country +- **Description:** A country, sitting between a region and the sites it contains. - **Namespace:** Location -- **Icon:** healthicons:city +- **Icon:** gis:search-country - **Inherit From:** LocationGeneric ### Site - **Label:** Site +- **Description:** A physical location hosting equipment, such as a data center or an office. - **Namespace:** Location - **Icon:** ri:building-line -- **Inherit From:** LocationGeneric, LocationHosting +- **Inherit From:** LocationGeneric, LocationHosting, IpamPrefixScope, IpamVLANGroupScope #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| facility_id | | Text | True | | | +| status | | Dropdown | False | active | active, planned, staging, decommissioning, deprecated | +| facility | | Text | True | | | | physical_address | | Text | True | | | - -#### Relationships - -| name | peer | optional | cardinality | kind | -| ---- | ---- | -------- | ----------- | ---- | -| owner | OrganizationGeneric | True | one | | - -### Rack - -- **Label:** Rack -- **Namespace:** Location -- **Icon:** clarity:rack-server-line -- **Inherit From:** LocationGeneric, LocationHosting - -#### Attributes - -| name | description | kind | optional | default_value | choices | -| ---- | ----------- | ---- | -------- | ------------- | ------- | -| facility_id | | Text | True | | | -| height | | Number | False | 42 | | - -#### Relationships - -| name | peer | optional | cardinality | kind | -| ---- | ---- | -------- | ----------- | ---- | -| owner | OrganizationGeneric | True | one | | - -## Extensions - -:::note - -In this context "extensions" refer to modifications or additions to the existing schema, such as adding new attributes, relationships, or other schema elements. - -::: - -### OrganizationProvider - -#### Relationships - -| name | peer | optional | cardinality | kind | -| ---- | ---- | -------- | ----------- | ---- | -| sites | LocationSite | True | many | | +| timezone | | Text | True | | | ## Code ```yaml version: '1.0' nodes: -- name: Country +- name: Region namespace: Location - label: Country + description: A geographical region grouping countries and sites. + label: Region + icon: carbon:cics-region-target + include_in_menu: true + menu_placement: LocationGeneric inherit_from: - LocationGeneric - menu_placement: LocationGeneric - display_label: name__value + - IpamPrefixScope parent: '' - children: LocationMetro - icon: gis:search-country - attributes: - - name: timezone - kind: Text - optional: true - order_weight: 1300 -- name: Metro + children: LocationCountry +- name: Country namespace: Location - label: Metro + description: A country, sitting between a region and the sites it contains. + label: Country + icon: gis:search-country + include_in_menu: true + menu_placement: LocationGeneric inherit_from: - LocationGeneric - menu_placement: LocationGeneric - display_label: name__value - parent: LocationCountry + parent: LocationRegion children: LocationSite - icon: healthicons:city - name: Site namespace: Location + description: A physical location hosting equipment, such as a data center or an + office. label: Site + icon: ri:building-line + include_in_menu: true + menu_placement: LocationGeneric inherit_from: - LocationGeneric - LocationHosting - menu_placement: LocationGeneric + - IpamPrefixScope + - IpamVLANGroupScope + parent: LocationCountry display_label: name__value - parent: LocationMetro - children: LocationRack - icon: ri:building-line attributes: - - name: facility_id + - name: status + kind: Dropdown + default_value: active + choices: + - name: active + label: Active + color: '#00d25b' + - name: planned + label: Planned + color: '#2196f3' + - name: staging + label: Staging + color: '#f0ad4e' + - name: decommissioning + label: Decommissioning + color: '#ff9800' + - name: deprecated + label: Deprecated + color: '#6c757d' + optional: false + order_weight: 1200 + - name: facility kind: Text unique: false optional: true - order_weight: 1100 + order_weight: 1150 - name: physical_address kind: Text unique: false optional: true - order_weight: 1500 - relationships: - - name: owner - peer: OrganizationGeneric - optional: true - cardinality: one -- name: Rack - namespace: Location - label: Rack - inherit_from: - - LocationGeneric - - LocationHosting - include_in_menu: true - display_label: name__value - menu_placement: LocationGeneric - parent: LocationSite - icon: clarity:rack-server-line - attributes: - - name: facility_id + order_weight: 1400 + - name: timezone kind: Text - unique: false optional: true - order_weight: 1100 - - name: height - label: Height (U) - optional: false - default_value: 42 - kind: Number order_weight: 1300 - relationships: - - name: owner - peer: OrganizationGeneric - optional: true - cardinality: one -extensions: - nodes: - - kind: OrganizationProvider - relationships: - - name: sites - peer: LocationSite - cardinality: many - optional: true ``` \ No newline at end of file diff --git a/docs/docs/reference/location_site.mdx b/docs/docs/reference/location_site.mdx new file mode 100644 index 00000000..52c81d32 --- /dev/null +++ b/docs/docs/reference/location_site.mdx @@ -0,0 +1,87 @@ +--- +title: Location Site +--- + +This schema extension introduces a standalone Location.Site node (with facility, physical address, timezone, and status). It defines the same Site node as extensions/location_minimal, so load one or the other, not both. + +## Details + +- **Dependencies:** + - [base](dcim) + +## Nodes + +### Site + +- **Label:** Site +- **Description:** A physical location hosting equipment, such as a data center or an office. +- **Namespace:** Location +- **Icon:** ri:building-line +- **Inherit From:** LocationGeneric, LocationHosting, IpamPrefixScope, IpamVLANGroupScope + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| status | | Dropdown | False | active | active, planned, staging, decommissioning, deprecated | +| facility | | Text | True | | | +| physical_address | | Text | True | | | +| timezone | | Text | True | | | + +## Code + +```yaml +version: '1.0' +nodes: +- name: Site + namespace: Location + description: A physical location hosting equipment, such as a data center or an + office. + label: Site + icon: ri:building-line + include_in_menu: true + menu_placement: LocationGeneric + inherit_from: + - LocationGeneric + - LocationHosting + - IpamPrefixScope + - IpamVLANGroupScope + display_label: name__value + attributes: + - name: status + kind: Dropdown + default_value: active + choices: + - name: active + label: Active + color: '#00d25b' + - name: planned + label: Planned + color: '#2196f3' + - name: staging + label: Staging + color: '#f0ad4e' + - name: decommissioning + label: Decommissioning + color: '#ff9800' + - name: deprecated + label: Deprecated + color: '#6c757d' + optional: false + order_weight: 1200 + - name: facility + kind: Text + unique: false + optional: true + order_weight: 1150 + - name: physical_address + kind: Text + unique: false + optional: true + order_weight: 1400 + - name: timezone + kind: Text + optional: true + order_weight: 1300 + +``` \ No newline at end of file diff --git a/docs/docs/reference/mlag.mdx b/docs/docs/reference/mlag.mdx index bca39177..725c21aa 100644 --- a/docs/docs/reference/mlag.mdx +++ b/docs/docs/reference/mlag.mdx @@ -35,10 +35,9 @@ Next steps: | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | Name of the interface | Text | | | | -| mlag_id | Identifier for the MLAG interface | Number | | | | +| name | Name of the interface | Text | False | | | | description | A brief description of the interface | Text | True | | | -| status | The status of the interface | Dropdown | | active | provisioning, free, active, maintenance, disabled, deleted, outage | +| status | The status of the interface | Dropdown | False | active | provisioning, free, active, maintenance, disabled, deleted, outage | | role | The role of the interface in the network | Dropdown | True | | server, router | #### Relationships @@ -66,6 +65,7 @@ Next steps: ### MlagDomain - **Label:** MLAG Domain +- **Description:** Generic holding the peer links and interfaces shared by the members of an MLAG domain. - **Namespace:** Generic - **Human Friendly ID:** domain_id__value @@ -73,15 +73,15 @@ Next steps: | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| domain_id | Identifier for the MLAG domain | Text | | | | -| reload_delay | Time in seconds to wait before bringing up the MLAG after a reload | Number | | 300 | | +| domain_id | Identifier for the MLAG domain | Text | False | | | +| reload_delay | Time in seconds to wait before bringing up the MLAG after a reload | Number | False | 300 | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| peer_links | InterfaceLag | | many | Attribute | -| mlag_interfaces | MlagInterface | | many | Component | +| peer_links | InterfaceLag | True | many | Attribute | +| mlag_interfaces | MlagInterface | True | many | Component | ## Extensions @@ -114,68 +114,70 @@ version: '1.0' generics: - name: MlagDomain namespace: Generic - include_in_menu: false + description: Generic holding the peer links and interfaces shared by the members + of an MLAG domain. label: MLAG Domain - display_label: domain_id__value + include_in_menu: false human_friendly_id: - domain_id__value + display_label: domain_id__value attributes: - name: domain_id - label: MLAG Domain ID kind: Text + label: MLAG Domain ID unique: true + optional: false description: Identifier for the MLAG domain - order_weight: 900 + order_weight: 1000 - name: reload_delay - label: Reload Delay kind: Number - description: Time in seconds to wait before bringing up the MLAG after a reload + label: Reload Delay default_value: 300 + optional: false + description: Time in seconds to wait before bringing up the MLAG after a reload order_weight: 1650 relationships: - name: peer_links - label: Peer Links - description: LAG interfaces used as peer-links between the MLAG peers peer: InterfaceLag - cardinality: many + label: Peer Links kind: Attribute + cardinality: many + optional: true + description: LAG interfaces used as peer-links between the MLAG peers order_weight: 1500 - name: mlag_interfaces - label: MLAG Interface(s) peer: MlagInterface - cardinality: many + label: MLAG Interface(s) kind: Component + cardinality: many + optional: true description: Bundle interfaces that are spread across all devices in this MLAG domain. - order_weight: 1500 + order_weight: 1550 nodes: - name: Interface namespace: Mlag - label: MLAG Interface description: Multi-Chassis Link Aggregation Group Interface + label: MLAG Interface + include_in_menu: false inherit_from: - InterfaceLayer2 - GenericInterfaceBundle - include_in_menu: false - uniqueness_constraints: - - - mlag_domain - - name__value human_friendly_id: - mlag_domain__domain_id__value - name__value order_by: - name__value display_label: name__value + uniqueness_constraints: + - - mlag_domain + - name__value attributes: - name: name kind: Text + optional: false description: Name of the interface order_weight: 1000 - - name: mlag_id - label: MLAG ID - kind: Number - description: Identifier for the MLAG interface - order_weight: 1050 - name: description kind: Text optional: true @@ -183,7 +185,7 @@ nodes: order_weight: 1100 - name: status kind: Dropdown - description: The status of the interface + default_value: active choices: - name: provisioning label: Provisioning @@ -196,7 +198,7 @@ nodes: - name: active label: Active description: Interface is active and operational. - color: '#A9CCE3' + color: '#00d25b' - name: maintenance label: Maintenance description: Interface is under maintenance. @@ -213,12 +215,11 @@ nodes: label: Outage description: Interface is currently experiencing an outage. color: '#F4CCCC' - default_value: active + optional: false + description: The status of the interface order_weight: 1200 - name: role kind: Dropdown - optional: true - description: The role of the interface in the network choices: - name: server label: Server Interface @@ -228,55 +229,58 @@ nodes: label: Router Interface description: Interface connecting routers color: '#B2D4E6' - order_weight: 1250 + optional: true + description: The role of the interface in the network + order_weight: 1300 relationships: - name: mlag_domain - label: MLAG Domain peer: GenericMlagDomain - optional: false - cardinality: one + label: MLAG Domain kind: Parent + cardinality: one + optional: false description: MLAG Domain this MLAG Interface belongs to - order_weight: 1750 + order_weight: 900 - name: Domain namespace: Mlag - label: MLAG Domain description: MLAG (Multi-Chassis Link Aggregation Group) Domain + label: MLAG Domain icon: mingcute:cloud-line + include_in_menu: true inherit_from: - GenericMlagDomain relationships: - name: peers peer: DcimDevice - optional: false - cardinality: many kind: Generic + cardinality: many + optional: false identifier: device__mlag_domain - max_count: 2 min_count: 2 + max_count: 2 order_weight: 950 extensions: nodes: - kind: InterfaceLag relationships: - name: mlag_peer_link - label: MLAG Peer Link peer: MlagDomain - optional: true - cardinality: one + label: MLAG Peer Link kind: Attribute + cardinality: one + optional: true description: MLAG Domain this LAG is used as peer link - order_weight: 1800 + order_weight: 1950 - kind: DcimDevice relationships: - name: mlag_domain - label: MLAG Domain peer: MlagDomain - optional: true - cardinality: one + label: MLAG Domain kind: Attribute - description: MLAG Domain this device belongs to - order_weight: 1800 + cardinality: one + optional: true identifier: device__mlag_domain + description: MLAG Domain this device belongs to + order_weight: 1900 ``` \ No newline at end of file diff --git a/docs/docs/reference/modules.mdx b/docs/docs/reference/modules.mdx deleted file mode 100644 index 615d48d5..00000000 --- a/docs/docs/reference/modules.mdx +++ /dev/null @@ -1,206 +0,0 @@ ---- -title: Modules ---- - -This schema extension allows you to capture Device Modules related information like the serial number or the status. You can insert the Module into a Dcim Physical Device. - -NOTE: This extension doesn't contain any Nodes, you can use the extension module_linecards or modules_routing_engine to use it - -## Details - -- **Dependencies:** - - [base](dcim) - -## Generics - -### GenericModule - -- **Label:** Module -- **Description:** A generic module, such as a Linecard or Routing Engine, installed in a device. -- **Namespace:** Device -- **Icon:** mdi:expansion-card -- **Human Friendly ID:** serial_number__value - -#### Attributes - -| name | description | kind | optional | default_value | choices | -| ---- | ----------- | ---- | -------- | ------------- | ------- | -| serial_number | Unique serial number of the module. | Text | | | | -| description | | Text | True | | | -| status | | Dropdown | | active | provisioning, active, maintenance, disabled, outage | - -#### Relationships - -| name | peer | optional | cardinality | kind | -| ---- | ---- | -------- | ----------- | ---- | -| module_type | DeviceGenericModuleType | False | one | Attribute | -| device | DcimPhysicalDevice | True | one | Attribute | - -### GenericModuleType - -- **Label:** Module Type -- **Description:** A generic module type, with common specifications like part number and manufacturer. -- **Namespace:** Device -- **Icon:** mdi:database-cog -- **Uniqueness Constraints:** - - name__value, manufacturer -- **Human Friendly ID:** name__value - -#### Attributes - -| name | description | kind | optional | default_value | choices | -| ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | Name of the module type. | Text | | | | -| description | Description of the module type. | Text | True | | | -| part_number | Part number of the module. | Text | True | | | - -#### Relationships - -| name | peer | optional | cardinality | kind | -| ---- | ---- | -------- | ----------- | ---- | -| manufacturer | OrganizationManufacturer | False | one | Attribute | -| tags | BuiltinTag | True | many | Attribute | - -## Extensions - -:::note - -In this context "extensions" refer to modifications or additions to the existing schema, such as adding new attributes, relationships, or other schema elements. - -::: - -### DcimPhysicalDevice - -#### Relationships - -| name | peer | optional | cardinality | kind | -| ---- | ---- | -------- | ----------- | ---- | -| modules | DeviceGenericModule | | many | Component | - -## Code - -```yaml -version: '1.0' -generics: -- name: GenericModule - namespace: Device - description: A generic module, such as a Linecard or Routing Engine, installed in - a device. - label: Module - icon: mdi:expansion-card - human_friendly_id: - - serial_number__value - display_label: serial_number__value - order_by: - - serial_number__value - attributes: - - name: serial_number - kind: Text - unique: true - description: Unique serial number of the module. - order_weight: 1000 - - name: description - kind: Text - optional: true - order_weight: 1100 - - name: status - kind: Dropdown - choices: - - name: provisioning - label: Provisioning - description: Linecard is being provisioned. - color: '#A9DFBF' - - name: active - label: Active - description: Linecard is active and operational. - color: '#A9CCE3' - - name: maintenance - label: Maintenance - description: Linecard is under maintenance. - color: '#FFF2CC' - - name: disabled - label: Disabled - description: Linecard has been disabled. - color: '#D3D3D3' - - name: outage - label: Outage - description: Linecard is currently experiencing an outage. - color: '#F4CCCC' - default_value: active - order_weight: 1300 - relationships: - - name: module_type - peer: DeviceGenericModuleType - optional: false - cardinality: one - kind: Attribute - order_weight: 1150 - - name: device - label: Device - peer: DcimPhysicalDevice - identifier: device__modules - optional: true - cardinality: one - kind: Attribute - order_weight: 1000 -- name: GenericModuleType - namespace: Device - description: A generic module type, with common specifications like part number - and manufacturer. - label: Module Type - icon: mdi:database-cog - menu_placement: DeviceGenericModule - display_label: name__value - uniqueness_constraints: - - - name__value - - manufacturer - human_friendly_id: - - name__value - order_by: - - manufacturer__name__value - - name__value - attributes: - - name: name - kind: Text - unique: true - description: Name of the module type. - order_weight: 1000 - - name: description - kind: Text - optional: true - description: Description of the module type. - order_weight: 1100 - - name: part_number - label: Part Number - kind: Text - optional: true - unique: true - description: Part number of the module. - order_weight: 1200 - relationships: - - name: manufacturer - peer: OrganizationManufacturer - identifier: manufacturer__moduletype - cardinality: one - optional: false - kind: Attribute - description: Manufacturer of the module type. - order_weight: 1250 - - name: tags - peer: BuiltinTag - optional: true - cardinality: many - kind: Attribute - description: Tags associated with the module type. - order_weight: 3000 -extensions: - nodes: - - kind: DcimPhysicalDevice - relationships: - - name: modules - peer: DeviceGenericModule - identifier: device__modules - cardinality: many - kind: Component - -``` \ No newline at end of file diff --git a/docs/docs/reference/modules_linecards.mdx b/docs/docs/reference/modules_linecards.mdx index d741b7a4..cfc74055 100644 --- a/docs/docs/reference/modules_linecards.mdx +++ b/docs/docs/reference/modules_linecards.mdx @@ -8,7 +8,7 @@ This schema extension allows you to capture Linecard related information like th - **Dependencies:** - [base](dcim) - - [extensions/modules](modules) + - [extensions/device_module](device_module) ## Nodes @@ -18,7 +18,7 @@ This schema extension allows you to capture Linecard related information like th - **Description:** Linecard Type information, detailing specifications such as part number and manufacturer. - **Namespace:** Device - **Icon:** mdi:poll -- **Inherit From:** DeviceGenericModuleType +- **Inherit From:** DcimGenericModuleType #### Relationships @@ -32,7 +32,7 @@ This schema extension allows you to capture Linecard related information like th - **Description:** A Linecard installed in a device, specifying slot, power status, and functionalities. - **Namespace:** Device - **Icon:** bi:pci-card -- **Inherit From:** DeviceGenericModule +- **Inherit From:** DcimGenericModule #### Attributes @@ -108,7 +108,7 @@ nodes: icon: mdi:poll label: Linecard Type inherit_from: - - DeviceGenericModuleType + - DcimGenericModuleType relationships: - name: linecards peer: DeviceLinecard @@ -121,9 +121,9 @@ nodes: functionalities. label: Linecard icon: bi:pci-card - menu_placement: DeviceGenericModule + menu_placement: DcimGenericModule inherit_from: - - DeviceGenericModule + - DcimGenericModule attributes: - name: slot kind: Number diff --git a/docs/docs/reference/modules_routing_engine.mdx b/docs/docs/reference/modules_routing_engine.mdx index 29e71a76..7b43a950 100644 --- a/docs/docs/reference/modules_routing_engine.mdx +++ b/docs/docs/reference/modules_routing_engine.mdx @@ -8,7 +8,7 @@ This schema extension allows you to capture Routing Engine related information l - **Dependencies:** - [base](dcim) - - [extensions/modules](modules) + - [extensions/device_module](device_module) ## Nodes @@ -17,7 +17,7 @@ This schema extension allows you to capture Routing Engine related information l - **Label:** Routing Engine Type - **Description:** Routing Engine Type information, detailing specifications such as part number and manufacturer. - **Namespace:** Device -- **Inherit From:** DeviceGenericModuleType +- **Inherit From:** DcimGenericModuleType #### Relationships @@ -31,10 +31,7 @@ This schema extension allows you to capture Routing Engine related information l - **Description:** A Routing Engine (RE) installed in a device, responsible for routing functionalities. - **Namespace:** Device - **Icon:** mdi:cpu-64-bit -- **Uniqueness Constraints:** - - serial_number__value -- **Human Friendly ID:** device__name__value, slot__value -- **Inherit From:** DeviceGenericModule +- **Inherit From:** DcimGenericModule #### Attributes @@ -60,7 +57,7 @@ nodes: number and manufacturer. label: Routing Engine Type inherit_from: - - DeviceGenericModuleType + - DcimGenericModuleType relationships: - name: routing_engines peer: DeviceRoutingEngine @@ -74,16 +71,7 @@ nodes: label: Routing Engine icon: mdi:cpu-64-bit inherit_from: - - DeviceGenericModule - uniqueness_constraints: - - - serial_number__value - human_friendly_id: - - device__name__value - - slot__value - order_by: - - device__name__value - - slot__value - display_label: serial_number__value + - DcimGenericModule attributes: - name: slot kind: Number diff --git a/docs/docs/reference/optical_transport.mdx b/docs/docs/reference/optical_transport.mdx index ecfeabd9..e95b27fd 100644 --- a/docs/docs/reference/optical_transport.mdx +++ b/docs/docs/reference/optical_transport.mdx @@ -8,7 +8,7 @@ Comprehensive optical transport network schemas for DWDM/WDM systems (ADVA FSP 3 - **Dependencies:** - [base](dcim) - - [extensions/modules](modules) + - [extensions/device_module](device_module) - [extensions/cable](cable) ## Nodes @@ -236,7 +236,7 @@ Comprehensive optical transport network schemas for DWDM/WDM systems (ADVA FSP 3 - **Description:** Categorization of optical modules by function - **Namespace:** Dcim - **Icon:** mdi:expansion-card -- **Inherit From:** DeviceGenericModuleType +- **Inherit From:** DcimGenericModuleType #### Attributes @@ -255,13 +255,13 @@ Comprehensive optical transport network schemas for DWDM/WDM systems (ADVA FSP 3 - **Uniqueness Constraints:** - computed_name__value - **Human Friendly ID:** computed_name__value -- **Inherit From:** DeviceGenericModule +- **Inherit From:** DcimGenericModule #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| computed_name | Computed module name (e.g., ABC123-TPD-1/1) | Text | False | | | +| computed_name | Computed module name (e.g., dc1-leaf1 > slot 1-TPD-1/1) | Text | False | | | | slot_number | Slot number in chassis (e.g., '1/1', '1/2', '2/1') | Text | False | | | | capacity_gbps | Line rate capacity in Gbps (e.g., 100, 200, 400) | Number | False | | | | modulation_format | Modulation format for optical transmission | Dropdown | False | | dp_qpsk, dp_16qam, dp_8qam, dp_64qam | @@ -284,13 +284,13 @@ Comprehensive optical transport network schemas for DWDM/WDM systems (ADVA FSP 3 - **Namespace:** Dcim - **Icon:** mdi:router-network - **Human Friendly ID:** computed_name__value -- **Inherit From:** DeviceGenericModule +- **Inherit From:** DcimGenericModule #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| computed_name | Computed module name (e.g., ABC123-MUX-1/3) | Text | False | | | +| computed_name | Computed module name (e.g., dc1-leaf1 > slot 1-MUX-1/3) | Text | False | | | | slot_number | Slot number in chassis (e.g., '1/3', '1/4', '2/3') | Text | False | | | | mux_type | Type of multiplexer technology | Dropdown | False | | passive_mux, passive_demux, oadm, roadm, wss | | channel_capacity | Number of supported DWDM channels (e.g., 40, 80, 96) | Number | False | | | @@ -393,13 +393,13 @@ Comprehensive optical transport network schemas for DWDM/WDM systems (ADVA FSP 3 - **Namespace:** Dcim - **Icon:** mdi:amplifier - **Human Friendly ID:** computed_name__value -- **Inherit From:** DeviceGenericModule +- **Inherit From:** DcimGenericModule #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| computed_name | Computed module name (e.g., ABC123-AMP-1/5) | Text | False | | | +| computed_name | Computed module name (e.g., dc1-leaf1 > slot 1-AMP-1/5) | Text | False | | | | slot_number | Slot number in chassis (e.g., '1/5', '1/6', '2/5') | Text | False | | | | amplifier_type | Type of optical amplifier | Dropdown | False | | edfa, raman, soa, vgc, hybrid | | stage | Amplifier stage position | Dropdown | False | | booster, inline, preamplifier | @@ -562,7 +562,7 @@ generics: description: Generic base for any channel allocation/routing (fiber, cable, or internal cross-connect) label: Channel Mapping - include_in_menu: true + include_in_menu: false attributes: - name: is_active kind: Boolean @@ -601,7 +601,7 @@ generics: description: Generic interface for any device that can multiplex DWDM channels (active or passive) label: Optical Multiplexer Device - include_in_menu: true + include_in_menu: false uniqueness_constraints: - - computed_name__value attributes: @@ -1131,7 +1131,7 @@ nodes: description: Categorization of optical modules by function icon: mdi:expansion-card inherit_from: - - DeviceGenericModuleType + - DcimGenericModuleType attributes: - name: name kind: Text @@ -1182,7 +1182,7 @@ nodes: installed in chassis icon: mdi:chip inherit_from: - - DeviceGenericModule + - DcimGenericModule display_label: computed_name__value uniqueness_constraints: - - computed_name__value @@ -1195,8 +1195,9 @@ nodes: optional: false computed_attribute: kind: Jinja2 - jinja2_template: '{{ device__serial__value }}-TPD-{{ slot_number__value }}' - description: Computed module name (e.g., ABC123-TPD-1/1) + jinja2_template: '{{ module_bay__computed_name__value }}-TPD-{{ slot_number__value + }}' + description: Computed module name (e.g., dc1-leaf1 > slot 1-TPD-1/1) - name: slot_number kind: Text optional: false @@ -1295,7 +1296,7 @@ nodes: in chassis icon: mdi:router-network inherit_from: - - DeviceGenericModule + - DcimGenericModule display_label: computed_name__value human_friendly_id: - computed_name__value @@ -1306,8 +1307,9 @@ nodes: optional: false computed_attribute: kind: Jinja2 - jinja2_template: '{{ device__serial__value }}-MUX-{{ slot_number__value }}' - description: Computed module name (e.g., ABC123-MUX-1/3) + jinja2_template: '{{ module_bay__computed_name__value }}-MUX-{{ slot_number__value + }}' + description: Computed module name (e.g., dc1-leaf1 > slot 1-MUX-1/3) - name: slot_number kind: Text optional: false @@ -1585,7 +1587,7 @@ nodes: description: Optical signal amplifier module (EDFA, Raman, VGC) installed in chassis icon: mdi:amplifier inherit_from: - - DeviceGenericModule + - DcimGenericModule display_label: computed_name__value human_friendly_id: - computed_name__value @@ -1596,8 +1598,9 @@ nodes: optional: false computed_attribute: kind: Jinja2 - jinja2_template: '{{ device__serial__value }}-AMP-{{ slot_number__value }}' - description: Computed module name (e.g., ABC123-AMP-1/5) + jinja2_template: '{{ module_bay__computed_name__value }}-AMP-{{ slot_number__value + }}' + description: Computed module name (e.g., dc1-leaf1 > slot 1-AMP-1/5) - name: slot_number kind: Text optional: false diff --git a/docs/docs/reference/organization.mdx b/docs/docs/reference/organization.mdx index 4c61d2c3..3a8fe468 100644 --- a/docs/docs/reference/organization.mdx +++ b/docs/docs/reference/organization.mdx @@ -21,8 +21,8 @@ Basic Organization schema to capture organizations, vendors, and related informa | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| device_type | DcimDeviceType | True | many | | -| platform | DcimPlatform | True | many | | +| device_types | DcimDeviceType | True | many | Attribute | +| platforms | DcimPlatform | True | many | Attribute | ### Provider @@ -36,7 +36,7 @@ Basic Organization schema to capture organizations, vendors, and related informa ### Generic - **Label:** Organization -- **Description:** An organization represent a legal entity, a company. +- **Description:** An organization represents a legal entity, such as a company. - **Namespace:** Organization - **Icon:** mdi:domain - **Human Friendly ID:** name__value @@ -45,7 +45,7 @@ Basic Organization schema to capture organizations, vendors, and related informa | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | description | | Text | True | | | #### Relationships @@ -61,56 +61,63 @@ version: '1.0' generics: - name: Generic namespace: Organization + description: An organization represents a legal entity, such as a company. label: Organization - description: An organization represent a legal entity, a company. + icon: mdi:domain + include_in_menu: true human_friendly_id: - name__value order_by: - name__value display_label: name__value - icon: mdi:domain - include_in_menu: true attributes: - name: name kind: Text unique: true + optional: false order_weight: 1000 - name: description kind: Text optional: true - order_weight: 1200 + order_weight: 1100 relationships: - name: tags peer: BuiltinTag - cardinality: many kind: Attribute + cardinality: many optional: true - order_weight: 3000 + order_weight: 2000 nodes: - name: Manufacturer namespace: Organization description: Device Manufacturer icon: mdi:domain - inherit_from: - - OrganizationGeneric include_in_menu: true menu_placement: OrganizationGeneric + inherit_from: + - OrganizationGeneric relationships: - - name: device_type + - name: device_types peer: DcimDeviceType + kind: Attribute cardinality: many optional: true - - name: platform + identifier: manufacturer__device_type + order_weight: 1300 + - name: platforms peer: DcimPlatform + kind: Attribute cardinality: many optional: true + identifier: manufacturer__platform + order_weight: 1400 - name: Provider namespace: Organization description: Circuit or Location Provider icon: mdi:domain - inherit_from: - - OrganizationGeneric include_in_menu: true menu_placement: OrganizationGeneric + inherit_from: + - OrganizationGeneric ``` \ No newline at end of file diff --git a/docs/docs/reference/patch_panel.mdx b/docs/docs/reference/patch_panel.mdx index 563e4cec..f794338a 100644 --- a/docs/docs/reference/patch_panel.mdx +++ b/docs/docs/reference/patch_panel.mdx @@ -2,7 +2,7 @@ title: Patch Panel --- -This schema extension allows you to capture patch panel related information like rear/front interfaces and mapping between them. You can insert the patch panel into a rack and leverage the device type model. Finally you can also capture information about potential modules you would insert into your patch panel. +This schema extension allows you to capture patch panel related information like rear/front interfaces and mapping between them. You can insert the patch panel into a rack and leverage the device type model. Cassettes and other inserts are tracked as regular device modules in module bays, through extensions/device_module. NOTE: This extension is compatible with all sort of connectors, meaning you can plug cable, circuits, cross-connect to front & rear interfaces! @@ -10,6 +10,7 @@ NOTE: This extension is compatible with all sort of connectors, meaning you can - **Dependencies:** - [base](dcim) + - [extensions/device_module](device_module) ## Nodes @@ -26,7 +27,7 @@ NOTE: This extension is compatible with all sort of connectors, meaning you can | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | module_capacity | The maximum number of modules that can be housed within this patch panel. | Number | True | | | | description | | Text | True | | | @@ -36,11 +37,11 @@ NOTE: This extension is compatible with all sort of connectors, meaning you can | ---- | ---- | -------- | ----------- | ---- | | front_interfaces | DcimFrontPatchPanelInterface | True | many | Component | | rear_interfaces | DcimRearPatchPanelInterface | True | many | Component | -| patch_panel_modules | DcimPatchPanelModule | True | many | Component | ### FrontPatchPanelInterface - **Label:** Patch Panel Front Interfaces +- **Description:** Front interface of a patch panel, where equipment is patched in. - **Namespace:** Dcim - **Uniqueness Constraints:** - patch_panel, name__value @@ -57,6 +58,7 @@ NOTE: This extension is compatible with all sort of connectors, meaning you can ### RearPatchPanelInterface - **Label:** Patch Panel Rear Interfaces +- **Description:** Rear interface of a patch panel, terminating the permanent cabling. - **Namespace:** Dcim - **Uniqueness Constraints:** - patch_panel, name__value @@ -70,36 +72,12 @@ NOTE: This extension is compatible with all sort of connectors, meaning you can | corresponding_front_rear | DcimFrontPatchPanelInterface | True | many | Attribute | | patch_panel | DcimPatchPanel | False | one | Parent | -### PatchPanelModule - -- **Label:** Patch Panel Module -- **Namespace:** Dcim -- **Icon:** mdi:expansion-card -- **Uniqueness Constraints:** - - patch_panel, position__value -- **Human Friendly ID:** patch_panel__name__value, name__value - -#### Attributes - -| name | description | kind | optional | default_value | choices | -| ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | -| position | Position for the module inside the Patch Panel. | Number | | | | -| module_type | Type of module inserted into the patch panel. | Dropdown | True | | 3_mpo_24_fo_lc | -| serial | | Text | True | | | -| description | | Text | True | | | - -#### Relationships - -| name | peer | optional | cardinality | kind | -| ---- | ---- | -------- | ----------- | ---- | -| patch_panel | DcimPatchPanel | False | one | Parent | - ## Generics ### GenericPatchPanelInterface - **Label:** Patch Panel Interfaces +- **Description:** Generic interface of a patch panel, front or rear. - **Namespace:** Dcim - **Icon:** mdi:ethernet @@ -107,9 +85,9 @@ NOTE: This extension is compatible with all sort of connectors, meaning you can | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | description | | Text | True | | | -| connector_type | | Dropdown | | | FC, LC, LC_PC, LC_UPC, LC_APC, LSH, LSH_PC, LSH_UPC, LSH_APC, LX_5, LX_5_PC, LX_5_UPC, LX_5_APC, MPO, MTRJ, SC, SC_PC, SC_UPC, SC_APC, ST, CS, SN, SMA_905, SMA_906, URM_P2 | +| connector_type | | Dropdown | False | | fc, lc, lc_pc, lc_upc, lc_apc, lsh, lsh_pc, lsh_upc, lsh_apc, lx_5, lx_5_pc, lx_5_upc, lx_5_apc, mpo, mtrj, sc, sc_pc, sc_upc, sc_apc, st, cs, sn, sma_905, sma_906, urm_p2, urm_p4, urm_p8, splice | ## Code @@ -117,267 +95,233 @@ NOTE: This extension is compatible with all sort of connectors, meaning you can version: '1.0' generics: - name: GenericPatchPanelInterface - label: Patch Panel Interfaces - menu_placement: DcimPatchPanel namespace: Dcim + description: Generic interface of a patch panel, front or rear. + label: Patch Panel Interfaces icon: mdi:ethernet + include_in_menu: true + menu_placement: DcimPatchPanel attributes: - name: name kind: Text + optional: false order_weight: 1000 - name: description kind: Text optional: true - order_weight: 2000 + order_weight: 1100 - name: connector_type kind: Dropdown - order_weight: 1100 choices: - - name: FC + - name: fc label: FC description: Standardized fiber optic connector used primarily in datacom and telecom applications. - - name: LC + - name: lc label: LC description: Compact fiber optic connector with a push-pull mechanism. - - name: LC_PC + - name: lc_pc label: LC/PC description: Polished LC connector providing physical contact (PC). - - name: LC_UPC + - name: lc_upc label: LC/UPC description: Ultra-Physical Contact (UPC) variant of the LC connector with enhanced polish. - - name: LC_APC + - name: lc_apc label: LC/APC description: Angled Physical Contact (APC) version of the LC connector with a slanted fiber end-face. - - name: LSH + - name: lsh label: LSH description: European fiber optic connector offering high durability. - - name: LSH_PC + - name: lsh_pc label: LSH/PC description: Physical Contact version of LSH with standard polish. - - name: LSH_UPC + - name: lsh_upc label: LSH/UPC description: Ultra-Physical Contact variant of LSH, minimizing return loss with a superior polish. - - name: LSH_APC + - name: lsh_apc label: LSH/APC description: Angled Physical Contact version of LSH, designed to reduce back reflections. - - name: LX_5 + - name: lx_5 label: LX.5 description: Miniaturized fiber optic connector similar to LC but with an additional shutter mechanism. - - name: LX_5_PC + - name: lx_5_pc label: LX.5/PC description: Physical Contact version of LX.5. - - name: LX_5_UPC + - name: lx_5_upc label: LX.5/UPC description: Ultra-Physical Contact variant of LX.5. - - name: LX_5_APC + - name: lx_5_apc label: LX.5/APC description: Angled Physical Contact version of LX.5. - - name: MPO + - name: mpo label: MPO description: Multi-fiber Push-On connector typically used in data centers for high-speed applications. - - name: MTRJ + - name: mtrj label: MTRJ description: Male-to-female fiber optic connector with two fibers. - - name: SC + - name: sc label: SC description: Square fiber optic connector with push-pull lock. - - name: SC_PC + - name: sc_pc label: SC/PC description: Physical Contact SC connector with a polished end-face. - - name: SC_UPC + - name: sc_upc label: SC/UPC description: Ultra-Physical Contact variant of SC. - - name: SC_APC + - name: sc_apc label: SC/APC description: Angled Physical Contact version of SC. - - name: ST + - name: st label: ST description: Bayonet-style fiber optic connector primarily used in industrial and military applications. - - name: CS + - name: cs label: CS description: Compact connector with a high-density duplex configuration. - - name: SN + - name: sn label: SN description: Small-form connector with dual fibers. - - name: SMA_905 + - name: sma_905 label: SMA 905 description: Stainless steel fiber optic connector. - - name: SMA_906 + - name: sma_906 label: SMA 906 description: Variant of SMA 905 with similar durability, frequently used in high-vibration settings. - - name: URM_P2 + - name: urm_p2 label: URM-P2 description: Specialized fiber optic connector for industrial and harsh environments. + - name: urm_p4 + label: URM-P4 + description: Similar to URM-P2 but designed for higher performance. + - name: urm_p8 + label: URM-P8 + description: Enhanced version of URM connectors with higher protection. + - name: splice + label: Splice + description: Permanent fiber connection method where two fiber ends are fused. + optional: false + order_weight: 1200 nodes: - name: PatchPanel - label: Patch Panel + namespace: Dcim description: A Patch Panel used for managing network cable connections in a data center or telecom setup. + label: Patch Panel icon: ic:round-device-hub - namespace: Dcim + include_in_menu: true + inherit_from: + - DcimPhysicalDevice human_friendly_id: - name__value order_by: - name__value display_label: name__value - inherit_from: - - DcimPhysicalDevice attributes: - name: name kind: Text unique: true + optional: false order_weight: 1000 - name: module_capacity - label: Module Capacity kind: Number + label: Module Capacity optional: true description: The maximum number of modules that can be housed within this patch panel. + order_weight: 1300 - name: description kind: Text optional: true - order_weight: 2000 + order_weight: 1100 relationships: - name: front_interfaces peer: DcimFrontPatchPanelInterface - identifier: front_interfaces - optional: true - cardinality: many kind: Component + cardinality: many + optional: true + identifier: patch_panel__front_interfaces + order_weight: 1350 - name: rear_interfaces peer: DcimRearPatchPanelInterface - identifier: rear_interfaces - optional: true - cardinality: many kind: Component - - name: patch_panel_modules - label: Modules - peer: DcimPatchPanelModule - optional: true cardinality: many - kind: Component + optional: true + identifier: patch_panel__rear_interfaces + order_weight: 1450 - name: FrontPatchPanelInterface + namespace: Dcim + description: Front interface of a patch panel, where equipment is patched in. label: Patch Panel Front Interfaces + include_in_menu: true menu_placement: DcimGenericPatchPanelInterface - namespace: Dcim + inherit_from: + - DcimEndpoint + - DcimGenericPatchPanelInterface human_friendly_id: - patch_panel__name__value - name__value - display_label: '{{ patch_panel__name__value }} > {{ name__value }}' order_by: - corresponding_front_rear__name__value - name__value + display_label: '{{ patch_panel__name__value }} > {{ name__value }}' uniqueness_constraints: - - patch_panel - name__value - inherit_from: - - DcimEndpoint - - DcimGenericPatchPanelInterface relationships: - name: corresponding_front_rear - label: Corresponding rear interface peer: DcimRearPatchPanelInterface - order_weight: 1200 - optional: true - cardinality: one + label: Corresponding rear interface kind: Attribute + cardinality: one + optional: true + order_weight: 1300 - name: patch_panel peer: DcimPatchPanel - order_weight: 900 - identifier: front_interfaces - optional: false - cardinality: one kind: Parent + cardinality: one + optional: false + identifier: patch_panel__front_interfaces + order_weight: 900 - name: RearPatchPanelInterface + namespace: Dcim + description: Rear interface of a patch panel, terminating the permanent cabling. label: Patch Panel Rear Interfaces + include_in_menu: true menu_placement: DcimGenericPatchPanelInterface - namespace: Dcim + inherit_from: + - DcimEndpoint + - DcimGenericPatchPanelInterface human_friendly_id: - patch_panel__name__value - name__value - display_label: '{{ patch_panel__name__value }} > {{ name__value }}' order_by: - patch_panel__name__value - name__value + display_label: '{{ patch_panel__name__value }} > {{ name__value }}' uniqueness_constraints: - - patch_panel - name__value - inherit_from: - - DcimEndpoint - - DcimGenericPatchPanelInterface relationships: - name: corresponding_front_rear - label: Corresponding front interfaces peer: DcimFrontPatchPanelInterface - order_weight: 1200 - optional: true - cardinality: many + label: Corresponding front interfaces kind: Attribute - - name: patch_panel - peer: DcimPatchPanel - order_weight: 900 - identifier: rear_interfaces - optional: false - cardinality: one - kind: Parent -- name: PatchPanelModule - namespace: Dcim - label: Patch Panel Module - menu_placement: DcimPatchPanel - icon: mdi:expansion-card - human_friendly_id: - - patch_panel__name__value - - name__value - display_label: '{{ patch_panel__name__value }} > {{ name__value }}' - order_by: - - patch_panel__name__value - - position__value - uniqueness_constraints: - - - patch_panel - - position__value - attributes: - - name: name - kind: Text - order_weight: 1000 - - name: position - kind: Number - description: Position for the module inside the Patch Panel. - order_weight: 1100 - - name: module_type - label: Module Type - kind: Dropdown - description: Type of module inserted into the patch panel. - order_weight: 1200 - optional: true - choices: - - name: 3_mpo_24_fo_lc - label: 24 FO LC 3 MPO - description: High-density MPO cassette with 24 fibers to front and 3 MPO to - rear. - color: '#7f7fff' - - name: serial - kind: Text - optional: true - order_weight: 1500 - - name: description - kind: Text + cardinality: many optional: true - order_weight: 2000 - relationships: + order_weight: 1300 - name: patch_panel peer: DcimPatchPanel + kind: Parent + cardinality: one optional: false + identifier: patch_panel__rear_interfaces order_weight: 900 - cardinality: one - kind: Parent ``` \ No newline at end of file diff --git a/docs/docs/reference/peering_ixp.mdx b/docs/docs/reference/peering_ixp.mdx index debf679e..8151f6dc 100644 --- a/docs/docs/reference/peering_ixp.mdx +++ b/docs/docs/reference/peering_ixp.mdx @@ -8,9 +8,9 @@ This schema extension contains all you need to model anything revolving around i - **Dependencies:** - [base](dcim) - - [extensions/routing](routing) - [extensions/routing_bgp](routing_bgp) - [extensions/routing_bgp_community](routing_bgp_community) + - [extensions/routing_policies_bgp](routing_policies_bgp) ## Nodes @@ -26,9 +26,9 @@ This schema extension contains all you need to model anything revolving around i | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | Name of the Internet Exchange | Text | | | | +| name | Name of the Internet Exchange | Text | False | | | | description | An optional description of the Internet Exchange | Text | True | | | -| status | | Dropdown | | enabled | enabled, disabled | +| status | | Dropdown | False | enabled | enabled, disabled | #### Relationships @@ -55,10 +55,10 @@ This schema extension contains all you need to model anything revolving around i | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | Name of the IXP Connection | Text | | | | +| name | Name of the IXP Connection | Text | False | | | | description | Description of the IXP Connection | Text | True | | | | peeringdb_netixlan | PeeringDB ID for the IXP connection | Number | True | | | -| status | | Dropdown | True | enabled | enabled, pre-maintenance, maintenance, post-maintenance, disabled | +| status | | Dropdown | True | enabled | enabled, pre_maintenance, maintenance, post_maintenance, disabled | | vlan | VLAN ID for the connection | Number | True | | | | mac_address | MAC address associated with the connection | MacAddress | True | | | @@ -66,11 +66,28 @@ This schema extension contains all you need to model anything revolving around i | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| ipv6_address | IpamIPAddress | | one | Attribute | -| ipv4_address | IpamIPAddress | | one | Attribute | +| ipv6_address | IpamIPAddress | True | one | Attribute | +| ipv4_address | IpamIPAddress | True | one | Attribute | | internet_exchange_point | PeeringIXP | False | one | Parent | -| router | DcimDevice | | one | Attribute | -| tags | BuiltinTag | | many | Attribute | +| router | DcimDevice | True | one | Attribute | +| bgp_sessions | RoutingBGPSession | True | many | Component | +| tags | BuiltinTag | True | many | Attribute | + +## Extensions + +:::note + +In this context "extensions" refer to modifications or additions to the existing schema, such as adding new attributes, relationships, or other schema elements. + +::: + +### RoutingBGPSession + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| ixp_connection | PeeringIXPConnection | True | one | Attribute | ## Code @@ -82,6 +99,7 @@ nodes: description: An Internet Exchange Point (IXP) for peering label: Internet Exchange icon: mdi:network + include_in_menu: true human_friendly_id: - name__value order_by: @@ -91,85 +109,95 @@ nodes: - name: name kind: Text unique: true + optional: false description: Name of the Internet Exchange order_weight: 1000 - name: description kind: Text - description: An optional description of the Internet Exchange optional: true + description: An optional description of the Internet Exchange order_weight: 1100 - name: status kind: Dropdown + default_value: enabled choices: - name: enabled label: Enabled description: Internet Exchange is active and operational - color: '#a8dadc' + color: '#00d25b' - name: disabled label: Disabled description: Internet Exchange is not operational color: '#b0bec5' - default_value: enabled + optional: false order_weight: 1200 relationships: - name: connections peer: PeeringIXPConnection - optional: true - cardinality: many kind: Component + cardinality: many + optional: true description: IXP connections associated with this Internet Exchange + order_weight: 1500 - name: local_as peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true order_weight: 1300 - name: import_policies - label: Import Routing Policies peer: RoutingPolicyBGP - identifier: ixp__import_bgppolicies - optional: true - cardinality: many + label: Import Routing Policies kind: Generic - description: Import routing policies applied to the session + cardinality: many + optional: true + identifier: ixp__import_bgppolicies + description: Import routing policies applied to every session on this internet + exchange point + order_weight: 1600 - name: export_policies - label: Export Routing Policies peer: RoutingPolicyBGP - identifier: ixp__export_bgppolicies - optional: true - cardinality: many + label: Export Routing Policies kind: Generic - description: Export routing policies applied to the session + cardinality: many + optional: true + identifier: ixp__export_bgppolicies + description: Export routing policies applied to every session on this internet + exchange point + order_weight: 1650 - name: bgp_communities - label: BGP Communities peer: RoutingBGPCommunity - optional: true - cardinality: many + label: BGP Communities kind: Generic - description: BGP communities associated with the session + cardinality: many + optional: true + description: BGP communities associated with this internet exchange point + order_weight: 1700 - name: tags peer: BuiltinTag - optional: true - cardinality: many kind: Attribute - order_weight: 3000 + cardinality: many + optional: true + order_weight: 2000 - name: IXPConnection namespace: Peering description: A connection to an Internet Exchange Point (IXP) label: IXP Connection icon: mdi:lan-connect + include_in_menu: true menu_placement: PeeringIXP - uniqueness_constraints: - - - name__value human_friendly_id: - name__value order_by: - name__value display_label: name__value + uniqueness_constraints: + - - name__value attributes: - name: name kind: Text unique: true + optional: false description: Name of the IXP Connection order_weight: 1000 - name: description @@ -178,20 +206,20 @@ nodes: description: Description of the IXP Connection order_weight: 1100 - name: peeringdb_netixlan - label: PeeringDB Netixlan kind: Number + label: PeeringDB Netixlan optional: true description: PeeringDB ID for the IXP connection order_weight: 1150 - name: status kind: Dropdown - optional: true + default_value: enabled choices: - name: enabled label: Enabled description: The system is fully operational and functioning as expected. - color: '#a8dadc' - - name: pre-maintenance + color: '#00d25b' + - name: pre_maintenance label: Pre-Maintenance description: Preparation stage before performing maintenance tasks. color: '#f4a261' @@ -199,7 +227,7 @@ nodes: label: Maintenance description: Currently undergoing maintenance tasks. color: '#e9c46a' - - name: post-maintenance + - name: post_maintenance label: Post-Maintenance description: Final checks and verifications after maintenance tasks. color: '#f0e5de' @@ -207,12 +235,12 @@ nodes: label: Disabled description: The system is not operational and cannot be used. color: '#b0bec5' - default_value: enabled + optional: true order_weight: 1200 - name: vlan kind: Number - description: VLAN ID for the connection optional: true + description: VLAN ID for the connection order_weight: 1300 - name: mac_address kind: MacAddress @@ -222,38 +250,66 @@ nodes: order_weight: 1350 relationships: - name: ipv6_address - label: IPv6 Address - description: IPv6 address assigned to the connection peer: IpamIPAddress - identifier: ixpconn__ipv6_address - cardinality: one + label: IPv6 Address kind: Attribute + cardinality: one + identifier: ixpconn__ipv6_address + optional: true + description: IPv6 address assigned to the connection order_weight: 1400 - name: ipv4_address - label: IPv4 Address - description: IPv4 address assigned to the connection peer: IpamIPAddress - identifier: ixpconn__ipv4_address - cardinality: one + label: IPv4 Address kind: Attribute + cardinality: one + identifier: ixpconn__ipv4_address + optional: true + description: IPv4 address assigned to the connection order_weight: 1375 - name: internet_exchange_point - label: IXP peer: PeeringIXP - optional: false - cardinality: one + label: IXP kind: Parent + cardinality: one + optional: false description: The Internet Exchange Point this connection is part of + order_weight: 900 - name: router peer: DcimDevice - cardinality: one kind: Attribute + cardinality: one + optional: true description: The router this IXP connection is connected to - order_weight: 1400 + order_weight: 1500 + - name: bgp_sessions + peer: RoutingBGPSession + label: BGP Sessions + kind: Component + cardinality: many + optional: true + on_delete: no-action + identifier: ixpconn__bgpsessions + description: BGP sessions established over this IXP connection + order_weight: 1550 - name: tags peer: BuiltinTag - cardinality: many kind: Attribute - order_weight: 3000 + cardinality: many + optional: true + order_weight: 2000 +extensions: + nodes: + - kind: RoutingBGPSession + relationships: + - name: ixp_connection + peer: PeeringIXPConnection + label: IXP Connection + kind: Attribute + cardinality: one + optional: true + identifier: ixpconn__bgpsessions + description: The IXP connection this BGP session is established over + order_weight: 1800 ``` \ No newline at end of file diff --git a/docs/docs/reference/physical_disk.mdx b/docs/docs/reference/physical_disk.mdx index bab45609..e2bcad3f 100644 --- a/docs/docs/reference/physical_disk.mdx +++ b/docs/docs/reference/physical_disk.mdx @@ -21,7 +21,7 @@ NOTE: This extension is compatible with all sort of device. You can apply the ge - **Icon:** carbon:vmdk-disk - **Uniqueness Constraints:** - device, name__value -- **Human Friendly ID:** name__value +- **Human Friendly ID:** device__name__value, name__value #### Attributes @@ -29,7 +29,7 @@ NOTE: This extension is compatible with all sort of device. You can apply the ge | ---- | ----------- | ---- | -------- | ------------- | ------- | | name | | Text | False | | | | disk_type | Specifies the type of disk | Dropdown | True | | ssd, nvme, hdd, hybrid | -| status | Lifecycle status of the hardware component. | Dropdown | | | in_inventory, active, decommissioned, disposed | +| status | Lifecycle status of the hardware component. | Dropdown | False | | in_inventory, active, decommissioned, disposed | | size | Disk capacity (in GB). | Number | False | | | | serial_number | Serial number of the disk | Text | True | | | | description | | Text | True | | | @@ -47,6 +47,12 @@ NOTE: This extension is compatible with all sort of device. You can apply the ge - **Description:** Generic that hold relationship toward physical disks. To apply on device that can have physical disks. - **Namespace:** Dcim +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| name | | Text | False | | | + #### Relationships | name | peer | optional | cardinality | kind | @@ -63,23 +69,33 @@ generics: description: Generic that hold relationship toward physical disks. To apply on device that can have physical disks. include_in_menu: false + attributes: + - name: name + kind: Text + unique: true + allow_override: any + optional: false + order_weight: 1000 relationships: - name: physical_disks - cardinality: many peer: DcimPhysicalDisk - optional: true kind: Component + cardinality: many + optional: true + order_weight: 1950 nodes: - name: PhysicalDisk namespace: Dcim description: Physical Disk label: Physical Disk icon: carbon:vmdk-disk + include_in_menu: true + human_friendly_id: + - device__name__value + - name__value order_by: - name__value display_label: name__value - human_friendly_id: - - name__value uniqueness_constraints: - - device - name__value @@ -87,12 +103,9 @@ nodes: - name: name kind: Text optional: false - order_weight: 900 + order_weight: 1000 - name: disk_type kind: Dropdown - description: Specifies the type of disk - order_weight: 950 - optional: true choices: - name: ssd label: SSD @@ -110,9 +123,11 @@ nodes: label: Hybrid description: Hybrid Drive color: '#ffcc80' + optional: true + description: Specifies the type of disk + order_weight: 1300 - name: status kind: Dropdown - description: Lifecycle status of the hardware component. choices: - name: in_inventory label: In Inventory @@ -121,7 +136,7 @@ nodes: - name: active label: Active description: The disk is currently in use within the infrastructure. - color: '#28a745' + color: '#00d25b' - name: decommissioned label: Decommissioned description: The disk is retired from active use but still stored for potential @@ -131,29 +146,32 @@ nodes: label: Disposed description: The disk has been securely erased and disposed of. color: '#dc3545' + optional: false + description: Lifecycle status of the hardware component. + order_weight: 1200 - name: size - label: Size (GB) kind: Number + label: Size (GB) optional: false - order_weight: 1000 description: Disk capacity (in GB). + order_weight: 1400 - name: serial_number kind: Text - description: Serial number of the disk unique: true - order_weight: 1100 optional: true + description: Serial number of the disk + order_weight: 1450 - name: description kind: Text unique: false optional: true - order_weight: 1500 + order_weight: 1100 relationships: - name: device peer: DcimDeviceWithPhysicalDisks - optional: false - cardinality: one kind: Parent - order_weight: 800 + cardinality: one + optional: false + order_weight: 900 ``` \ No newline at end of file diff --git a/docs/docs/reference/qinq.mdx b/docs/docs/reference/qinq.mdx index 439a46ac..9d951acb 100644 --- a/docs/docs/reference/qinq.mdx +++ b/docs/docs/reference/qinq.mdx @@ -2,7 +2,7 @@ title: QinQ --- -This schema extension brings extensions to VLAN model in order to support QinQ. +This schema extension adds the Service VLAN and Customer VLAN nodes needed to model QinQ on top of the VLAN extension. ## Details @@ -10,63 +10,102 @@ This schema extension brings extensions to VLAN model in order to support QinQ. - [base](dcim) - [extensions/vlan](vlan) -## Extensions +## Nodes -:::note +### SVLAN -In this context "extensions" refer to modifications or additions to the existing schema, such as adding new attributes, relationships, or other schema elements. +- **Label:** S-VLAN +- **Description:** A VLAN used to encapsulate multiple CVLANs. +- **Namespace:** Ipam +- **Uniqueness Constraints:** + - vlan_id__value, vlan_group +- **Inherit From:** IpamGenericVLAN -::: +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| cvlan | IpamCVLAN | True | many | Attribute | + +### CVLAN -### IpamVLAN +- **Label:** C-VLAN +- **Description:** A VLAN assigned to customer traffic, encapsulated within an S-VLAN. +- **Namespace:** Ipam +- **Uniqueness Constraints:** + - vlan_id__value, svlan +- **Human Friendly ID:** svlan__name__value, vlan_id__value +- **Inherit From:** IpamGenericVLAN #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| qinq_role | | Dropdown | True | | suplier, customer | +| name | | Text | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| svlan | IpamVLAN | True | one | Attribute | -| cvlan | IpamVLAN | True | many | Attribute | +| svlan | IpamSVLAN | False | one | Attribute | ## Code ```yaml version: '1.0' -extensions: - nodes: - - kind: IpamVLAN - attributes: - - name: qinq_role - kind: Dropdown - optional: true - choices: - - name: suplier - label: Suplier - description: A VLAN used to encapsulate multiple CVLANs. - - name: customer - label: Customer - description: A VLAN assigned to customer traffic. - relationships: - - name: svlan - label: Supplier vlan - peer: IpamVLAN - optional: true - direction: inbound - identifier: vlan__qinq - cardinality: one - kind: Attribute - - name: cvlan - label: Customer vlan(s) - peer: IpamVLAN - optional: true - direction: outbound - identifier: vlan__qinq - cardinality: many - kind: Attribute +nodes: +- name: SVLAN + namespace: Ipam + description: A VLAN used to encapsulate multiple CVLANs. + label: S-VLAN + include_in_menu: false + inherit_from: + - IpamGenericVLAN + uniqueness_constraints: + - - vlan_id__value + - vlan_group + relationships: + - name: cvlan + peer: IpamCVLAN + label: Customer vlan(s) + kind: Attribute + cardinality: many + optional: true + identifier: vlan__qinq + direction: outbound + order_weight: 1600 +- name: CVLAN + namespace: Ipam + description: A VLAN assigned to customer traffic, encapsulated within an S-VLAN. + label: C-VLAN + include_in_menu: false + inherit_from: + - IpamGenericVLAN + human_friendly_id: + - svlan__name__value + - vlan_id__value + display_label: '{{ svlan__name__value }}-{{ vlan_id__value }}' + uniqueness_constraints: + - - vlan_id__value + - svlan + attributes: + - name: name + kind: Text + read_only: true + computed_attribute: + kind: Jinja2 + jinja2_template: '{{ svlan__name__value }}-{{ vlan_id__value }}' + optional: true + order_weight: 1000 + relationships: + - name: svlan + peer: IpamSVLAN + label: Supplier vlan + kind: Attribute + cardinality: one + optional: false + identifier: vlan__qinq + direction: inbound + order_weight: 1600 ``` \ No newline at end of file diff --git a/docs/docs/reference/rack.mdx b/docs/docs/reference/rack.mdx new file mode 100644 index 00000000..2f94c1b3 --- /dev/null +++ b/docs/docs/reference/rack.mdx @@ -0,0 +1,163 @@ +--- +title: Rack +--- + +This schema extension introduces a Rack model representing a physical equipment rack installed at a site. Racks can be placed at a LocationSite and can host devices and other equipment. LocationRack needs a Location.Site: extensions/location_site is declared above as the smallest provider, but extensions/location_minimal provides the same node as part of its hierarchy and satisfies the rack equally, load whichever suits, never both. LocationRack is also defined, hierarchically and incompatibly, by experimental/location_extended, so load one or the other, not both. + +## Details + +- **Dependencies:** + - [base](dcim) + - [extensions/location_site](location_site) + +## Nodes + +### Rack + +- **Label:** Rack +- **Description:** A physical equipment rack installed at a site. +- **Namespace:** Location +- **Icon:** clarity:rack-server-line +- **Uniqueness Constraints:** + - site, name__value +- **Human Friendly ID:** site__name__value, name__value +- **Inherit From:** LocationHosting + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| name | | Text | False | | | +| facility | | Text | True | | | +| status | | Dropdown | False | active | active, available, reserved, planned, decommissioning, deprecated | +| height | | Number | False | 42 | | +| serial_number | | Text | True | | | +| asset_tag | | Text | True | | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| site | LocationSite | False | one | Parent | +| tags | BuiltinTag | True | many | Attribute | + +## Extensions + +:::note + +In this context "extensions" refer to modifications or additions to the existing schema, such as adding new attributes, relationships, or other schema elements. + +::: + +### LocationSite + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| racks | LocationRack | True | many | Component | + +## Code + +```yaml +version: '1.0' +nodes: +- name: Rack + namespace: Location + description: A physical equipment rack installed at a site. + label: Rack + icon: clarity:rack-server-line + include_in_menu: true + menu_placement: LocationGeneric + inherit_from: + - LocationHosting + human_friendly_id: + - site__name__value + - name__value + order_by: + - name__value + display_label: name__value + uniqueness_constraints: + - - site + - name__value + attributes: + - name: name + kind: Text + unique: false + optional: false + order_weight: 1000 + - name: facility + kind: Text + optional: true + order_weight: 1150 + - name: status + kind: Dropdown + default_value: active + choices: + - name: active + label: Active + description: Rack is installed and in use. + color: '#00d25b' + - name: available + label: Available + description: Rack is installed and has capacity for new equipment. + color: '#00bcd4' + - name: reserved + label: Reserved + description: Rack is allocated but not yet in use. + color: '#4d90fe' + - name: planned + label: Planned + description: Rack is planned but not yet installed. + color: '#2196f3' + - name: decommissioning + label: Decommissioning + description: Rack is being phased out and emptied. + color: '#ff9800' + - name: deprecated + label: Deprecated + description: Rack has been removed from service. + color: '#6c757d' + optional: false + order_weight: 1200 + - name: height + kind: Number + label: Height (U) + default_value: 42 + optional: false + order_weight: 1300 + - name: serial_number + kind: Text + optional: true + order_weight: 1350 + - name: asset_tag + kind: Text + optional: true + order_weight: 1400 + relationships: + - name: site + peer: LocationSite + kind: Parent + cardinality: one + optional: false + identifier: site__racks + order_weight: 900 + - name: tags + peer: BuiltinTag + kind: Attribute + cardinality: many + optional: true + order_weight: 2000 +extensions: + nodes: + - kind: LocationSite + relationships: + - name: racks + peer: LocationRack + kind: Component + cardinality: many + optional: true + identifier: site__racks + order_weight: 1850 + +``` \ No newline at end of file diff --git a/docs/docs/reference/routing.mdx b/docs/docs/reference/routing.mdx index cd51945c..0e8f8c08 100644 --- a/docs/docs/reference/routing.mdx +++ b/docs/docs/reference/routing.mdx @@ -8,13 +8,13 @@ This schema extension contains generics to create Routing Protocol "Instance". T - **Dependencies:** - [base](dcim) - - [extensions/vlan](vlan) + - [extensions/vrf](vrf) ## Generics ### Protocol -- **Label:** Protocol +- **Label:** Routing Protocol - **Description:** Generic protocol model for routing protocols - **Namespace:** Routing - **Icon:** carbon:router @@ -24,7 +24,7 @@ This schema extension contains generics to create Routing Protocol "Instance". T | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | | description | Description of the protocol | Text | False | | | -| status | Status of the Protocol Configuration. | Dropdown | | | active, disabled, deleted | +| status | Status of the Protocol Configuration. | Dropdown | False | | active, disabled, deleted | #### Relationships @@ -41,14 +41,14 @@ generics: - name: Protocol namespace: Routing description: Generic protocol model for routing protocols - label: Protocol + label: Routing Protocol icon: carbon:router - include_in_menu: false + include_in_menu: true attributes: - name: description kind: Text - optional: false unique: true + optional: false description: Description of the protocol order_weight: 1100 - name: status @@ -57,7 +57,7 @@ generics: - name: active label: Active description: Configuration is active and operational. - color: '#A9CCE3' + color: '#00d25b' - name: disabled label: Disabled description: Configuration has been disabled. @@ -66,21 +66,22 @@ generics: label: Deleted description: Configuration has been deleted. color: '#FAD7A0' + optional: false description: Status of the Protocol Configuration. - order_weight: 1150 + order_weight: 1200 relationships: - name: device peer: DcimDevice - optional: false - cardinality: one kind: Parent - order_weight: 1050 + cardinality: one + optional: false + order_weight: 900 - name: vrf - label: VRF peer: IpamVRF - optional: false - cardinality: one + label: VRF kind: Attribute - order_weight: 1075 + cardinality: one + optional: false + order_weight: 1050 ``` \ No newline at end of file diff --git a/docs/docs/reference/routing_aggregate.mdx b/docs/docs/reference/routing_aggregate.mdx index d3acd23c..780cef8c 100644 --- a/docs/docs/reference/routing_aggregate.mdx +++ b/docs/docs/reference/routing_aggregate.mdx @@ -32,7 +32,7 @@ This schema extension contains all you need to model the Aggregate Routing Proto | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| destination | IpamPrefix | | | Attribute | +| destination | IpamPrefix | True | | Attribute | ## Code @@ -43,30 +43,32 @@ nodes: namespace: Routing description: Aggregate Protocol with action and BGP communities label: Aggregate Routes - include_in_menu: false icon: grommet-icons:aggregate + include_in_menu: true + menu_placement: RoutingProtocol inherit_from: - RoutingProtocol attributes: - name: discard - label: Discard kind: Boolean - optional: true + label: Discard default_value: false - order_weight: 1275 + optional: true + order_weight: 1350 - name: import_policies kind: Text optional: true - order_weight: 1300 + order_weight: 1400 - name: export_policies kind: Text optional: true - order_weight: 1350 + order_weight: 1450 relationships: - name: destination - kind: Attribute peer: IpamPrefix - description: Destination network for the static route. - order_weight: 1200 + kind: Attribute + optional: true + description: Destination network aggregated by this route. + order_weight: 1300 ``` \ No newline at end of file diff --git a/docs/docs/reference/routing_bgp.mdx b/docs/docs/reference/routing_bgp.mdx index 1a955660..d16ac0ad 100644 --- a/docs/docs/reference/routing_bgp.mdx +++ b/docs/docs/reference/routing_bgp.mdx @@ -24,8 +24,8 @@ This schema extension contains all you need to model your BGP platform. | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | Name of the Autonomous System | Text | | | | -| asn | Autonomous System Number | Number | | | | +| name | Name of the Autonomous System | Text | False | | | +| asn | Autonomous System Number | Number | False | | | | description | Description of the Autonomous System | Text | True | | | #### Relationships @@ -55,7 +55,7 @@ This schema extension contains all you need to model your BGP platform. | maximum_routes | Maximum routes for the BGP Group. | Number | True | | | | local_pref | Force Local Pref for this BGP Peer Group. | Number | True | | | | send_community | Whether to send community attributes. | Checkbox | True | | | -| address_family | The address family for the routing policy indicating the type of IP address. | Dropdown | | ipv4 | ipv4, ipv6 | +| address_family | The address family for the routing policy indicating the type of IP address. | Dropdown | False | ipv4 | ipv4, ipv6 | #### Relationships @@ -78,8 +78,8 @@ This schema extension contains all you need to model your BGP platform. | ---- | ----------- | ---- | -------- | ------------- | ------- | | import_policies | | Text | True | | | | export_policies | | Text | True | | | -| session_type | Type of BGP Session | Text | | | | -| role | Role of the BGP Session | Dropdown | | | backbone, upstream, peering | +| session_type | Type of BGP Session | Dropdown | False | | external, internal | +| role | Role of the BGP Session | Dropdown | True | | backbone, upstream, peering | | local_pref | Force Local Pref for this BGP Peer Session. | Number | True | | | #### Relationships @@ -90,7 +90,7 @@ This schema extension contains all you need to model your BGP platform. | remote_as | RoutingAutonomousSystem | True | one | Attribute | | local_ip | IpamIPAddress | True | one | Attribute | | remote_ip | IpamIPAddress | True | one | Attribute | -| device | DcimDevice | True | one | | +| device | DcimDevice | True | one | Generic | | peer_group | RoutingBGPPeerGroup | True | one | Attribute | | peer_session | RoutingBGPSession | True | one | Attribute | @@ -116,7 +116,7 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| asn | RoutingAutonomousSystem | True | many | | +| asn | RoutingAutonomousSystem | True | many | Generic | ## Code @@ -129,6 +129,7 @@ nodes: belonging to a network label: Autonomous System icon: mdi:bank-circle-outline + include_in_menu: true menu_placement: RoutingBGPSession human_friendly_id: - asn__value @@ -140,14 +141,16 @@ nodes: attributes: - name: name kind: Text + unique: true + optional: false description: Name of the Autonomous System order_weight: 1000 - unique: true - name: asn kind: Number + unique: true + optional: false description: Autonomous System Number order_weight: 1050 - unique: true - name: description kind: Text optional: true @@ -156,25 +159,29 @@ nodes: relationships: - name: organization peer: OrganizationGeneric - optional: false - cardinality: one kind: Attribute + cardinality: one + optional: false + order_weight: 1200 - name: location peer: LocationGeneric - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + order_weight: 1300 - name: devices peer: DcimDevice - optional: true - cardinality: many kind: Attribute + cardinality: many + optional: true + order_weight: 1400 - name: BGPPeerGroup namespace: Routing 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 + include_in_menu: true menu_placement: RoutingBGPSession inherit_from: - RoutingProtocol @@ -187,8 +194,8 @@ nodes: attributes: - name: name kind: Text - optional: false unique: true + optional: false description: Name of the BGP Group order_weight: 1000 - name: import_policies @@ -201,25 +208,26 @@ nodes: order_weight: 1350 - name: maximum_routes kind: Number + parameters: + min_value: 0 optional: true description: Maximum routes for the BGP Group. order_weight: 1400 - regex: ^[0-9]+$ - name: local_pref kind: Number + parameters: + min_value: 0 optional: true description: Force Local Pref for this BGP Peer Group. order_weight: 1450 - regex: ^[0-9]+$ - name: send_community kind: Checkbox optional: true description: Whether to send community attributes. order_weight: 1500 - name: address_family - description: The address family for the routing policy indicating the type of - IP address. kind: Dropdown + default_value: ipv4 choices: - name: ipv4 label: IPv4 @@ -229,26 +237,31 @@ nodes: label: IPv6 description: Policy applies to IPv6 addresses. color: '#E6E6FA' - default_value: ipv4 - order_weight: 1150 + optional: false + description: The address family for the routing policy indicating the type of + IP address. + order_weight: 1250 relationships: - name: local_as - identifier: bgppeergroup__local_as peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgppeergroup__local_as + order_weight: 1550 - name: remote_as - identifier: bgppeergroup__remote_as peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgppeergroup__remote_as + order_weight: 1600 - name: BGPSession namespace: Routing description: A BGP Session represent a point to point connection between two routers label: BGP Session icon: mdi:router + include_in_menu: true inherit_from: - RoutingProtocol order_by: @@ -258,16 +271,23 @@ nodes: - name: import_policies kind: Text optional: true + order_weight: 1700 - name: export_policies kind: Text optional: true + order_weight: 1750 - name: session_type - kind: Text - enum: - - EXTERNAL - - INTERNAL + kind: Dropdown + choices: + - name: external + label: External + description: Session established with a router in a different autonomous system. + - name: internal + label: Internal + description: Session established with a router in the same autonomous system. + optional: false description: Type of BGP Session - order_weight: 1200 + order_weight: 1250 - name: role kind: Dropdown choices: @@ -283,70 +303,81 @@ nodes: label: Peering description: Connect with other networks via IX. color: '#E6E6FA' + optional: true description: Role of the BGP Session - order_weight: 1600 + order_weight: 1300 - name: local_pref kind: Number + parameters: + min_value: 0 optional: true description: Force Local Pref for this BGP Peer Session. - order_weight: 1450 - regex: ^[0-9]+$ + order_weight: 1650 relationships: - name: local_as - identifier: bgpsession__local_as peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgpsession__local_as + order_weight: 1350 - name: remote_as - identifier: bgpsession__remote_as peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgpsession__remote_as + order_weight: 1400 - name: local_ip - identifier: bgpsession__local_ip peer: IpamIPAddress - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgpsession__local_ip + order_weight: 1450 - name: remote_ip - identifier: bgpsession__remote_ip peer: IpamIPAddress - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgpsession__remote_ip + order_weight: 1500 - name: device peer: DcimDevice - optional: true + kind: Generic cardinality: one + optional: true + order_weight: 900 - name: peer_group peer: RoutingBGPPeerGroup - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + order_weight: 1550 - name: peer_session peer: RoutingBGPSession - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + order_weight: 1600 extensions: nodes: - kind: DcimGenericDevice relationships: - name: asn peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute - order_weight: 1600 + cardinality: one + optional: true + order_weight: 1800 - kind: OrganizationGeneric relationships: - name: asn + peer: RoutingAutonomousSystem label: Autonomous System + kind: Generic cardinality: many optional: true - peer: RoutingAutonomousSystem - order_weight: 2000 + order_weight: 1700 ``` \ No newline at end of file diff --git a/docs/docs/reference/routing_bgp_community.mdx b/docs/docs/reference/routing_bgp_community.mdx index c8796875..5fe5b430 100644 --- a/docs/docs/reference/routing_bgp_community.mdx +++ b/docs/docs/reference/routing_bgp_community.mdx @@ -8,7 +8,7 @@ This schema extension adds the BGP Communities models. - **Dependencies:** - [base](dcim) - - [extensions/routing](routing) + - [extensions/routing_policies](routing_policies) ## Nodes @@ -24,15 +24,15 @@ This schema extension adds the BGP Communities models. | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | The name of the BGP community. | Text | | | | +| name | The name of the BGP community. | Text | False | | | | description | An optional description of the BGP community. | Text | True | | | -| community | The value of the BGP community (RFC1997, RFC4360, RFC8092). | Text | | | | +| community | The value of the BGP community (RFC1997, RFC4360, RFC8092). | Text | False | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| routing_policy | RoutingPolicy | | many | Generic | +| routing_policy | RoutingPolicy | True | many | Generic | | tags | BuiltinTag | True | many | Attribute | ## Code @@ -42,9 +42,10 @@ version: '1.0' nodes: - name: BGPCommunity namespace: Routing - icon: iconoir:community - label: BGP Community description: Defines a BGP community. + label: BGP Community + icon: iconoir:community + include_in_menu: true human_friendly_id: - name__value order_by: @@ -53,31 +54,35 @@ nodes: attributes: - name: name kind: Text + unique: true + optional: false description: The name of the BGP community. order_weight: 1000 - unique: true - name: description kind: Text - description: An optional description of the BGP community. optional: true + description: An optional description of the BGP community. order_weight: 1100 - name: community kind: Text + unique: true + optional: false description: The value of the BGP community (RFC1997, RFC4360, RFC8092). order_weight: 1200 - unique: true relationships: - name: routing_policy - label: Routing Policies peer: RoutingPolicy - description: The BGP Policies using this BGP Community. + label: Routing Policies kind: Generic cardinality: many + optional: true + description: The BGP Policies using this BGP Community. + order_weight: 1300 - name: tags peer: BuiltinTag kind: Attribute - optional: true cardinality: many - order_weight: 3000 + optional: true + order_weight: 2000 ``` \ No newline at end of file diff --git a/docs/docs/reference/routing_bgp_rr.mdx b/docs/docs/reference/routing_bgp_rr.mdx index 8d006aff..8cf1f598 100644 --- a/docs/docs/reference/routing_bgp_rr.mdx +++ b/docs/docs/reference/routing_bgp_rr.mdx @@ -8,7 +8,6 @@ This schema extension extend the BGP extension to add BGP Route Reflector Cluste - **Dependencies:** - [base](dcim) - - [extensions/routing](routing) - [extensions/routing_bgp](routing_bgp) ## Nodes @@ -25,7 +24,7 @@ This schema extension extend the BGP extension to add BGP Route Reflector Cluste | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | Name of the Route Reflector Cluster | Text | | | | +| name | Name of the Route Reflector Cluster | Text | False | | | | description | Optional description of the Route Reflector Cluster | Text | True | | | #### Relationships @@ -49,7 +48,7 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| rr_cluster | RoutingBGPRRCluster | | one | Attribute | +| rr_cluster | RoutingBGPRRCluster | True | one | Attribute | ## Code @@ -61,45 +60,49 @@ nodes: description: A Route Reflector (RR) Cluster used for grouping internal peers label: Route Reflector Cluster icon: mdi:router-network - include_in_menu: false + include_in_menu: true + menu_placement: RoutingBGPSession human_friendly_id: - name__value display_label: name__value attributes: - name: name kind: Text + unique: true + optional: false description: Name of the Route Reflector Cluster order_weight: 1000 - unique: true - name: description kind: Text - description: Optional description of the Route Reflector Cluster optional: true + description: Optional description of the Route Reflector Cluster order_weight: 1100 relationships: - name: cluster_id - label: Cluster ID peer: IpamIPAddress - description: Cluster ID represented as a reference to an IP Address - cardinality: one + label: Cluster ID kind: Attribute + cardinality: one optional: false + description: Cluster ID represented as a reference to an IP Address order_weight: 1200 - name: peer_groups - label: BGP Peer Groups peer: RoutingBGPPeerGroup - cardinality: many + label: BGP Peer Groups kind: Generic + cardinality: many optional: true + order_weight: 1300 extensions: nodes: - kind: RoutingBGPPeerGroup relationships: - name: rr_cluster - label: RR Cluster peer: RoutingBGPRRCluster - cardinality: one + label: RR Cluster kind: Attribute - order_weight: 1600 + cardinality: one + optional: true + order_weight: 1700 ``` \ No newline at end of file diff --git a/docs/docs/reference/routing_ospf.mdx b/docs/docs/reference/routing_ospf.mdx index ff7079c6..b4d5d47a 100644 --- a/docs/docs/reference/routing_ospf.mdx +++ b/docs/docs/reference/routing_ospf.mdx @@ -28,7 +28,7 @@ This schema extension contains all you need to model the OSPF Routing Protocol. | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | | reference_bandwidth | Reference bandwidth for OSPF instance (in Mbps). | Number | True | 1000 | | -| version | Version of the OSPF protocol. | Dropdown | | ospf | ospf, ospfv3 | +| version | Version of the OSPF protocol. | Dropdown | False | ospf | ospf, ospfv3 | | import_policies | | Text | True | | | | export_policies | | Text | True | | | @@ -55,10 +55,10 @@ This schema extension contains all you need to model the OSPF Routing Protocol. | ---- | ----------- | ---- | -------- | ------------- | ------- | | description | Description of the OSPF interface. | Text | False | | | | metric | OSPF metric for the interface. | Number | True | | | -| mode | Mode of the OSPF interface. | Dropdown | | normal | normal, passive, peer_to_peer | +| mode | Mode of the OSPF interface. | Dropdown | False | normal | normal, passive, peer_to_peer | | authentication_key | Shared secret used to authenticate and secure routing messages between neighboring routers. | Password | True | | | | authentication_mode | | Dropdown | True | | md5, sha1 | -| area | OSPF area associated with the interface. | Text | | | | +| area | OSPF area associated with the interface. | Text | False | | | #### Relationships @@ -77,31 +77,33 @@ nodes: description: OSPF (Open Shortest Path First) instance on a Virtual Router. label: OSPF icon: mdi:network-outline - include_in_menu: false + include_in_menu: true + menu_placement: RoutingProtocol + inherit_from: + - RoutingProtocol + human_friendly_id: + - device__name__value + - vrf__name__value + - version__value order_by: - router_id__address__value - vrf__name__value - device__name__value + display_label: description__value uniqueness_constraints: - - device - vrf - version__value - human_friendly_id: - - device__name__value - - vrf__name__value - - version__value - display_label: description__value - inherit_from: - - RoutingProtocol attributes: - name: reference_bandwidth kind: Number - optional: true default_value: 1000 + optional: true description: Reference bandwidth for OSPF instance (in Mbps). - order_weight: 1150 + order_weight: 1350 - name: version kind: Dropdown + default_value: ospf choices: - name: ospf label: OSPFv2 @@ -111,51 +113,54 @@ nodes: label: OSPFv3 description: Open Shortest Path First version 3. color: '#E6E6FA' - default_value: ospf + optional: false description: Version of the OSPF protocol. - order_weight: 1100 + order_weight: 1300 - name: import_policies kind: Text optional: true - order_weight: 1300 + order_weight: 1450 - name: export_policies kind: Text optional: true - order_weight: 1350 + order_weight: 1500 relationships: - name: router_id peer: IpamIPAddress - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + order_weight: 1400 - name: ospf_interfaces - label: OSPF Interfaces peer: RoutingOSPFInterface - identifier: ospf__ospfinterfaces - optional: true - cardinality: many + label: OSPF Interfaces kind: Component + cardinality: many + optional: true + identifier: ospf__ospfinterfaces + order_weight: 1550 - name: OSPFInterface namespace: Routing description: Pivot table linking OSPF configuration to an interface. label: OSPF Interface icon: mdi:ethernet - include_in_menu: false + include_in_menu: true + menu_placement: RoutingOSPF + human_friendly_id: + - description__value order_by: - description__value display_label: description__value uniqueness_constraints: - - ospf - interface - human_friendly_id: - - description__value attributes: - name: description kind: Text - optional: false unique: true + optional: false description: Description of the OSPF interface. - order_weight: 1500 + order_weight: 1100 - name: metric kind: Number optional: true @@ -163,6 +168,7 @@ nodes: order_weight: 1400 - name: mode kind: Dropdown + default_value: normal choices: - name: normal label: Normal @@ -176,14 +182,14 @@ nodes: label: Peer-to-Peer description: OSPF peer-to-peer interface mode. color: '#E6E6FA' - default_value: normal + optional: false description: Mode of the OSPF interface. order_weight: 1300 - name: authentication_key kind: Password + optional: true description: Shared secret used to authenticate and secure routing messages between neighboring routers. - optional: true order_weight: 1250 - name: authentication_mode kind: Dropdown @@ -198,22 +204,23 @@ nodes: order_weight: 1225 - name: area kind: Text + optional: false description: OSPF area associated with the interface. order_weight: 1200 relationships: - name: ospf - label: OSPF peer: RoutingOSPF - identifier: ospf__ospfinterfaces - optional: false - cardinality: one + label: OSPF kind: Parent - order_weight: 1100 + cardinality: one + optional: false + identifier: ospf__ospfinterfaces + order_weight: 900 - name: interface peer: InterfaceLayer3 - optional: false - cardinality: one kind: Attribute - order_weight: 1200 + cardinality: one + optional: false + order_weight: 1500 ``` \ No newline at end of file diff --git a/docs/docs/reference/routing_pim.mdx b/docs/docs/reference/routing_pim.mdx index c9893322..17ee5cc3 100644 --- a/docs/docs/reference/routing_pim.mdx +++ b/docs/docs/reference/routing_pim.mdx @@ -52,8 +52,8 @@ This schema extension contains all you need to model the PIM Protocol. | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| description | Description of the OSPF interface. | Text | False | | | -| pim_mode | PIM mode used for multicast routing on this interface. | Dropdown | | | sparse, dense, bidirectional | +| description | Description of the PIM interface. | Text | False | | | +| pim_mode | PIM mode used for multicast routing on this interface. | Dropdown | False | | sparse, dense, bidirectional | | hello_interval | Interval for PIM hello messages (in seconds). | Number | True | 30 | | | dr_priority | Designated Router priority on the interface. | Number | True | 1 | | @@ -74,24 +74,25 @@ nodes: description: Protocol Independent Multicast (PIM) instance on a Virtual Router. label: PIM icon: mdi:network-outline - include_in_menu: false + include_in_menu: true + menu_placement: RoutingProtocol inherit_from: - RoutingProtocol + human_friendly_id: + - device__name__value + - vrf__name__value order_by: - vrf__name__value - device__name__value + display_label: description__value uniqueness_constraints: - - device - vrf - human_friendly_id: - - device__name__value - - vrf__name__value - display_label: description__value attributes: - name: dr_priority kind: Number - optional: true default_value: 1 + optional: true description: Designated Router priority. order_weight: 1250 - name: import_policies @@ -105,37 +106,40 @@ nodes: relationships: - name: rp_address peer: IpamIPAddress + kind: Attribute + cardinality: one optional: true description: Rendezvous Point (RP) address for PIM. - cardinality: one - kind: Attribute + order_weight: 1400 - name: pim_interfaces - label: PIM Interfaces peer: RoutingPIMInterface - identifier: pim__piminterfaces - optional: true - cardinality: many + label: PIM Interfaces kind: Component + cardinality: many + optional: true + identifier: pim__piminterfaces + order_weight: 1450 - name: PIMInterface namespace: Routing description: Interface configuration for PIM. label: PIM Interface icon: mdi:ethernet - include_in_menu: false + include_in_menu: true + menu_placement: RoutingPIM + human_friendly_id: + - description__value order_by: - description__value display_label: description__value uniqueness_constraints: - - pim - interface - human_friendly_id: - - description__value attributes: - name: description kind: Text - optional: false unique: true - description: Description of the OSPF interface. + optional: false + description: Description of the PIM interface. order_weight: 1100 - name: pim_mode kind: Dropdown @@ -152,33 +156,35 @@ nodes: label: Bidirectional Mode description: Bidirectional PIM for efficient traffic forwarding. color: '#E6E6FA' + optional: false description: PIM mode used for multicast routing on this interface. order_weight: 1150 - name: hello_interval kind: Number - optional: true default_value: 30 + optional: true description: Interval for PIM hello messages (in seconds). order_weight: 1300 - name: dr_priority kind: Number - optional: true default_value: 1 + optional: true description: Designated Router priority on the interface. order_weight: 1250 relationships: - name: pim - label: PIM peer: RoutingPIM - identifier: pim__piminterfaces - optional: false - cardinality: one + label: PIM kind: Parent + cardinality: one + optional: false + identifier: pim__piminterfaces + order_weight: 900 - name: interface peer: InterfaceLayer3 - optional: false - cardinality: one kind: Attribute + cardinality: one + optional: false order_weight: 1200 ``` \ No newline at end of file diff --git a/docs/docs/reference/routing_policies.mdx b/docs/docs/reference/routing_policies.mdx index c2dbe9a9..77f8749a 100644 --- a/docs/docs/reference/routing_policies.mdx +++ b/docs/docs/reference/routing_policies.mdx @@ -13,6 +13,7 @@ This schema extension contains a generic to create Routing Policies. This Generi ### Policy +- **Label:** Routing Policy - **Description:** Policy defining the rules for routing traffic in a network. - **Namespace:** Routing - **Icon:** carbon:deployment-policy @@ -24,9 +25,9 @@ This schema extension contains a generic to create Routing Policies. This Generi | ---- | ----------- | ---- | -------- | ------------- | ------- | | name | The name of the routing policy. | Text | False | | | | description | An optional description of the routing policy. | Text | True | | | -| policy_type | The type of routing policy which specifies the direction of route advertisement. | Dropdown | | | import-policy, export-policy, import-export-policy | +| policy_type | The type of routing policy which specifies the direction of route advertisement. | Dropdown | False | | import_policy, export_policy, import_export_policy | | weight | Priority of the routing policy. The higher the number, the higher the priority. | Number | True | 1000 | | -| address_family | The address family for the routing policy indicating the type of IP address. | Dropdown | | all | ipv4, ipv6, all | +| address_family | The address family for the routing policy indicating the type of IP address. | Dropdown | False | all | ipv4, ipv6, all | ## Code @@ -35,9 +36,10 @@ version: '1.0' generics: - name: Policy namespace: Routing - icon: carbon:deployment-policy - include_in_menu: false description: Policy defining the rules for routing traffic in a network. + label: Routing Policy + icon: carbon:deployment-policy + include_in_menu: true human_friendly_id: - name__value order_by: @@ -46,45 +48,45 @@ generics: attributes: - name: name kind: Text - description: The name of the routing policy. unique: true optional: false + description: The name of the routing policy. order_weight: 1000 - name: description kind: Text - description: An optional description of the routing policy. optional: true + description: An optional description of the routing policy. order_weight: 1100 - name: policy_type - label: Type kind: Dropdown - description: The type of routing policy which specifies the direction of route - advertisement. + label: Type choices: - - name: import-policy + - name: import_policy label: Import description: Policy for incoming routes. color: '#E6E6FA' - - name: export-policy + - name: export_policy label: Export description: Policy for outgoing routes. color: '#E6E6FA' - - name: import-export-policy + - name: import_export_policy label: Import + Export description: Policy for both incoming and outgoing routes. color: '#E6E6FA' + optional: false + description: The type of routing policy which specifies the direction of route + advertisement. order_weight: 1200 - name: weight kind: Number + default_value: 1000 + optional: true description: Priority of the routing policy. The higher the number, the higher the priority. - optional: true - default_value: 1000 order_weight: 1400 - name: address_family - description: The address family for the routing policy indicating the type of - IP address. kind: Dropdown + default_value: all choices: - name: ipv4 label: IPv4 @@ -98,7 +100,9 @@ generics: label: All description: Policy applies to both IPv4 and IPv6 addresses. color: '#E6E6FA' - default_value: all + optional: false + description: The address family for the routing policy indicating the type of + IP address. order_weight: 1150 ``` \ No newline at end of file diff --git a/docs/docs/reference/routing_policies_aggregate.mdx b/docs/docs/reference/routing_policies_aggregate.mdx index 863bac25..7d50551d 100644 --- a/docs/docs/reference/routing_policies_aggregate.mdx +++ b/docs/docs/reference/routing_policies_aggregate.mdx @@ -8,16 +8,14 @@ This extension is using the Routing Policies extensions and the Routing Aggregat - **Dependencies:** - [base](dcim) - - [extensions/routing](routing) - [extensions/routing_policies](routing_policies) - - [extensions/routing_aggregate](routing_aggregate) ## Nodes ### PolicyAggregate - **Label:** Aggregate Routing Policies -- **Description:** A routing policiers for Aggregate +- **Description:** A routing policy for Aggregate. - **Namespace:** Routing - **Icon:** carbon:deployment-policy - **Inherit From:** RoutingPolicy @@ -29,10 +27,11 @@ version: '1.0' nodes: - name: PolicyAggregate namespace: Routing - description: A routing policiers for Aggregate + description: A routing policy for Aggregate. label: Aggregate Routing Policies icon: carbon:deployment-policy - include_in_menu: false + include_in_menu: true + menu_placement: RoutingPolicy inherit_from: - RoutingPolicy diff --git a/docs/docs/reference/routing_policies_bgp.mdx b/docs/docs/reference/routing_policies_bgp.mdx index 3f2b4309..a4a06679 100644 --- a/docs/docs/reference/routing_policies_bgp.mdx +++ b/docs/docs/reference/routing_policies_bgp.mdx @@ -8,7 +8,6 @@ This extension is using the Routing Policies extensions and the Routing BGP one - **Dependencies:** - [base](dcim) - - [extensions/routing](routing) - [extensions/routing_policies](routing_policies) - [extensions/routing_bgp](routing_bgp) @@ -17,7 +16,7 @@ This extension is using the Routing Policies extensions and the Routing BGP one ### PolicyBGP - **Label:** BGP Routing Policies -- **Description:** A routing policiers for BGP +- **Description:** A routing policy for BGP. - **Namespace:** Routing - **Icon:** carbon:deployment-policy - **Inherit From:** RoutingPolicy @@ -43,8 +42,8 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| import_routing_policies | RoutingPolicyBGP | | many | Generic | -| export_routing_policies | RoutingPolicyBGP | | many | Generic | +| import_routing_policies | RoutingPolicyBGP | True | many | Generic | +| export_routing_policies | RoutingPolicyBGP | True | many | Generic | ### RoutingBGPSession @@ -59,8 +58,8 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| import_routing_policies | RoutingPolicy | | many | Generic | -| export_routing_policies | RoutingPolicy | | many | Generic | +| import_routing_policies | RoutingPolicyBGP | True | many | Generic | +| export_routing_policies | RoutingPolicyBGP | True | many | Generic | ## Code @@ -69,10 +68,11 @@ version: '1.0' nodes: - name: PolicyBGP namespace: Routing - description: A routing policiers for BGP + description: A routing policy for BGP. label: BGP Routing Policies icon: carbon:deployment-policy - include_in_menu: false + include_in_menu: true + menu_placement: RoutingPolicy inherit_from: - RoutingPolicy extensions: @@ -87,19 +87,23 @@ extensions: state: absent relationships: - name: import_routing_policies - label: Import Routing Policies peer: RoutingPolicyBGP - identifier: bgp__import_policies - description: The routing-policies used by this instance for import. + label: Import Routing Policies kind: Generic cardinality: many + identifier: bgppeergroup__import_policies + optional: true + description: The routing-policies used by this instance for import. + order_weight: 1750 - name: export_routing_policies - label: Export Routing Policies peer: RoutingPolicyBGP - identifier: bgp__export_policies - description: The routing-policies used by this instance for export. + label: Export Routing Policies kind: Generic cardinality: many + identifier: bgppeergroup__export_policies + optional: true + description: The routing-policies used by this instance for export. + order_weight: 1800 - kind: RoutingBGPSession attributes: - name: import_policies @@ -110,18 +114,22 @@ extensions: state: absent relationships: - name: import_routing_policies + peer: RoutingPolicyBGP label: Import Routing Policies - peer: RoutingPolicy - identifier: bgp__import_policies - description: The routing-policies used by this instance for import. kind: Generic cardinality: many + identifier: bgpsession__import_policies + optional: true + description: The routing-policies used by this instance for import. + order_weight: 1850 - name: export_routing_policies + peer: RoutingPolicyBGP label: Export Routing Policies - peer: RoutingPolicy - identifier: bgp__export_policies - description: The routing-policies used by this instance for export. kind: Generic cardinality: many + identifier: bgpsession__export_policies + optional: true + description: The routing-policies used by this instance for export. + order_weight: 1900 ``` \ No newline at end of file diff --git a/docs/docs/reference/routing_policies_ospf.mdx b/docs/docs/reference/routing_policies_ospf.mdx index c2896b56..119aff6d 100644 --- a/docs/docs/reference/routing_policies_ospf.mdx +++ b/docs/docs/reference/routing_policies_ospf.mdx @@ -8,7 +8,6 @@ This extension is using the Routing Policies extensions and the Routing OSPF one - **Dependencies:** - [base](dcim) - - [extensions/routing](routing) - [extensions/routing_policies](routing_policies) - [extensions/routing_ospf](routing_ospf) @@ -17,7 +16,7 @@ This extension is using the Routing Policies extensions and the Routing OSPF one ### PolicyOSPF - **Label:** OSPF Routing Policies -- **Description:** A routing policiers for OSPF +- **Description:** A routing policy for OSPF. - **Namespace:** Routing - **Icon:** carbon:deployment-policy - **Inherit From:** RoutingPolicy @@ -43,8 +42,8 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| import_routing_policies | RoutingPolicyOSPF | | many | Generic | -| export_routing_policies | RoutingPolicyOSPF | | many | Generic | +| import_routing_policies | RoutingPolicyOSPF | True | many | Generic | +| export_routing_policies | RoutingPolicyOSPF | True | many | Generic | ## Code @@ -53,10 +52,11 @@ version: '1.0' nodes: - name: PolicyOSPF namespace: Routing - description: A routing policiers for OSPF + description: A routing policy for OSPF. label: OSPF Routing Policies icon: carbon:deployment-policy - include_in_menu: false + include_in_menu: true + menu_placement: RoutingPolicy inherit_from: - RoutingPolicy extensions: @@ -71,18 +71,22 @@ extensions: state: absent relationships: - name: import_routing_policies - label: Import Routing Policies peer: RoutingPolicyOSPF - identifier: ospf__import_policies - description: The routing-policies used by this instance for import. + label: Import Routing Policies kind: Generic cardinality: many + identifier: ospf__import_policies + optional: true + description: The routing-policies used by this instance for import. + order_weight: 1600 - name: export_routing_policies - label: Export Routing Policies peer: RoutingPolicyOSPF - identifier: ospf__export_policies - description: The routing-policies used by this instance for export. + label: Export Routing Policies kind: Generic cardinality: many + identifier: ospf__export_policies + optional: true + description: The routing-policies used by this instance for export. + order_weight: 1650 ``` \ No newline at end of file diff --git a/docs/docs/reference/routing_policies_pim.mdx b/docs/docs/reference/routing_policies_pim.mdx index 189a6c77..ae1e6791 100644 --- a/docs/docs/reference/routing_policies_pim.mdx +++ b/docs/docs/reference/routing_policies_pim.mdx @@ -8,7 +8,6 @@ This schema inherits the `RoutingPolicy` schema and removes `import_policies` an - **Dependencies:** - [base](dcim) - - [extensions/routing](routing) - [extensions/routing_policies](routing_policies) - [extensions/routing_pim](routing_pim) @@ -17,7 +16,7 @@ This schema inherits the `RoutingPolicy` schema and removes `import_policies` an ### PolicyPIM - **Label:** PIM Routing Policies -- **Description:** A routing policiers for PIM +- **Description:** A routing policy for PIM. - **Namespace:** Routing - **Icon:** carbon:deployment-policy - **Inherit From:** RoutingPolicy @@ -43,8 +42,8 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| import_routing_policies | RoutingPolicyPIM | | many | Generic | -| export_routing_policies | RoutingPolicyPIM | | many | Generic | +| import_routing_policies | RoutingPolicyPIM | True | many | Generic | +| export_routing_policies | RoutingPolicyPIM | True | many | Generic | ## Code @@ -53,10 +52,11 @@ version: '1.0' nodes: - name: PolicyPIM namespace: Routing - description: A routing policiers for PIM + description: A routing policy for PIM. label: PIM Routing Policies icon: carbon:deployment-policy - include_in_menu: false + include_in_menu: true + menu_placement: RoutingPolicy inherit_from: - RoutingPolicy extensions: @@ -71,18 +71,22 @@ extensions: state: absent relationships: - name: import_routing_policies - label: Import Routing Policies peer: RoutingPolicyPIM - identifier: pim__import_policies - description: The routing-policies used by this instance for import. + label: Import Routing Policies kind: Generic cardinality: many + identifier: pim__import_policies + optional: true + description: The routing-policies used by this instance for import. + order_weight: 1500 - name: export_routing_policies - label: Export Routing Policies peer: RoutingPolicyPIM - identifier: pim__export_policies - description: The routing-policies used by this instance for export. + label: Export Routing Policies kind: Generic cardinality: many + identifier: pim__export_policies + optional: true + description: The routing-policies used by this instance for export. + order_weight: 1550 ``` \ No newline at end of file diff --git a/docs/docs/reference/sfp.mdx b/docs/docs/reference/sfp.mdx index 7cea68b8..c903639e 100644 --- a/docs/docs/reference/sfp.mdx +++ b/docs/docs/reference/sfp.mdx @@ -55,7 +55,7 @@ Improvements: | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| serial | | Text | True | | | +| serial_number | | Text | True | | | | sfp_type | Type of SFP, such as LR, SR, T. | Dropdown | False | | lr, sr, lrm, t, sr4, lr4, zr, er, dac, aoc | | status | | Dropdown | False | plugged | plugged, spare, decommissioned | | form_factor | The physical form factor of the SFP module. | Dropdown | False | | sfp, sfp_plus, qsfp, qsfp_plus, qsfp28, qsfp_dd, cfp, cfp2, cfp4, xfp, sfp56, qsfp56, osfp | @@ -64,7 +64,7 @@ Improvements: | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| interface | DcimInterface | True | one | Attribute | +| interface | InterfacePhysical | True | one | Attribute | | spare_location | LocationHosting | True | one | Attribute | | manufacturer | OrganizationManufacturer | True | one | Attribute | @@ -76,13 +76,13 @@ In this context "extensions" refer to modifications or additions to the existing ::: -### DcimInterface +### InterfacePhysical #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| plugged_sfp | DcimGenericSFP | True | one | | +| plugged_sfp | DcimGenericSFP | True | one | Generic | ### LocationHosting @@ -90,7 +90,7 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| spare_sfps | DcimGenericSFP | True | many | | +| spare_sfps | DcimGenericSFP | True | many | Generic | ### OrganizationManufacturer @@ -98,7 +98,7 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| sfps | DcimGenericSFP | True | many | | +| sfps | DcimGenericSFP | True | many | Generic | ## Code @@ -113,15 +113,12 @@ generics: include_in_menu: true display_label: '{{ form_factor__value }} {{ sfp_type__value }}' attributes: - - name: serial + - name: serial_number kind: Text optional: true order_weight: 1400 - name: sfp_type kind: Dropdown - description: Type of SFP, such as LR, SR, T. - order_weight: 1100 - optional: false choices: - name: lr label: LR (Long Reach) @@ -164,10 +161,11 @@ generics: label: AOC (Active Optical Cable) description: Active Optical Cable, used for short connections over fiber. color: '#6699ff' + optional: false + description: Type of SFP, such as LR, SR, T. + order_weight: 1100 - name: status kind: Dropdown - optional: false - order_weight: 1300 default_value: plugged choices: - name: plugged @@ -182,11 +180,10 @@ generics: label: Decommissioned description: Decommissioned might be broken or not used anymore. color: '#ffd27f' + optional: false + order_weight: 1200 - name: form_factor kind: Dropdown - description: The physical form factor of the SFP module. - order_weight: 1000 - optional: false choices: - name: sfp label: SFP @@ -227,75 +224,88 @@ generics: - name: osfp label: OSFP color: '#0099cc' + optional: false + description: The physical form factor of the SFP module. + order_weight: 1000 relationships: - name: interface - peer: DcimInterface + peer: InterfacePhysical kind: Attribute - optional: true cardinality: one - order_weight: 1200 + optional: true + identifier: sfp__interface + order_weight: 1300 - name: spare_location peer: LocationHosting kind: Attribute - optional: true cardinality: one + optional: true order_weight: 1500 - name: manufacturer peer: OrganizationManufacturer - cardinality: one kind: Attribute + cardinality: one optional: true order_weight: 1350 nodes: - name: StandardSFP namespace: Dcim - inherit_from: - - DcimGenericSFP description: Standard SFP module for various types (e.g., LR, SR, T). label: Standard SFP icon: mdi:gpu + include_in_menu: true menu_placement: DcimGenericSFP -- name: BidiSFP - namespace: Dcim inherit_from: - DcimGenericSFP +- name: BidiSFP + namespace: Dcim description: Bidirectional SFP supporting two wavelengths for single-fiber operation. label: Bidirectional SFP icon: lineicons:arrow-both-direction-vertical-1 + include_in_menu: true menu_placement: DcimGenericSFP + inherit_from: + - DcimGenericSFP attributes: - name: wavelength_tx - label: Transmit Wavelength (nm) kind: Number + label: Transmit Wavelength (nm) optional: false description: Transmit wavelength in nm. order_weight: 1175 - name: wavelength_rx - label: Receive Wavelength (nm) kind: Number + label: Receive Wavelength (nm) optional: false description: Receive wavelength in nm. order_weight: 1150 extensions: nodes: - - kind: DcimInterface + - kind: InterfacePhysical relationships: - name: plugged_sfp peer: DcimGenericSFP + kind: Generic cardinality: one optional: true + identifier: sfp__interface + order_weight: 1700 - kind: LocationHosting relationships: - name: spare_sfps peer: DcimGenericSFP + kind: Generic cardinality: many optional: true + order_weight: 1750 - kind: OrganizationManufacturer relationships: - name: sfps - label: SFPs peer: DcimGenericSFP + kind: Generic + label: SFPs cardinality: many optional: true + order_weight: 1500 ``` \ No newline at end of file diff --git a/docs/docs/reference/snmp.mdx b/docs/docs/reference/snmp.mdx index 0830ee61..93f2009a 100644 --- a/docs/docs/reference/snmp.mdx +++ b/docs/docs/reference/snmp.mdx @@ -2,7 +2,7 @@ title: SNMP --- -This schema extension contains models for SNMP Communities and SNMP Clients. As you can see this extension is not linked to Tenancy or Device, as you could decide to link the Community to different models based on your use case. +This schema extension contains models for SNMP Communities and SNMP Clients. A community links to the devices it is configured on; any further wiring, to a tenant for instance, is left to you. ## Details @@ -24,8 +24,8 @@ This schema extension contains models for SNMP Communities and SNMP Clients. As | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| community_string | | Password | | | | -| access | | Text | | | | +| community_string | | Password | False | | | +| access | | Dropdown | False | | read_only, read_write | ### CommunityV3 @@ -40,12 +40,12 @@ This schema extension contains models for SNMP Communities and SNMP Clients. As | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| username | | Text | | | | -| auth_protocol | | Text | | | | +| username | | Text | False | | | +| auth_protocol | | Dropdown | False | | none, md5, sha | | auth_password | | Password | True | | | -| privacy_protocol | | Text | | | | +| privacy_protocol | | Dropdown | False | | none, des, aes | | privacy_password | | Password | True | | | -| security_level | | Dropdown | | | noAuthNoPriv, authNoPriv, authPriv | +| security_level | | Dropdown | False | | no_auth_no_priv, auth_no_priv, auth_priv | ### Client @@ -59,14 +59,15 @@ This schema extension contains models for SNMP Communities and SNMP Clients. As | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | client_description | | Text | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| community | SnmpCommunity | | many | | +| ip_addresses | IpamIPAddress | True | many | Attribute | +| communities | SnmpCommunity | True | many | Attribute | ## Generics @@ -82,14 +83,15 @@ This schema extension contains models for SNMP Communities and SNMP Clients. As | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | description | | Text | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| clients | SnmpClient | | many | Component | +| clients | SnmpClient | True | many | Component | +| devices | DcimGenericDevice | True | many | Attribute | ## Code @@ -101,129 +103,180 @@ generics: description: Generic model for SNMP community configurations. label: SNMP Community icon: iconoir:community + include_in_menu: true human_friendly_id: - name__value - display_label: name__value order_by: - name__value + display_label: name__value attributes: - name: name kind: Text + unique: true + optional: false order_weight: 1000 - name: description kind: Text - order_weight: 1100 optional: true + order_weight: 1100 relationships: - name: clients peer: SnmpClient - cardinality: many kind: Component + cardinality: many + optional: true + order_weight: 1900 + - name: devices + peer: DcimGenericDevice + label: Devices + kind: Attribute + cardinality: many + optional: true + identifier: snmp_community__device + description: Devices this community is configured on. + order_weight: 1800 nodes: - name: CommunityV2 namespace: Snmp description: SNMP v1/v2c community configuration. label: SNMP v1/v2c icon: iconoir:community + include_in_menu: true menu_placement: SnmpCommunity + inherit_from: + - SnmpCommunity human_friendly_id: - name__value - display_label: name__value order_by: - name__value - inherit_from: - - SnmpCommunity + display_label: name__value attributes: - name: community_string kind: Password + optional: false order_weight: 1300 - name: access - kind: Text - enum: - - Read-Only - - Read-Write + kind: Dropdown + choices: + - name: read_only + label: Read-Only + description: Read-only access. + - name: read_write + label: Read-Write + description: Read-write access. + optional: false order_weight: 1200 - name: CommunityV3 namespace: Snmp description: SNMP version 3 configuration with enhanced security. label: SNMP v3 icon: iconoir:community + include_in_menu: true menu_placement: SnmpCommunity + inherit_from: + - SnmpCommunity human_friendly_id: - name__value - display_label: name__value order_by: - name__value - inherit_from: - - SnmpCommunity + display_label: name__value attributes: - name: username kind: Text + optional: false order_weight: 1300 - name: auth_protocol + kind: Dropdown label: Authentication Protocol - kind: Text - enum: - - None - - MD5 - - SHA + choices: + - name: none + label: None + description: No authentication. + - name: md5 + label: MD5 + description: MD5 authentication. + - name: sha + label: SHA + description: SHA authentication. + optional: false order_weight: 1400 - name: auth_password - label: Authentication Password kind: Password - order_weight: 1500 + label: Authentication Password optional: true + order_weight: 1500 - name: privacy_protocol + kind: Dropdown label: Privacy Protocol - kind: Text - enum: - - None - - DES - - AES + choices: + - name: none + label: None + description: No privacy. + - name: des + label: DES + description: DES encryption. + - name: aes + label: AES + description: AES encryption. + optional: false order_weight: 1600 - name: privacy_password - label: Privacy Password kind: Password - order_weight: 1700 + label: Privacy Password optional: true + order_weight: 1700 - name: security_level - label: Security Level kind: Dropdown + label: Security Level choices: - - name: noAuthNoPriv + - name: no_auth_no_priv label: NoAuthNoPriv description: No authentication and no privacy. - - name: authNoPriv + - name: auth_no_priv label: AuthNoPriv description: Authentication but no privacy. - - name: authPriv + - name: auth_priv label: AuthPriv description: Both authentication and privacy. + optional: false order_weight: 1200 - name: Client namespace: Snmp description: Represents an SNMP client that interacts with SNMP Community. label: SNMP Client icon: ph:user-list-light + include_in_menu: true menu_placement: SnmpCommunity human_friendly_id: - name__value - display_label: name__value order_by: - name__value + display_label: name__value attributes: - name: name kind: Text + unique: true + optional: false order_weight: 1000 - name: client_description - label: Description kind: Text - order_weight: 1100 + label: Description optional: true + order_weight: 1100 relationships: - - name: community + - name: ip_addresses + peer: IpamIPAddress + label: IP Addresses + kind: Attribute + cardinality: many + optional: true + description: Authorized SNMP client address. + order_weight: 1150 + - name: communities peer: SnmpCommunity + kind: Attribute cardinality: many + optional: true order_weight: 1200 ``` \ No newline at end of file diff --git a/docs/docs/reference/tenancy.mdx b/docs/docs/reference/tenancy.mdx index f0d844c8..b6d01eb6 100644 --- a/docs/docs/reference/tenancy.mdx +++ b/docs/docs/reference/tenancy.mdx @@ -2,20 +2,20 @@ title: Tenancy --- -This schema extension introduces tenancy for some of the schema nodes (circuits...) +This schema extension introduces a Tenant node that can own devices, IP prefixes/addresses, and hosting locations. See the comment at the bottom of `tenancy.yml` for an example of how to extend tenancy onto optional extension nodes such as `DcimCircuit`. ## Details - **Dependencies:** - [base](dcim) - - [extensions/circuit](circuit) ## Nodes ### Tenant -- **Description:** A tenant is owning the corresponding entity -- **Namespace:** Tenancy +- **Label:** Tenant +- **Description:** A tenant is the owner of the corresponding devices, addressing, and locations. +- **Namespace:** Organization - **Icon:** mdi:domain - **Inherit From:** OrganizationGeneric @@ -23,9 +23,50 @@ This schema extension introduces tenancy for some of the schema nodes (circuits. | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| tags | BuiltinTag | True | many | Attribute | -| location | LocationBuilding | True | many | | -| circuit | DcimCircuit | True | many | | +| devices | DcimGenericDevice | True | many | Generic | +| prefixes | IpamPrefix | True | many | Generic | +| addresses | IpamIPAddress | True | many | Generic | +| locations | LocationHosting | True | many | Generic | + +## Extensions + +:::note + +In this context "extensions" refer to modifications or additions to the existing schema, such as adding new attributes, relationships, or other schema elements. + +::: + +### DcimGenericDevice + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| tenant | OrganizationTenant | True | one | Attribute | + +### IpamPrefix + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| tenant | OrganizationTenant | True | one | Attribute | + +### IpamIPAddress + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| tenant | OrganizationTenant | True | one | Attribute | + +### LocationHosting + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| tenant | OrganizationTenant | True | one | Attribute | ## Code @@ -33,26 +74,85 @@ This schema extension introduces tenancy for some of the schema nodes (circuits. version: '1.0' nodes: - name: Tenant - namespace: Tenancy - description: A tenant is owning the corresponding entity + namespace: Organization + description: A tenant is the owner of the corresponding devices, addressing, and + locations. + label: Tenant icon: mdi:domain include_in_menu: true + menu_placement: OrganizationGeneric inherit_from: - OrganizationGeneric relationships: - - name: tags - peer: BuiltinTag + - name: devices + peer: DcimGenericDevice + label: Devices + kind: Generic + cardinality: many + optional: true + identifier: tenant__device + order_weight: 1300 + - name: prefixes + peer: IpamPrefix + label: Prefixes + kind: Generic cardinality: many - kind: Attribute optional: true - order_weight: 3000 - - name: location - peer: LocationBuilding + identifier: tenant__prefix + order_weight: 1350 + - name: addresses + peer: IpamIPAddress + label: Addresses + kind: Generic cardinality: many optional: true - - name: circuit - peer: DcimCircuit + identifier: tenant__ip_address + order_weight: 1400 + - name: locations + peer: LocationHosting + label: Locations + kind: Generic cardinality: many optional: true + identifier: tenant__location + order_weight: 1450 +extensions: + nodes: + - kind: DcimGenericDevice + relationships: + - name: tenant + peer: OrganizationTenant + kind: Attribute + cardinality: one + optional: true + identifier: tenant__device + order_weight: 1850 + - kind: IpamPrefix + relationships: + - name: tenant + peer: OrganizationTenant + kind: Attribute + cardinality: one + optional: true + identifier: tenant__prefix + order_weight: 1400 + - kind: IpamIPAddress + relationships: + - name: tenant + peer: OrganizationTenant + kind: Attribute + cardinality: one + optional: true + identifier: tenant__ip_address + order_weight: 1350 + - kind: LocationHosting + relationships: + - name: tenant + peer: OrganizationTenant + kind: Attribute + cardinality: one + optional: true + identifier: tenant__location + order_weight: 1800 ``` \ No newline at end of file diff --git a/docs/docs/reference/topology.mdx b/docs/docs/reference/topology.mdx index 8e4fd600..26ef0676 100644 --- a/docs/docs/reference/topology.mdx +++ b/docs/docs/reference/topology.mdx @@ -2,54 +2,721 @@ title: Topology --- -This schema extension introduces abstract network pods and services running in the pods, such as MPLS and EVPN. +A schema for defining and managing network topology, strategies, and services. ## Details - **Dependencies:** - [base](dcim) + - [extensions/vlan](vlan) -## Generics +## Nodes -### Generic +### Topology - **Label:** Topology -- **Description:** Generic model for topology. +- **Description:** A Topology represents the entire network pod. - **Namespace:** Topology - **Icon:** carbon:network-3 +- **Human Friendly ID:** name__value +- **Inherit From:** CoreArtifactTarget #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | +| name | | Text | | | | | description | | Text | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | +| elements | TopologyGenericElement | True | many | Component | +| strategy | TopologyNetworkStrategy | True | one | Component | | location | LocationGeneric | True | one | Attribute | +| devices | DcimGenericDevice | True | many | Component | +| network_services | TopologyNetworkService | True | many | Component | + +### MPLSStrategy + +- **Label:** MPLS Strategy +- **Description:** Specific strategy attributes for MPLS. +- **Namespace:** Topology +- **Icon:** eos-icons:neural-network +- **Human Friendly ID:** name__value +- **Inherit From:** TopologyNetworkStrategy + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| underlay | | Dropdown | | | ospf, isis, bgp | +| overlay | | Dropdown | | | ldp, rsvp, segment_routing | + +### EVPNStrategy + +- **Label:** EVPN Strategy +- **Description:** Specific strategy attributes for EVPN. +- **Namespace:** Topology +- **Icon:** carbon:load-balancer-network +- **Human Friendly ID:** name__value +- **Inherit From:** TopologyNetworkStrategy + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| underlay | | Dropdown | | | ebgp, ospf, isis | +| overlay | | Dropdown | | | ebgp, ibgp | + +### PhysicalElement + +- **Label:** Physical Topology Element +- **Description:** Physical aspect of topology elements. +- **Namespace:** Topology +- **Icon:** carbon:network-3-reference +- **Human Friendly ID:** name__value +- **Inherit From:** TopologyGenericElement + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| mtu | | Number | | 1500 | | +| border | | Boolean | | False | | +| mlag_support | | Boolean | | False | | +| device_role | | Dropdown | | | spine, leaf, pe_router, p_router, route_reflector, cpe, firewall | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| device_type | DcimDeviceType | True | one | Attribute | + +### DhcpOption + +- **Label:** Dhcp Option +- **Description:** Represents a configurable option within a Dhcp server. +- **Namespace:** Network +- **Icon:** gis:globe-options +- **Human Friendly ID:** name__value + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| name | | Text | | | | +| description | | Text | True | | | +| option_code | | Number | | | | +| content | | Text | | | | + +### DhcpServer + +- **Label:** Dhcp Server +- **Description:** Represents a Dhcp server in the network. +- **Namespace:** Network +- **Icon:** eos-icons:ip +- **Human Friendly ID:** name__value +- **Inherit From:** NetworkManagementServer + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| lease_time | | Text | | | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| dhcp_options | NetworkDhcpOption | True | many | Component | + +### NameServer + +- **Label:** DNS Server +- **Description:** Represents a DNS server in the network. +- **Namespace:** Network +- **Icon:** eos-icons:dns +- **Human Friendly ID:** name__value +- **Inherit From:** NetworkManagementServer + +### NTPServer + +- **Label:** NTP Server +- **Description:** Represents a NTP server in the network. +- **Namespace:** Network +- **Icon:** iconoir:time-zone +- **Human Friendly ID:** name__value +- **Inherit From:** NetworkManagementServer + +### NetworkServiceIdentifier + +- **Label:** Network Service Identifier +- **Description:** Generic model for different types of identifiers used in network services. +- **Namespace:** Topology +- **Icon:** mdi:identifier +- **Human Friendly ID:** identifier__value + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| identifier | | Number | | | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| service | TopologyNetworkService | True | one | | + +### NetworkService + +- **Label:** Network Service +- **Description:** Network services attached to a Topology. +- **Namespace:** Topology +- **Icon:** carbon:ibm-cloud-internet-services +- **Human Friendly ID:** name__value + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| name | | Text | | | | +| description | | Text | | | | +| service_type | | Text | | | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| identifier | TopologyNetworkServiceIdentifier | False | one | Attribute | +| topology | TopologyTopology | False | one | Parent | +| vlan | IpamVLAN | True | one | Component | +| prefix | IpamPrefix | True | one | Component | + +## Generics + +### ManagementServer + +- **Label:** Network Management Servers +- **Description:** Generic model for network management server (dns, ntp, and dhcp). +- **Namespace:** Network +- **Human Friendly ID:** name__value + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| name | | Text | | | | +| description | | Text | True | | | +| status | | Dropdown | | | active, provisioning, maintenance, drained | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| location | LocationGeneric | True | many | | +| ip_addresses | IpamIPAddress | True | many | Component | + +### GenericElement + +- **Label:** Generic Topology Element +- **Description:** Base model for elements +- **Namespace:** Topology +- **Icon:** carbon:network-3-reference +- **Human Friendly ID:** name__value + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| name | | Text | | | | +| description | | Text | True | | | +| quantity | | Number | | | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| topology | TopologyTopology | False | one | Parent | + +### NetworkStrategy + +- **Label:** Network Strategy +- **Description:** Generic model for network strategies (underlays and overlays). +- **Namespace:** Topology +- **Icon:** iconoir:strategy +- **Human Friendly ID:** name__value + +#### Attributes + +| name | description | kind | optional | default_value | choices | +| ---- | ----------- | ---- | -------- | ------------- | ------- | +| name | | Text | | | | +| description | | Text | True | | | + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| topology | TopologyTopology | True | many | | + +## Extensions + +:::note + +In this context "extensions" refer to modifications or additions to the existing schema, such as adding new attributes, relationships, or other schema elements. + +::: + +### DcimGenericDevice + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| topology | TopologyTopology | True | one | | + +### IpamPrefix + +#### Relationships + +| name | peer | optional | cardinality | kind | +| ---- | ---- | -------- | ----------- | ---- | +| network_service | TopologyNetworkService | True | one | | ## Code ```yaml version: '1.0' generics: -- name: Generic +- name: ManagementServer + namespace: Network + description: Generic model for network management server (dns, ntp, and dhcp). + label: Network Management Servers + human_friendly_id: + - name__value + display_label: name__value + order_by: + - name__value + include_in_menu: true + attributes: + - name: name + kind: Text + order_weight: 1000 + - name: description + kind: Text + order_weight: 1100 + 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' + relationships: + - name: location + peer: LocationGeneric + optional: true + cardinality: many + - name: ip_addresses + peer: IpamIPAddress + optional: true + cardinality: many + kind: Component +- name: GenericElement + namespace: Topology + description: Base model for elements + label: Generic Topology Element + icon: carbon:network-3-reference + human_friendly_id: + - name__value + display_label: name__value + order_by: + - name__value + include_in_menu: false + menu_placement: TopologyTopology + attributes: + - name: name + kind: Text + order_weight: 1000 + - name: description + kind: Text + order_weight: 1100 + optional: true + - name: quantity + kind: Number + order_weight: 1200 + relationships: + - name: topology + peer: TopologyTopology + cardinality: one + kind: Parent + optional: false +- name: NetworkStrategy + namespace: Topology + description: Generic model for network strategies (underlays and overlays). + label: Network Strategy + icon: iconoir:strategy + human_friendly_id: + - name__value + display_label: name__value + order_by: + - name__value + include_in_menu: true + menu_placement: TopologyTopology + attributes: + - name: name + kind: Text + order_weight: 1000 + - name: description + kind: Text + order_weight: 1100 + optional: true + relationships: + - name: topology + peer: TopologyTopology + optional: true + cardinality: many +nodes: +- name: Topology namespace: Topology - description: Generic model for topology. + description: A Topology represents the entire network pod. label: Topology icon: carbon:network-3 + human_friendly_id: + - name__value + display_label: name__value + order_by: + - name__value + inherit_from: + - CoreArtifactTarget attributes: + - name: name + kind: Text + unique: true + order_weight: 1000 - name: description kind: Text - order_weight: 1300 optional: true + order_weight: 1100 relationships: + - name: elements + peer: TopologyGenericElement + optional: true + cardinality: many + kind: Component + - name: strategy + peer: TopologyNetworkStrategy + optional: true + cardinality: one + kind: Component - name: location peer: LocationGeneric optional: true cardinality: one kind: Attribute + - name: devices + peer: DcimGenericDevice + optional: true + cardinality: many + kind: Component + - name: network_services + peer: TopologyNetworkService + optional: true + cardinality: many + kind: Component +- name: MPLSStrategy + namespace: Topology + description: Specific strategy attributes for MPLS. + label: MPLS Strategy + icon: eos-icons:neural-network + inherit_from: + - TopologyNetworkStrategy + menu_placement: TopologyNetworkStrategy + include_in_menu: false + human_friendly_id: + - name__value + order_by: + - name__value + display_label: name__value + attributes: + - name: underlay + kind: Dropdown + choices: + - name: ospf + label: OSPF + - name: isis + label: ISIS + - name: bgp + label: BGP + - name: overlay + kind: Dropdown + choices: + - name: ldp + label: LDP + - name: rsvp + label: RSVP + - name: segment_routing + label: Segment Routing +- name: EVPNStrategy + namespace: Topology + description: Specific strategy attributes for EVPN. + label: EVPN Strategy + icon: carbon:load-balancer-network + inherit_from: + - TopologyNetworkStrategy + menu_placement: TopologyNetworkStrategy + include_in_menu: false + human_friendly_id: + - name__value + order_by: + - name__value + display_label: name__value + attributes: + - name: underlay + kind: Dropdown + choices: + - name: ebgp + label: EBGP + - name: ospf + label: OSPF + - name: isis + label: ISIS + - name: overlay + kind: Dropdown + choices: + - name: ebgp + label: EBGP + - name: ibgp + label: IBGP +- name: PhysicalElement + namespace: Topology + description: Physical aspect of topology elements. + label: Physical Topology Element + icon: carbon:network-3-reference + menu_placement: TopologyTopology + human_friendly_id: + - name__value + order_by: + - name__value + display_label: name__value + inherit_from: + - TopologyGenericElement + attributes: + - name: mtu + kind: Number + default_value: 1500 + order_weight: 3000 + - name: border + kind: Boolean + label: Is a Topology Border + default_value: false + order_weight: 2400 + - name: mlag_support + kind: Boolean + label: MLAG Support + default_value: false + order_weight: 2500 + - name: device_role + label: Role + kind: Dropdown + choices: + - name: spine + color: '#ffb3ba' + - name: leaf + color: '#ffdfba' + - name: pe_router + color: '#baffc9' + - name: p_router + color: '#bae1ff' + - name: route_reflector + color: '#ffbaba' + - name: cpe + color: '#f2bae1' + - name: firewall + color: '#c5a3ff' + order_weight: 1300 + relationships: + - name: device_type + label: Type + peer: DcimDeviceType + optional: true + cardinality: one + kind: Attribute + order_weight: 1400 +- name: DhcpOption + namespace: Network + description: Represents a configurable option within a Dhcp server. + label: Dhcp Option + icon: gis:globe-options + menu_placement: NetworkManagementServer + include_in_menu: false + human_friendly_id: + - name__value + display_label: name__value + order_by: + - name__value + attributes: + - name: name + kind: Text + order_weight: 1000 + - name: description + kind: Text + optional: true + order_weight: 1100 + - name: option_code + kind: Number + order_weight: 2000 + - name: content + kind: Text + order_weight: 2100 +- name: DhcpServer + namespace: Network + description: Represents a Dhcp server in the network. + label: Dhcp Server + icon: eos-icons:ip + menu_placement: NetworkManagementServer + include_in_menu: false + human_friendly_id: + - name__value + display_label: name__value + order_by: + - name__value + inherit_from: + - NetworkManagementServer + attributes: + - name: lease_time + kind: Text + order_weight: 2100 + relationships: + - name: dhcp_options + peer: NetworkDhcpOption + optional: true + cardinality: many + kind: Component +- name: NameServer + namespace: Network + description: Represents a DNS server in the network. + label: DNS Server + icon: eos-icons:dns + menu_placement: NetworkManagementServer + human_friendly_id: + - name__value + display_label: name__value + order_by: + - name__value + inherit_from: + - NetworkManagementServer +- name: NTPServer + namespace: Network + description: Represents a NTP server in the network. + label: NTP Server + icon: iconoir:time-zone + menu_placement: NetworkManagementServer + human_friendly_id: + - name__value + display_label: name__value + order_by: + - name__value + inherit_from: + - NetworkManagementServer +- name: NetworkServiceIdentifier + namespace: Topology + description: Generic model for different types of identifiers used in network services. + label: Network Service Identifier + icon: mdi:identifier + menu_placement: TopologyNetworkService + human_friendly_id: + - identifier__value + order_by: + - identifier__value + display_label: identifier__value + attributes: + - name: identifier + kind: Number + relationships: + - name: service + label: Network Service + peer: TopologyNetworkService + cardinality: one + optional: true +- name: NetworkService + namespace: Topology + description: Network services attached to a Topology. + label: Network Service + icon: carbon:ibm-cloud-internet-services + human_friendly_id: + - name__value + order_by: + - name__value + display_label: name__value + attributes: + - name: name + label: Service Name + kind: Text + order_weight: 1000 + - name: description + kind: Text + order_weight: 1100 + - name: service_type + kind: Text + enum: + - Layer2 + - Layer3 + order_weight: 1200 + relationships: + - name: identifier + peer: TopologyNetworkServiceIdentifier + cardinality: one + kind: Attribute + optional: false + - name: topology + peer: TopologyTopology + cardinality: one + kind: Parent + optional: false + - name: vlan + peer: IpamVLAN + optional: true + cardinality: one + kind: Component + order_weight: 1500 + - name: prefix + peer: IpamPrefix + optional: true + cardinality: one + kind: Component + order_weight: 1400 +extensions: + nodes: + - kind: DcimGenericDevice + relationships: + - name: topology + peer: TopologyTopology + optional: true + cardinality: one + - kind: IpamPrefix + relationships: + - name: network_service + label: Network Service + peer: TopologyNetworkService + optional: true + cardinality: one + order_weight: 1400 ``` \ No newline at end of file diff --git a/docs/docs/reference/users.mdx b/docs/docs/reference/users.mdx deleted file mode 100644 index b2fc6162..00000000 --- a/docs/docs/reference/users.mdx +++ /dev/null @@ -1,173 +0,0 @@ ---- -title: Users ---- - -This schema extension contains models for account management. - -## Details - -- **Dependencies:** - - [base](dcim) - -## Nodes - -### Group - -- **Label:** User Groups -- **Description:** User Group -- **Namespace:** User -- **Icon:** iconoir:group -- **Human Friendly ID:** name__value - -#### Attributes - -| name | description | kind | optional | default_value | choices | -| ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | -| description | | Text | True | | | -| idle_timeout | | Number | | | | -| permissions | | Dropdown | False | | admin, operator, read-only | - -### Account - -- **Label:** User Account -- **Description:** User login and authentication -- **Namespace:** User -- **Icon:** mdi:account-key -- **Human Friendly ID:** name__value - -#### Attributes - -| name | description | kind | optional | default_value | choices | -| ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | The login username | Text | | | | -| full_name | Full name of the account | Text | True | | | -| ssh_key | SSH key for secure access | Password | True | | | -| password | Password for login (alternative to SSH key) | Password | True | | | -| mfa_enabled | Whether multi-factor authentication is enabled | Boolean | | False | | - -#### Relationships - -| name | peer | optional | cardinality | kind | -| ---- | ---- | -------- | ----------- | ---- | -| user_group | UserGroup | False | one | Attribute | -| organization | OrganizationGeneric | False | one | Parent | - -## Extensions - -:::note - -In this context "extensions" refer to modifications or additions to the existing schema, such as adding new attributes, relationships, or other schema elements. - -::: - -### OrganizationGeneric - -#### Relationships - -| name | peer | optional | cardinality | kind | -| ---- | ---- | -------- | ----------- | ---- | -| accounts | UserAccount | | many | Component | - -## Code - -```yaml -version: '1.0' -nodes: -- name: Group - namespace: User - description: User Group - label: User Groups - icon: iconoir:group - display_label: name__value - order_by: - - name__value - human_friendly_id: - - name__value - attributes: - - name: name - kind: Text - order_weight: 1000 - unique: true - - name: description - kind: Text - optional: true - order_weight: 1100 - - name: idle_timeout - label: Idle Timeout (s) - kind: Number - order_weight: 1300 - - name: permissions - kind: Dropdown - optional: false - choices: - - name: admin - description: All rights on device. - color: '#E6E6FA' - - name: operator - description: Operator right on configuration. - color: '#E6E6FA' - - name: read-only - description: Read only right on configuration. - color: '#E6E6FA' - order_weight: 1200 -- name: Account - namespace: User - description: User login and authentication - label: User Account - icon: mdi:account-key - display_label: name__value - order_by: - - name__value - human_friendly_id: - - name__value - attributes: - - name: name - label: Username - kind: Text - description: The login username - order_weight: 1000 - unique: true - - name: full_name - kind: Text - optional: true - description: Full name of the account - order_weight: 1100 - - name: ssh_key - kind: Password - optional: true - description: SSH key for secure access - order_weight: 1300 - - name: password - kind: Password - optional: true - description: Password for login (alternative to SSH key) - order_weight: 1400 - - name: mfa_enabled - kind: Boolean - default_value: false - description: Whether multi-factor authentication is enabled - order_weight: 1500 - relationships: - - name: user_group - peer: UserGroup - cardinality: one - optional: false - kind: Attribute - order_weight: 1200 - - name: organization - peer: OrganizationGeneric - optional: false - cardinality: one - kind: Parent -extensions: - nodes: - - kind: OrganizationGeneric - relationships: - - name: accounts - kind: Component - peer: UserAccount - description: List of Accounts under this organization - cardinality: many - -``` \ No newline at end of file diff --git a/docs/docs/reference/vlan.mdx b/docs/docs/reference/vlan.mdx index 18065bba..14437cbb 100644 --- a/docs/docs/reference/vlan.mdx +++ b/docs/docs/reference/vlan.mdx @@ -14,50 +14,60 @@ This schema extension contains models to support VLANs in you network. ### VLAN - **Label:** VLAN -- **Description:** A VLAN is isolated layer two domain +- **Description:** A plain VLAN, with no QinQ role of its own. - **Namespace:** Ipam -- **Icon:** mdi:lan-pending - **Uniqueness Constraints:** - - vlan_id__value, l2domain + - vlan_id__value, vlan_group +- **Inherit From:** IpamGenericVLAN + +### VLANGroup + +- **Label:** VLAN Group +- **Description:** A VLAN group scopes VLANs to a domain (site, rack, etc.). +- **Namespace:** Ipam +- **Icon:** mdi:domain-switch - **Human Friendly ID:** name__value #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | description | | Text | True | | | -| vlan_id | | Number | | | | -| status | | Dropdown | | | active, provisioning, maintenance, drained | -| role | | Dropdown | True | | server, management, user | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| location | LocationHosting | True | many | | -| prefixes | IpamPrefix | True | many | | -| l2domain | IpamL2Domain | False | one | Attribute | +| scope | IpamVLANGroupScope | True | one | Attribute | +| vlans | IpamGenericVLAN | True | many | Component | + +## Generics -### L2Domain +### GenericVLAN -- **Label:** Layer 2 Domain -- **Description:** Represents layer 2 domain. +- **Label:** VLAN +- **Description:** A VLAN is an isolated layer two domain. - **Namespace:** Ipam -- **Icon:** mdi:domain-switch +- **Icon:** mdi:lan-pending - **Human Friendly ID:** name__value #### Attributes | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | +| description | | Text | True | | | +| vlan_id | | Number | False | | | +| status | | Dropdown | False | active | active, reserved, provisioning, maintenance, deprecated | +| role | | Dropdown | True | | server, management, user | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| vlans | IpamVLAN | True | many | Component | +| prefixes | IpamPrefix | True | many | Attribute | +| vlan_group | IpamVLANGroup | False | one | Attribute | ## Extensions @@ -67,45 +77,42 @@ In this context "extensions" refer to modifications or additions to the existing ::: -### IpamPrefix +### IpamVLANGroupScope #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| vlan | IpamVLAN | True | one | Attribute | +| vlan_groups | IpamVLANGroup | True | many | Attribute | -### InterfaceLayer2 +### IpamPrefix #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| untagged_vlan | IpamVLAN | True | one | Generic | -| tagged_vlan | IpamVLAN | True | many | Generic | +| vlan | IpamGenericVLAN | True | one | Attribute | -### LocationHosting +### InterfaceLayer2 #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| vlans | IpamVLAN | True | many | | +| untagged_vlan | IpamGenericVLAN | True | one | Generic | +| tagged_vlan | IpamGenericVLAN | True | many | Generic | ## Code ```yaml version: '1.0' -nodes: -- name: VLAN +generics: +- name: GenericVLAN namespace: Ipam - description: A VLAN is isolated layer two domain + description: A VLAN is an isolated layer two domain. label: VLAN icon: mdi:lan-pending - menu_placement: IpamL2Domain - uniqueness_constraints: - - - vlan_id__value - - l2domain + include_in_menu: true human_friendly_id: - name__value order_by: @@ -114,33 +121,44 @@ nodes: attributes: - name: name kind: Text + optional: false + order_weight: 1000 - name: description kind: Text optional: true + order_weight: 1100 - name: vlan_id kind: Number + optional: false + order_weight: 1050 - name: status kind: Dropdown + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: '#7fbf7f' + color: '#00d25b' + - name: reserved + label: Reserved + description: Reserved for future use, not yet active. + color: '#4d90fe' - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: '#ffff7f' + color: '#f0ad4e' - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: '#ffd27f' - - name: drained - label: Drained - description: Temporarily taken out of service. - color: '#bfbfbf' + color: '#ff9800' + - name: deprecated + label: Deprecated + description: No longer in use and scheduled for removal. + color: '#e04040' + optional: false + order_weight: 1200 - name: role kind: Dropdown - optional: true choices: - name: server label: Server @@ -154,71 +172,108 @@ nodes: label: User description: Segments designed for end-user access and activities. color: '#a0b78d' - relationships: - - name: location - peer: LocationHosting optional: true - cardinality: many + order_weight: 1300 + relationships: - name: prefixes peer: IpamPrefix - optional: true + kind: Attribute cardinality: many - - name: l2domain - peer: IpamL2Domain - optional: false - cardinality: one + optional: true + identifier: vlan__prefix + order_weight: 1500 + - name: vlan_group + peer: IpamVLANGroup + label: VLAN Group kind: Attribute - order_weight: 1200 -- name: L2Domain + cardinality: one + optional: false + identifier: vlan_group__vlan + order_weight: 1400 +nodes: +- name: VLAN namespace: Ipam - description: Represents layer 2 domain. - label: Layer 2 Domain + description: A plain VLAN, with no QinQ role of its own. + label: VLAN + include_in_menu: false + inherit_from: + - IpamGenericVLAN + uniqueness_constraints: + - - vlan_id__value + - vlan_group +- name: VLANGroup + namespace: Ipam + description: A VLAN group scopes VLANs to a domain (site, rack, etc.). + label: VLAN Group icon: mdi:domain-switch + include_in_menu: true + menu_placement: IpamGenericVLAN human_friendly_id: - name__value display_label: name__value attributes: - name: name kind: Text + unique: true + optional: false order_weight: 1000 + - name: description + kind: Text + optional: true + order_weight: 1100 relationships: - - name: vlans - peer: IpamVLAN + - name: scope + peer: IpamVLANGroupScope + kind: Attribute + cardinality: one optional: true - cardinality: many + identifier: vlan_group__scope + order_weight: 900 + - name: vlans + peer: IpamGenericVLAN kind: Component + cardinality: many + optional: true + identifier: vlan_group__vlan + order_weight: 1500 extensions: nodes: + - kind: IpamVLANGroupScope + relationships: + - name: vlan_groups + peer: IpamVLANGroup + label: VLAN Groups + kind: Attribute + cardinality: many + optional: true + identifier: vlan_group__scope + order_weight: 1600 - kind: IpamPrefix relationships: - name: vlan - peer: IpamVLAN - optional: true - cardinality: one + peer: IpamGenericVLAN kind: Attribute - order_weight: 1400 + cardinality: one + optional: true + identifier: vlan__prefix + order_weight: 1450 - kind: InterfaceLayer2 relationships: - name: untagged_vlan + peer: IpamGenericVLAN label: Untagged VLAN - peer: IpamVLAN - optional: true - cardinality: one kind: Generic + cardinality: one + optional: true identifier: interface_l2__untagged_vlan + order_weight: 1500 - name: tagged_vlan + peer: IpamGenericVLAN label: Tagged VLANs - peer: IpamVLAN - optional: true - cardinality: many kind: Generic - identifier: interface_l2__tagged_vlan - - kind: LocationHosting - relationships: - - name: vlans - label: VLANs - peer: IpamVLAN cardinality: many optional: true + identifier: interface_l2__tagged_vlan + order_weight: 1550 ``` \ No newline at end of file diff --git a/docs/docs/reference/vrf.mdx b/docs/docs/reference/vrf.mdx index 533c8851..603c1b89 100644 --- a/docs/docs/reference/vrf.mdx +++ b/docs/docs/reference/vrf.mdx @@ -14,7 +14,7 @@ This schema extension contains models to support VRF in your network. ### VRF - **Label:** VRF -- **Description:** A VRF is isolated layer three domain +- **Description:** A VRF is an isolated layer three domain. - **Namespace:** Ipam - **Icon:** mdi:router - **Human Friendly ID:** name__value @@ -25,15 +25,15 @@ This schema extension contains models to support VRF in your network. | ---- | ----------- | ---- | -------- | ------------- | ------- | | name | | Text | False | | | | vrf_rd | | Text | True | | | +| enforce_unique | Declares the intent that prefixes and addresses be unique in this VRF. Infrahub does not enforce it; use a check or generator. | Boolean | True | True | | | description | | Text | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| namespace | BuiltinIPNamespace | False | one | Attribute | -| import_rt | IpamRouteTarget | True | one | Attribute | -| export_rt | IpamRouteTarget | True | one | Attribute | +| import_rt | IpamRouteTarget | True | many | Attribute | +| export_rt | IpamRouteTarget | True | many | Attribute | ### RouteTarget @@ -47,14 +47,15 @@ This schema extension contains models to support VRF in your network. | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | | Text | | | | +| name | | Text | False | | | | description | | Text | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| vrf | IpamVRF | True | many | | +| import_vrf | IpamVRF | True | many | Generic | +| export_vrf | IpamVRF | True | many | Generic | ## Extensions @@ -87,9 +88,10 @@ version: '1.0' nodes: - name: VRF namespace: Ipam - description: A VRF is isolated layer three domain + description: A VRF is an isolated layer three domain. label: VRF icon: mdi:router + include_in_menu: true human_friendly_id: - name__value order_by: @@ -98,41 +100,49 @@ nodes: attributes: - name: name kind: Text - optional: false unique: true + optional: false + order_weight: 1000 - name: vrf_rd - label: Route Distinguisher kind: Text + label: Route Distinguisher + optional: true + order_weight: 1050 + - name: enforce_unique + kind: Boolean + label: Enforce Unique + description: Declares the intent that prefixes and addresses be unique in this + VRF. Infrahub does not enforce it; use a check or generator. + default_value: true optional: true + order_weight: 1200 - name: description kind: Text optional: true - order_weight: 1200 + order_weight: 1100 relationships: - - name: namespace - peer: BuiltinIPNamespace - optional: false - cardinality: one - kind: Attribute - name: import_rt - identifier: vrf__import - label: Import Targets peer: IpamRouteTarget - optional: true - cardinality: one + label: Import Targets kind: Attribute + cardinality: many + optional: true + identifier: vrf__import + order_weight: 1300 - name: export_rt - identifier: vrf__export - label: Export Targets peer: IpamRouteTarget - optional: true - cardinality: one + label: Export Targets kind: Attribute + cardinality: many + optional: true + identifier: vrf__export + order_weight: 1350 - name: RouteTarget namespace: Ipam description: Route Target (RFC 4360) label: Route Target icon: mdi:target + include_in_menu: true menu_placement: IpamVRF human_friendly_id: - name__value @@ -143,33 +153,50 @@ nodes: - name: name kind: Text unique: true + optional: false + order_weight: 1000 - name: description kind: Text optional: true + order_weight: 1100 relationships: - - name: vrf + - name: import_vrf peer: IpamVRF + kind: Generic + label: Imported by VRFs + cardinality: many optional: true + identifier: vrf__import + order_weight: 1300 + - name: export_vrf + peer: IpamVRF + kind: Generic + label: Exported by VRFs cardinality: many + optional: true + identifier: vrf__export + order_weight: 1350 extensions: nodes: - kind: IpamPrefix relationships: - name: vrf - label: VRF peer: IpamVRF - optional: true - cardinality: one + label: VRF kind: Attribute + cardinality: one + optional: true + identifier: prefix__vrf order_weight: 1150 - kind: IpamIPAddress relationships: - name: vrf - label: VRF peer: IpamVRF - optional: true - cardinality: one + label: VRF kind: Attribute + cardinality: one + optional: true + identifier: ip_address__vrf order_weight: 1150 ``` \ No newline at end of file diff --git a/docs/docs/reference/vrrp.mdx b/docs/docs/reference/vrrp.mdx index da595122..cf0407b9 100644 --- a/docs/docs/reference/vrrp.mdx +++ b/docs/docs/reference/vrrp.mdx @@ -23,16 +23,16 @@ This schema extension contains models for VRRP. | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| name | Unique name of the entry | Text | | | | -| group | VRRP Group | Text | | | | +| name | Unique name of the entry | Text | False | | | +| vrid | Virtual Router ID (VRID, should be between 1 and 255) | Number | False | | | | password | VRRP Password/Key | HashedPassword | True | | | #### Relationships | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| ip_address | IpamIPAddress | True | many | Attribute | -| vrrp_interfaces | NetworkVRRPInterface | | many | Component | +| ip_addresses | IpamIPAddress | True | many | Attribute | +| vrrp_interfaces | NetworkVRRPInterface | True | many | Component | ### VRRPInterface @@ -47,7 +47,7 @@ This schema extension contains models for VRRP. | name | description | kind | optional | default_value | choices | | ---- | ----------- | ---- | -------- | ------------- | ------- | -| priority | VRRP Priority (Should be between 0 to 255) | Number | | 100 | | +| priority | VRRP Priority (Should be between 1 and 255) | Number | False | 100 | | #### Relationships @@ -70,7 +70,7 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| vrrp | NetworkVRRPInterface | | one | Component | +| vrrp | NetworkVRRPInterface | True | one | Component | ### IpamIPAddress @@ -78,7 +78,7 @@ In this context "extensions" refer to modifications or additions to the existing | name | peer | optional | cardinality | kind | | ---- | ---- | -------- | ----------- | ---- | -| vrrp | NetworkVRRPGroup | | one | Component | +| vrrp | NetworkVRRPGroup | True | one | Attribute | ## Code @@ -87,55 +87,63 @@ version: '1.0' nodes: - name: VRRPGroup namespace: Network + description: VRRP Group configuration label: VRRP Group icon: fluent:virtual-network-20-filled - description: VRRP Group configuration - display_label: name__value - order_by: - - name__value + include_in_menu: true human_friendly_id: - name__value + order_by: + - name__value + display_label: name__value attributes: - name: name kind: Text label: Name unique: true + optional: false description: Unique name of the entry order_weight: 1000 - - name: group - kind: Text - description: VRRP Group - label: Group + - name: vrid + kind: Number + label: VRID + parameters: + min_value: 1 + max_value: 255 + optional: false + description: Virtual Router ID (VRID, should be between 1 and 255) order_weight: 1100 - name: password kind: HashedPassword - description: VRRP Password/Key label: Password optional: true + description: VRRP Password/Key order_weight: 1400 relationships: - - name: ip_address - on_delete: cascade - description: VRRP IP (v4 or v6) - label: IP Address + - name: ip_addresses peer: IpamIPAddress - optional: true - cardinality: many + label: IP Addresses kind: Attribute + cardinality: many + optional: true + on_delete: cascade + description: VRRP IP (v4 or v6) order_weight: 1200 - name: vrrp_interfaces - on_delete: cascade - kind: Component peer: NetworkVRRPInterface - cardinality: many label: VRRP Interfaces + kind: Component + cardinality: many + on_delete: cascade + optional: true order_weight: 1300 - name: VRRPInterface namespace: Network + description: VRRP Interface configuration label: VRRP Interface icon: carbon:interface-usage + include_in_menu: true menu_placement: NetworkVRRPGroup - description: VRRP Interface configuration order_by: - priority__value uniqueness_constraints: @@ -145,46 +153,51 @@ nodes: - name: priority kind: Number label: VRRP Priority - description: VRRP Priority (Should be between 0 to 255) - regex: ^(25[0-5]|2[0-4][0-9]|1?[0-9]?[0-9])$ default_value: 100 + parameters: + min_value: 1 + max_value: 255 + optional: false + description: VRRP Priority (Should be between 1 and 255) order_weight: 1100 relationships: - name: vrrp_group - description: VRRP Group - label: VRRP Group peer: NetworkVRRPGroup - optional: false - cardinality: one + label: VRRP Group kind: Attribute + cardinality: one + optional: false + description: VRRP Group order_weight: 1200 - name: interface - description: Interface L3 - label: Interface peer: InterfaceLayer3 - optional: false - cardinality: one + label: Interface kind: Attribute + cardinality: one + optional: false + description: Interface L3 order_weight: 1300 extensions: nodes: - kind: InterfaceLayer3 relationships: - name: vrrp - kind: Component peer: NetworkVRRPInterface - description: VRRP Interface Configuration - cardinality: one label: VRRP - order_weight: 1500 + kind: Component + cardinality: one + optional: true + description: VRRP Interface Configuration + order_weight: 1650 - kind: IpamIPAddress relationships: - name: vrrp - kind: Component peer: NetworkVRRPGroup - description: Part of VRRP Group - cardinality: one label: VRRP Group - order_weight: 1600 + kind: Attribute + cardinality: one + optional: true + description: Part of VRRP Group + order_weight: 1700 ``` \ No newline at end of file diff --git a/experimental/azure/azure.yml b/experimental/azure/azure.yml index 89cbb3e0..f52ca423 100644 --- a/experimental/azure/azure.yml +++ b/experimental/azure/azure.yml @@ -1,4 +1,9 @@ # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- --- version: "1.0" diff --git a/experimental/circuit_service/circuit_service.yml b/experimental/circuit_service/circuit_service.yml index 87a5be80..4f16c599 100644 --- a/experimental/circuit_service/circuit_service.yml +++ b/experimental/circuit_service/circuit_service.yml @@ -1,4 +1,9 @@ # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- --- version: "1.0" nodes: @@ -30,7 +35,7 @@ nodes: cardinality: one kind: Attribute - name: circuit_endpoints - peer: CircuitEndpoint + peer: DcimCircuitEndpoint optional: true cardinality: many kind: Component @@ -43,7 +48,7 @@ extensions: peer: CircuitService cardinality: many optional: true - - kind: CircuitEndpoint + - kind: DcimCircuitEndpoint relationships: - name: circuit_service peer: CircuitService diff --git a/extensions/firewall_policer/README.md b/experimental/firewall_policer/README.md similarity index 100% rename from extensions/firewall_policer/README.md rename to experimental/firewall_policer/README.md diff --git a/extensions/firewall_policer/firewall_policer.yml b/experimental/firewall_policer/firewall_policer.yml similarity index 95% rename from extensions/firewall_policer/firewall_policer.yml rename to experimental/firewall_policer/firewall_policer.yml index cc075063..d330a396 100644 --- a/extensions/firewall_policer/firewall_policer.yml +++ b/experimental/firewall_policer/firewall_policer.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: diff --git a/experimental/infiniband/infiniband.yml b/experimental/infiniband/infiniband.yml index 19ab0e80..300e948b 100644 --- a/experimental/infiniband/infiniband.yml +++ b/experimental/infiniband/infiniband.yml @@ -1,4 +1,9 @@ # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- --- version: "1.0" nodes: diff --git a/experimental/location_extended/location_extended.yml b/experimental/location_extended/location_extended.yml index 7ead6658..fe010d94 100644 --- a/experimental/location_extended/location_extended.yml +++ b/experimental/location_extended/location_extended.yml @@ -1,7 +1,13 @@ # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- --- version: "1.0" +# Defines Location.Rack. Mutually exclusive with extensions/rack, load one, not both. nodes: # -------------------- Locations -------------------- - name: Continent @@ -109,7 +115,7 @@ nodes: label: Rack display_label: name__value human_friendly_id: - - shortname__value + - name__value parent: "LocationSuite" children: "" icon: "clarity:rack-server-line" diff --git a/experimental/modules_linecards/linecard.yml b/experimental/modules_linecards/linecard.yml index 77013391..dfa4ce06 100644 --- a/experimental/modules_linecards/linecard.yml +++ b/experimental/modules_linecards/linecard.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" @@ -11,7 +16,7 @@ nodes: icon: mdi:poll label: "Linecard Type" inherit_from: - - DeviceGenericModuleType + - DcimGenericModuleType relationships: - name: linecards peer: DeviceLinecard @@ -24,9 +29,9 @@ nodes: description: "A Linecard installed in a device, specifying slot, power status, and functionalities." label: "Linecard" icon: "bi:pci-card" - menu_placement: DeviceGenericModule + menu_placement: DcimGenericModule inherit_from: - - DeviceGenericModule + - DcimGenericModule attributes: - name: slot kind: Number diff --git a/experimental/modules_routing_engine/routing_engine.yml b/experimental/modules_routing_engine/routing_engine.yml index 1d4d2b68..4d93dd86 100644 --- a/experimental/modules_routing_engine/routing_engine.yml +++ b/experimental/modules_routing_engine/routing_engine.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: @@ -8,7 +13,7 @@ nodes: description: "Routing Engine Type information, detailing specifications such as part number and manufacturer." label: "Routing Engine Type" inherit_from: - - DeviceGenericModuleType + - DcimGenericModuleType relationships: - name: routing_engines peer: DeviceRoutingEngine @@ -22,18 +27,9 @@ nodes: label: "Routing Engine" icon: "mdi:cpu-64-bit" inherit_from: - - DeviceGenericModule - uniqueness_constraints: - - ["serial_number__value"] - # # Only one RE per Device RE-Slot - # - ["device", "slot__value"] - human_friendly_id: - - device__name__value - - slot__value - order_by: - - device__name__value - - slot__value - display_label: serial_number__value + - DcimGenericModule + # human_friendly_id, order_by, and display_label are inherited from DcimGenericModule + # (computed_name__value, derived from module_bay + module_type), which is already unique. attributes: - name: slot kind: Number diff --git a/experimental/optical_transport/optical_transport.yml b/experimental/optical_transport/optical_transport.yml index b507918e..0ecb9e65 100644 --- a/experimental/optical_transport/optical_transport.yml +++ b/experimental/optical_transport/optical_transport.yml @@ -1,4 +1,9 @@ # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- --- version: "1.0" @@ -6,7 +11,7 @@ version: "1.0" # # Depends on: # - base/dcim.yml (DcimGenericDevice, DcimPhysicalDevice, DcimEndpoint, DcimConnector) -# - extensions/modules/modules.yml (DeviceGenericModule, DeviceGenericModuleType) +# - extensions/device_module/device_module.yml (DcimGenericModule, DcimGenericModuleType, DcimModuleBay) # - extensions/cable/cable.yml (DcimCable) # # Four layers: @@ -640,7 +645,7 @@ nodes: description: "Categorization of optical modules by function" icon: mdi:expansion-card inherit_from: - - DeviceGenericModuleType + - DcimGenericModuleType attributes: - name: name kind: Text @@ -694,7 +699,7 @@ nodes: description: "Optical-electrical-optical conversion module (100G, 400G coherent) installed in chassis" icon: mdi:chip inherit_from: - - DeviceGenericModule + - DcimGenericModule display_label: computed_name__value uniqueness_constraints: - [computed_name__value] @@ -707,8 +712,8 @@ nodes: optional: false computed_attribute: kind: Jinja2 - jinja2_template: "{{ device__serial__value }}-TPD-{{ slot_number__value }}" - description: "Computed module name (e.g., ABC123-TPD-1/1)" + jinja2_template: "{{ module_bay__computed_name__value }}-TPD-{{ slot_number__value }}" + description: "Computed module name (e.g., dc1-leaf1 > slot 1-TPD-1/1)" - name: slot_number kind: Text optional: false @@ -810,7 +815,7 @@ nodes: description: "Multiplexer/Demultiplexer/ROADM module for wavelength management installed in chassis" icon: mdi:router-network inherit_from: - - DeviceGenericModule + - DcimGenericModule display_label: computed_name__value human_friendly_id: - computed_name__value @@ -821,8 +826,8 @@ nodes: optional: false computed_attribute: kind: Jinja2 - jinja2_template: "{{ device__serial__value }}-MUX-{{ slot_number__value }}" - description: "Computed module name (e.g., ABC123-MUX-1/3)" + jinja2_template: "{{ module_bay__computed_name__value }}-MUX-{{ slot_number__value }}" + description: "Computed module name (e.g., dc1-leaf1 > slot 1-MUX-1/3)" - name: slot_number kind: Text optional: false @@ -1114,7 +1119,7 @@ nodes: description: "Optical signal amplifier module (EDFA, Raman, VGC) installed in chassis" icon: mdi:amplifier inherit_from: - - DeviceGenericModule + - DcimGenericModule display_label: computed_name__value human_friendly_id: - computed_name__value @@ -1125,8 +1130,8 @@ nodes: optional: false computed_attribute: kind: Jinja2 - jinja2_template: "{{ device__serial__value }}-AMP-{{ slot_number__value }}" - description: "Computed module name (e.g., ABC123-AMP-1/5)" + jinja2_template: "{{ module_bay__computed_name__value }}-AMP-{{ slot_number__value }}" + description: "Computed module name (e.g., dc1-leaf1 > slot 1-AMP-1/5)" - name: slot_number kind: Text optional: false diff --git a/experimental/qos/qos.yml b/experimental/qos/qos.yml index 23db03af..120651ee 100644 --- a/experimental/qos/qos.yml +++ b/experimental/qos/qos.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: diff --git a/experimental/security/security.yml b/experimental/security/security.yml index e1ed134b..a727c25e 100644 --- a/experimental/security/security.yml +++ b/experimental/security/security.yml @@ -1,4 +1,9 @@ # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- --- version: "1.0" generics: diff --git a/experimental/tenancy/tenancy.yml b/experimental/tenancy/tenancy.yml deleted file mode 100644 index 756085b3..00000000 --- a/experimental/tenancy/tenancy.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json -version: "1.0" - -nodes: - - name: Tenant - namespace: Tenancy - description: A tenant is owning the corresponding entity - icon: mdi:domain - include_in_menu: true - inherit_from: - - OrganizationGeneric - relationships: - - name: tags - peer: BuiltinTag - cardinality: many - kind: Attribute - optional: true - order_weight: 3000 - - name: location - peer: LocationBuilding - cardinality: many - optional: true - - name: circuit - peer: DcimCircuit - cardinality: many - optional: true diff --git a/experimental/topology/topology.yml b/experimental/topology/topology.yml index f79ac4d2..54bedfbc 100644 --- a/experimental/topology/topology.yml +++ b/experimental/topology/topology.yml @@ -1,4 +1,9 @@ # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- --- version: "1.0" generics: @@ -44,7 +49,7 @@ generics: optional: true cardinality: many - name: ip_addresses - peer: InfraIPAddress + peer: IpamIPAddress optional: true cardinality: many kind: Component @@ -399,13 +404,13 @@ nodes: kind: Parent optional: false - name: vlan - peer: InfraVLAN + peer: IpamVLAN optional: true cardinality: one kind: Component order_weight: 1500 - name: prefix - peer: InfraPrefix + peer: IpamPrefix optional: true cardinality: one kind: Component diff --git a/experimental/vlan-translation/vlan-translation.yml b/experimental/vlan-translation/vlan-translation.yml index b6b423e2..ee4cb430 100644 --- a/experimental/vlan-translation/vlan-translation.yml +++ b/experimental/vlan-translation/vlan-translation.yml @@ -1,4 +1,9 @@ # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- --- version: '1.0' diff --git a/extensions/aggregate/README.md b/extensions/aggregate/README.md new file mode 100644 index 00000000..4f159e7e --- /dev/null +++ b/extensions/aggregate/README.md @@ -0,0 +1,3 @@ +# aggregate + +Please refer to the [reference page](https://docs.infrahub.app/schema-library/reference/aggregate) for the corresponding documentation. diff --git a/extensions/aggregate/aggregate.yml b/extensions/aggregate/aggregate.yml new file mode 100644 index 00000000..9a8b4d5a --- /dev/null +++ b/extensions/aggregate/aggregate.yml @@ -0,0 +1,73 @@ +--- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- +version: "1.0" + +nodes: + - name: Aggregate + namespace: Ipam + description: An aggregate is a top-level IPv4 or IPv6 prefix assigned by a RIR. + label: Aggregate + icon: mdi:ip-network + include_in_menu: true + menu_placement: BuiltinIPAM + inherit_from: + - BuiltinIPPrefix + human_friendly_id: + - prefix__value + order_by: + - prefix__value + display_label: prefix__value + uniqueness_constraints: + - [prefix__value] + attributes: + - name: description + kind: Text + optional: true + order_weight: 1100 + - name: date_added + kind: DateTime + label: Date Added + optional: true + order_weight: 1200 + relationships: + - name: rir + peer: OrganizationRIR + label: RIR + kind: Attribute + cardinality: one + optional: false + identifier: aggregate__rir + order_weight: 1000 + + - name: RIR + namespace: Organization + description: >- + A Regional Internet Registry (ARIN, RIPE, APNIC, LACNIC, AFRINIC) or a private + entity managing private address space. + label: RIR + icon: mdi:certificate + include_in_menu: true + menu_placement: OrganizationGeneric + inherit_from: + - OrganizationGeneric + attributes: + - name: private + kind: Boolean + label: Private + default_value: false + optional: false + description: Indicates this RIR manages private (RFC 1918 / RFC 4193) address space. + order_weight: 1300 + relationships: + - name: aggregates + peer: IpamAggregate + kind: Generic + cardinality: many + optional: true + identifier: aggregate__rir + order_weight: 1400 diff --git a/extensions/cable/cable.yml b/extensions/cable/cable.yml index 0643e7be..c51b593d 100644 --- a/extensions/cable/cable.yml +++ b/extensions/cable/cable.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: @@ -8,26 +13,32 @@ nodes: description: Physical cable connecting two endpoints label: Cable icon: mdi:cable-data + include_in_menu: true + menu_placement: DcimDevice inherit_from: - DcimConnector + human_friendly_id: + - label__value + order_by: + - label__value + display_label: label__value attributes: - name: status kind: Dropdown - optional: true - order_weight: 1000 + default_value: connected choices: - name: connected label: Connected - description: Fully operational and currently in connected - color: "#7fbf7f" + description: Fully operational and currently connected + color: "#00d25b" - name: planned label: Planned description: In the process of being set up - color: "#ffff7f" + color: "#2196f3" + optional: false + order_weight: 1200 - name: cable_type kind: Dropdown - optional: true - order_weight: 1100 choices: # Copper Cables - name: cat3 @@ -62,45 +73,42 @@ nodes: label: CAT8 description: "Category 8 twisted pair cable." color: "#99ccff" # Light Blue - # Fiber Cables (Multi-mode) - - name: mmf-om1 + - name: mmf_om1 label: Multimode Fiber OM1 description: "Multimode fiber (62.5/125 µm)." color: "#ff9933" # Dark Orange - - name: mmf-om2 + - name: mmf_om2 label: Multimode Fiber OM2 description: "Multimode fiber (50/125 µm)." color: "#ff9933" # Dark Orange - - name: mmf-om3 + - name: mmf_om3 label: Multimode Fiber OM3 description: "Optimized multimode fiber (50/125 µm)." color: "#ff9933" # Dark Orange - - name: mmf-om4 + - name: mmf_om4 label: Multimode Fiber OM4 description: "Enhanced multimode fiber (50/125 µm)." color: "#ff9933" # Dark Orange - - name: mmf-om5 + - name: mmf_om5 label: Multimode Fiber OM5 description: "Wideband multimode fiber (50/125 µm)." color: "#ff9933" # Dark Orange - # Fiber Cables (Single-mode) - - name: smf-os1 + - name: smf_os1 label: Singlemode Fiber OS1 description: "Standard singlemode fiber." color: "#ffcc00" # Yellow - - name: smf-os2 + - name: smf_os2 label: Singlemode Fiber OS2 description: "Improved singlemode fiber." color: "#ffcc00" # Yellow - # Direct Attach and Active Optical Cables - - name: dac-passive + - name: dac_passive label: Passive DAC description: "Direct Attach Copper (Passive)." color: "#a0a0a0" # Grey - - name: dac-active + - name: dac_active label: Active DAC description: "Direct Attach Copper (Active)." color: "#a0a0a0" # Grey @@ -108,13 +116,12 @@ nodes: label: Active Optical Cable description: "Active Optical Cable." color: "#a0a0a0" # Grey - # Special Cables - name: coaxial label: Coaxial description: "Coaxial cable for broadband." color: "#000000" # Black - - name: mrj21-trunk + - name: mrj21_trunk label: MRJ21 Trunk description: "High-density copper cable." color: "#000000" # Black @@ -126,12 +133,12 @@ nodes: label: USB description: "Universal Serial Bus cable." color: "#000000" # Black + optional: true + order_weight: 1100 - name: color kind: Dropdown - optional: true - order_weight: 1300 choices: - - name: dark-red + - name: dark_red label: Dark Red color: "#aa1409" - name: red @@ -149,7 +156,7 @@ nodes: - name: purple label: Purple color: "#9c27b0" - - name: dark-purple + - name: dark_purple label: Dark Purple color: "#673ab7" - name: indigo @@ -158,7 +165,7 @@ nodes: - name: blue label: Blue color: "#2196f3" - - name: light-blue + - name: light_blue label: Light Blue color: "#03a9f4" - name: cyan @@ -170,13 +177,13 @@ nodes: - name: aqua label: Aqua color: "#00ffff" - - name: dark-green + - name: dark_green label: Dark Green color: "#2f6a31" - name: green label: Green color: "#4caf50" - - name: light-green + - name: light_green label: Light Green color: "#8bc34a" - name: lime @@ -191,31 +198,36 @@ nodes: - name: orange label: Orange color: "#ff9800" - - name: dark-orange + - name: dark_orange label: Dark Orange color: "#ff5722" - name: brown label: Brown color: "#795548" - - name: light-grey + - name: light_grey label: Light Grey color: "#c0c0c0" - name: grey label: Grey color: "#9e9e9e" - - name: dark-grey + - name: dark_grey label: Dark Grey color: "#607d8b" - name: black label: Black color: "#111111" + optional: true + order_weight: 1300 + # Optional so a cable can be recorded before anyone labels it in the field, unique + # so a labelled cable still resolves through the human_friendly_id. - name: label kind: Text + unique: true optional: true - order_weight: 1200 + order_weight: 1000 # As we can't put float in Number "forcing" length in cm - name: length - label: Length (in cm) kind: Number + label: Length (in cm) optional: true order_weight: 1350 diff --git a/extensions/circuit/circuit.yml b/extensions/circuit/circuit.yml index b34e22aa..984265a0 100644 --- a/extensions/circuit/circuit.yml +++ b/extensions/circuit/circuit.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: @@ -9,6 +14,7 @@ nodes: description: A Circuit represent service operated by a provider. label: Circuit icon: mdi:cable-data + include_in_menu: true human_friendly_id: - circuit_id__value order_by: @@ -18,137 +24,182 @@ nodes: - name: circuit_id kind: Text unique: true + optional: false + order_weight: 1000 - name: description kind: Text optional: true + order_weight: 1100 + - name: commit_rate + kind: Number + label: Commit Rate (Kbps) + optional: true + order_weight: 1400 - name: circuit_type kind: Dropdown - description: Specifies the type of circuit. choices: - - name: upstream - label: Upstream - description: Connection to an upstream provider or Internet service provider (ISP) + - name: internet_access + label: Internet Access + description: Broadband or dedicated internet access circuit. color: "#1e90ff" + - name: point_to_point + label: Point to Point + description: Dedicated layer 2 or layer 3 link between two sites. + color: "#a0c878" - name: peering label: Peering - description: Connection to another network for exchange of traffic + description: Connection to another network for exchange of traffic. color: "#20b2aa" - name: dark_fiber label: Dark Fiber - description: Leased, unlit fiber for customer management and operation - color: "#333333" + description: Leased, unlit fiber managed and operated by the customer. + color: "#555555" - name: mpls label: MPLS - description: Multi-Protocol Label Switching circuit for QoS-based routing + description: Multi-Protocol Label Switching circuit for QoS-based routing. color: "#7f00ff" + optional: true + description: Specifies the type of circuit. + order_weight: 1300 - name: status kind: Dropdown + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: "#7fbf7f" + color: "#00d25b" - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: "#ffff7f" + color: "#f0ad4e" - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: "#ffd27f" + color: "#ff9800" - name: drained label: Drained description: Temporarily taken out of service. - color: "#bfbfbf" + color: "#9e9e9e" + optional: false + order_weight: 1200 relationships: - name: provider peer: OrganizationProvider - optional: false - cardinality: one kind: Attribute - - name: location - label: Location - peer: LocationHosting - optional: true cardinality: one - kind: Attribute + optional: false + identifier: circuit__provider order_weight: 1500 - - name: enpoints + - name: endpoints peer: DcimCircuitEndpoint - optional: true - cardinality: many kind: Component + cardinality: many + optional: true + identifier: circuit__endpoint + order_weight: 1600 + # The description field carries the provider-side reference for the termination, + # for example a patch panel position or a cross-connect ID. - name: CircuitEndpoint namespace: Dcim - description: A circuit endpoint, could be a position in a MMR... + description: >- + One of the two terminations (A or Z) of a circuit, at the location where the provider hands + the circuit off. label: Circuit Endpoint - inherit_from: - - DcimEndpoint icon: mdi:ethernet + include_in_menu: true menu_placement: DcimCircuit + inherit_from: + - DcimEndpoint human_friendly_id: - circuit__circuit_id__value - name__value - uniqueness_constraints: - - [circuit, name__value] order_by: - name__value display_label: name__value + uniqueness_constraints: + - [circuit, side__value] attributes: + - name: side + kind: Dropdown + label: Side + choices: + - name: a + label: A + description: A-side of the circuit. + - name: z + label: Z + description: Z-side of the circuit. + optional: false + order_weight: 950 - name: name kind: Text - description: Name of the circuit endoint, could be a MMR position for instance. + read_only: true + computed_attribute: + kind: Jinja2 + jinja2_template: "{{ circuit__circuit_id__value }}_{{ side__value | upper }}" + optional: false order_weight: 1000 - name: status kind: Dropdown - optional: true + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: "#7fbf7f" + color: "#00d25b" - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: "#ffff7f" + color: "#f0ad4e" - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: "#ffd27f" + color: "#ff9800" - name: drained label: Drained description: Temporarily taken out of service. - color: "#bfbfbf" + color: "#9e9e9e" + optional: false + order_weight: 1200 - name: description kind: Text optional: true + order_weight: 1100 relationships: - name: circuit peer: DcimCircuit - order_weight: 900 - optional: false - cardinality: one kind: Parent + cardinality: one + optional: false + identifier: circuit__endpoint + order_weight: 900 - name: location - label: Location peer: LocationHosting - optional: false - cardinality: one + label: Location kind: Attribute + cardinality: one + optional: false + identifier: circuit_endpoint__location order_weight: 1500 - extensions: nodes: - kind: OrganizationProvider relationships: - name: circuits peer: DcimCircuit + kind: Generic cardinality: many optional: true + identifier: circuit__provider + order_weight: 1300 - kind: LocationHosting relationships: - - name: circuits - peer: DcimCircuit + - name: circuit_endpoints + peer: DcimCircuitEndpoint + kind: Generic cardinality: many optional: true + identifier: circuit_endpoint__location + order_weight: 1700 diff --git a/extensions/circuit_contract/circuit_contract.yml b/extensions/circuit_contract/circuit_contract.yml index fc7ab250..e9baf67d 100644 --- a/extensions/circuit_contract/circuit_contract.yml +++ b/extensions/circuit_contract/circuit_contract.yml @@ -1,15 +1,21 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json --- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: - name: CircuitContract namespace: Dcim - inherit_from: - - CoreFileObject description: A contract document associated with a circuit service, including terms, costs, and validity period. label: Circuit Contract icon: mdi:file-sign + include_in_menu: true menu_placement: DcimCircuit + inherit_from: + - CoreFileObject human_friendly_id: - name__value order_by: @@ -18,23 +24,26 @@ nodes: attributes: - name: name kind: Text + read_only: true # You must set the attribute to read-only as the value will be handled by the system computed_attribute: kind: Jinja2 jinja2_template: "contract_{{ circuit__circuit_id__value }}" - read_only: true # You must set the attribute to read-only as the value will be handled by the system optional: false # As it's a Jinja2 kind of attribute you can make it mandatory + order_weight: 1000 - name: contract_start kind: DateTime optional: false + order_weight: 1200 - name: contract_end kind: DateTime optional: false + order_weight: 1300 - name: monthly_cost kind: Number optional: true + order_weight: 1400 - name: currency kind: Dropdown - optional: true choices: - name: usd label: USD @@ -45,6 +54,8 @@ nodes: - name: gbp label: GBP description: British Pound Sterling + optional: true + order_weight: 1450 relationships: # Example of a relationship to capture the account that signed the contract # - name: signed_by @@ -57,13 +68,16 @@ nodes: kind: Attribute cardinality: one optional: false + identifier: circuit__contract order_weight: 950 - extensions: nodes: - kind: DcimCircuit relationships: - name: contract peer: DcimCircuitContract + kind: Generic cardinality: one optional: true + identifier: circuit__contract + order_weight: 1550 diff --git a/extensions/cluster/cluster.yml b/extensions/cluster/cluster.yml index 30aaf12f..5d1192c1 100644 --- a/extensions/cluster/cluster.yml +++ b/extensions/cluster/cluster.yml @@ -1,13 +1,18 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: - name: Generic namespace: Cluster description: A cluster of machines hosting services or other machines. - label: Clusters icon: mdi:dots-hexagon + include_in_menu: false human_friendly_id: - name__value order_by: @@ -16,25 +21,27 @@ generics: attributes: - name: name kind: Text - description: Name of the cluster. unique: true + optional: false + description: Name of the cluster. order_weight: 1000 - name: description kind: Text optional: true + order_weight: 1100 relationships: - - name: location - label: Location + - name: locations peer: LocationGeneric - optional: false - cardinality: many + label: Locations kind: Attribute + cardinality: many + optional: false order_weight: 1400 - name: tags peer: BuiltinTag - optional: true - cardinality: many kind: Attribute + cardinality: many + optional: true order_weight: 2000 - name: GenericComputeUnitNodes @@ -43,29 +50,33 @@ generics: include_in_menu: false relationships: - name: nodes - label: Nodes - identifier: worker_in_cluster - cardinality: many peer: ComputeGenericUnit + label: Nodes kind: Component - + cardinality: many + identifier: worker_in_cluster + optional: true + order_weight: 1500 extensions: nodes: - kind: ComputeGenericUnit relationships: - name: worker_in_cluster - identifier: worker_in_cluster - label: Worker in cluster peer: ClusterGenericComputeUnitNodes + kind: Generic + label: Worker in cluster cardinality: one - description: This device is a worker node of the specified cluster. optional: true + identifier: worker_in_cluster + description: This device is a worker node of the specified cluster. + order_weight: 1900 - kind: LocationGeneric relationships: - name: clusters - label: Clusters peer: ClusterGeneric - cardinality: many + label: Clusters kind: Component - description: All clusters available on that location. + cardinality: many optional: true + description: All clusters available on that location. + order_weight: 1650 diff --git a/extensions/compute/compute.yml b/extensions/compute/compute.yml index 25fa8ceb..709babf9 100644 --- a/extensions/compute/compute.yml +++ b/extensions/compute/compute.yml @@ -1,12 +1,18 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: - name: GenericUnit namespace: Compute description: A generic unit that can compute (e.g. server, vm ...). - include_in_menu: false + label: Compute + include_in_menu: true - name: HostVirtualMachine namespace: Virtualization @@ -14,10 +20,12 @@ generics: include_in_menu: false relationships: - name: virtual_machines - cardinality: many peer: VirtualizationVirtualMachine kind: Component + cardinality: many optional: true + identifier: host__virtual_machine + order_weight: 1450 nodes: - name: PhysicalServer @@ -25,6 +33,8 @@ nodes: description: A physical server with fixed resources and specific hardware characteristics. label: Physical Server icon: mdi:server + include_in_menu: true + menu_placement: ComputeGenericUnit inherit_from: - ComputeGenericUnit - DcimGenericDevice @@ -34,63 +44,70 @@ nodes: attributes: - name: status kind: Dropdown - optional: false - order_weight: 1100 + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: "#7fbf7f" + color: "#00d25b" - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: "#ffff7f" + color: "#f0ad4e" - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: "#ffd27f" + color: "#ff9800" - name: drained label: Drained description: Temporarily taken out of service. - color: "#bfbfbf" + color: "#9e9e9e" + optional: false + order_weight: 1200 + - name: VirtualMachine namespace: Virtualization description: A virtual machine hosted on a server or a cluster. label: Virtual Machine icon: carbon:virtual-machine + menu_placement: ComputeGenericUnit + include_in_menu: true inherit_from: - ComputeGenericUnit - DcimGenericDevice attributes: - name: role kind: Dropdown - optional: true - description: Role of the virtual machine. - order_weight: 1400 choices: - name: application + label: Application color: "#7f7fff" - name: storage + label: Storage color: "#bf7fbf" + optional: true + description: Role of the virtual machine. + order_weight: 1300 - name: vcpu kind: Number optional: true - order_weight: 1900 description: Number of CPU cores assigned to the VM. + order_weight: 1400 - name: memory kind: Number optional: true - order_weight: 1900 description: Amount of memory (in GB) assigned to the VM. + order_weight: 1450 - name: disk kind: Number optional: true - order_weight: 1900 description: Disk space (in GB) assigned to the VM. + order_weight: 1500 relationships: - name: host peer: VirtualizationHostVirtualMachine - optional: false - cardinality: one kind: Attribute - order_weight: 1500 + cardinality: one + optional: false + identifier: host__virtual_machine + order_weight: 1350 diff --git a/extensions/cross_connect/cross_connect.yml b/extensions/cross_connect/cross_connect.yml index da256ef3..d7675992 100644 --- a/extensions/cross_connect/cross_connect.yml +++ b/extensions/cross_connect/cross_connect.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: @@ -8,52 +13,55 @@ nodes: description: Cross-connect between different endpoints within a datacenter. label: Cross-Connect icon: streamline:arrow-crossover-right-solid + include_in_menu: true inherit_from: - DcimConnector - order_by: - - provider__name__value - display_label: "{{ identifier__value }} (Provider: {{ provider__name__value }})" human_friendly_id: - provider__name__value - identifier__value + order_by: + - provider__name__value + display_label: "{{ identifier__value }} (Provider: {{ provider__name__value }})" uniqueness_constraints: - [identifier__value, provider] attributes: - name: identifier kind: Text - order_weight: 900 + optional: false + order_weight: 1000 - name: description kind: Text optional: true - order_weight: 1300 + order_weight: 1100 - name: status kind: Dropdown - optional: true - order_weight: 1200 + default_value: planned choices: - name: connected label: Connected - description: "Fully operational and currently in connected" - color: "#7fbf7f" + description: "Fully operational and currently connected" + color: "#00d25b" - name: planned label: Planned description: "In the process of being set up" - color: "#ffff7f" + color: "#2196f3" - name: reserved label: Reserved description: "Fully connected and reserved for a future use" - color: "#9090de" + color: "#4d90fe" + optional: false + order_weight: 1200 relationships: - name: location - label: Location peer: LocationHosting - optional: false - cardinality: one + label: Location kind: Attribute - order_weight: 1100 + cardinality: one + optional: false + order_weight: 1400 - name: provider peer: OrganizationProvider - optional: false - cardinality: one kind: Attribute - order_weight: 1000 + cardinality: one + optional: false + order_weight: 1300 diff --git a/extensions/device_module/README.md b/extensions/device_module/README.md new file mode 100644 index 00000000..f23726f1 --- /dev/null +++ b/extensions/device_module/README.md @@ -0,0 +1,3 @@ +# device_module + +Please refer to the [reference page](https://docs.infrahub.app/schema-library/reference/device_module) for the corresponding documentation. diff --git a/extensions/device_module/device_module.yml b/extensions/device_module/device_module.yml new file mode 100644 index 00000000..06e8073b --- /dev/null +++ b/extensions/device_module/device_module.yml @@ -0,0 +1,258 @@ +--- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- + +version: "1.0" + +generics: + - name: GenericModule + namespace: Dcim + description: "A generic module, such as a Linecard or Routing Engine, installed in a module bay." + label: "Module" + icon: mdi:expansion-card + include_in_menu: true + human_friendly_id: + - computed_name__value + display_label: computed_name__value + attributes: + - name: computed_name + kind: Text + unique: true + read_only: true + optional: false + allow_override: any + computed_attribute: + kind: Jinja2 + jinja2_template: "{{ module_bay__computed_name__value }}" + description: "Name computed from the module bay; concrete module kinds may refine it." + order_weight: 1000 + - name: serial_number + kind: Text + optional: true + description: "Serial number of the module, if known." + order_weight: 1400 + - name: description + kind: Text + optional: true + order_weight: 1100 + - name: status + kind: Dropdown + default_value: active + choices: + - name: provisioning + label: Provisioning + description: "Module is being installed and provisioned." + color: "#f0ad4e" + - name: active + label: Active + description: "Module is installed and operational." + color: "#00d25b" + - name: maintenance + label: Maintenance + description: "Module is under maintenance." + color: "#ff9800" + - name: failed + label: Failed + description: "Module is still installed but is not operational." + color: "#e04040" + - name: rma + label: RMA + description: "Module has failed and is being returned to the manufacturer." + color: "#6c757d" + optional: false + description: "Operational status of the module." + order_weight: 1200 + relationships: + - name: module_bay + peer: DcimModuleBay + label: Module Bay + kind: Attribute + cardinality: one + optional: false + identifier: module_bay__module + # A module only exists once installed - it must be installed to be tracked. + # Spares awaiting installation aren't modeled by this node. + order_weight: 900 + + - name: GenericModuleType + namespace: Dcim + description: "A generic module type, with common specifications like part number and manufacturer." + label: "Module Type" + icon: mdi:database-cog + include_in_menu: true + menu_placement: DcimGenericModule + human_friendly_id: + - name__value + order_by: + - manufacturer__name__value + - name__value + display_label: name__value + uniqueness_constraints: + - ["name__value", "manufacturer"] + attributes: + - name: name + kind: Text + unique: true + optional: false + description: "Name of the module type." + order_weight: 1000 + - name: description + kind: Text + optional: true + description: "Description of the module type." + order_weight: 1100 + - name: part_number + kind: Text + label: Part Number + optional: true + description: "Part number of the module." + order_weight: 1200 + relationships: + - name: manufacturer + peer: OrganizationManufacturer + kind: Attribute + cardinality: one + optional: false + identifier: manufacturer__moduletype + description: "Manufacturer of the module type." + order_weight: 1250 + +nodes: + - name: ModuleBay + namespace: Dcim + description: "A physical bay on a device that can receive a module." + label: "Module Bay" + icon: mdi:tray + include_in_menu: true + menu_placement: DcimDevice + human_friendly_id: + - computed_name__value + order_by: + - device__name__value + - name__value + display_label: computed_name__value + uniqueness_constraints: + - ["device", "name__value"] + attributes: + - name: computed_name + kind: Text + unique: true + read_only: true + computed_attribute: + kind: Jinja2 + jinja2_template: "{{ device__name__value }} > {{ name__value }}" + optional: false + description: "Name computed from the device and bay name." + order_weight: 800 + - name: name + kind: Text + optional: false + description: "Name of the bay, e.g. 'slot 1' or 'psu 1'." + order_weight: 1000 + - name: position + kind: Number + optional: true + parameters: + min_value: 1 + description: "Numeric position of the bay within the device (e.g. slot 1, 2, 3)." + order_weight: 1050 + - name: description + kind: Text + optional: true + order_weight: 1100 + - name: role + kind: Dropdown + optional: true + description: "The role of the module bay, indicating the type of module it is intended to receive." + order_weight: 1300 + choices: + - name: supervisor + label: Supervisor + description: "Bay intended for a supervisor / routing engine module." + color: "#A9CCE3" + - name: line_card + label: Line Card + description: "Bay intended for a line card module." + color: "#B4E0DC" + - name: power_supply + label: Power Supply + description: "Bay intended for a power supply module." + color: "#E3DAC9" + - name: fan + label: Fan + description: "Bay intended for a fan module." + color: "#D2B4DE" + relationships: + - name: device + peer: DcimPhysicalDevice + label: Device + # Peer is DcimPhysicalDevice; base/dcim.yml adds `name` to that generic so + # `device__name__value` resolves in computed_name above. + kind: Parent + cardinality: one + optional: false + identifier: device__module_bays + order_weight: 900 + - name: installed_module + peer: DcimGenericModule + label: Installed Module + kind: Attribute + cardinality: one + optional: true + identifier: module_bay__module + order_weight: 1200 + + - name: Module + namespace: Dcim + description: "Standard module installed in a device." + label: "Module" + icon: mdi:expansion-card + include_in_menu: false + inherit_from: + - DcimGenericModule + attributes: + - name: computed_name + kind: Text + unique: true + read_only: true + computed_attribute: + kind: Jinja2 + jinja2_template: "{{ module_bay__computed_name__value }} ({{ module_type__name__value }})" + optional: false + description: "Name computed from the module bay and module type." + order_weight: 1000 + relationships: + - name: module_type + peer: DcimModuleType + kind: Attribute + cardinality: one + optional: false + order_weight: 950 + + - name: ModuleType + namespace: Dcim + description: "Standard module type, defining common specifications for a Module." + label: "Module Type" + icon: mdi:database-cog + include_in_menu: false + inherit_from: + - DcimGenericModuleType + +extensions: + nodes: + # DCIM Extensions + - kind: DcimPhysicalDevice + relationships: + - name: module_bays + peer: DcimModuleBay + label: Module Bays + kind: Component + cardinality: many + optional: true + identifier: device__module_bays + description: "Module bays available on this device." + order_weight: 1750 diff --git a/extensions/device_psu_module/README.md b/extensions/device_psu_module/README.md new file mode 100644 index 00000000..d45d7938 --- /dev/null +++ b/extensions/device_psu_module/README.md @@ -0,0 +1,3 @@ +# device_psu_module + +Please refer to the [reference page](https://docs.infrahub.app/schema-library/reference/device_psu_module) for the corresponding documentation. diff --git a/extensions/device_psu_module/device_psu_module.yml b/extensions/device_psu_module/device_psu_module.yml new file mode 100644 index 00000000..28b5d220 --- /dev/null +++ b/extensions/device_psu_module/device_psu_module.yml @@ -0,0 +1,62 @@ +--- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- + +version: "1.0" + +nodes: + - name: PSUModule + namespace: Dcim + description: "Power Supply Unit (PSU) installed in a device." + label: "PSU Module" + icon: mdi:power-plug + include_in_menu: false + inherit_from: + - DcimGenericModule + attributes: + - name: computed_name + kind: Text + unique: true + read_only: true + computed_attribute: + kind: Jinja2 + jinja2_template: "{{ module_bay__computed_name__value }} ({{ module_type__name__value }})" + optional: false + description: "Name computed from the module bay and module type." + order_weight: 1000 + relationships: + - name: module_type + peer: DcimPSUModuleType + kind: Attribute + cardinality: one + optional: false + order_weight: 950 + + - name: PSUModuleType + namespace: Dcim + description: "PSU module type, defining common specifications such as wattage and hot-swap capability." + label: "PSU Module Type" + icon: mdi:database-cog + include_in_menu: false + inherit_from: + - DcimGenericModuleType + attributes: + - name: wattage + kind: Number + label: Wattage (W) + optional: true + parameters: + min_value: 1 + description: "Wattage in watts." + order_weight: 1300 + - name: hot_swappable + kind: Boolean + label: Hot-Swappable + default_value: false + optional: false + description: "Whether the PSU can be replaced without powering down the device." + order_weight: 1350 diff --git a/extensions/dwdm/dwdm.yml b/extensions/dwdm/dwdm.yml index 90e37ff9..c8dcdd32 100644 --- a/extensions/dwdm/dwdm.yml +++ b/extensions/dwdm/dwdm.yml @@ -1,135 +1,146 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: - name: GenericOadmInterface - label: Optical Multiplexer Interfaces - menu_placement: DcimOpticalMultiplexer namespace: Dcim + description: Generic interface of an optical add-drop multiplexer, front or rear. + label: Optical Multiplexer Interfaces icon: mdi:ethernet + include_in_menu: true + menu_placement: DcimOpticalMultiplexer attributes: - name: name kind: Text + optional: false order_weight: 1000 - name: description kind: Text optional: true - order_weight: 2000 + order_weight: 1100 + # NOTE: this choice list is duplicated in extensions/patch_panel and the two must be + # kept in sync. Infrahub cannot share a choice list across extension files without a + # shared generic in a common ancestor, which is a base-tier change. - name: connector_type kind: Dropdown - order_weight: 1100 choices: - - name: FC + - name: fc label: FC description: "Standardized fiber optic connector used primarily in datacom and telecom applications." - - name: LC + - name: lc label: LC description: "Compact fiber optic connector with a push-pull mechanism." - - name: LC_PC + - name: lc_pc label: LC/PC description: "Polished LC connector providing physical contact (PC)." - - name: LC_UPC + - name: lc_upc label: LC/UPC description: "Ultra-Physical Contact (UPC) variant of the LC connector with enhanced polish." - - name: LC_APC + - name: lc_apc label: LC/APC description: "Angled Physical Contact (APC) version of the LC connector with a slanted fiber end-face." - - name: LSH + - name: lsh label: LSH description: "European fiber optic connector offering high durability." - - name: LSH_PC + - name: lsh_pc label: LSH/PC description: "Physical Contact version of LSH with standard polish." - - name: LSH_UPC + - name: lsh_upc label: LSH/UPC description: "Ultra-Physical Contact variant of LSH, minimizing return loss with a superior polish." - - name: LSH_APC + - name: lsh_apc label: LSH/APC description: "Angled Physical Contact version of LSH, designed to reduce back reflections." - - name: LX_5 + - name: lx_5 label: LX.5 description: "Miniaturized fiber optic connector similar to LC but with an additional shutter mechanism." - - name: LX_5_PC + - name: lx_5_pc label: LX.5/PC description: "Physical Contact version of LX.5." - - name: LX_5_UPC + - name: lx_5_upc label: LX.5/UPC description: "Ultra-Physical Contact variant of LX.5." - - name: LX_5_APC + - name: lx_5_apc label: LX.5/APC description: "Angled Physical Contact version of LX.5." - - name: MPO + - name: mpo label: MPO description: "Multi-fiber Push-On connector typically used in data centers for high-speed applications." - - name: MTRJ + - name: mtrj label: MTRJ description: "Male-to-female fiber optic connector with two fibers." - - name: SC + - name: sc label: SC description: "Square fiber optic connector with push-pull lock." - - name: SC_PC + - name: sc_pc label: SC/PC description: "Physical Contact SC connector with a polished end-face." - - name: SC_UPC + - name: sc_upc label: SC/UPC description: "Ultra-Physical Contact variant of SC." - - name: SC_APC + - name: sc_apc label: SC/APC description: "Angled Physical Contact version of SC." - - name: ST + - name: st label: ST description: "Bayonet-style fiber optic connector primarily used in industrial and military applications." - - name: CS + - name: cs label: CS description: "Compact connector with a high-density duplex configuration." - - name: SN + - name: sn label: SN description: "Small-form connector with dual fibers." - - name: SMA_905 + - name: sma_905 label: SMA 905 description: "Stainless steel fiber optic connector." - - name: SMA_906 + - name: sma_906 label: SMA 906 description: "Variant of SMA 905 with similar durability, frequently used in high-vibration settings." - - name: URM_P2 + - name: urm_p2 label: URM-P2 description: "Specialized fiber optic connector for industrial and harsh environments." - # FIXME: Commenting out otherwise I'm facing a Text attribute length should be less than 4096 characters. - # - name: URM_P4 - # label: URM-P4 - # description: "Similar to URM-P2 but designed for higher performance." - # - name: URM_P8 - # label: URM-P8 - # description: "Enhanced version of URM connectors with higher protection." - # - name: Splice - # label: Splice - # description: "Permanent fiber connection method where two fiber ends are fused." - + - name: urm_p4 + label: URM-P4 + description: "Similar to URM-P2 but designed for higher performance." + - name: urm_p8 + label: URM-P8 + description: "Enhanced version of URM connectors with higher protection." + - name: splice + label: Splice + description: "Permanent fiber connection method where two fiber ends are fused." + optional: false + order_weight: 1200 nodes: - name: OpticalMultiplexer + namespace: Dcim + description: >- + An OADM (Optical Add Drop Multiplexer) supporting various WDM + (Wavelength Division Multiplexing) technologies. label: Optical Multiplexer - description: An OADM (Optical Add Drop Multiplexer) supporting various - WDM (Wavelength Division Multiplexing) technologies. icon: mdi:transit-connection-variant - namespace: Dcim + include_in_menu: true + inherit_from: + - DcimPhysicalDevice human_friendly_id: - name__value order_by: - name__value display_label: name__value - inherit_from: - - DcimPhysicalDevice attributes: - name: name kind: Text unique: true + optional: false order_weight: 1000 - name: wdm_type kind: Dropdown - description: Type of WDM (e.g CWDM. DWDM) - order_weight: 1110 - optional: false + default_value: dwdm choices: - name: cwdm label: CWDM (Coarse Wavelength Division Multiplexing) @@ -139,86 +150,99 @@ nodes: label: DWDM (Dense Wavelength Division Multiplexing) description: Supports dense wavelengths and amplification for long-distance communication. color: "#9933cc" - default_value: dwdm + optional: false + description: Type of WDM technology (e.g. CWDM, DWDM) + order_weight: 1300 - name: description kind: Text optional: true - order_weight: 2000 + order_weight: 1100 relationships: - name: front_interfaces peer: DcimOadmFrontInterface - identifier: front_interfaces - optional: true - cardinality: many kind: Component + cardinality: many + optional: true + identifier: optical_multiplexer__front_interfaces + order_weight: 1350 - name: rear_interface peer: DcimOadmRearInterface - identifier: rear_interfaces - optional: true - cardinality: one kind: Component + cardinality: one + optional: true + identifier: optical_multiplexer__rear_interface + order_weight: 1450 - name: OadmFrontInterface + namespace: Dcim + description: Client-side interface of an optical add-drop multiplexer, carrying a single channel. label: Optical Multiplexer Front Interfaces + include_in_menu: true menu_placement: DcimGenericOadmInterface - namespace: Dcim + inherit_from: + - DcimEndpoint + - DcimGenericOadmInterface human_friendly_id: - optical_multiplexer__name__value - name__value - display_label: "{{ optical_multiplexer__name__value }} > {{ name__value }}" order_by: - optical_multiplexer__name__value - name__value + display_label: "{{ optical_multiplexer__name__value }} > {{ name__value }}" uniqueness_constraints: - [optical_multiplexer, name__value] - inherit_from: - - DcimEndpoint - - DcimGenericOadmInterface relationships: - name: optical_multiplexer peer: DcimOpticalMultiplexer - order_weight: 900 - identifier: front_interfaces - optional: false - cardinality: one kind: Parent + cardinality: one + optional: false + identifier: optical_multiplexer__front_interfaces + order_weight: 900 - name: channels peer: DcimWdmChannel - order_weight: 1200 - optional: true - cardinality: many kind: Attribute + cardinality: many + optional: true + identifier: oadm_interface__channels + order_weight: 1300 - name: OadmRearInterface + namespace: Dcim + description: Line-side interface of an optical add-drop multiplexer, carrying the multiplexed signal. label: Optical Multiplexer Rear Interfaces + include_in_menu: true menu_placement: DcimGenericOadmInterface - namespace: Dcim + inherit_from: + - DcimEndpoint + - DcimGenericOadmInterface human_friendly_id: - optical_multiplexer__name__value - name__value - display_label: "{{ optical_multiplexer__name__value }} > {{ name__value }}" order_by: - optical_multiplexer__name__value - name__value + display_label: "{{ optical_multiplexer__name__value }} > {{ name__value }}" uniqueness_constraints: - [optical_multiplexer, name__value] - inherit_from: - - DcimEndpoint - - DcimGenericOadmInterface relationships: - name: optical_multiplexer peer: DcimOpticalMultiplexer - order_weight: 900 - identifier: rear_interface - optional: false - cardinality: one kind: Parent + cardinality: one + optional: false + identifier: optical_multiplexer__rear_interface + order_weight: 900 - name: WdmChannel namespace: Dcim description: A WDM channel with its wavelength and frequency. label: WDM Channel icon: game-icons:laser-warning + include_in_menu: true + human_friendly_id: + - wdm_type__value + - channel__value order_by: - wdm_type__value - channel__value @@ -229,18 +253,15 @@ nodes: # For a given type channel number must be unique - [channel__value, wdm_type__value] # TODO: Maybe add some further validations - human_friendly_id: - - wdm_type__value - - channel__value attributes: - name: channel kind: Number + optional: false description: WDM channel number. + order_weight: 1000 - name: wdm_type kind: Dropdown - description: Type of WDM (e.g CWDM. DWDM) - order_weight: 1110 - optional: false + default_value: dwdm choices: - name: cwdm label: CWDM (Coarse Wavelength Division Multiplexing) @@ -250,30 +271,35 @@ nodes: label: DWDM (Dense Wavelength Division Multiplexing) description: Supports dense wavelengths and amplification for long-distance communication. color: "#9933cc" - default_value: dwdm + optional: false + description: Type of WDM technology (e.g. CWDM, DWDM) + order_weight: 1100 - name: wavelength - label: Wavelength (nm) kind: Text # Text until float possible in Number Kind + label: Wavelength (nm) + optional: false description: Wavelength of the channel in nm. + order_weight: 1200 - name: frequency - label: Frequency (GHz) kind: Text # Text until float possible in Number Kind + label: Frequency (GHz) + optional: false description: Frequency of the channel in GHz. + order_weight: 1300 - name: WdmSFP namespace: Dcim - inherit_from: - - DcimGenericSFP description: SFP with configuration for Wavelength Division Multiplexing. label: WDM SFP icon: mdi:laser-pointer + include_in_menu: true menu_placement: DcimGenericSFP + inherit_from: + - DcimGenericSFP attributes: - name: wdm_type kind: Dropdown - description: Type of WDM (e.g CWDM. DWDM) - order_weight: 1110 - optional: false + default_value: dwdm choices: - name: cwdm label: CWDM (Coarse Wavelength Division Multiplexing) @@ -283,12 +309,15 @@ nodes: label: DWDM (Dense Wavelength Division Multiplexing) description: Supports dense wavelengths and amplification for long-distance communication. color: "#9933cc" - default_value: dwdm + optional: false + description: Type of WDM technology (e.g. CWDM, DWDM) + order_weight: 1150 relationships: - name: wdm_channel - label: WDM Channel peer: DcimWdmChannel + label: WDM Channel kind: Attribute cardinality: one optional: false - order_weight: 1150 + identifier: wdm_sfp__channel + order_weight: 1250 diff --git a/extensions/hosting_cluster/hosting_cluster.yml b/extensions/hosting_cluster/hosting_cluster.yml index 88dc69b7..1c8b4c03 100644 --- a/extensions/hosting_cluster/hosting_cluster.yml +++ b/extensions/hosting_cluster/hosting_cluster.yml @@ -1,54 +1,75 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: - name: Hosting namespace: Cluster - label: Hosting Cluster description: A cluster hosting virtual machines. + label: Hosting Cluster icon: mdi:dots-hexagon - menu_placement: ClusterGeneric + include_in_menu: true + menu_placement: ComputeGenericUnit inherit_from: - ClusterGeneric - VirtualizationHostVirtualMachine # Means we can get VM running on this one - ClusterGenericComputeUnitNodes # Means it's built out of regular compute unit (e.g. server) attributes: - - name: cluster_type + - name: technology kind: Dropdown - order_weight: 1200 - description: Type of the cluster. + label: Technology choices: - - name: aws - label: Amazon Web Service - color: "#b90028" - - name: kvm - label: KVM - color: "#0082e2" - - name: gcp - label: Google Cloud Platform - color: "#e29200" - name: vmware - label: VMware + label: VMware vSphere color: "#3d8600" - - name: status - kind: Dropdown + - name: kvm + label: KVM / QEMU + color: "#0082e2" + - name: hyper_v + label: Hyper-V + color: "#00adef" + - name: xen + label: Xen / XenServer + color: "#f5821f" + - name: nutanix + label: Nutanix AHV + color: "#024da1" + - name: openstack + label: OpenStack + color: "#ed1944" + - name: kubernetes + label: Kubernetes + color: "#326ce5" + - name: public_cloud + label: Public Cloud + color: "#888888" optional: false + description: Underlying virtualisation or clustering technology. order_weight: 1300 + - name: status + kind: Dropdown + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: "#7fbf7f" + color: "#00d25b" - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: "#ffff7f" + color: "#f0ad4e" - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: "#ffd27f" + color: "#ff9800" - name: drained label: Drained description: Temporarily taken out of service. - color: "#bfbfbf" + color: "#9e9e9e" + optional: false + order_weight: 1200 diff --git a/extensions/interface_breakout/interface_breakout.yml b/extensions/interface_breakout/interface_breakout.yml index 966bda7a..49160039 100644 --- a/extensions/interface_breakout/interface_breakout.yml +++ b/extensions/interface_breakout/interface_breakout.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" extensions: @@ -8,27 +13,28 @@ extensions: attributes: - name: breakout_capability kind: Boolean - optional: false default_value: false + optional: false description: "Indicates if the port supports breakout capability" + order_weight: 1800 relationships: - name: breakout_child_interfaces peer: InterfacePhysical label: "Breakout child interface(s)" - optional: true - cardinality: many kind: Attribute + cardinality: many + optional: true identifier: "physical__breakout" direction: outbound description: "Interfaces resulting from the breakout" - order_weight: 1650 + order_weight: 1850 - name: breakout_parent_interface peer: InterfacePhysical label: "Breakout parent interface" - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true identifier: "physical__breakout" direction: inbound description: "Interface from which breakout is created" - order_weight: 1700 + order_weight: 1900 diff --git a/extensions/lag/lag.yml b/extensions/lag/lag.yml index f95c4cbf..53f8a7af 100644 --- a/extensions/lag/lag.yml +++ b/extensions/lag/lag.yml @@ -1,47 +1,57 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: - name: InterfaceBundle namespace: Generic + description: Generic holding the members of an interface bundle such as a LAG. label: Generic Interface Bundle include_in_menu: false attributes: - name: name kind: Text + optional: false description: "Name of the interface" order_weight: 1000 - name: bundle_number kind: Number + optional: false description: "Bundle number for the aggregated interface" - order_weight: 1100 + order_weight: 1250 relationships: - name: bundle_members - label: "Member(s)" peer: InterfacePhysical - identifier: interface__bundle - cardinality: many + label: "Member(s)" kind: Attribute + cardinality: many + identifier: interface__bundle + optional: true description: "Physical Interfaces that are members of this aggregate" order_weight: 1800 nodes: - name: Lag namespace: Interface - label: LAG Interface description: "LAG interface" + label: LAG Interface + include_in_menu: false inherit_from: - DcimInterface - InterfaceLayer2 - InterfaceLayer3 - InterfaceHasSubInterface - GenericInterfaceBundle - include_in_menu: false attributes: - name: lacp_rate - label: "LACP Rate" kind: Dropdown + label: "LACP Rate" + default_value: fast choices: - name: slow label: Slow @@ -49,12 +59,13 @@ nodes: - name: fast label: Fast color: "#E6E6FA" # lavender - default_value: fast + optional: false description: "LACP rate for the aggregated interface" - order_weight: 1700 + order_weight: 1850 - name: lacp_mode - label: LACP Mode kind: Dropdown + label: LACP Mode + default_value: active choices: - name: active label: Active @@ -65,18 +76,19 @@ nodes: - name: disabled label: Disabled color: "#E6E6FA" # lavender + optional: false description: "LACP mode for the aggregated interface" - default_value: active - order_weight: 1750 + order_weight: 1900 relationships: - # Redifine the relationship here to add common_parent constraint + # Redefine the relationship here to add the common_parent constraint - name: bundle_members - common_parent: device - label: "Member(s)" peer: InterfacePhysical - identifier: interface__bundle - cardinality: many + label: "Member(s)" kind: Attribute + cardinality: many + identifier: interface__bundle + common_parent: device + optional: true description: "Physical Interfaces that are members of this aggregate" order_weight: 1800 @@ -85,11 +97,11 @@ extensions: - kind: InterfacePhysical relationships: - name: bundle - label: Interface Bundle peer: GenericInterfaceBundle - identifier: interface__bundle - optional: true - cardinality: one + label: Interface Bundle kind: Attribute + cardinality: one + optional: true + identifier: interface__bundle description: "Interface Bundle using this Physical Interface" - order_weight: 1800 + order_weight: 1950 diff --git a/extensions/location_minimal/README.md b/extensions/location_minimal/README.md index 428e0ee8..af0126d5 100644 --- a/extensions/location_minimal/README.md +++ b/extensions/location_minimal/README.md @@ -1,3 +1,5 @@ # location_minimal Please refer to the [reference page](https://docs.infrahub.app/schema-library/reference/location_minimal) for the corresponding documentation. + +This extension defines `Location.Site`, the same node as `extensions/location_site`. Load one or the other, never both. diff --git a/extensions/location_minimal/location_minimal.yml b/extensions/location_minimal/location_minimal.yml index 15eb4944..0805fe12 100644 --- a/extensions/location_minimal/location_minimal.yml +++ b/extensions/location_minimal/location_minimal.yml @@ -1,97 +1,86 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" +# Defines Location.Site. Mutually exclusive with extensions/location_site, load one, not both. nodes: - - name: Country + - name: Region namespace: Location - label: Country + description: A geographical region grouping countries and sites. + label: Region + icon: carbon:cics-region-target + include_in_menu: true + menu_placement: LocationGeneric inherit_from: - LocationGeneric - menu_placement: LocationGeneric - display_label: name__value + - IpamPrefixScope parent: "" - children: LocationMetro - icon: gis:search-country - attributes: - - name: timezone - kind: Text - optional: true - order_weight: 1300 + children: LocationCountry - - name: Metro + - name: Country namespace: Location - label: Metro + description: A country, sitting between a region and the sites it contains. + label: Country + icon: gis:search-country + include_in_menu: true + menu_placement: LocationGeneric inherit_from: - LocationGeneric - menu_placement: LocationGeneric - display_label: name__value - parent: LocationCountry + parent: LocationRegion children: LocationSite - icon: healthicons:city - name: Site namespace: Location + description: A physical location hosting equipment, such as a data center or an office. label: Site + icon: ri:building-line + include_in_menu: true + menu_placement: LocationGeneric inherit_from: - LocationGeneric - LocationHosting - menu_placement: LocationGeneric + - IpamPrefixScope + - IpamVLANGroupScope + parent: LocationCountry display_label: name__value - parent: LocationMetro - children: LocationRack - icon: ri:building-line attributes: - - name: facility_id + - name: status + kind: Dropdown + default_value: active + choices: + - name: active + label: Active + color: "#00d25b" + - name: planned + label: Planned + color: "#2196f3" + - name: staging + label: Staging + color: "#f0ad4e" + - name: decommissioning + label: Decommissioning + color: "#ff9800" + - name: deprecated + label: Deprecated + color: "#6c757d" + optional: false + order_weight: 1200 + - name: facility kind: Text unique: false optional: true - order_weight: 1100 + order_weight: 1150 - name: physical_address kind: Text unique: false optional: true - order_weight: 1500 - relationships: - - name: owner - peer: OrganizationGeneric - optional: true - cardinality: one - - - name: Rack - namespace: Location - label: Rack - inherit_from: - - LocationGeneric - - LocationHosting - include_in_menu: true - display_label: name__value - menu_placement: LocationGeneric - parent: LocationSite - icon: clarity:rack-server-line - attributes: - - name: facility_id + order_weight: 1400 + - name: timezone kind: Text - unique: false optional: true - order_weight: 1100 - - name: height - label: Height (U) - optional: false - default_value: 42 - kind: Number order_weight: 1300 - relationships: - - name: owner - peer: OrganizationGeneric - optional: true - cardinality: one - -extensions: - nodes: - - kind: OrganizationProvider - relationships: - - name: sites - peer: LocationSite - cardinality: many - optional: true diff --git a/extensions/location_site/README.md b/extensions/location_site/README.md new file mode 100644 index 00000000..822016ce --- /dev/null +++ b/extensions/location_site/README.md @@ -0,0 +1,5 @@ +# location_site + +Please refer to the [reference page](https://docs.infrahub.app/schema-library/reference/location_site) for the corresponding documentation. + +This extension defines `Location.Site`, the same node as `extensions/location_minimal`. Load one or the other, never both. diff --git a/extensions/location_site/location_site.yml b/extensions/location_site/location_site.yml new file mode 100644 index 00000000..b6709dd8 --- /dev/null +++ b/extensions/location_site/location_site.yml @@ -0,0 +1,60 @@ +--- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- +version: "1.0" + +# Defines Location.Site. Mutually exclusive with extensions/location_minimal, load one, not both. +nodes: + - name: Site + namespace: Location + description: A physical location hosting equipment, such as a data center or an office. + label: Site + icon: ri:building-line + include_in_menu: true + menu_placement: LocationGeneric + inherit_from: + - LocationGeneric + - LocationHosting + - IpamPrefixScope + - IpamVLANGroupScope + display_label: name__value + attributes: + - name: status + kind: Dropdown + default_value: active + choices: + - name: active + label: Active + color: "#00d25b" + - name: planned + label: Planned + color: "#2196f3" + - name: staging + label: Staging + color: "#f0ad4e" + - name: decommissioning + label: Decommissioning + color: "#ff9800" + - name: deprecated + label: Deprecated + color: "#6c757d" + optional: false + order_weight: 1200 + - name: facility + kind: Text + unique: false + optional: true + order_weight: 1150 + - name: physical_address + kind: Text + unique: false + optional: true + order_weight: 1400 + - name: timezone + kind: Text + optional: true + order_weight: 1300 diff --git a/extensions/meet_me_room/README.md b/extensions/meet_me_room/README.md deleted file mode 100644 index 1cdb12b5..00000000 --- a/extensions/meet_me_room/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# 🧩 Meet me room - -This extension will allow you to capture meet me room within a datacenter. It will be part of the location hierarchy and you will be able to attach various "hosting" related objects (circuit endpoints, patch panels...) - -## Node - -- MMR - -## Dependencies - -- Base -- LocationMinimal diff --git a/extensions/mlag/mlag.yml b/extensions/mlag/mlag.yml index d2d62287..749c74d9 100644 --- a/extensions/mlag/mlag.yml +++ b/extensions/mlag/mlag.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: @@ -10,31 +15,35 @@ generics: # and add the necessary relationships/attributes to it following MlagDomain node example below - name: MlagDomain namespace: Generic - include_in_menu: false + description: Generic holding the peer links and interfaces shared by the members of an MLAG domain. label: MLAG Domain - display_label: domain_id__value + include_in_menu: false human_friendly_id: - domain_id__value + display_label: domain_id__value attributes: - name: domain_id - label: "MLAG Domain ID" kind: Text + label: "MLAG Domain ID" unique: true # TODO: This one could be a mess to make unique... + optional: false description: "Identifier for the MLAG domain" - order_weight: 900 + order_weight: 1000 - name: reload_delay - label: "Reload Delay" kind: Number - description: "Time in seconds to wait before bringing up the MLAG after a reload" + label: "Reload Delay" default_value: 300 + optional: false + description: "Time in seconds to wait before bringing up the MLAG after a reload" order_weight: 1650 relationships: - name: peer_links - label: "Peer Links" - description: "LAG interfaces used as peer-links between the MLAG peers" peer: InterfaceLag - cardinality: many + label: "Peer Links" kind: Attribute + cardinality: many + optional: true + description: "LAG interfaces used as peer-links between the MLAG peers" order_weight: 1500 # Depending on the use-case this could be optional or not # Example: User creates a MLAG domain and generator implements it = keep it optional @@ -45,33 +54,35 @@ generics: # max_count: 2 # min_count: 2 - name: mlag_interfaces - label: "MLAG Interface(s)" peer: MlagInterface - cardinality: many + label: "MLAG Interface(s)" kind: Component + cardinality: many + optional: true description: "Bundle interfaces that are spread across all devices in this MLAG domain." - order_weight: 1500 + order_weight: 1550 nodes: - name: Interface namespace: Mlag - label: MLAG Interface description: "Multi-Chassis Link Aggregation Group Interface" + label: MLAG Interface + include_in_menu: false inherit_from: - InterfaceLayer2 - GenericInterfaceBundle - include_in_menu: false - uniqueness_constraints: - - [mlag_domain, name__value] human_friendly_id: - mlag_domain__domain_id__value - name__value order_by: - name__value display_label: name__value + uniqueness_constraints: + - [mlag_domain, name__value] attributes: - name: name kind: Text + optional: false description: "Name of the interface" order_weight: 1000 - name: description @@ -81,7 +92,7 @@ nodes: order_weight: 1100 - name: status kind: Dropdown - description: "The status of the interface" + default_value: "active" choices: - name: provisioning label: Provisioning @@ -94,7 +105,7 @@ nodes: - name: active label: Active description: "Interface is active and operational." - color: "#A9CCE3" # pastel blue + color: "#00d25b" - name: maintenance label: Maintenance description: "Interface is under maintenance." @@ -111,12 +122,11 @@ nodes: label: Outage description: "Interface is currently experiencing an outage." color: "#F4CCCC" # pastel red - default_value: "active" + optional: false + description: "The status of the interface" order_weight: 1200 - name: role kind: Dropdown - optional: true - description: "The role of the interface in the network" choices: - name: server label: Server Interface @@ -126,35 +136,38 @@ nodes: label: Router Interface description: "Interface connecting routers" color: "#B2D4E6" # pastel sky blue - order_weight: 1250 + optional: true + description: "The role of the interface in the network" + order_weight: 1300 relationships: - name: mlag_domain - label: "MLAG Domain" peer: GenericMlagDomain - optional: false - cardinality: one + label: "MLAG Domain" kind: Parent + cardinality: one + optional: false description: "MLAG Domain this MLAG Interface belongs to" - order_weight: 1750 + order_weight: 900 # Placeholder node implementation of MLAG domain - name: Domain namespace: Mlag - label: MLAG Domain description: "MLAG (Multi-Chassis Link Aggregation Group) Domain" + label: MLAG Domain icon: mingcute:cloud-line + include_in_menu: true inherit_from: - GenericMlagDomain relationships: - name: peers peer: DcimDevice - optional: false - cardinality: many kind: Generic + cardinality: many + optional: false identifier: device__mlag_domain # Most of the vendor limit to 2 devices (peers) per group/domain - max_count: 2 min_count: 2 + max_count: 2 order_weight: 950 extensions: @@ -162,21 +175,21 @@ extensions: - kind: InterfaceLag relationships: - name: mlag_peer_link - label: "MLAG Peer Link" peer: MlagDomain - optional: true - cardinality: one + label: "MLAG Peer Link" kind: Attribute + cardinality: one + optional: true description: "MLAG Domain this LAG is used as peer link" - order_weight: 1800 + order_weight: 1950 - kind: DcimDevice relationships: - name: mlag_domain - label: "MLAG Domain" peer: MlagDomain - optional: true - cardinality: one + label: "MLAG Domain" kind: Attribute - description: "MLAG Domain this device belongs to" - order_weight: 1800 + cardinality: one + optional: true identifier: device__mlag_domain + description: "MLAG Domain this device belongs to" + order_weight: 1900 diff --git a/extensions/modules/README.md b/extensions/modules/README.md deleted file mode 100644 index b4bf961d..00000000 --- a/extensions/modules/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# modules - -Please refer to the [reference page](https://docs.infrahub.app/schema-library/reference/modules) for the corresponding documentation. diff --git a/extensions/modules/modules.yml b/extensions/modules/modules.yml deleted file mode 100644 index f8ccd680..00000000 --- a/extensions/modules/modules.yml +++ /dev/null @@ -1,127 +0,0 @@ ---- -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json - -version: "1.0" - -generics: - - name: GenericModule - namespace: Device - description: "A generic module, such as a Linecard or Routing Engine, installed in a device." - label: "Module" - icon: mdi:expansion-card - human_friendly_id: - - serial_number__value - display_label: serial_number__value - order_by: - - serial_number__value - attributes: - - name: serial_number - kind: Text - unique: true - description: "Unique serial number of the module." - order_weight: 1000 - - name: description - kind: Text - optional: true - order_weight: 1100 - - name: status - kind: Dropdown - choices: - - name: provisioning - label: Provisioning - description: "Linecard is being provisioned." - color: "#A9DFBF" # light pastel green - - name: active - label: Active - description: "Linecard is active and operational." - color: "#A9CCE3" # pastel blue - - name: maintenance - label: Maintenance - description: "Linecard is under maintenance." - color: "#FFF2CC" # pastel yellow - - name: disabled - label: Disabled - description: "Linecard has been disabled." - color: "#D3D3D3" # light grey - - name: outage - label: Outage - description: "Linecard is currently experiencing an outage." - color: "#F4CCCC" # pastel red - default_value: "active" - order_weight: 1300 - relationships: - - name: module_type - peer: DeviceGenericModuleType - optional: false - cardinality: one - kind: Attribute - order_weight: 1150 - - name: device - label: Device - peer: DcimPhysicalDevice - identifier: device__modules - # We could have module in the storage so Device should not be mandatory - optional: true - cardinality: one - kind: Attribute # Parent - order_weight: 1000 - - - name: GenericModuleType - namespace: Device - description: "A generic module type, with common specifications like part number and manufacturer." - label: "Module Type" - icon: mdi:database-cog - menu_placement: DeviceGenericModule - display_label: name__value - uniqueness_constraints: - - ["name__value", "manufacturer"] - human_friendly_id: - - name__value - order_by: - - manufacturer__name__value - - name__value - attributes: - - name: name - kind: Text - unique: true - description: "Name of the module type." - order_weight: 1000 - - name: description - kind: Text - optional: true - description: "Description of the module type." - order_weight: 1100 - - name: part_number - label: Part Number - kind: Text - optional: true - unique: true - description: "Part number of the module." - order_weight: 1200 - relationships: - - name: manufacturer - peer: OrganizationManufacturer - identifier: manufacturer__moduletype - cardinality: one - optional: false - kind: Attribute - description: "Manufacturer of the module type." - order_weight: 1250 - - name: tags - peer: BuiltinTag - optional: true - cardinality: many - kind: Attribute - description: "Tags associated with the module type." - order_weight: 3000 - -extensions: - nodes: - # DCIM Extensions - - kind: DcimPhysicalDevice - relationships: - - name: modules - peer: DeviceGenericModule - identifier: device__modules - cardinality: many - kind: Component diff --git a/extensions/patch_panel/patch_panel.yml b/extensions/patch_panel/patch_panel.yml index 0e29077e..09ff5f76 100644 --- a/extensions/patch_panel/patch_panel.yml +++ b/extensions/patch_panel/patch_panel.yml @@ -1,267 +1,232 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: - name: GenericPatchPanelInterface - label: Patch Panel Interfaces - menu_placement: DcimPatchPanel namespace: Dcim + description: Generic interface of a patch panel, front or rear. + label: Patch Panel Interfaces icon: mdi:ethernet + include_in_menu: true + menu_placement: DcimPatchPanel attributes: - name: name kind: Text + optional: false order_weight: 1000 - name: description kind: Text optional: true - order_weight: 2000 + order_weight: 1100 + # NOTE: this choice list is duplicated in extensions/dwdm and the two must be + # kept in sync. Infrahub cannot share a choice list across extension files without a + # shared generic in a common ancestor, which is a base-tier change. - name: connector_type kind: Dropdown - order_weight: 1100 choices: - - name: FC + - name: fc label: FC description: "Standardized fiber optic connector used primarily in datacom and telecom applications." - - name: LC + - name: lc label: LC description: "Compact fiber optic connector with a push-pull mechanism." - - name: LC_PC + - name: lc_pc label: LC/PC description: "Polished LC connector providing physical contact (PC)." - - name: LC_UPC + - name: lc_upc label: LC/UPC description: "Ultra-Physical Contact (UPC) variant of the LC connector with enhanced polish." - - name: LC_APC + - name: lc_apc label: LC/APC description: "Angled Physical Contact (APC) version of the LC connector with a slanted fiber end-face." - - name: LSH + - name: lsh label: LSH description: "European fiber optic connector offering high durability." - - name: LSH_PC + - name: lsh_pc label: LSH/PC description: "Physical Contact version of LSH with standard polish." - - name: LSH_UPC + - name: lsh_upc label: LSH/UPC description: "Ultra-Physical Contact variant of LSH, minimizing return loss with a superior polish." - - name: LSH_APC + - name: lsh_apc label: LSH/APC description: "Angled Physical Contact version of LSH, designed to reduce back reflections." - - name: LX_5 + - name: lx_5 label: LX.5 description: "Miniaturized fiber optic connector similar to LC but with an additional shutter mechanism." - - name: LX_5_PC + - name: lx_5_pc label: LX.5/PC description: "Physical Contact version of LX.5." - - name: LX_5_UPC + - name: lx_5_upc label: LX.5/UPC description: "Ultra-Physical Contact variant of LX.5." - - name: LX_5_APC + - name: lx_5_apc label: LX.5/APC description: "Angled Physical Contact version of LX.5." - - name: MPO + - name: mpo label: MPO description: "Multi-fiber Push-On connector typically used in data centers for high-speed applications." - - name: MTRJ + - name: mtrj label: MTRJ description: "Male-to-female fiber optic connector with two fibers." - - name: SC + - name: sc label: SC description: "Square fiber optic connector with push-pull lock." - - name: SC_PC + - name: sc_pc label: SC/PC description: "Physical Contact SC connector with a polished end-face." - - name: SC_UPC + - name: sc_upc label: SC/UPC description: "Ultra-Physical Contact variant of SC." - - name: SC_APC + - name: sc_apc label: SC/APC description: "Angled Physical Contact version of SC." - - name: ST + - name: st label: ST description: "Bayonet-style fiber optic connector primarily used in industrial and military applications." - - name: CS + - name: cs label: CS description: "Compact connector with a high-density duplex configuration." - - name: SN + - name: sn label: SN description: "Small-form connector with dual fibers." - - name: SMA_905 + - name: sma_905 label: SMA 905 description: "Stainless steel fiber optic connector." - - name: SMA_906 + - name: sma_906 label: SMA 906 description: "Variant of SMA 905 with similar durability, frequently used in high-vibration settings." - - name: URM_P2 + - name: urm_p2 label: URM-P2 description: "Specialized fiber optic connector for industrial and harsh environments." - # FIXME: Commenting out otherwise I'm facing a Text attribute length should be less than 4096 characters. - # - name: URM_P4 - # label: URM-P4 - # description: "Similar to URM-P2 but designed for higher performance." - # - name: URM_P8 - # label: URM-P8 - # description: "Enhanced version of URM connectors with higher protection." - # - name: Splice - # label: Splice - # description: "Permanent fiber connection method where two fiber ends are fused." + - name: urm_p4 + label: URM-P4 + description: "Similar to URM-P2 but designed for higher performance." + - name: urm_p8 + label: URM-P8 + description: "Enhanced version of URM connectors with higher protection." + - name: splice + label: Splice + description: "Permanent fiber connection method where two fiber ends are fused." + optional: false + order_weight: 1200 nodes: - name: PatchPanel - label: Patch Panel + namespace: Dcim description: A Patch Panel used for managing network cable connections in a data center or telecom setup. + label: Patch Panel icon: ic:round-device-hub - namespace: Dcim + include_in_menu: true + inherit_from: + - DcimPhysicalDevice human_friendly_id: - name__value order_by: - name__value display_label: name__value - inherit_from: - - DcimPhysicalDevice attributes: - name: name kind: Text unique: true # TODO: maybe combine location / name + optional: false order_weight: 1000 - name: module_capacity - label: Module Capacity kind: Number + label: Module Capacity optional: true description: The maximum number of modules that can be housed within this patch panel. + order_weight: 1300 - name: description kind: Text optional: true - order_weight: 2000 + order_weight: 1100 relationships: - name: front_interfaces peer: DcimFrontPatchPanelInterface - identifier: front_interfaces - optional: true - cardinality: many kind: Component + cardinality: many + optional: true + identifier: patch_panel__front_interfaces + order_weight: 1350 - name: rear_interfaces peer: DcimRearPatchPanelInterface - identifier: rear_interfaces - optional: true - cardinality: many kind: Component - - name: patch_panel_modules - label: Modules - peer: DcimPatchPanelModule - optional: true cardinality: many - kind: Component + optional: true + identifier: patch_panel__rear_interfaces + order_weight: 1450 - name: FrontPatchPanelInterface + namespace: Dcim + description: Front interface of a patch panel, where equipment is patched in. label: Patch Panel Front Interfaces + include_in_menu: true menu_placement: DcimGenericPatchPanelInterface - namespace: Dcim + inherit_from: + - DcimEndpoint + - DcimGenericPatchPanelInterface human_friendly_id: - patch_panel__name__value - name__value - display_label: "{{ patch_panel__name__value }} > {{ name__value }}" order_by: - corresponding_front_rear__name__value - name__value + display_label: "{{ patch_panel__name__value }} > {{ name__value }}" uniqueness_constraints: - [patch_panel, name__value] - inherit_from: - - DcimEndpoint - - DcimGenericPatchPanelInterface relationships: - name: corresponding_front_rear - label: Corresponding rear interface peer: DcimRearPatchPanelInterface - order_weight: 1200 - optional: true - cardinality: one + label: Corresponding rear interface kind: Attribute + cardinality: one + optional: true + order_weight: 1300 - name: patch_panel peer: DcimPatchPanel - order_weight: 900 - identifier: front_interfaces - optional: false - cardinality: one kind: Parent + cardinality: one + optional: false + identifier: patch_panel__front_interfaces + order_weight: 900 - name: RearPatchPanelInterface + namespace: Dcim + description: Rear interface of a patch panel, terminating the permanent cabling. label: Patch Panel Rear Interfaces + include_in_menu: true menu_placement: DcimGenericPatchPanelInterface - namespace: Dcim + inherit_from: + - DcimEndpoint + - DcimGenericPatchPanelInterface human_friendly_id: - patch_panel__name__value - name__value - display_label: "{{ patch_panel__name__value }} > {{ name__value }}" order_by: - patch_panel__name__value - name__value + display_label: "{{ patch_panel__name__value }} > {{ name__value }}" uniqueness_constraints: - [patch_panel, name__value] - inherit_from: - - DcimEndpoint - - DcimGenericPatchPanelInterface relationships: - name: corresponding_front_rear - label: Corresponding front interfaces peer: DcimFrontPatchPanelInterface - order_weight: 1200 - optional: true - cardinality: many + label: Corresponding front interfaces kind: Attribute - - name: patch_panel - peer: DcimPatchPanel - order_weight: 900 - identifier: rear_interfaces - optional: false - cardinality: one - kind: Parent - - - name: PatchPanelModule - namespace: Dcim - label: Patch Panel Module - menu_placement: DcimPatchPanel - icon: mdi:expansion-card - human_friendly_id: - - patch_panel__name__value - - name__value - display_label: "{{ patch_panel__name__value }} > {{ name__value }}" - order_by: - - patch_panel__name__value - - position__value - uniqueness_constraints: - - [patch_panel, position__value] - attributes: - - name: name - kind: Text - order_weight: 1000 - - name: position - kind: Number - description: Position for the module inside the Patch Panel. - order_weight: 1100 - - name: module_type - label: Module Type - kind: Dropdown - description: Type of module inserted into the patch panel. - order_weight: 1200 - optional: true - choices: - - name: 3_mpo_24_fo_lc - label: 24 FO LC 3 MPO - description: High-density MPO cassette with 24 fibers to front and 3 MPO to rear. - color: "#7f7fff" - - name: serial - kind: Text - optional: true - order_weight: 1500 - - name: description - kind: Text + cardinality: many optional: true - order_weight: 2000 - relationships: + order_weight: 1300 - name: patch_panel peer: DcimPatchPanel + kind: Parent + cardinality: one optional: false + identifier: patch_panel__rear_interfaces order_weight: 900 - cardinality: one - kind: Parent diff --git a/extensions/peering_ixp/peering_ixp.yml b/extensions/peering_ixp/peering_ixp.yml index 71560fe2..39386dca 100644 --- a/extensions/peering_ixp/peering_ixp.yml +++ b/extensions/peering_ixp/peering_ixp.yml @@ -1,5 +1,10 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json --- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: - name: IXP @@ -7,6 +12,7 @@ nodes: description: "An Internet Exchange Point (IXP) for peering" label: "Internet Exchange" icon: "mdi:network" + include_in_menu: true human_friendly_id: - "name__value" order_by: @@ -16,86 +22,94 @@ nodes: - name: name kind: Text unique: true + optional: false description: "Name of the Internet Exchange" order_weight: 1000 - name: description kind: Text - description: "An optional description of the Internet Exchange" optional: true + description: "An optional description of the Internet Exchange" order_weight: 1100 - name: status kind: Dropdown + default_value: "enabled" choices: - name: enabled label: Enabled description: "Internet Exchange is active and operational" - color: "#a8dadc" + color: "#00d25b" - name: disabled label: Disabled description: "Internet Exchange is not operational" color: "#b0bec5" - default_value: "enabled" + optional: false order_weight: 1200 relationships: - name: connections peer: PeeringIXPConnection - optional: true - cardinality: many kind: Component + cardinality: many + optional: true description: "IXP connections associated with this Internet Exchange" + order_weight: 1500 - name: local_as peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true order_weight: 1300 - name: import_policies - label: Import Routing Policies peer: RoutingPolicyBGP - identifier: ixp__import_bgppolicies - optional: true - cardinality: many + label: Import Routing Policies kind: Generic - description: "Import routing policies applied to the session" + cardinality: many + optional: true + identifier: ixp__import_bgppolicies + description: "Import routing policies applied to every session on this internet exchange point" + order_weight: 1600 - name: export_policies - label: Export Routing Policies peer: RoutingPolicyBGP - identifier: ixp__export_bgppolicies - optional: true - cardinality: many + label: Export Routing Policies kind: Generic - description: "Export routing policies applied to the session" + cardinality: many + optional: true + identifier: ixp__export_bgppolicies + description: "Export routing policies applied to every session on this internet exchange point" + order_weight: 1650 - name: bgp_communities - label: "BGP Communities" peer: RoutingBGPCommunity - optional: true - cardinality: many + label: "BGP Communities" kind: Generic - description: "BGP communities associated with the session" + cardinality: many + optional: true + description: "BGP communities associated with this internet exchange point" + order_weight: 1700 - name: tags peer: BuiltinTag - optional: true - cardinality: many kind: Attribute - order_weight: 3000 + cardinality: many + optional: true + order_weight: 2000 - name: IXPConnection namespace: Peering description: "A connection to an Internet Exchange Point (IXP)" label: "IXP Connection" icon: "mdi:lan-connect" + include_in_menu: true menu_placement: PeeringIXP - uniqueness_constraints: - - ["name__value"] human_friendly_id: - "name__value" order_by: - name__value display_label: name__value + uniqueness_constraints: + - ["name__value"] attributes: - name: name kind: Text unique: true + optional: false description: "Name of the IXP Connection" order_weight: 1000 - name: description @@ -104,20 +118,20 @@ nodes: description: "Description of the IXP Connection" order_weight: 1100 - name: peeringdb_netixlan - label: PeeringDB Netixlan kind: Number + label: PeeringDB Netixlan optional: true description: "PeeringDB ID for the IXP connection" order_weight: 1150 - name: status kind: Dropdown - optional: true + default_value: "enabled" choices: - name: enabled label: Enabled description: "The system is fully operational and functioning as expected." - color: "#a8dadc" - - name: pre-maintenance + color: "#00d25b" + - name: pre_maintenance label: Pre-Maintenance description: "Preparation stage before performing maintenance tasks." color: "#f4a261" @@ -125,7 +139,7 @@ nodes: label: Maintenance description: "Currently undergoing maintenance tasks." color: "#e9c46a" - - name: post-maintenance + - name: post_maintenance label: Post-Maintenance description: "Final checks and verifications after maintenance tasks." color: "#f0e5de" @@ -133,12 +147,12 @@ nodes: label: Disabled description: "The system is not operational and cannot be used." color: "#b0bec5" - default_value: "enabled" + optional: true order_weight: 1200 - name: vlan kind: Number - description: "VLAN ID for the connection" optional: true + description: "VLAN ID for the connection" order_weight: 1300 - name: mac_address kind: MacAddress @@ -148,36 +162,65 @@ nodes: order_weight: 1350 relationships: - name: ipv6_address - label: IPv6 Address - description: "IPv6 address assigned to the connection" peer: IpamIPAddress - identifier: ixpconn__ipv6_address - cardinality: one + label: IPv6 Address kind: Attribute + cardinality: one + identifier: ixpconn__ipv6_address + optional: true + description: "IPv6 address assigned to the connection" order_weight: 1400 - name: ipv4_address - label: IPv4 Address - description: "IPv4 address assigned to the connection" peer: IpamIPAddress - identifier: ixpconn__ipv4_address - cardinality: one + label: IPv4 Address kind: Attribute + cardinality: one + identifier: ixpconn__ipv4_address + optional: true + description: "IPv4 address assigned to the connection" order_weight: 1375 - name: internet_exchange_point - label: IXP peer: PeeringIXP - optional: false - cardinality: one + label: IXP kind: Parent + cardinality: one + optional: false description: "The Internet Exchange Point this connection is part of" + order_weight: 900 - name: router peer: DcimDevice - cardinality: one kind: Attribute + cardinality: one + optional: true description: "The router this IXP connection is connected to" - order_weight: 1400 + order_weight: 1500 + - name: bgp_sessions + peer: RoutingBGPSession + label: BGP Sessions + kind: Component + cardinality: many + optional: true + on_delete: no-action # a session outlives its IXP connection; it is owned by its device + identifier: ixpconn__bgpsessions + description: "BGP sessions established over this IXP connection" + order_weight: 1550 - name: tags peer: BuiltinTag - cardinality: many kind: Attribute - order_weight: 3000 + cardinality: many + optional: true + order_weight: 2000 + +extensions: + nodes: + - kind: RoutingBGPSession + relationships: + - name: ixp_connection + peer: PeeringIXPConnection + label: IXP Connection + kind: Attribute + cardinality: one + optional: true + identifier: ixpconn__bgpsessions + description: "The IXP connection this BGP session is established over" + order_weight: 1800 diff --git a/extensions/physical_disk/physical_disk.yml b/extensions/physical_disk/physical_disk.yml index 909f9e42..39a35133 100644 --- a/extensions/physical_disk/physical_disk.yml +++ b/extensions/physical_disk/physical_disk.yml @@ -1,20 +1,37 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: - name: DeviceWithPhysicalDisks namespace: Dcim - description: - Generic that hold relationship toward physical disks. To apply on device that can have physical - disks. + description: Generic that hold relationship toward physical disks. To apply on device that can have physical disks. include_in_menu: false + attributes: + # Here so HFIDs and computed names can resolve, see DcimPhysicalDevice.name. + # unique is required because DcimPhysicalDisk.human_friendly_id walks + # device__name__value, and Infrahub only accepts a peer attribute combination that is + # unique. Every device kind this generic is meant to be applied to already inherits + # DcimGenericDevice, which declares name unique, so nothing changes for them; + # allow_override lets an implementer restate the attribute either way. + - name: name + kind: Text + unique: true + allow_override: any + optional: false + order_weight: 1000 relationships: - name: physical_disks - cardinality: many peer: DcimPhysicalDisk - optional: true kind: Component + cardinality: many + optional: true + order_weight: 1950 nodes: - name: PhysicalDisk @@ -22,23 +39,22 @@ nodes: description: Physical Disk label: Physical Disk icon: carbon:vmdk-disk + include_in_menu: true + human_friendly_id: + - device__name__value + - name__value order_by: - name__value display_label: name__value - human_friendly_id: - - name__value uniqueness_constraints: - [device, name__value] attributes: - name: name kind: Text optional: false - order_weight: 900 + order_weight: 1000 - name: disk_type kind: Dropdown - description: Specifies the type of disk - order_weight: 950 - optional: true choices: - name: ssd label: SSD @@ -56,9 +72,11 @@ nodes: label: Hybrid description: Hybrid Drive color: "#ffcc80" + optional: true + description: Specifies the type of disk + order_weight: 1300 - name: status kind: Dropdown - description: Lifecycle status of the hardware component. choices: - name: in_inventory label: In Inventory @@ -67,7 +85,7 @@ nodes: - name: active label: Active description: The disk is currently in use within the infrastructure. - color: "#28a745" + color: "#00d25b" - name: decommissioned label: Decommissioned description: The disk is retired from active use but still stored for potential reuse or auditing. @@ -76,27 +94,30 @@ nodes: label: Disposed description: The disk has been securely erased and disposed of. color: "#dc3545" + optional: false + description: Lifecycle status of the hardware component. + order_weight: 1200 - name: size - label: Size (GB) kind: Number + label: Size (GB) optional: false - order_weight: 1000 description: Disk capacity (in GB). + order_weight: 1400 - name: serial_number kind: Text - description: Serial number of the disk unique: true - order_weight: 1100 optional: true + description: Serial number of the disk + order_weight: 1450 - name: description kind: Text unique: false optional: true - order_weight: 1500 + order_weight: 1100 relationships: - name: device peer: DcimDeviceWithPhysicalDisks - optional: false - cardinality: one kind: Parent - order_weight: 800 + cardinality: one + optional: false + order_weight: 900 diff --git a/extensions/qinq/qinq.yaml b/extensions/qinq/qinq.yaml deleted file mode 100644 index 5ca4652e..00000000 --- a/extensions/qinq/qinq.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json -version: "1.0" - -# TODO: Override L2 interface to add tunnel option for l2 mode -extensions: - nodes: - - kind: IpamVLAN - attributes: - - name: qinq_role - kind: Dropdown - optional: true - choices: - - name: suplier - label: Suplier - description: A VLAN used to encapsulate multiple CVLANs. - - name: customer - label: Customer - description: A VLAN assigned to customer traffic. - relationships: - - name: svlan - label: Supplier vlan - peer: IpamVLAN - optional: true - direction: inbound - identifier: vlan__qinq - cardinality: one - kind: Attribute - - name: cvlan - label: Customer vlan(s) - peer: IpamVLAN - optional: true - direction: outbound - identifier: vlan__qinq - cardinality: many - kind: Attribute diff --git a/extensions/qinq/qinq.yml b/extensions/qinq/qinq.yml new file mode 100644 index 00000000..147dcf61 --- /dev/null +++ b/extensions/qinq/qinq.yml @@ -0,0 +1,62 @@ +--- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- +version: "1.0" + +nodes: + - name: SVLAN + namespace: Ipam + description: A VLAN used to encapsulate multiple CVLANs. + label: S-VLAN + include_in_menu: false + inherit_from: + - IpamGenericVLAN + uniqueness_constraints: + - [vlan_id__value, vlan_group] + relationships: + - name: cvlan + peer: IpamCVLAN + label: Customer vlan(s) + kind: Attribute + cardinality: many + optional: true + identifier: vlan__qinq + direction: outbound + order_weight: 1600 + + - name: CVLAN + namespace: Ipam + description: A VLAN assigned to customer traffic, encapsulated within an S-VLAN. + label: C-VLAN + include_in_menu: false + inherit_from: + - IpamGenericVLAN + human_friendly_id: + - svlan__name__value + - vlan_id__value + display_label: "{{ svlan__name__value }}-{{ vlan_id__value }}" + uniqueness_constraints: + - [vlan_id__value, svlan] + attributes: + - name: name + kind: Text + read_only: true + computed_attribute: + kind: Jinja2 + jinja2_template: "{{ svlan__name__value }}-{{ vlan_id__value }}" + optional: true + order_weight: 1000 + relationships: + - name: svlan + peer: IpamSVLAN + label: Supplier vlan + kind: Attribute + cardinality: one + optional: false + identifier: vlan__qinq + direction: inbound + order_weight: 1600 diff --git a/extensions/rack/README.md b/extensions/rack/README.md new file mode 100644 index 00000000..41ec0165 --- /dev/null +++ b/extensions/rack/README.md @@ -0,0 +1,5 @@ +# rack + +Please refer to the [reference page](https://docs.infrahub.app/schema-library/reference/rack) for the corresponding documentation. + +`LocationSite` comes from either `extensions/location_minimal` or `extensions/location_site`. `LocationRack` is also defined, hierarchically and incompatibly, by `experimental/location_extended`, so load one or the other, never both. diff --git a/extensions/rack/rack.yml b/extensions/rack/rack.yml new file mode 100644 index 00000000..1249a6a8 --- /dev/null +++ b/extensions/rack/rack.yml @@ -0,0 +1,108 @@ +--- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- +version: "1.0" + +# Defines Location.Rack. Mutually exclusive with experimental/location_extended, load one, not both. +nodes: + - name: Rack + namespace: Location + description: A physical equipment rack installed at a site. + label: Rack + icon: clarity:rack-server-line + include_in_menu: true + menu_placement: LocationGeneric + inherit_from: + - LocationHosting + human_friendly_id: + - site__name__value + - name__value + order_by: + - name__value + display_label: name__value + uniqueness_constraints: + - [site, name__value] + attributes: + - name: name + kind: Text + unique: false + optional: false + order_weight: 1000 + - name: facility + kind: Text + optional: true + order_weight: 1150 + - name: status + kind: Dropdown + default_value: active + choices: + - name: active + label: Active + description: Rack is installed and in use. + color: "#00d25b" + - name: available + label: Available + description: Rack is installed and has capacity for new equipment. + color: "#00bcd4" + - name: reserved + label: Reserved + description: Rack is allocated but not yet in use. + color: "#4d90fe" + - name: planned + label: Planned + description: Rack is planned but not yet installed. + color: "#2196f3" + - name: decommissioning + label: Decommissioning + description: Rack is being phased out and emptied. + color: "#ff9800" + - name: deprecated + label: Deprecated + description: Rack has been removed from service. + color: "#6c757d" + optional: false + order_weight: 1200 + - name: height + kind: Number + label: Height (U) + default_value: 42 + optional: false + order_weight: 1300 + - name: serial_number + kind: Text + optional: true + order_weight: 1350 + - name: asset_tag + kind: Text + optional: true + order_weight: 1400 + relationships: + - name: site + peer: LocationSite + kind: Parent + cardinality: one + optional: false + identifier: site__racks + order_weight: 900 + - name: tags + peer: BuiltinTag + kind: Attribute + cardinality: many + optional: true + order_weight: 2000 + +extensions: + nodes: + - kind: LocationSite + relationships: + - name: racks + peer: LocationRack + kind: Component + cardinality: many + optional: true + identifier: site__racks + order_weight: 1850 diff --git a/extensions/routing/routing.yml b/extensions/routing/routing.yml index 176b6263..e2b209a7 100644 --- a/extensions/routing/routing.yml +++ b/extensions/routing/routing.yml @@ -1,20 +1,24 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json --- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: - name: Protocol namespace: Routing description: "Generic protocol model for routing protocols" - label: "Protocol" + label: "Routing Protocol" icon: "carbon:router" - include_in_menu: false + include_in_menu: true attributes: - # TODO: Should be computed later - name: description kind: Text - optional: false unique: true + optional: false description: "Description of the protocol" order_weight: 1100 - name: status @@ -23,7 +27,7 @@ generics: - name: active label: Active description: "Configuration is active and operational." - color: "#A9CCE3" # pastel blue + color: "#00d25b" - name: disabled label: Disabled description: "Configuration has been disabled." @@ -32,19 +36,20 @@ generics: label: Deleted description: "Configuration has been deleted." color: "#FAD7A0" # pastel orange + optional: false description: "Status of the Protocol Configuration." - order_weight: 1150 + order_weight: 1200 relationships: - name: device peer: DcimDevice - optional: false - cardinality: one kind: Parent - order_weight: 1050 + cardinality: one + optional: false + order_weight: 900 - name: vrf - label: VRF peer: IpamVRF - optional: false - cardinality: one + label: VRF kind: Attribute - order_weight: 1075 + cardinality: one + optional: false + order_weight: 1050 diff --git a/extensions/routing_aggregate/aggregate.yml b/extensions/routing_aggregate/aggregate.yml index 41fe4e64..62ea3c8f 100644 --- a/extensions/routing_aggregate/aggregate.yml +++ b/extensions/routing_aggregate/aggregate.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: @@ -7,28 +12,30 @@ nodes: namespace: Routing description: "Aggregate Protocol with action and BGP communities" label: "Aggregate Routes" - include_in_menu: false icon: "grommet-icons:aggregate" + include_in_menu: true + menu_placement: RoutingProtocol inherit_from: - "RoutingProtocol" attributes: - name: discard - label: Discard kind: Boolean - optional: true + label: Discard default_value: false - order_weight: 1275 + optional: true + order_weight: 1350 - name: import_policies kind: Text optional: true - order_weight: 1300 + order_weight: 1400 - name: export_policies kind: Text optional: true - order_weight: 1350 + order_weight: 1450 relationships: - name: destination - kind: Attribute peer: IpamPrefix - description: "Destination network for the static route." - order_weight: 1200 + kind: Attribute + optional: true + description: "Destination network aggregated by this route." + order_weight: 1300 diff --git a/extensions/routing_bgp/bgp.yml b/extensions/routing_bgp/bgp.yml index 8ccd9b01..3517c614 100644 --- a/extensions/routing_bgp/bgp.yml +++ b/extensions/routing_bgp/bgp.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: @@ -8,6 +13,7 @@ nodes: 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 + include_in_menu: true menu_placement: RoutingBGPSession human_friendly_id: - "asn__value" @@ -19,14 +25,16 @@ nodes: attributes: - name: name kind: Text + unique: true + optional: false description: "Name of the Autonomous System" order_weight: 1000 - unique: true - name: asn kind: Number + unique: true + optional: false description: "Autonomous System Number" order_weight: 1050 - unique: true - name: description kind: Text optional: true @@ -35,25 +43,29 @@ nodes: relationships: - name: organization peer: OrganizationGeneric - optional: false - cardinality: one kind: Attribute + cardinality: one + optional: false + order_weight: 1200 - name: location peer: LocationGeneric - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + order_weight: 1300 - name: devices peer: DcimDevice - optional: true - cardinality: many kind: Attribute + cardinality: many + optional: true + order_weight: 1400 - name: BGPPeerGroup namespace: Routing 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 + include_in_menu: true menu_placement: RoutingBGPSession inherit_from: - "RoutingProtocol" @@ -66,8 +78,8 @@ nodes: attributes: - name: name kind: Text - optional: false unique: true + optional: false description: "Name of the BGP Group" order_weight: 1000 - name: import_policies @@ -80,24 +92,26 @@ nodes: order_weight: 1350 - name: maximum_routes kind: Number + parameters: + min_value: 0 optional: true description: "Maximum routes for the BGP Group." order_weight: 1400 - regex: "^[0-9]+$" - name: local_pref kind: Number + parameters: + min_value: 0 optional: true description: "Force Local Pref for this BGP Peer Group." order_weight: 1450 - regex: "^[0-9]+$" - name: send_community kind: Checkbox optional: true description: "Whether to send community attributes." order_weight: 1500 - name: address_family - description: "The address family for the routing policy indicating the type of IP address." kind: Dropdown + default_value: "ipv4" choices: - name: "ipv4" label: IPv4 @@ -107,27 +121,31 @@ nodes: label: IPv6 description: "Policy applies to IPv6 addresses." color: "#E6E6FA" # lavender - default_value: "ipv4" - order_weight: 1150 + optional: false + description: "The address family for the routing policy indicating the type of IP address." + order_weight: 1250 relationships: - name: local_as - identifier: bgppeergroup__local_as peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgppeergroup__local_as + order_weight: 1550 - name: remote_as - identifier: bgppeergroup__remote_as peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgppeergroup__remote_as + order_weight: 1600 - name: BGPSession namespace: Routing description: A BGP Session represent a point to point connection between two routers label: BGP Session icon: mdi:router + include_in_menu: true inherit_from: - "RoutingProtocol" order_by: @@ -137,16 +155,23 @@ nodes: - name: import_policies kind: Text optional: true + order_weight: 1700 - name: export_policies kind: Text optional: true + order_weight: 1750 - name: session_type - kind: Text - enum: - - EXTERNAL - - INTERNAL + kind: Dropdown + choices: + - name: external + label: External + description: "Session established with a router in a different autonomous system." + - name: internal + label: Internal + description: "Session established with a router in the same autonomous system." + optional: false description: "Type of BGP Session" - order_weight: 1200 + order_weight: 1250 - name: role kind: Dropdown choices: @@ -162,53 +187,63 @@ nodes: label: Peering description: "Connect with other networks via IX." color: "#E6E6FA" # lavender + optional: true description: "Role of the BGP Session" - order_weight: 1600 + order_weight: 1300 - name: local_pref kind: Number + parameters: + min_value: 0 optional: true description: "Force Local Pref for this BGP Peer Session." - order_weight: 1450 - regex: "^[0-9]+$" + order_weight: 1650 relationships: - name: local_as - identifier: bgpsession__local_as peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgpsession__local_as + order_weight: 1350 - name: remote_as - identifier: bgpsession__remote_as peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgpsession__remote_as + order_weight: 1400 - name: local_ip - identifier: bgpsession__local_ip peer: IpamIPAddress - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgpsession__local_ip + order_weight: 1450 - name: remote_ip - identifier: bgpsession__remote_ip peer: IpamIPAddress - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + identifier: bgpsession__remote_ip + order_weight: 1500 - name: device peer: DcimDevice - optional: true + kind: Generic cardinality: one + optional: true + order_weight: 900 - name: peer_group peer: RoutingBGPPeerGroup - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + order_weight: 1550 - name: peer_session peer: RoutingBGPSession - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + order_weight: 1600 extensions: nodes: @@ -216,15 +251,16 @@ extensions: relationships: - name: asn peer: RoutingAutonomousSystem - optional: true - cardinality: one kind: Attribute - order_weight: 1600 + cardinality: one + optional: true + order_weight: 1800 - kind: OrganizationGeneric relationships: - name: asn + peer: RoutingAutonomousSystem label: Autonomous System + kind: Generic cardinality: many optional: true - peer: RoutingAutonomousSystem - order_weight: 2000 + order_weight: 1700 diff --git a/extensions/routing_bgp_community/bgp_community.yml b/extensions/routing_bgp_community/bgp_community.yml index a4ecb99d..458e4f7a 100644 --- a/extensions/routing_bgp_community/bgp_community.yml +++ b/extensions/routing_bgp_community/bgp_community.yml @@ -1,13 +1,19 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json --- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: - name: BGPCommunity namespace: Routing - icon: iconoir:community - label: "BGP Community" description: "Defines a BGP community." + label: "BGP Community" + icon: iconoir:community + include_in_menu: true human_friendly_id: - name__value order_by: @@ -16,29 +22,33 @@ nodes: attributes: - name: name kind: Text + unique: true + optional: false description: "The name of the BGP community." order_weight: 1000 - unique: true - name: description kind: Text - description: "An optional description of the BGP community." optional: true + description: "An optional description of the BGP community." order_weight: 1100 - name: community kind: Text + unique: true + optional: false description: "The value of the BGP community (RFC1997, RFC4360, RFC8092)." order_weight: 1200 - unique: true relationships: - name: routing_policy - label: Routing Policies peer: RoutingPolicy - description: "The BGP Policies using this BGP Community." + label: Routing Policies kind: Generic cardinality: many + optional: true + description: "The BGP Policies using this BGP Community." + order_weight: 1300 - name: tags peer: BuiltinTag kind: Attribute - optional: true cardinality: many - order_weight: 3000 + optional: true + order_weight: 2000 diff --git a/extensions/routing_bgp_rr/bgp_rr.yml b/extensions/routing_bgp_rr/bgp_rr.yml index 6f866fe1..408e4e63 100644 --- a/extensions/routing_bgp_rr/bgp_rr.yml +++ b/extensions/routing_bgp_rr/bgp_rr.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: @@ -8,44 +13,48 @@ nodes: description: "A Route Reflector (RR) Cluster used for grouping internal peers" label: "Route Reflector Cluster" icon: "mdi:router-network" - include_in_menu: false + include_in_menu: true + menu_placement: RoutingBGPSession human_friendly_id: - name__value display_label: name__value attributes: - name: name kind: Text + unique: true + optional: false description: "Name of the Route Reflector Cluster" order_weight: 1000 - unique: true - name: description kind: Text - description: "Optional description of the Route Reflector Cluster" optional: true + description: "Optional description of the Route Reflector Cluster" order_weight: 1100 relationships: - name: cluster_id - label: "Cluster ID" peer: IpamIPAddress - description: "Cluster ID represented as a reference to an IP Address" - cardinality: one + label: "Cluster ID" kind: Attribute + cardinality: one optional: false + description: "Cluster ID represented as a reference to an IP Address" order_weight: 1200 - name: peer_groups - label: "BGP Peer Groups" peer: RoutingBGPPeerGroup - cardinality: many + label: "BGP Peer Groups" kind: Generic + cardinality: many optional: true + order_weight: 1300 extensions: nodes: - kind: RoutingBGPPeerGroup relationships: - name: rr_cluster - label: "RR Cluster" peer: RoutingBGPRRCluster - cardinality: one + label: "RR Cluster" kind: Attribute - order_weight: 1600 + cardinality: one + optional: true + order_weight: 1700 diff --git a/extensions/routing_ospf/ospf.yml b/extensions/routing_ospf/ospf.yml index dcb19eb6..c73efe02 100644 --- a/extensions/routing_ospf/ospf.yml +++ b/extensions/routing_ospf/ospf.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: @@ -8,29 +13,31 @@ nodes: description: "OSPF (Open Shortest Path First) instance on a Virtual Router." label: "OSPF" icon: "mdi:network-outline" - include_in_menu: false + include_in_menu: true + menu_placement: RoutingProtocol + inherit_from: + - "RoutingProtocol" + human_friendly_id: + - "device__name__value" + - "vrf__name__value" + - "version__value" order_by: - router_id__address__value - vrf__name__value - device__name__value + display_label: description__value uniqueness_constraints: - ["device", "vrf", "version__value"] - human_friendly_id: - - "device__name__value" - - "vrf__name__value" - - "version__value" - display_label: description__value - inherit_from: - - "RoutingProtocol" attributes: - name: reference_bandwidth kind: Number - optional: true default_value: 1000 + optional: true description: "Reference bandwidth for OSPF instance (in Mbps)." - order_weight: 1150 + order_weight: 1350 - name: version kind: Dropdown + default_value: ospf choices: - name: ospf label: OSPFv2 @@ -40,52 +47,55 @@ nodes: label: OSPFv3 description: "Open Shortest Path First version 3." color: "#E6E6FA" # lavender - default_value: ospf + optional: false description: "Version of the OSPF protocol." - order_weight: 1100 + order_weight: 1300 - name: import_policies kind: Text optional: true - order_weight: 1300 + order_weight: 1450 - name: export_policies kind: Text optional: true - order_weight: 1350 + order_weight: 1500 relationships: - name: router_id peer: IpamIPAddress - optional: true - cardinality: one kind: Attribute + cardinality: one + optional: true + order_weight: 1400 - name: ospf_interfaces - label: OSPF Interfaces peer: RoutingOSPFInterface - identifier: ospf__ospfinterfaces - optional: true - cardinality: many + label: OSPF Interfaces kind: Component + cardinality: many + optional: true + identifier: ospf__ospfinterfaces + order_weight: 1550 - name: OSPFInterface namespace: Routing description: "Pivot table linking OSPF configuration to an interface." label: "OSPF Interface" icon: "mdi:ethernet" - include_in_menu: false + include_in_menu: true + menu_placement: RoutingOSPF + human_friendly_id: + - "description__value" order_by: - description__value display_label: description__value uniqueness_constraints: - ["ospf", "interface"] - human_friendly_id: - - "description__value" attributes: # Could be computed later on based on OSPF Instance / Interface Name - name: description kind: Text - optional: false unique: true + optional: false description: "Description of the OSPF interface." - order_weight: 1500 + order_weight: 1100 - name: metric kind: Number optional: true @@ -93,6 +103,7 @@ nodes: order_weight: 1400 - name: mode kind: Dropdown + default_value: normal choices: - name: normal label: Normal @@ -106,13 +117,13 @@ nodes: label: Peer-to-Peer description: "OSPF peer-to-peer interface mode." color: "#E6E6FA" # lavender - default_value: normal + optional: false description: "Mode of the OSPF interface." order_weight: 1300 - name: authentication_key kind: Password - description: "Shared secret used to authenticate and secure routing messages between neighboring routers." optional: true + description: "Shared secret used to authenticate and secure routing messages between neighboring routers." order_weight: 1250 - name: authentication_mode kind: Dropdown @@ -127,20 +138,21 @@ nodes: order_weight: 1225 - name: area kind: Text + optional: false description: "OSPF area associated with the interface." order_weight: 1200 relationships: - name: ospf - label: OSPF peer: RoutingOSPF - identifier: ospf__ospfinterfaces - optional: false - cardinality: one + label: OSPF kind: Parent - order_weight: 1100 + cardinality: one + optional: false + identifier: ospf__ospfinterfaces + order_weight: 900 - name: interface peer: InterfaceLayer3 - optional: false - cardinality: one kind: Attribute - order_weight: 1200 + cardinality: one + optional: false + order_weight: 1500 diff --git a/extensions/routing_pim/pim.yml b/extensions/routing_pim/pim.yml index 5aab18e4..1af43801 100644 --- a/extensions/routing_pim/pim.yml +++ b/extensions/routing_pim/pim.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: @@ -8,23 +13,24 @@ nodes: description: "Protocol Independent Multicast (PIM) instance on a Virtual Router." label: "PIM" icon: "mdi:network-outline" - include_in_menu: false + include_in_menu: true + menu_placement: RoutingProtocol inherit_from: - "RoutingProtocol" + human_friendly_id: + - "device__name__value" + - "vrf__name__value" order_by: - vrf__name__value - device__name__value + display_label: description__value uniqueness_constraints: - ["device", "vrf"] - human_friendly_id: - - "device__name__value" - - "vrf__name__value" - display_label: description__value attributes: - name: dr_priority kind: Number - optional: true default_value: 1 + optional: true description: "Designated Router priority." order_weight: 1250 - name: import_policies @@ -38,38 +44,41 @@ nodes: relationships: - name: rp_address peer: IpamIPAddress + kind: Attribute + cardinality: one optional: true description: "Rendezvous Point (RP) address for PIM." - cardinality: one - kind: Attribute + order_weight: 1400 - name: pim_interfaces - label: PIM Interfaces peer: RoutingPIMInterface - identifier: pim__piminterfaces - optional: true - cardinality: many + label: PIM Interfaces kind: Component + cardinality: many + optional: true + identifier: pim__piminterfaces + order_weight: 1450 - name: PIMInterface namespace: Routing description: "Interface configuration for PIM." label: "PIM Interface" icon: "mdi:ethernet" - include_in_menu: false + include_in_menu: true + menu_placement: RoutingPIM + human_friendly_id: + - "description__value" order_by: - description__value display_label: description__value uniqueness_constraints: - ["pim", "interface"] - human_friendly_id: - - "description__value" attributes: # Could be computed later on based on PIM Instance / Interface Name - name: description kind: Text - optional: false unique: true - description: "Description of the OSPF interface." + optional: false + description: "Description of the PIM interface." order_weight: 1100 - name: pim_mode kind: Dropdown @@ -86,31 +95,33 @@ nodes: label: Bidirectional Mode description: "Bidirectional PIM for efficient traffic forwarding." color: "#E6E6FA" # lavender + optional: false description: "PIM mode used for multicast routing on this interface." order_weight: 1150 - name: hello_interval kind: Number - optional: true default_value: 30 + optional: true description: "Interval for PIM hello messages (in seconds)." order_weight: 1300 - name: dr_priority kind: Number - optional: true default_value: 1 + optional: true description: "Designated Router priority on the interface." order_weight: 1250 relationships: - name: pim - label: PIM peer: RoutingPIM - identifier: pim__piminterfaces - optional: false - cardinality: one + label: PIM kind: Parent + cardinality: one + optional: false + identifier: pim__piminterfaces + order_weight: 900 - name: interface peer: InterfaceLayer3 - optional: false - cardinality: one kind: Attribute + cardinality: one + optional: false order_weight: 1200 diff --git a/extensions/routing_policies/routing_policies.yml b/extensions/routing_policies/routing_policies.yml index fa66ffc6..953c598e 100644 --- a/extensions/routing_policies/routing_policies.yml +++ b/extensions/routing_policies/routing_policies.yml @@ -1,13 +1,19 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json --- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: - name: Policy namespace: Routing - icon: carbon:deployment-policy - include_in_menu: false description: "Policy defining the rules for routing traffic in a network." + label: "Routing Policy" + icon: carbon:deployment-policy + include_in_menu: true human_friendly_id: - "name__value" order_by: @@ -16,42 +22,43 @@ generics: attributes: - name: name kind: Text - description: "The name of the routing policy." unique: true optional: false + description: "The name of the routing policy." order_weight: 1000 - name: description kind: Text - description: "An optional description of the routing policy." optional: true + description: "An optional description of the routing policy." order_weight: 1100 - name: policy_type - label: Type kind: Dropdown - description: "The type of routing policy which specifies the direction of route advertisement." + label: Type choices: - - name: import-policy + - name: import_policy label: Import description: "Policy for incoming routes." color: "#E6E6FA" # lavender - - name: export-policy + - name: export_policy label: Export description: "Policy for outgoing routes." color: "#E6E6FA" # lavender - - name: import-export-policy + - name: import_export_policy label: Import + Export description: "Policy for both incoming and outgoing routes." color: "#E6E6FA" # lavender + optional: false + description: "The type of routing policy which specifies the direction of route advertisement." order_weight: 1200 - name: weight kind: Number - description: "Priority of the routing policy. The higher the number, the higher the priority." - optional: true default_value: 1000 + optional: true + description: "Priority of the routing policy. The higher the number, the higher the priority." order_weight: 1400 - name: address_family - description: "The address family for the routing policy indicating the type of IP address." kind: Dropdown + default_value: "all" choices: - name: "ipv4" label: IPv4 @@ -65,5 +72,6 @@ generics: label: All description: "Policy applies to both IPv4 and IPv6 addresses." color: "#E6E6FA" # lavender - default_value: "all" + optional: false + description: "The address family for the routing policy indicating the type of IP address." order_weight: 1150 diff --git a/extensions/routing_policies_aggregate/routing_policies_aggregate.yml b/extensions/routing_policies_aggregate/routing_policies_aggregate.yml index 8336f88b..f3bf5a78 100644 --- a/extensions/routing_policies_aggregate/routing_policies_aggregate.yml +++ b/extensions/routing_policies_aggregate/routing_policies_aggregate.yml @@ -1,17 +1,24 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json --- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: - name: PolicyAggregate namespace: Routing - description: A routing policiers for Aggregate + description: A routing policy for Aggregate. label: Aggregate Routing Policies icon: carbon:deployment-policy - include_in_menu: false + include_in_menu: true + menu_placement: RoutingPolicy inherit_from: - "RoutingPolicy" - # TODO: extend if need + # Add attributes here if this policy flavour needs more than the generic RoutingPolicy provides. +# Uncommenting this block also requires adding extensions/routing_aggregate back to .metadata.yml. # extensions: # nodes: # - kind: RoutingAggregate diff --git a/extensions/routing_policies_bgp/routing_policies_bgp.yml b/extensions/routing_policies_bgp/routing_policies_bgp.yml index a3fe79b3..599228ca 100644 --- a/extensions/routing_policies_bgp/routing_policies_bgp.yml +++ b/extensions/routing_policies_bgp/routing_policies_bgp.yml @@ -1,17 +1,23 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json --- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: - name: PolicyBGP namespace: Routing - description: A routing policiers for BGP + description: A routing policy for BGP. label: BGP Routing Policies icon: carbon:deployment-policy - include_in_menu: false + include_in_menu: true + menu_placement: RoutingPolicy inherit_from: - "RoutingPolicy" - # TODO: extend if need + # Add attributes here if this policy flavour needs more than the generic RoutingPolicy provides. extensions: nodes: @@ -25,20 +31,23 @@ extensions: state: absent relationships: - name: import_routing_policies - label: Import Routing Policies peer: RoutingPolicyBGP - identifier: bgp__import_policies - description: "The routing-policies used by this instance for import." + label: Import Routing Policies kind: Generic cardinality: many + identifier: bgppeergroup__import_policies + optional: true + description: "The routing-policies used by this instance for import." + order_weight: 1750 - name: export_routing_policies - label: Export Routing Policies peer: RoutingPolicyBGP - identifier: bgp__export_policies - description: "The routing-policies used by this instance for export." + label: Export Routing Policies kind: Generic cardinality: many - + identifier: bgppeergroup__export_policies + optional: true + description: "The routing-policies used by this instance for export." + order_weight: 1800 - kind: RoutingBGPSession attributes: - name: import_policies @@ -49,16 +58,20 @@ extensions: state: absent relationships: - name: import_routing_policies + peer: RoutingPolicyBGP label: Import Routing Policies - peer: RoutingPolicy - identifier: bgp__import_policies - description: "The routing-policies used by this instance for import." kind: Generic cardinality: many + identifier: bgpsession__import_policies + optional: true + description: "The routing-policies used by this instance for import." + order_weight: 1850 - name: export_routing_policies + peer: RoutingPolicyBGP label: Export Routing Policies - peer: RoutingPolicy - identifier: bgp__export_policies - description: "The routing-policies used by this instance for export." kind: Generic cardinality: many + identifier: bgpsession__export_policies + optional: true + description: "The routing-policies used by this instance for export." + order_weight: 1900 diff --git a/extensions/routing_policies_ospf/routing_policies_ospf.yml b/extensions/routing_policies_ospf/routing_policies_ospf.yml index bccb969a..40e85183 100644 --- a/extensions/routing_policies_ospf/routing_policies_ospf.yml +++ b/extensions/routing_policies_ospf/routing_policies_ospf.yml @@ -1,17 +1,23 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json --- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: - name: PolicyOSPF namespace: Routing - description: A routing policiers for OSPF + description: A routing policy for OSPF. label: OSPF Routing Policies icon: carbon:deployment-policy - include_in_menu: false + include_in_menu: true + menu_placement: RoutingPolicy inherit_from: - "RoutingPolicy" - # TODO: extend if need + # Add attributes here if this policy flavour needs more than the generic RoutingPolicy provides. extensions: nodes: @@ -25,16 +31,20 @@ extensions: state: absent relationships: - name: import_routing_policies - label: Import Routing Policies peer: RoutingPolicyOSPF - identifier: ospf__import_policies - description: "The routing-policies used by this instance for import." + label: Import Routing Policies kind: Generic cardinality: many + identifier: ospf__import_policies + optional: true + description: "The routing-policies used by this instance for import." + order_weight: 1600 - name: export_routing_policies - label: Export Routing Policies peer: RoutingPolicyOSPF - identifier: ospf__export_policies - description: "The routing-policies used by this instance for export." + label: Export Routing Policies kind: Generic cardinality: many + identifier: ospf__export_policies + optional: true + description: "The routing-policies used by this instance for export." + order_weight: 1650 diff --git a/extensions/routing_policies_pim/routing_policies_pim.yml b/extensions/routing_policies_pim/routing_policies_pim.yml index 75c124be..91df60be 100644 --- a/extensions/routing_policies_pim/routing_policies_pim.yml +++ b/extensions/routing_policies_pim/routing_policies_pim.yml @@ -1,17 +1,23 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json --- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: - name: PolicyPIM namespace: Routing - description: A routing policiers for PIM + description: A routing policy for PIM. label: PIM Routing Policies icon: carbon:deployment-policy - include_in_menu: false + include_in_menu: true + menu_placement: RoutingPolicy inherit_from: - "RoutingPolicy" - # TODO: extend if need + # Add attributes here if this policy flavour needs more than the generic RoutingPolicy provides. extensions: nodes: @@ -25,16 +31,20 @@ extensions: state: absent relationships: - name: import_routing_policies - label: Import Routing Policies peer: RoutingPolicyPIM - identifier: pim__import_policies - description: "The routing-policies used by this instance for import." + label: Import Routing Policies kind: Generic cardinality: many + identifier: pim__import_policies + optional: true + description: "The routing-policies used by this instance for import." + order_weight: 1500 - name: export_routing_policies - label: Export Routing Policies peer: RoutingPolicyPIM - identifier: pim__export_policies - description: "The routing-policies used by this instance for export." + label: Export Routing Policies kind: Generic cardinality: many + identifier: pim__export_policies + optional: true + description: "The routing-policies used by this instance for export." + order_weight: 1550 diff --git a/extensions/sfp/sfp.yml b/extensions/sfp/sfp.yml index 11b475cf..c5f6befa 100644 --- a/extensions/sfp/sfp.yml +++ b/extensions/sfp/sfp.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: @@ -11,15 +16,12 @@ generics: include_in_menu: true display_label: "{{ form_factor__value }} {{ sfp_type__value }}" attributes: - - name: serial + - name: serial_number kind: Text optional: true order_weight: 1400 - name: sfp_type kind: Dropdown - description: "Type of SFP, such as LR, SR, T." - order_weight: 1100 - optional: false choices: - name: lr label: LR (Long Reach) @@ -61,10 +63,11 @@ generics: label: AOC (Active Optical Cable) description: Active Optical Cable, used for short connections over fiber. color: "#6699ff" + optional: false + description: "Type of SFP, such as LR, SR, T." + order_weight: 1100 - name: status kind: Dropdown - optional: false - order_weight: 1300 default_value: plugged choices: - name: plugged @@ -79,11 +82,10 @@ generics: label: Decommissioned description: Decommissioned might be broken or not used anymore. color: "#ffd27f" + optional: false + order_weight: 1200 - name: form_factor kind: Dropdown - description: "The physical form factor of the SFP module." - order_weight: 1000 - optional: false choices: - name: sfp label: SFP @@ -124,55 +126,60 @@ generics: - name: osfp label: OSFP color: "#0099cc" + optional: false + description: "The physical form factor of the SFP module." + order_weight: 1000 relationships: - name: interface peer: InterfacePhysical kind: Attribute - optional: true cardinality: one - order_weight: 1200 + optional: true identifier: sfp__interface + order_weight: 1300 - name: spare_location peer: LocationHosting kind: Attribute - optional: true cardinality: one + optional: true order_weight: 1500 - name: manufacturer peer: OrganizationManufacturer - cardinality: one kind: Attribute + cardinality: one optional: true order_weight: 1350 nodes: - name: StandardSFP namespace: Dcim - inherit_from: - - DcimGenericSFP description: Standard SFP module for various types (e.g., LR, SR, T). label: Standard SFP icon: mdi:gpu + include_in_menu: true menu_placement: DcimGenericSFP + inherit_from: + - DcimGenericSFP - name: BidiSFP namespace: Dcim - inherit_from: - - DcimGenericSFP description: "Bidirectional SFP supporting two wavelengths for single-fiber operation." label: Bidirectional SFP icon: lineicons:arrow-both-direction-vertical-1 + include_in_menu: true menu_placement: DcimGenericSFP + inherit_from: + - DcimGenericSFP attributes: - name: wavelength_tx - label: "Transmit Wavelength (nm)" kind: Number + label: "Transmit Wavelength (nm)" optional: false description: "Transmit wavelength in nm." order_weight: 1175 - name: wavelength_rx - label: "Receive Wavelength (nm)" kind: Number + label: "Receive Wavelength (nm)" optional: false description: "Receive wavelength in nm." order_weight: 1150 @@ -183,19 +190,25 @@ extensions: relationships: - name: plugged_sfp peer: DcimGenericSFP + kind: Generic cardinality: one optional: true identifier: sfp__interface + order_weight: 1700 - kind: LocationHosting relationships: - name: spare_sfps peer: DcimGenericSFP + kind: Generic cardinality: many optional: true + order_weight: 1750 - kind: OrganizationManufacturer relationships: - name: sfps - label: SFPs peer: DcimGenericSFP + kind: Generic + label: SFPs cardinality: many optional: true + order_weight: 1500 diff --git a/extensions/snmp/snmp.yml b/extensions/snmp/snmp.yml index d81ccb73..f3da930a 100644 --- a/extensions/snmp/snmp.yml +++ b/extensions/snmp/snmp.yml @@ -1,5 +1,10 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" generics: @@ -8,24 +13,38 @@ generics: description: Generic model for SNMP community configurations. label: SNMP Community icon: iconoir:community + include_in_menu: true human_friendly_id: - name__value - display_label: name__value order_by: - name__value + display_label: name__value attributes: - name: name kind: Text + unique: true + optional: false order_weight: 1000 - name: description kind: Text - order_weight: 1100 optional: true + order_weight: 1100 relationships: - name: clients peer: SnmpClient - cardinality: many kind: Component + cardinality: many + optional: true + order_weight: 1900 + - name: devices + peer: DcimGenericDevice + label: Devices + kind: Attribute + cardinality: many + optional: true + identifier: snmp_community__device + description: Devices this community is configured on. + order_weight: 1800 nodes: # -------------------- Snmp Community -------------------- @@ -34,23 +53,30 @@ nodes: description: SNMP v1/v2c community configuration. label: SNMP v1/v2c icon: iconoir:community + include_in_menu: true menu_placement: SnmpCommunity + inherit_from: + - SnmpCommunity human_friendly_id: - name__value - display_label: name__value order_by: - name__value - inherit_from: - - SnmpCommunity + display_label: name__value attributes: - name: community_string kind: Password + optional: false order_weight: 1300 - name: access - kind: Text - enum: - - Read-Only - - Read-Write + kind: Dropdown + choices: + - name: read_only + label: Read-Only + description: Read-only access. + - name: read_write + label: Read-Write + description: Read-write access. + optional: false order_weight: 1200 - name: CommunityV3 @@ -58,57 +84,74 @@ nodes: description: SNMP version 3 configuration with enhanced security. label: SNMP v3 icon: iconoir:community + include_in_menu: true menu_placement: SnmpCommunity + inherit_from: + - SnmpCommunity human_friendly_id: - name__value - display_label: name__value order_by: - name__value - inherit_from: - - SnmpCommunity + display_label: name__value attributes: - name: username kind: Text + optional: false order_weight: 1300 - name: auth_protocol + kind: Dropdown label: Authentication Protocol - kind: Text - enum: - - None - - MD5 - - SHA + choices: + - name: none + label: None + description: No authentication. + - name: md5 + label: MD5 + description: MD5 authentication. + - name: sha + label: SHA + description: SHA authentication. + optional: false order_weight: 1400 - name: auth_password - label: Authentication Password kind: Password - order_weight: 1500 + label: Authentication Password optional: true + order_weight: 1500 - name: privacy_protocol + kind: Dropdown label: Privacy Protocol - kind: Text - enum: - - None - - DES - - AES + choices: + - name: none + label: None + description: No privacy. + - name: des + label: DES + description: DES encryption. + - name: aes + label: AES + description: AES encryption. + optional: false order_weight: 1600 - name: privacy_password - label: Privacy Password kind: Password - order_weight: 1700 + label: Privacy Password optional: true + order_weight: 1700 - name: security_level - label: Security Level kind: Dropdown + label: Security Level choices: - - name: noAuthNoPriv + - name: no_auth_no_priv label: NoAuthNoPriv description: No authentication and no privacy. - - name: authNoPriv + - name: auth_no_priv label: AuthNoPriv description: Authentication but no privacy. - - name: authPriv + - name: auth_priv label: AuthPriv description: Both authentication and privacy. + optional: false order_weight: 1200 - name: Client @@ -116,24 +159,36 @@ nodes: description: Represents an SNMP client that interacts with SNMP Community. label: SNMP Client icon: ph:user-list-light + include_in_menu: true menu_placement: SnmpCommunity human_friendly_id: - name__value - display_label: name__value order_by: - name__value + display_label: name__value attributes: - # TODO improve - Should it be a relationship to IPAddress or IPPrefix node ? - name: name kind: Text + unique: true + optional: false order_weight: 1000 - name: client_description - label: Description kind: Text - order_weight: 1100 + label: Description optional: true + order_weight: 1100 relationships: - - name: community + - name: ip_addresses + peer: IpamIPAddress + label: IP Addresses + kind: Attribute + cardinality: many + optional: true + description: Authorized SNMP client address. + order_weight: 1150 + - name: communities peer: SnmpCommunity + kind: Attribute cardinality: many + optional: true order_weight: 1200 diff --git a/experimental/tenancy/README.md b/extensions/tenancy/README.md similarity index 100% rename from experimental/tenancy/README.md rename to extensions/tenancy/README.md diff --git a/extensions/tenancy/tenancy.yml b/extensions/tenancy/tenancy.yml new file mode 100644 index 00000000..e54f165b --- /dev/null +++ b/extensions/tenancy/tenancy.yml @@ -0,0 +1,126 @@ +--- +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- +version: "1.0" + +nodes: + - name: Tenant + namespace: Organization + description: A tenant is the owner of the corresponding devices, addressing, and locations. + label: Tenant + icon: mdi:domain + include_in_menu: true + menu_placement: OrganizationGeneric + inherit_from: + - OrganizationGeneric + relationships: + - name: devices + peer: DcimGenericDevice + label: Devices + kind: Generic + cardinality: many + optional: true + identifier: tenant__device + order_weight: 1300 + - name: prefixes + peer: IpamPrefix + label: Prefixes + kind: Generic + cardinality: many + optional: true + identifier: tenant__prefix + order_weight: 1350 + - name: addresses + peer: IpamIPAddress + label: Addresses + kind: Generic + cardinality: many + optional: true + identifier: tenant__ip_address + order_weight: 1400 + - name: locations + peer: LocationHosting + label: Locations + kind: Generic + cardinality: many + optional: true + identifier: tenant__location + order_weight: 1450 + +extensions: + nodes: + - kind: DcimGenericDevice + relationships: + - name: tenant + peer: OrganizationTenant + kind: Attribute + cardinality: one + optional: true + identifier: tenant__device + order_weight: 1850 + - kind: IpamPrefix + relationships: + - name: tenant + peer: OrganizationTenant + kind: Attribute + cardinality: one + optional: true + identifier: tenant__prefix + order_weight: 1400 + - kind: IpamIPAddress + relationships: + - name: tenant + peer: OrganizationTenant + kind: Attribute + cardinality: one + optional: true + identifier: tenant__ip_address + order_weight: 1350 + - kind: LocationHosting + relationships: + - name: tenant + peer: OrganizationTenant + kind: Attribute + cardinality: one + optional: true + identifier: tenant__location +# --------------------------------------------------------------------------- +# Composing with other extensions +# --------------------------------------------------------------------------- +# This extension only wires Tenant onto nodes that live in the base schema, so it has +# no dependency beyond `base` and can always be loaded on its own. +# +# Some extensions (e.g. `extensions/circuit`, which defines `DcimCircuit`) are optional +# and aren't guaranteed to be loaded. Adding a hard `peer: DcimCircuit` relationship here +# would break schema loading whenever the circuit extension isn't present, so that wiring +# is intentionally left out of this file. +# +# If you do load `extensions/circuit` and want a Tenant on a Circuit, add the reciprocal +# pair below to your own schema (e.g. a small local extension file that depends on both +# `extensions/tenancy` and `extensions/circuit`): +# +# extensions: +# nodes: +# - kind: DcimCircuit +# relationships: +# - name: tenant +# peer: OrganizationTenant +# identifier: tenant__circuit +# optional: true +# cardinality: one +# kind: Attribute +# - kind: OrganizationTenant +# relationships: +# - name: circuits +# peer: DcimCircuit +# identifier: tenant__circuit +# cardinality: many +# optional: true +# kind: Generic +# +# The same pattern applies to any other optional extension node you want tenancy on. + order_weight: 1800 diff --git a/extensions/topology/README.md b/extensions/topology/README.md deleted file mode 100644 index ba24f1c1..00000000 --- a/extensions/topology/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# topology - -Please refer to the [reference page](https://docs.infrahub.app/schema-library/reference/topology) for the corresponding documentation. diff --git a/extensions/topology/topology.yml b/extensions/topology/topology.yml deleted file mode 100644 index da7c900e..00000000 --- a/extensions/topology/topology.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json -version: "1.0" - -generics: - - name: Generic - namespace: Topology - description: Generic model for topology. - label: Topology - icon: carbon:network-3 - # default_filter: name__value - # display_label: name__value - attributes: - # TODO: I believe at some point some Containerlab tricks will happen here - # e.g. boolean "is container lab topo" then if ticked we generate artifact - # Or actually it would be better to create a group for that? - # Then - - name: description - kind: Text - order_weight: 1300 - optional: true - relationships: - - name: location - peer: LocationGeneric - optional: true - cardinality: one - kind: Attribute - # TODO: When implementing design ... - # - name: design - # peer: TopologyDesign - # kind: Attribute - # cardinality: one diff --git a/extensions/users/README.md b/extensions/users/README.md deleted file mode 100644 index ccecd1f1..00000000 --- a/extensions/users/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# users - -Please refer to the [reference page](https://docs.infrahub.app/schema-library/reference/users) for the corresponding documentation. diff --git a/extensions/users/users.yml b/extensions/users/users.yml deleted file mode 100644 index 3bcdc51e..00000000 --- a/extensions/users/users.yml +++ /dev/null @@ -1,103 +0,0 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json ---- -version: "1.0" - -nodes: - - name: Group - namespace: User - description: "User Group" - label: "User Groups" - icon: "iconoir:group" - display_label: name__value - order_by: - - name__value - human_friendly_id: - - "name__value" - attributes: - - name: name - kind: Text - order_weight: 1000 - unique: true - - name: description - kind: Text - optional: true - order_weight: 1100 - - name: idle_timeout - label: Idle Timeout (s) - kind: Number - order_weight: 1300 - - name: permissions - kind: Dropdown - optional: false - choices: - - name: admin - description: "All rights on device." - color: "#E6E6FA" # lavender - - name: operator - description: "Operator right on configuration." - color: "#E6E6FA" # lavender - - name: read-only - description: "Read only right on configuration." - color: "#E6E6FA" # lavender - order_weight: 1200 - - - name: Account - namespace: User - description: "User login and authentication" - label: "User Account" - icon: "mdi:account-key" - display_label: name__value - order_by: - - name__value - human_friendly_id: - - "name__value" - attributes: - - name: name - label: Username - kind: Text - description: "The login username" - order_weight: 1000 - unique: true - - name: full_name - kind: Text - optional: true - description: "Full name of the account" - order_weight: 1100 - - name: ssh_key - kind: Password - optional: true - description: "SSH key for secure access" - order_weight: 1300 - - name: password - kind: Password - optional: true - description: "Password for login (alternative to SSH key)" - order_weight: 1400 - - name: mfa_enabled - kind: Boolean - default_value: false - description: "Whether multi-factor authentication is enabled" - order_weight: 1500 - relationships: - - name: user_group - peer: UserGroup - cardinality: one - optional: false - kind: Attribute - order_weight: 1200 - - name: organization - peer: OrganizationGeneric - optional: false - cardinality: one - kind: Parent - -extensions: - nodes: - # Organization Extensions - - kind: OrganizationGeneric - relationships: - - name: accounts - kind: Component - peer: UserAccount - description: "List of Accounts under this organization" - cardinality: many diff --git a/extensions/vlan/vlan.yml b/extensions/vlan/vlan.yml index cef7c31e..29d6d15e 100644 --- a/extensions/vlan/vlan.yml +++ b/extensions/vlan/vlan.yml @@ -1,16 +1,19 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" -nodes: - - name: VLAN +generics: + - name: GenericVLAN namespace: Ipam - description: A VLAN is isolated layer two domain + description: A VLAN is an isolated layer two domain. label: VLAN icon: mdi:lan-pending - menu_placement: IpamL2Domain - uniqueness_constraints: - - [vlan_id__value, l2domain] + include_in_menu: true human_friendly_id: - name__value order_by: @@ -19,33 +22,44 @@ nodes: attributes: - name: name kind: Text + optional: false + order_weight: 1000 - name: description kind: Text optional: true + order_weight: 1100 - name: vlan_id kind: Number + optional: false + order_weight: 1050 - name: status kind: Dropdown + default_value: active choices: - name: active label: Active description: Fully operational and currently in service. - color: "#7fbf7f" + color: "#00d25b" + - name: reserved + label: Reserved + description: Reserved for future use, not yet active. + color: "#4d90fe" - name: provisioning label: Provisioning description: In the process of being set up and configured. - color: "#ffff7f" + color: "#f0ad4e" - name: maintenance label: Maintenance description: Undergoing routine maintenance or repairs. - color: "#ffd27f" - - name: drained - label: Drained - description: Temporarily taken out of service. - color: "#bfbfbf" + color: "#ff9800" + - name: deprecated + label: Deprecated + description: No longer in use and scheduled for removal. + color: "#e04040" + optional: false + order_weight: 1200 - name: role kind: Dropdown - optional: true choices: - name: server label: Server @@ -59,71 +73,108 @@ nodes: label: User description: Segments designed for end-user access and activities. color: "#a0b78d" - relationships: - - name: location - peer: LocationHosting optional: true - cardinality: many + order_weight: 1300 + relationships: - name: prefixes peer: IpamPrefix - optional: true + kind: Attribute cardinality: many - - name: l2domain - peer: IpamL2Domain - optional: false - cardinality: one + optional: true + identifier: vlan__prefix + order_weight: 1500 + - name: vlan_group + peer: IpamVLANGroup + label: VLAN Group kind: Attribute - order_weight: 1200 + cardinality: one + optional: false + identifier: vlan_group__vlan + order_weight: 1400 - - name: L2Domain +nodes: + - name: VLAN + namespace: Ipam + description: A plain VLAN, with no QinQ role of its own. + label: VLAN + include_in_menu: false + inherit_from: + - IpamGenericVLAN + uniqueness_constraints: + - [vlan_id__value, vlan_group] + + - name: VLANGroup namespace: Ipam - description: Represents layer 2 domain. - label: Layer 2 Domain + description: A VLAN group scopes VLANs to a domain (site, rack, etc.). + label: VLAN Group icon: mdi:domain-switch + include_in_menu: true + menu_placement: IpamGenericVLAN human_friendly_id: - name__value display_label: name__value attributes: - name: name kind: Text + unique: true + optional: false order_weight: 1000 + - name: description + kind: Text + optional: true + order_weight: 1100 relationships: - - name: vlans - peer: IpamVLAN + - name: scope + peer: IpamVLANGroupScope + kind: Attribute + cardinality: one optional: true - cardinality: many + identifier: vlan_group__scope + order_weight: 900 + - name: vlans + peer: IpamGenericVLAN kind: Component + cardinality: many + optional: true + identifier: vlan_group__vlan + order_weight: 1500 extensions: nodes: + - kind: IpamVLANGroupScope + relationships: + - name: vlan_groups + peer: IpamVLANGroup + label: VLAN Groups + kind: Attribute + cardinality: many + optional: true + identifier: vlan_group__scope + order_weight: 1600 - kind: IpamPrefix relationships: - name: vlan - peer: IpamVLAN - optional: true - cardinality: one + peer: IpamGenericVLAN kind: Attribute - order_weight: 1400 + cardinality: one + optional: true + identifier: vlan__prefix + order_weight: 1450 - kind: InterfaceLayer2 relationships: - name: untagged_vlan + peer: IpamGenericVLAN label: Untagged VLAN - peer: IpamVLAN - optional: true - cardinality: one kind: Generic + cardinality: one + optional: true identifier: interface_l2__untagged_vlan + order_weight: 1500 - name: tagged_vlan + peer: IpamGenericVLAN label: Tagged VLANs - peer: IpamVLAN - optional: true - cardinality: many kind: Generic - identifier: interface_l2__tagged_vlan - - kind: LocationHosting - relationships: - - name: vlans - label: VLANs - peer: IpamVLAN cardinality: many optional: true + identifier: interface_l2__tagged_vlan + order_weight: 1550 diff --git a/extensions/vrf/vrf.yml b/extensions/vrf/vrf.yml index 488aa8bd..3c9977ab 100644 --- a/extensions/vrf/vrf.yml +++ b/extensions/vrf/vrf.yml @@ -1,13 +1,19 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: - name: VRF namespace: Ipam - description: A VRF is isolated layer three domain + description: A VRF is an isolated layer three domain. label: VRF icon: mdi:router + include_in_menu: true human_friendly_id: - name__value order_by: @@ -16,42 +22,59 @@ nodes: attributes: - name: name kind: Text - optional: false unique: true + optional: false + order_weight: 1000 - name: vrf_rd - label: Route Distinguisher kind: Text + label: Route Distinguisher + optional: true + order_weight: 1050 + - name: enforce_unique + kind: Boolean + label: Enforce Unique + description: >- + Declares the intent that prefixes and addresses be unique in this VRF. Infrahub does + not enforce it; use a check or generator. + default_value: true optional: true + order_weight: 1200 - name: description kind: Text optional: true - order_weight: 1200 + order_weight: 1100 relationships: - - name: namespace - peer: BuiltinIPNamespace - optional: false - cardinality: one - kind: Attribute + # Uncomment to pin each VRF to its own IP namespace; the library leaves VRFs + # namespace-agnostic by default. + # - name: namespace + # peer: BuiltinIPNamespace + # identifier: vrf__namespace + # optional: true + # cardinality: one + # kind: Attribute - name: import_rt - identifier: vrf__import - label: Import Targets peer: IpamRouteTarget - optional: true - cardinality: one + label: Import Targets kind: Attribute + cardinality: many + optional: true + identifier: vrf__import + order_weight: 1300 - name: export_rt - identifier: vrf__export - label: Export Targets peer: IpamRouteTarget - optional: true - cardinality: one + label: Export Targets kind: Attribute + cardinality: many + optional: true + identifier: vrf__export + order_weight: 1350 - name: RouteTarget namespace: Ipam description: Route Target (RFC 4360) label: Route Target icon: mdi:target + include_in_menu: true menu_placement: IpamVRF human_friendly_id: - name__value @@ -59,36 +82,51 @@ nodes: - name__value display_label: name__value attributes: - # TODO: regex to comply with RFC 4360 (nautobot doesn't enforce that) - name: name kind: Text unique: true + optional: false + order_weight: 1000 - name: description kind: Text optional: true + order_weight: 1100 relationships: - - name: vrf + - name: import_vrf peer: IpamVRF + kind: Generic + label: Imported by VRFs + cardinality: many optional: true + identifier: vrf__import + order_weight: 1300 + - name: export_vrf + peer: IpamVRF + kind: Generic + label: Exported by VRFs cardinality: many - + optional: true + identifier: vrf__export + order_weight: 1350 extensions: nodes: - kind: IpamPrefix relationships: - name: vrf - label: VRF peer: IpamVRF - optional: true - cardinality: one + label: VRF kind: Attribute + cardinality: one + optional: true + identifier: prefix__vrf order_weight: 1150 - kind: IpamIPAddress relationships: - name: vrf - label: VRF peer: IpamVRF - optional: true - cardinality: one + label: VRF kind: Attribute + cardinality: one + optional: true + identifier: ip_address__vrf order_weight: 1150 diff --git a/extensions/vrrp/vrrp.yml b/extensions/vrrp/vrrp.yml index d690eb3f..f274ee85 100644 --- a/extensions/vrrp/vrrp.yml +++ b/extensions/vrrp/vrrp.yml @@ -1,61 +1,74 @@ --- # yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +# --------------------------------------------------------------------------- +# This schema is a starting point for building with Infrahub, not a finished production model. +# Adapting it for your environment typically requires architectural review, see +# docs.infrahub.app, or reach out to OpsMill for help. +# --------------------------------------------------------------------------- version: "1.0" nodes: - name: VRRPGroup namespace: Network + description: VRRP Group configuration label: VRRP Group icon: fluent:virtual-network-20-filled - description: VRRP Group configuration - display_label: name__value - order_by: - - name__value + include_in_menu: true human_friendly_id: - name__value + order_by: + - name__value + display_label: name__value attributes: - # Could become a 'computed field' based on group + ip + # Could become a computed attribute from vrid + ip_addresses, as IpamCVLAN.name does. - name: name kind: Text label: Name unique: true + optional: false description: Unique name of the entry order_weight: 1000 - - name: group - kind: Text - description: VRRP Group - label: Group + - name: vrid + kind: Number + label: VRID + parameters: + min_value: 1 + max_value: 255 + optional: false + description: Virtual Router ID (VRID, should be between 1 and 255) order_weight: 1100 - name: password kind: HashedPassword - description: VRRP Password/Key label: Password optional: true + description: VRRP Password/Key order_weight: 1400 relationships: - - name: ip_address - on_delete: cascade - description: VRRP IP (v4 or v6) - label: IP Address + - name: ip_addresses peer: IpamIPAddress - optional: true - cardinality: many + label: IP Addresses kind: Attribute + cardinality: many + optional: true + on_delete: cascade + description: VRRP IP (v4 or v6) order_weight: 1200 - name: vrrp_interfaces - on_delete: cascade - kind: Component peer: NetworkVRRPInterface - cardinality: many label: VRRP Interfaces + kind: Component + cardinality: many + on_delete: cascade + optional: true order_weight: 1300 - name: VRRPInterface namespace: Network + description: VRRP Interface configuration label: VRRP Interface icon: carbon:interface-usage + include_in_menu: true menu_placement: NetworkVRRPGroup - description: VRRP Interface configuration order_by: - priority__value uniqueness_constraints: @@ -64,27 +77,29 @@ nodes: - name: priority kind: Number label: VRRP Priority - description: VRRP Priority (Should be between 0 to 255) - # Using a Regex until https://github.com/opsmill/infrahub/issues/2967 - regex: ^(25[0-5]|2[0-4][0-9]|1?[0-9]?[0-9])$ default_value: 100 + parameters: + min_value: 1 + max_value: 255 + optional: false + description: VRRP Priority (Should be between 1 and 255) order_weight: 1100 relationships: - name: vrrp_group - description: VRRP Group - label: VRRP Group peer: NetworkVRRPGroup - optional: false - cardinality: one + label: VRRP Group kind: Attribute + cardinality: one + optional: false + description: VRRP Group order_weight: 1200 - name: interface - description: Interface L3 - label: Interface peer: InterfaceLayer3 - optional: false - cardinality: one + label: Interface kind: Attribute + cardinality: one + optional: false + description: Interface L3 order_weight: 1300 extensions: @@ -92,18 +107,20 @@ extensions: - kind: InterfaceLayer3 relationships: - name: vrrp - kind: Component peer: NetworkVRRPInterface - description: VRRP Interface Configuration - cardinality: one label: VRRP - order_weight: 1500 + kind: Component + cardinality: one + optional: true + description: VRRP Interface Configuration + order_weight: 1650 - kind: IpamIPAddress relationships: - name: vrrp - kind: Component peer: NetworkVRRPGroup - description: Part of VRRP Group - cardinality: one label: VRRP Group - order_weight: 1600 + kind: Attribute + cardinality: one + optional: true + description: Part of VRRP Group + order_weight: 1700 diff --git a/objects/base/01_organization.yml b/objects/base/01_organization.yml new file mode 100644 index 00000000..26bcb621 --- /dev/null +++ b/objects/base/01_organization.yml @@ -0,0 +1,29 @@ +# --------------------------------------------------------------------------- +# Mock data for base/organization.yml. +# Depends on: (none) -- safe to load first. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: OrganizationManufacturer + data: + - name: Cisco + description: Cisco Systems, Inc. + - name: Juniper + description: Juniper Networks, Inc. + - name: Dell + description: Dell Technologies Inc. + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: OrganizationProvider + data: + - name: Acme Networks + description: Acme Networks -- the operator this mock data belongs to. + - name: Lumen + description: Lumen Technologies -- transit and dark fiber provider. + - name: Colt + description: Colt Technology Services -- transit and cross connects. diff --git a/objects/base/02_dcim.yml b/objects/base/02_dcim.yml new file mode 100644 index 00000000..910a0cbe --- /dev/null +++ b/objects/base/02_dcim.yml @@ -0,0 +1,49 @@ +# --------------------------------------------------------------------------- +# Mock data for base/dcim.yml. +# Depends on: base/organization.yml (manufacturer references). +# +# NOTE: DcimDevice is intentionally NOT populated here. DcimPhysicalDevice.location +# is a required relationship to LocationHosting, and base/location.yml only defines +# the abstract LocationGeneric/LocationHosting mixins -- there is no concrete node +# to attach a device to until a location extension is loaded. See +# objects/extensions/rack and objects/extensions/compute for device instances built +# on top of extensions/location_minimal. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimPlatform + data: + - name: Cisco IOS-XR + manufacturer: Cisco + - name: Juniper Junos + manufacturer: Juniper + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimDeviceType + data: + - name: ASR9001 + description: Cisco ASR 9001 aggregation router. + manufacturer: Cisco + part_number: ASR-9001 + height: 2 + full_depth: true + weight: 18 + - name: MX204 + description: Juniper MX204 universal routing platform. + manufacturer: Juniper + part_number: MX204-HWBASE3-AC + height: 1 + full_depth: false + weight: 9 + - name: PowerEdge R660 + description: Dell PowerEdge R660 rack server. + manufacturer: Dell + part_number: R660 + height: 1 + full_depth: true + weight: 16 diff --git a/objects/base/03_ipam.yml b/objects/base/03_ipam.yml new file mode 100644 index 00000000..be8b7fd0 --- /dev/null +++ b/objects/base/03_ipam.yml @@ -0,0 +1,29 @@ +# --------------------------------------------------------------------------- +# Mock data for base/ipam.yml. +# Depends on: (none) -- safe to load with the rest of base. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamPrefix + data: + - prefix: 10.0.0.0/16 + description: Global backbone supernet. + status: active + role: backbone + - prefix: 192.0.2.0/24 + description: Documentation / demo prefix (RFC 5737). + status: active + role: link + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamIPAddress + data: + - address: 192.0.2.1/32 + description: Demo loopback address. + status: active + role: loopback diff --git a/objects/extensions/aggregate/aggregate.yml b/objects/extensions/aggregate/aggregate.yml new file mode 100644 index 00000000..6e7848a4 --- /dev/null +++ b/objects/extensions/aggregate/aggregate.yml @@ -0,0 +1,42 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/aggregate. +# Depends on: base only. +# IpamAggregate inherits BuiltinIPPrefix; its only mandatory attribute is +# `prefix` (an IPNetwork). `ip_namespace` is optional and defaults to the +# built-in "default" namespace when omitted. OrganizationRIR is a concrete +# node (inherits the OrganizationGeneric generic), so it's referenced as a +# plain scalar human_friendly_id (name__value) from the `rir` relationship, +# which is cardinality one with a concrete peer. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: OrganizationRIR + data: + - name: ARIN + description: American Registry for Internet Numbers. + - name: RIPE NCC + description: Réseau IP Européens Network Coordination Centre. + - name: Private (RFC 1918) + description: Internal registry for RFC 1918 / RFC 4193 private address space. + private: true + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamAggregate + data: + - prefix: "10.0.0.0/8" + rir: "Private (RFC 1918)" + description: Private address space aggregate (RFC 1918). + date_added: "2020-01-01T00:00:00Z" + - prefix: "192.0.0.0/8" + rir: ARIN + description: Legacy Class C space aggregate. + date_added: "2015-06-01T00:00:00Z" + - prefix: "2001:db8::/32" + rir: RIPE NCC + description: Documentation IPv6 aggregate block. + date_added: "2018-03-15T00:00:00Z" diff --git a/objects/extensions/circuit/circuit.yml b/objects/extensions/circuit/circuit.yml new file mode 100644 index 00000000..495ff2fe --- /dev/null +++ b/objects/extensions/circuit/circuit.yml @@ -0,0 +1,107 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/circuit. +# Self-sufficient: it creates every record it references, so it can be loaded +# on its own on top of base + any extension that provides a concrete +# LocationSite (extensions/location_minimal or extensions/location_site). +# +# DcimCircuitEndpoint.location is mandatory and its peer LocationHosting is a +# base generic that base itself never implements, so the endpoints need a Site +# to exist. The sites are created below with their name only, deliberately +# without a parent: extensions/location_site has no tier above Site, and +# extensions/location_minimal puts them under Americas -> United States, so +# restating either tree here would tie this file to one of the two mutually +# exclusive location extensions. Restating location_minimal's tree is not an +# option anyway, since re-upserting the hierarchy root fails with "Not +# supported to assign a value to parent for LocationRegion". +# +# ORDER: load this file BEFORE your location fixture. In the .metadata.yml +# resolver order that is what happens (circuit sorts ahead of +# location_minimal), and location_minimal's fuller definition then adopts NYC1 +# and SJC1 into its hierarchy. Loading it the other way round leaves the two +# sites without a parent, because `infrahubctl object load` sends an explicit +# null for every optional cardinality-one relationship a document omits -- see +# the note at the top of objects/extensions/mlag/mlag.yml. +# +# NOTE: this file also creates the OrganizationProvider (from base) fixtures it +# needs. If base's own object file has already loaded the same records (Lumen, +# Colt), this upserts/matches them instead of duplicating -- see rule in AGENTS +# notes about repeating mandatory fields for an existing target. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: LocationSite + data: + - name: NYC1 + description: "Circuit hand-off site, New York metro." + - name: SJC1 + description: "Circuit hand-off site, San Jose metro." + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: OrganizationProvider + data: + - name: Lumen + description: Lumen Technologies -- transit and dark fiber provider. + - name: Colt + description: Colt Technology Services -- transit and cross connects. + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimCircuit + data: + - circuit_id: "LUMEN-00123" + description: "NYC1 to SJC1 backbone link" + commit_rate: 10000000 + circuit_type: point_to_point + status: active + provider: Lumen + # DcimCircuit.endpoints is a Component (cardinality many) -- data is a + # list. Each endpoint's `name` is a read_only computed attribute, so it + # is never set here. + endpoints: + kind: DcimCircuitEndpoint + data: + - side: a + status: active + description: "NYC1 hand-off" + # location is cardinality one, peer LocationHosting (a Generic) + # whose human_friendly_id is the single field name__value, so the + # already-created site is referenced by that scalar. + location: NYC1 + - side: z + status: active + description: "SJC1 hand-off" + location: SJC1 + + - circuit_id: "COLT-00456" + description: "NYC1 internet access circuit" + commit_rate: 1000000 + circuit_type: internet_access + status: active + provider: Colt + endpoints: + kind: DcimCircuitEndpoint + data: + - side: a + status: active + description: "NYC1 hand-off" + location: NYC1 + + - circuit_id: "LUMEN-00789" + description: "SJC1 dark fiber segment" + circuit_type: dark_fiber + status: provisioning + provider: Lumen + endpoints: + kind: DcimCircuitEndpoint + data: + - side: a + status: provisioning + description: "SJC1 hand-off" + location: SJC1 diff --git a/objects/extensions/compute/compute.yml b/objects/extensions/compute/compute.yml new file mode 100644 index 00000000..2ac6bb99 --- /dev/null +++ b/objects/extensions/compute/compute.yml @@ -0,0 +1,48 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/compute. +# Depends on: base, extensions/location_minimal (LocationSite: SJC1). +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: ComputePhysicalServer + data: + - name: sjc1-esx01 + description: ESXi hypervisor host. + status: active + device_type: PowerEdge R660 + rack_face: front + # LocationSite inherits LocationHosting (a Generic) -- specify the concrete + # kind so the reference is unambiguous. + # `location` is cardinality one, so `data` is a single mapping, not a list. + location: + kind: LocationSite + data: + name: SJC1 + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: VirtualizationVirtualMachine + data: + - name: sjc1-vm-web01 + description: Web front-end VM. + role: application + vcpu: 4 + memory: 16 + disk: 100 + # VirtualizationHostVirtualMachine is a Generic -- specify the concrete kind. + # `host` is cardinality one, so `data` is a single mapping, not a list. + # A nested kind+data block is validated as a full object spec, so it must + # repeat all of the target's mandatory fields (name + location here), not + # just enough to identify it -- the upsert then matches the server above. + host: + kind: ComputePhysicalServer + data: + name: sjc1-esx01 + location: + kind: LocationSite + data: + name: SJC1 diff --git a/objects/extensions/cross_connect/cross_connect.yml b/objects/extensions/cross_connect/cross_connect.yml new file mode 100644 index 00000000..0e84eb36 --- /dev/null +++ b/objects/extensions/cross_connect/cross_connect.yml @@ -0,0 +1,86 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/cross_connect. +# Depends on: base, extensions/location_minimal (LocationSite: NYC1, SJC1), +# extensions/rack (LocationRack: NYC1-RACK-01, DcimDevice: nyc1-rtr01 with +# interface GigabitEthernet0/0/0/0). +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimCrossConnect + data: + - identifier: "XC-NYC1-0001" + description: "Long-haul fiber cross-connect to Lumen POP" + status: connected + # provider is cardinality one to a CONCRETE kind (OrganizationProvider), + # but its existence isn't guaranteed on a fresh instance, so we use a + # nested kind+data block (full create spec -- OrganizationProvider's + # only mandatory field is `name`) instead of a bare scalar reference. + # This upserts rather than duplicating if it already exists. + provider: + kind: OrganizationProvider + data: + name: Lumen + # location is cardinality one to LocationHosting, a Generic -- nested + # kind+data block. LocationSite's only mandatory field is `name`. + location: + kind: LocationSite + data: + name: NYC1 + # connected_endpoints is cardinality many to DcimEndpoint, a Generic -- + # nested kind+data with `data` as a list. InterfacePhysical's mandatory + # fields are `name` and `device`; `device` is itself cardinality one to + # a Generic (DcimGenericDevice), so it needs its own nested kind+data + # repeating DcimDevice's mandatory fields (name + location), and so on + # down to LocationSite. Every level is a full create spec, so this + # upserts/matches existing objects rather than duplicating them. + # Uses a dedicated interface (TenGigE0/0/0/1) rather than the + # GigabitEthernet0/0/0/0 fixture, since an Interface's `connector` is + # cardinality one and that one is already attached to a DcimCable. + connected_endpoints: + kind: InterfacePhysical + data: + - name: TenGigE0/0/0/1 + device: + kind: DcimDevice + data: + name: nyc1-rtr01 + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: + kind: LocationSite + data: + name: NYC1 + + - identifier: "XC-NYC1-0002" + description: "Planned cross-connect for new customer circuit" + status: planned + provider: + kind: OrganizationProvider + data: + name: Colt + # Demonstrates attaching a cross-connect at the rack level instead of + # the site level. LocationRack's mandatory fields are name + site. + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: + kind: LocationSite + data: + name: NYC1 + + - identifier: "XC-SJC1-0001" + description: "Reserved cross-connect pending activation" + status: reserved + provider: + kind: OrganizationProvider + data: + name: Lumen + location: + kind: LocationSite + data: + name: SJC1 diff --git a/objects/extensions/device_module/device_module.yml b/objects/extensions/device_module/device_module.yml new file mode 100644 index 00000000..7dee2553 --- /dev/null +++ b/objects/extensions/device_module/device_module.yml @@ -0,0 +1,87 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/device_module. +# Depends on: base, extensions/location_minimal (LocationSite: NYC1), +# extensions/rack (LocationRack: NYC1-RACK-01, DcimDevice: nyc1-rtr01). +# Order: DcimModuleType -> DcimModuleBay -> DcimModule (module_bay/module_type +# are resolved by human_friendly_id, so the targets must already exist). +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimModuleType + data: + - name: ASR9001-RP + description: "Route processor module for the ASR 9001." + part_number: "A9K-RP" + manufacturer: Cisco + + - name: ASR9001-FAN + description: "Fan tray module for the ASR 9001." + part_number: "A9K-FAN" + manufacturer: Cisco + + - name: MX204-RE + description: "Routing engine module for the MX204." + part_number: "RE-MX204" + manufacturer: Juniper + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimModuleBay + data: + # `device` is cardinality one and its peer DcimPhysicalDevice is a Generic, + # so it needs a nested kind+data block. The nested data mapping is + # validated as a full create spec for DcimDevice, whose only mandatory + # fields without a default are `name` and `location` -- and `location` + # is itself a Generic peer (LocationHosting), so it repeats the same + # nested pattern down to LocationRack (name + site). All values here + # match the existing nyc1-rtr01 fixture exactly, so this upserts/matches + # it instead of creating a duplicate. + - name: "slot 1" + position: 1 + description: "Primary route processor slot." + device: &nyc1_rtr01 + kind: DcimDevice + data: + name: nyc1-rtr01 + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + + - name: "slot 2" + position: 2 + description: "Secondary route processor slot." + device: *nyc1_rtr01 + + - name: "fan tray 1" + position: 3 + description: "Fan tray slot." + device: *nyc1_rtr01 + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimModule + data: + # `module_bay` (cardinality one, peer DcimModuleBay is concrete) is + # referenced by its computed human_friendly_id: " > ". + # `module_type` (cardinality one, peer DcimModuleType is concrete) is + # referenced by its plain name. Both bays and types are created above, + # in this same file, before this document runs. + - module_bay: "nyc1-rtr01 > slot 1" + module_type: ASR9001-RP + serial_number: "FOC12345678" + + - module_bay: "nyc1-rtr01 > slot 2" + module_type: ASR9001-RP + serial_number: "FOC87654321" + + - module_bay: "nyc1-rtr01 > fan tray 1" + module_type: ASR9001-FAN + serial_number: "FAN00112233" diff --git a/objects/extensions/device_psu_module/device_psu_module.yml b/objects/extensions/device_psu_module/device_psu_module.yml new file mode 100644 index 00000000..0f22cced --- /dev/null +++ b/objects/extensions/device_psu_module/device_psu_module.yml @@ -0,0 +1,87 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/device_psu_module. +# Depends on: base, extensions/location_minimal (LocationSite: NYC1), +# extensions/rack (LocationRack: NYC1-RACK-01, DcimDevice: nyc1-rtr01), +# extensions/device_module (DcimModuleBay/DcimModule kinds). +# +# Module<->ModuleBay is a strict 1:1 relationship, and nyc1-rtr01's existing +# bays ("slot 1", "slot 2", "fan tray 1") are already occupied by DcimModule +# instances from extensions/device_module -- so this file creates brand new +# bays ("PSU slot 1"/"PSU slot 2") to install the PSU modules +# into, instead of reusing the existing ones. +# +# Order: DcimPSUModuleType -> DcimModuleBay (new PSU bays) -> DcimPSUModule +# (module_bay/module_type are resolved by human_friendly_id, so the targets +# must already exist). +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimPSUModuleType + data: + - name: ASR9001-PSU + description: "AC power supply module for the ASR 9001." + part_number: "A9K-PSU" + manufacturer: Cisco + wattage: 3000 + hot_swappable: true + + - name: MX204-PSU + description: "AC power supply module for the MX204." + part_number: "PSU-MX204" + manufacturer: Juniper + wattage: 650 + hot_swappable: true + + - name: PowerEdge-PSU + description: "Redundant power supply module for the PowerEdge R660." + part_number: "PWR-R660" + manufacturer: Dell + wattage: 800 + hot_swappable: true + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimModuleBay + data: + # New bays, distinct from the existing "slot 1"/"slot 2"/"fan tray 1" + # (already occupied), used below to install the PSU modules. + - name: "PSU slot 1" + position: 4 + description: "Primary power supply slot." + device: &nyc1_rtr01 + kind: DcimDevice + data: + name: nyc1-rtr01 + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + + - name: "PSU slot 2" + position: 5 + description: "Secondary power supply slot." + device: *nyc1_rtr01 + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimPSUModule + data: + # `module_bay` (cardinality one, peer DcimModuleBay is concrete) is + # referenced by its computed human_friendly_id: " > ". + # `module_type` (cardinality one, peer DcimPSUModuleType is concrete) is + # referenced by its plain name. Both bays and types are created above, + # in this same file, before this document runs. + - module_bay: "nyc1-rtr01 > PSU slot 1" + module_type: ASR9001-PSU + serial_number: "PSU00112233" + + - module_bay: "nyc1-rtr01 > PSU slot 2" + module_type: ASR9001-PSU + serial_number: "PSU44556677" diff --git a/objects/extensions/dwdm/dwdm.yml b/objects/extensions/dwdm/dwdm.yml new file mode 100644 index 00000000..e9909012 --- /dev/null +++ b/objects/extensions/dwdm/dwdm.yml @@ -0,0 +1,170 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/dwdm. +# Depends on: base, extensions/location_minimal (LocationSite: NYC1), +# extensions/rack (LocationRack: NYC1-RACK-01, DcimDevice: nyc1-rtr01), +# extensions/sfp (DcimGenericSFP base + existing plugged/spare SFPs on +# GigabitEthernet0/0/0/0 and /1). +# +# DcimWdmChannel records are created first since both the OADM front +# interfaces and the WDM SFPs below reference them. DcimOpticalMultiplexer +# is created next, with its front/rear interfaces nested as Component +# children. A new interface (GigabitEthernet0/0/0/4) is added on nyc1-rtr01 +# for the plugged WDM SFP demo, since GigabitEthernet0/0/0/0 through /3 are +# already occupied by other fixtures. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimWdmChannel + data: + - channel: 1 + wdm_type: dwdm + wavelength: "1550.12" + frequency: "193.10" + + - channel: 2 + wdm_type: dwdm + wavelength: "1550.92" + frequency: "193.20" + + - channel: 20 + wdm_type: cwdm + wavelength: "1611.00" + frequency: "186.00" + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimOpticalMultiplexer + data: + - name: NYC1-MUX01 + wdm_type: dwdm + description: Primary DWDM multiplexer for the NYC1 backbone ring. + position: 20 + rack_face: front + # `location` (from DcimPhysicalDevice) peer is LocationHosting, a + # Generic -- specify the concrete kind. Cardinality one, so `data` is + # a single mapping. This upserts against the existing rack. + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + # front_interfaces is a Component relationship (cardinality many) -- + # nest the concrete kind with `data` as a list. The `optical_multiplexer` + # Parent relationship on each child is implied by this nesting. + front_interfaces: + kind: DcimOadmFrontInterface + data: + - name: "CH1" + connector_type: lc + # `channels` peer (DcimWdmChannel) is a CONCRETE kind whose + # human_friendly_id has two components ([wdm_type__value, + # channel__value]) and the relationship is cardinality many, so + # it's a plain list of HFID lists (same pattern as + # `bundle_members` in objects/extensions/lag/lag.yml). + channels: + - [dwdm, "1"] + - name: "CH2" + connector_type: lc + channels: + - [dwdm, "2"] + # rear_interface is a Component relationship of cardinality one -- + # nest the concrete kind with `data` as a single mapping. + rear_interface: + kind: DcimOadmRearInterface + data: + name: "COM" + connector_type: lc + + - name: NYC1-MUX02 + wdm_type: cwdm + description: Secondary CWDM multiplexer, spare capacity at NYC1. + position: 22 + rack_face: front + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + front_interfaces: + kind: DcimOadmFrontInterface + data: + - name: "CH1" + connector_type: lc + channels: + - [cwdm, "20"] + rear_interface: + kind: DcimOadmRearInterface + data: + name: "COM" + connector_type: lc + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimDevice + data: + # Upsert the existing fixture device to add a free physical interface + # for the plugged WDM SFP below (GigabitEthernet0/0/0/0 through /3 are + # already in use by other fixtures). + - name: nyc1-rtr01 + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + interfaces: + kind: InterfacePhysical + data: + - name: GigabitEthernet0/0/0/4 + role: core + status: active + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimWdmSFP + data: + - sfp_type: zr + form_factor: sfp_plus + status: plugged + wdm_type: dwdm + serial_number: "SFP-WDM-0001" + manufacturer: Cisco + # `interface` peer (InterfacePhysical) is a CONCRETE kind with a + # composite human_friendly_id ([device__name__value, name__value]). + interface: [nyc1-rtr01, GigabitEthernet0/0/0/4] + # `wdm_channel` peer (DcimWdmChannel) is a CONCRETE kind with a + # composite human_friendly_id ([wdm_type__value, channel__value]), + # cardinality one -- a plain list of the HFID parts. + wdm_channel: [dwdm, "1"] + + - sfp_type: zr + form_factor: sfp_plus + status: spare + wdm_type: dwdm + serial_number: "SFP-WDM-0002" + manufacturer: Cisco + spare_location: + kind: LocationSite + data: + name: NYC1 + wdm_channel: [dwdm, "2"] + + - sfp_type: zr + form_factor: qsfp28 + status: spare + wdm_type: cwdm + serial_number: "SFP-WDM-0003" + manufacturer: Cisco + spare_location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + wdm_channel: [cwdm, "20"] diff --git a/objects/extensions/hosting_cluster/hosting_cluster.yml b/objects/extensions/hosting_cluster/hosting_cluster.yml new file mode 100644 index 00000000..494f6f87 --- /dev/null +++ b/objects/extensions/hosting_cluster/hosting_cluster.yml @@ -0,0 +1,91 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/hosting_cluster. +# Depends on: base, extensions/location_minimal (LocationSite: SJC1, NYC1), +# extensions/cluster (ClusterGeneric, ClusterGenericComputeUnitNodes), +# extensions/compute (ComputePhysicalServer "sjc1-esx01" already exists). +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: ComputePhysicalServer + data: + - name: sjc1-esx02 + description: Second ESXi hypervisor host in the SJC1 cluster. + status: active + device_type: PowerEdge R660 + rack_face: front + location: + kind: LocationSite + data: + name: SJC1 + - name: nyc1-esx01 + description: First KVM hypervisor host in the NYC1 cluster. + status: active + device_type: PowerEdge R660 + rack_face: front + location: + kind: LocationSite + data: + name: NYC1 + - name: nyc1-esx02 + description: Second KVM hypervisor host in the NYC1 cluster. + status: active + device_type: PowerEdge R660 + rack_face: front + location: + kind: LocationSite + data: + name: NYC1 + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: ClusterHosting + data: + - name: SJC1-VMware-Cluster01 + description: VMware vSphere cluster at SJC1 built from physical servers. + technology: vmware + status: active + # `locations` is cardinality many (a cluster can span locations), and + # LocationGeneric is a Generic -- each entry is a human_friendly_id, and + # an HFID is always a list of its parts, so the single-part site name is + # wrapped in a list. A bare string there is read as a node ID. + locations: + - [SJC1] + # `nodes` is cardinality many, and ComputeGenericUnit is a Generic -- + # a flat list of HFID strings is not enough (the peer schema can't be + # resolved), so specify the concrete kind with a list of upsert specs. + nodes: + kind: ComputePhysicalServer + data: + - name: sjc1-esx01 + location: + kind: LocationSite + data: + name: SJC1 + - name: sjc1-esx02 + location: + kind: LocationSite + data: + name: SJC1 + - name: NYC1-KVM-Cluster01 + description: KVM/QEMU cluster at NYC1 built from physical servers. + technology: kvm + status: active + locations: + - [NYC1] + nodes: + kind: ComputePhysicalServer + data: + - name: nyc1-esx01 + location: + kind: LocationSite + data: + name: NYC1 + - name: nyc1-esx02 + location: + kind: LocationSite + data: + name: NYC1 diff --git a/objects/extensions/interface_breakout/interface_breakout.yml b/objects/extensions/interface_breakout/interface_breakout.yml new file mode 100644 index 00000000..891a9dae --- /dev/null +++ b/objects/extensions/interface_breakout/interface_breakout.yml @@ -0,0 +1,77 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/interface_breakout. +# Depends on: base, extensions/rack (DcimDevice: nyc1-rtr01, in LocationRack +# NYC1-RACK-01), which in turn depends on extensions/location_minimal for +# LocationSite NYC1. +# +# interface_breakout only extends InterfacePhysical -- it adds a +# `breakout_capability` attribute plus a self-referencing relationship pair +# (breakout_parent_interface / breakout_child_interfaces, identifier +# "physical__breakout"). It introduces no new node/generic kind, so there is +# nothing new to add to the menu. +# +# breakout_parent_interface is cardinality one with peer InterfacePhysical, a +# concrete kind whose human_friendly_id is the 2-part +# [device__name__value, name__value] (see base/dcim.yml, generic DcimInterface, +# inherited by InterfacePhysical). A cardinality-one relationship to a +# concrete peer with a multi-part HFID is referenced as a plain list of +# scalars (a "ONE_REF"): [device_name, interface_name]. +# +# The breakout parent interface is listed first below so that each child's +# breakout_parent_interface reference resolves against an interface that +# already exists by the time it is processed. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimDevice + data: + - name: nyc1-rtr01 + status: active + role: edge + device_type: ASR9001 + platform: Cisco IOS-XR + position: 40 + rack_face: front + # LocationRack inherits LocationHosting (a Generic) -- specify the + # concrete kind so the reference is unambiguous and upserts against the + # existing rack from extensions/rack's mock data. + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + # `interfaces` is a Component relationship (cardinality many, concrete + # peer InterfacePhysical) -- each entry below is created/upserted + # individually against nyc1-rtr01, alongside the existing + # GigabitEthernet0/0/0/0 interface from extensions/rack (this does not + # replace or remove it). + interfaces: + kind: InterfacePhysical + data: + - name: HundredGigE0/0/0/1 + description: "100G port, broken out into 4x 25G" + role: core + status: active + breakout_capability: true + - name: HundredGigE0/0/0/1/0 + description: "Breakout child 1/4 of HundredGigE0/0/0/1" + role: access + status: active + breakout_parent_interface: ["nyc1-rtr01", "HundredGigE0/0/0/1"] + - name: HundredGigE0/0/0/1/1 + description: "Breakout child 2/4 of HundredGigE0/0/0/1" + role: access + status: active + breakout_parent_interface: ["nyc1-rtr01", "HundredGigE0/0/0/1"] + - name: HundredGigE0/0/0/1/2 + description: "Breakout child 3/4 of HundredGigE0/0/0/1" + role: access + status: active + breakout_parent_interface: ["nyc1-rtr01", "HundredGigE0/0/0/1"] + - name: HundredGigE0/0/0/1/3 + description: "Breakout child 4/4 of HundredGigE0/0/0/1" + role: access + status: active + breakout_parent_interface: ["nyc1-rtr01", "HundredGigE0/0/0/1"] diff --git a/objects/extensions/lag/lag.yml b/objects/extensions/lag/lag.yml new file mode 100644 index 00000000..11c59647 --- /dev/null +++ b/objects/extensions/lag/lag.yml @@ -0,0 +1,57 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/lag. +# Depends on: base, extensions/rack (DcimDevice: nyc1-rtr01, in NYC1-RACK-01). +# Adds two fresh physical interfaces on nyc1-rtr01 (TenGigE0/0/0/1 and /2, +# distinct from the pre-existing GigabitEthernet0/0/0/0) and bundles them +# into a LAG. `interfaces` is a Component relationship of cardinality many +# with a Generic peer (DcimInterface) -- since we need to mix two concrete +# kinds (InterfacePhysical and InterfaceLag) under it, we use the +# "list of {kind, data}" format rather than a single {kind, data: [...]} +# block. Items are created in list order, so the member interfaces are +# listed before the LAG that references them via `bundle_members`. +# InterfacePhysical's human_friendly_id is [device__name__value, name__value] +# (a 2-part list), and `bundle_members` is cardinality many with a CONCRETE +# peer (InterfacePhysical), so it's a plain list of HFID lists. +# Note: extensions/mlag builds on top of this LAG later -- kept self +# contained here. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimDevice + data: + - name: nyc1-rtr01 + device_type: ASR9001 + platform: Cisco IOS-XR + # LocationRack inherits LocationHosting (a Generic) -- specify the + # concrete kind so the reference is unambiguous and upserts against + # the rack created by extensions/rack. + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + interfaces: + - kind: InterfacePhysical + data: + name: TenGigE0/0/0/1 + status: active + role: core + - kind: InterfacePhysical + data: + name: TenGigE0/0/0/2 + status: active + role: core + - kind: InterfaceLag + data: + name: Bundle-Ether1 + description: LAG toward nyc1-sw01 uplink. + status: active + role: core + bundle_number: 1 + lacp_mode: active + lacp_rate: fast + bundle_members: + - ["nyc1-rtr01", "TenGigE0/0/0/1"] + - ["nyc1-rtr01", "TenGigE0/0/0/2"] diff --git a/objects/extensions/location_minimal/location_minimal.yml b/objects/extensions/location_minimal/location_minimal.yml new file mode 100644 index 00000000..49da4899 --- /dev/null +++ b/objects/extensions/location_minimal/location_minimal.yml @@ -0,0 +1,29 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/location_minimal. +# Depends on: base. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: LocationRegion + data: + - name: Americas + description: North & South America. + children: + kind: LocationCountry + data: + - name: United States + children: + kind: LocationSite + data: + - name: NYC1 + status: active + facility: Equinix NY5 + physical_address: "755 Secaucus Rd, Secaucus, NJ 07094" + timezone: America/New_York + - name: SJC1 + status: active + facility: Equinix SV1 + physical_address: "2001 Ryan Ave, San Jose, CA 95131" + timezone: America/Los_Angeles diff --git a/objects/extensions/mlag/mlag.yml b/objects/extensions/mlag/mlag.yml new file mode 100644 index 00000000..99857226 --- /dev/null +++ b/objects/extensions/mlag/mlag.yml @@ -0,0 +1,190 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/mlag. +# Depends on: base, extensions/lag (InterfaceLag, GenericInterfaceBundle), +# extensions/location_minimal (LocationSite: NYC1), extensions/rack +# (LocationRack: NYC1-RACK-01). +# +# UPSERT RULE FOR EVERY FILE UNDER objects/ -- documented once, here. +# +# `infrahubctl object load` builds each record from scratch and saves it with +# allow_upsert, and infrahub-sdk fills in every optional cardinality-one +# relationship the document leaves out with an explicit null. Re-declaring a +# node another file has already linked therefore CLEARS those links. Where the +# link is guarded by a constraint the load fails outright, as here: +# +# ['DcimDeviceUpsert'] Node has 0 peers for device__mlag_domain, +# no fewer than 2 allowed +# +# MlagDomain.peers is min_count/max_count 2 and shares the identifier +# device__mlag_domain with the optional DcimDevice.mlag_domain added by this +# extension, so ANY later document that re-upserts a member device without +# restating mlag_domain breaks the domain. Restating it is not an option +# either: it would make objects/extensions/rack (and four other files) depend +# on this extension's schema, inverting the layering. +# +# So a fixture that owns a relationship owns its endpoints too. This file +# creates, and is the only file anywhere under objects/ that ever saves, +# nyc1-rtr02 and nyc1-rtr03. It deliberately does not build the domain on +# nyc1-rtr01: objects/extensions/rack, device_psu_module, dwdm, routing_ospf +# and routing_pim all re-upsert that device after this file has run. +# objects/extensions/routing_bgp and peering_ixp only reference nyc1-rtr02 by +# human_friendly_id, which does not save it and so is safe. +# +# A MlagDomain regroups exactly 2 devices (peers, min_count/max_count = 2) +# built over LAG interfaces used as peer-links, so both peers are created here +# in the same rack/site, each with its own pair of physical interfaces bundled +# into its own "Bundle-Ether1" LAG. Both LAGs then become the domain's +# peer_links. +# +# MlagInterface inherits GenericInterfaceBundle (bundle_members, cardinality +# many, peer InterfacePhysical) but NOT DcimInterface -- it has no single +# "device" of its own. Instead it is "spread across devices in the domain" +# by bundling physical interfaces that live on different peer devices. +# TenGigE0/0/0/3 and /4 on both devices serve as those members. +# +# MlagInterface.mlag_domain is a Parent relationship (mandatory, cardinality +# one) paired with MlagDomain.mlag_interfaces (Component, cardinality many), +# so nesting the MlagInterface records under mlag_interfaces implies the +# mlag_domain link -- no need to set it explicitly, matching how +# extensions/rack nests InterfacePhysical under DcimDevice.interfaces. +# +# peer_links (peer InterfaceLag, concrete kind, cardinality many) and peers +# (peer DcimDevice, concrete kind, cardinality many) are both lists of +# human_friendly_id refs, and every HFID is itself a list of its parts: +# InterfaceLag's is the 2-part [device__name__value, name__value], DcimDevice's +# is the 1-part [name__value]. A bare string there is read as a node ID, so the +# single-part HFID is wrapped in a list too. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimDevice + data: + # First peer of the MLAG domain, with a peer-link LAG over + # TenGigE0/0/0/1-2 and a pair of MLAG-facing interfaces on /3 and /4. + - name: nyc1-rtr02 + status: active + role: edge + device_type: ASR9001 + platform: Cisco IOS-XR + position: 41 + rack_face: front + location: &nyc1_rack_01 + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + interfaces: + - kind: InterfacePhysical + data: + name: TenGigE0/0/0/1 + status: active + role: core + - kind: InterfacePhysical + data: + name: TenGigE0/0/0/2 + status: active + role: core + - kind: InterfacePhysical + data: + name: TenGigE0/0/0/3 + status: active + role: core + - kind: InterfacePhysical + data: + name: TenGigE0/0/0/4 + status: active + role: core + - kind: InterfaceLag + data: + name: Bundle-Ether1 + description: MLAG peer-link toward nyc1-rtr03. + status: active + role: core + bundle_number: 1 + lacp_mode: active + lacp_rate: fast + bundle_members: + - ["nyc1-rtr02", "TenGigE0/0/0/1"] + - ["nyc1-rtr02", "TenGigE0/0/0/2"] + + # Second peer of the MLAG domain -- same rack/site as nyc1-rtr02, with a + # mirrored peer-link LAG and its own pair of MLAG-facing interfaces. Both + # peers live in one document so the LocationRack anchor above can be + # reused: a YAML anchor does not cross a `---` document boundary. + - name: nyc1-rtr03 + status: active + role: edge + device_type: ASR9001 + platform: Cisco IOS-XR + position: 42 + rack_face: front + location: *nyc1_rack_01 + interfaces: + - kind: InterfacePhysical + data: + name: TenGigE0/0/0/1 + status: active + role: core + - kind: InterfacePhysical + data: + name: TenGigE0/0/0/2 + status: active + role: core + - kind: InterfacePhysical + data: + name: TenGigE0/0/0/3 + status: active + role: core + - kind: InterfacePhysical + data: + name: TenGigE0/0/0/4 + status: active + role: core + - kind: InterfaceLag + data: + name: Bundle-Ether1 + description: MLAG peer-link toward nyc1-rtr02. + status: active + role: core + bundle_number: 1 + lacp_mode: active + lacp_rate: fast + bundle_members: + - ["nyc1-rtr03", "TenGigE0/0/0/1"] + - ["nyc1-rtr03", "TenGigE0/0/0/2"] + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: MlagDomain + data: + - domain_id: "NYC1-MLAG-01" + reload_delay: 300 + peers: + - ["nyc1-rtr02"] + - ["nyc1-rtr03"] + peer_links: + - ["nyc1-rtr02", "Bundle-Ether1"] + - ["nyc1-rtr03", "Bundle-Ether1"] + mlag_interfaces: + kind: MlagInterface + data: + - name: Bundle-Ether100 + description: MLAG port-channel toward nyc1-acc-sw01. + status: active + role: router + bundle_number: 100 + bundle_members: + - ["nyc1-rtr02", "TenGigE0/0/0/3"] + - ["nyc1-rtr03", "TenGigE0/0/0/3"] + - name: Bundle-Ether101 + description: MLAG port-channel toward nyc1-acc-sw02. + status: active + role: router + bundle_number: 101 + bundle_members: + - ["nyc1-rtr02", "TenGigE0/0/0/4"] + - ["nyc1-rtr03", "TenGigE0/0/0/4"] diff --git a/objects/extensions/patch_panel/patch_panel.yml b/objects/extensions/patch_panel/patch_panel.yml new file mode 100644 index 00000000..865e730b --- /dev/null +++ b/objects/extensions/patch_panel/patch_panel.yml @@ -0,0 +1,83 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/patch_panel. +# Depends on: base, extensions/location_minimal (LocationSite: NYC1), +# extensions/rack (LocationRack: NYC1-RACK-01). +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimPatchPanel + data: + - name: NYC1-PP-01 + description: 24-port LC fiber patch panel. + module_capacity: 24 + position: 38 + rack_face: front + # LocationRack inherits LocationHosting (a Generic) -- specify the + # concrete kind so the reference is unambiguous. `location` is + # cardinality one, so `data` is a single mapping, not a list. This + # matches the existing NYC1-RACK-01 rack created by extensions/rack. + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + # rear_interfaces is a Component relationship (cardinality many) -- + # nest the concrete kind with `data` as a list. The `patch_panel` + # Parent relationship on each child is implied by this nesting. + rear_interfaces: + kind: DcimRearPatchPanelInterface + data: + - name: RJ1 + connector_type: lc + - name: RJ2 + connector_type: lc + + - name: NYC1-PP-02 + description: 12-port SC fiber patch panel. + module_capacity: 12 + position: 37 + rack_face: front + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + rear_interfaces: + kind: DcimRearPatchPanelInterface + data: + - name: RJ1 + connector_type: sc + +--- +# Front interfaces are created as their own top-level documents (rather than +# nested under the patch panel) so each one can reference its corresponding +# rear interface created above via `corresponding_front_rear`. This document +# runs after the one above, so those rear interfaces already exist. +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimFrontPatchPanelInterface + data: + - name: FR1 + connector_type: lc + # patch_panel peer (DcimPatchPanel) is a CONCRETE kind with a + # single-field human_friendly_id (name), so a plain scalar works. + patch_panel: NYC1-PP-01 + # corresponding_front_rear peer (DcimRearPatchPanelInterface) is a + # CONCRETE kind but its human_friendly_id has two components + # (patch_panel__name, name) -- a cardinality-one reference to a + # multi-component HFID must be given as a list of the HFID parts, + # in order, not a single scalar string. + corresponding_front_rear: [NYC1-PP-01, RJ1] + + - name: FR2 + connector_type: lc + patch_panel: NYC1-PP-01 + corresponding_front_rear: [NYC1-PP-01, RJ2] + + - name: FR1 + connector_type: sc + patch_panel: NYC1-PP-02 + corresponding_front_rear: [NYC1-PP-02, RJ1] diff --git a/objects/extensions/peering_ixp/peering_ixp.yml b/objects/extensions/peering_ixp/peering_ixp.yml new file mode 100644 index 00000000..a2b58073 --- /dev/null +++ b/objects/extensions/peering_ixp/peering_ixp.yml @@ -0,0 +1,99 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/peering_ixp. +# Depends on: extensions/routing (RoutingAutonomousSystem, RoutingBGPCommunity +# via routing_bgp_community, RoutingPolicyBGP via routing_policies_bgp, +# RoutingBGPSession via routing_bgp -- all already created), base (DcimDevice: +# nyc1-rtr01/nyc1-rtr02; LocationSite: NYC1/SJC1), extensions/vrf (IpamIPAddress +# 192.0.2.21/32, 192.0.2.22/32 in the "default" namespace). +# +# This file owns PeeringIXP and PeeringIXPConnection for real, and adds one +# more RoutingBGPSession upsert to wire the extension's ixp_connection +# attribute (added by extensions/peering_ixp/peering_ixp.yml onto +# RoutingBGPSession) onto a pre-existing session. +# +# PeeringIXP's human_friendly_id is just `name__value`, so it's referenced as +# a plain scalar string. local_as (cardinality one, peer +# RoutingAutonomousSystem, a concrete kind) uses that kind's two-part +# [asn, name] HFID as a YAML list, quoting the Number asn component as a +# string. import_policies/export_policies (cardinality many, peer +# RoutingPolicyBGP -- concrete, HFID name__value) and bgp_communities +# (cardinality many, peer RoutingBGPCommunity -- concrete, HFID name__value) +# are lists of HFIDs, and an HFID is always a list of its parts -- so each +# single-part entry is itself a one-element list, not a bare string. +# +# PeeringIXPConnection's human_friendly_id is also just `name__value`. +# internet_exchange_point (Parent, cardinality one, mandatory) references +# PeeringIXP by its scalar HFID. router (cardinality one, peer DcimDevice, +# concrete, HFID name__value) is a plain scalar. ipv4_address (cardinality +# one, peer IpamIPAddress, concrete) uses that kind's two-part +# [ip_namespace, address] HFID as a YAML list. +# +# The RoutingBGPSession upsert below matches the existing "eBGP session to +# Customer A via CUST-A-EBGP on nyc1-rtr01" record (created by +# objects/extensions/routing_bgp) by its description HFID and repeats only +# its mandatory fields (description/status/role/session_type/vrf -- per +# convention, see objects/extensions/routing_policies_bgp for the same +# pattern) while adding the new ixp_connection link. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: PeeringIXP + data: + - name: NYC1-IX + description: "New York area internet exchange point serving the NYC1 site." + status: enabled + local_as: + - "65000" + - NYC1-BACKBONE-AS + import_policies: + - [CUST-A-IMPORT-PREFER-CUSTOMER] + export_policies: + - [CUST-A-EXPORT-DEFAULT-ROUTE] + bgp_communities: + - [NO-EXPORT] + + - name: SJC1-IX + description: "San Jose area internet exchange point serving the SJC1 site." + status: enabled + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: PeeringIXPConnection + data: + - name: nyc1-rtr01-NYC1-IX + description: "nyc1-rtr01's connection into NYC1-IX" + peeringdb_netixlan: 25256 + status: enabled + vlan: 100 + router: nyc1-rtr01 + internet_exchange_point: NYC1-IX + ipv4_address: + - default + - 192.0.2.21/32 + + - name: nyc1-rtr02-NYC1-IX + description: "nyc1-rtr02's connection into NYC1-IX" + status: enabled + vlan: 200 + router: nyc1-rtr02 + internet_exchange_point: NYC1-IX + ipv4_address: + - default + - 192.0.2.22/32 + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingBGPSession + data: + - description: "eBGP session to Customer A via CUST-A-EBGP on nyc1-rtr01" + status: active + session_type: external + role: peering + vrf: CUST-A + ixp_connection: nyc1-rtr01-NYC1-IX diff --git a/objects/extensions/qinq/qinq.yml b/objects/extensions/qinq/qinq.yml new file mode 100644 index 00000000..5abbdce1 --- /dev/null +++ b/objects/extensions/qinq/qinq.yml @@ -0,0 +1,45 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/qinq. +# Depends on: base, extensions/location_minimal, extensions/vlan +# (IpamVLANGroup: NYC1-VLANs). +# IpamSVLAN and IpamCVLAN both inherit from IpamGenericVLAN, so each needs its own +# vlan_id/vlan_group. IpamCVLAN's `name` attribute is a read-only computed +# attribute (Jinja2 from svlan + vlan_id), so it is never set here. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamSVLAN + data: + - name: NYC1-SVLAN-3001 + description: Supplier VLAN carrying customer traffic for tenant A at NYC1. + vlan_id: 3001 + status: active + vlan_group: NYC1-VLANs + - name: NYC1-SVLAN-3002 + description: Supplier VLAN carrying customer traffic for tenant B at NYC1. + vlan_id: 3002 + status: active + vlan_group: NYC1-VLANs + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamCVLAN + data: + # `name` is read-only/computed (svlan name + vlan_id) -- do not set it. + - vlan_id: 101 + status: active + vlan_group: NYC1-VLANs + # IpamSVLAN is a concrete kind -- plain human_friendly_id scalar. + svlan: NYC1-SVLAN-3001 + - vlan_id: 102 + status: active + vlan_group: NYC1-VLANs + svlan: NYC1-SVLAN-3001 + - vlan_id: 103 + status: active + vlan_group: NYC1-VLANs + svlan: NYC1-SVLAN-3002 diff --git a/objects/extensions/rack/rack.yml b/objects/extensions/rack/rack.yml new file mode 100644 index 00000000..39ebd68a --- /dev/null +++ b/objects/extensions/rack/rack.yml @@ -0,0 +1,46 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/rack. +# Depends on: base, extensions/location_minimal (LocationSite: NYC1). +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: LocationRack + data: + - name: NYC1-RACK-01 + site: NYC1 + status: active + height: 42 + facility: "R101" + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimDevice + data: + - name: nyc1-rtr01 + status: active + role: edge + device_type: ASR9001 + platform: Cisco IOS-XR + position: 40 + rack_face: front + # LocationRack inherits LocationHosting (a Generic) -- specify the concrete + # kind so the reference is unambiguous and upserts against the rack above. + # `location` is cardinality one, so `data` is a single mapping, not a list. + # A nested kind+data block is validated as a full object spec, so it must + # repeat all of the target's mandatory fields (name + site here), not just + # enough to identify it -- the upsert then matches the rack created above. + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + interfaces: + kind: InterfacePhysical + data: + - name: GigabitEthernet0/0/0/0 + role: core + status: active diff --git a/objects/extensions/routing/routing.yml b/objects/extensions/routing/routing.yml new file mode 100644 index 00000000..71d7f24a --- /dev/null +++ b/objects/extensions/routing/routing.yml @@ -0,0 +1,49 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing. +# Depends on: base (DcimDevice: nyc1-rtr01, from extensions/rack). +# +# extensions/routing/routing.yml defines only the abstract RoutingProtocol +# generic (device + vrf + description + status, all mandatory) -- it has no +# concrete node of its own, so nothing of kind "RoutingProtocol" can be +# created directly. RoutingBGPPeerGroup (from extensions/routing_bgp) is used +# below purely to exercise/prove the generic's mandatory-field contract with +# a real instance attached to nyc1-rtr01. Later waves building +# routing_bgp/routing_ospf/routing_pim/routing_aggregate own the "real" +# object files for their concrete kinds and may add to or ignore this data. +# +# extensions/vrf is being built in parallel and its data may not exist yet, +# so the IpamVRF instance below is created inline rather than assumed. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamVRF + data: + - name: CUST-A + description: VRF for Customer A routed services. + vrf_rd: "65000:100" + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingBGPPeerGroup + data: + # `device` (cardinality one, peer DcimDevice) and `vrf` (cardinality one, + # peer IpamVRF) are both concrete kinds, so plain human_friendly_id + # scalars are used. These two relationships plus `description` and + # `status` are the mandatory fields inherited from RoutingProtocol. + - name: CUST-A-EBGP + description: "eBGP peer group for Customer A on nyc1-rtr01" + status: active + address_family: ipv4 + device: nyc1-rtr01 + vrf: CUST-A + + - name: CUST-A-IBGP + description: "iBGP peer group for Customer A on nyc1-rtr01" + status: active + address_family: ipv4 + device: nyc1-rtr01 + vrf: CUST-A diff --git a/objects/extensions/routing_aggregate/routing_aggregate.yml b/objects/extensions/routing_aggregate/routing_aggregate.yml new file mode 100644 index 00000000..eec53047 --- /dev/null +++ b/objects/extensions/routing_aggregate/routing_aggregate.yml @@ -0,0 +1,48 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing_aggregate. +# Depends on: extensions/routing (RoutingProtocol generic), base/extensions/rack +# (DcimDevice: nyc1-rtr01), extensions/vrf and extensions/routing (IpamVRF: +# CUSTOMER-B, MGMT-VRF, CUST-A), extensions/aggregate (IpamPrefix: 10.0.0.0/16, +# 192.0.2.0/24, namespace "default"). +# +# RoutingAggregateRoute inherits RoutingProtocol: description (Text, unique, +# also the human_friendly_id), status (Dropdown), device (peer DcimDevice, +# concrete, cardinality one, mandatory), vrf (peer IpamVRF, concrete, +# cardinality one, mandatory) are all inherited and mandatory. discard, +# import_policies, export_policies and destination (peer IpamPrefix, many, +# optional) are added by this node. +# +# `device` and `vrf` are concrete kinds with cardinality one, so plain +# human_friendly_id scalars are used (e.g. `device: nyc1-rtr01`). `destination` +# is cardinality many with a concrete peer (IpamPrefix) whose human_friendly_id +# is composite (["ip_namespace__name", "prefix"]), so each entry is itself a +# list, e.g. `["default", "10.0.0.0/16"]`. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingAggregateRoute + data: + - description: "Aggregate summary route for Customer A allocated block on nyc1-rtr01" + status: active + device: nyc1-rtr01 + vrf: CUST-A + discard: false + import_policies: "CUST-A-EXPORT-SUMMARY" + destination: + - ["default", "10.0.0.0/16"] + + - description: "Discard route for unused Customer B subnet on nyc1-rtr01" + status: active + device: nyc1-rtr01 + vrf: CUSTOMER-B + discard: true + destination: + - ["default", "192.0.2.0/24"] + + - description: "Disabled aggregate route pending decommission on nyc1-rtr01" + status: disabled + device: nyc1-rtr01 + vrf: MGMT-VRF + discard: false diff --git a/objects/extensions/routing_bgp/routing_bgp.yml b/objects/extensions/routing_bgp/routing_bgp.yml new file mode 100644 index 00000000..208d904d --- /dev/null +++ b/objects/extensions/routing_bgp/routing_bgp.yml @@ -0,0 +1,170 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing_bgp. +# Depends on: base (DcimDevice: nyc1-rtr01, nyc1-rtr02), extensions/routing +# (RoutingBGPPeerGroup: CUST-A-EBGP, CUST-A-IBGP on nyc1-rtr01 / VRF CUST-A -- +# created there purely to demonstrate the RoutingProtocol generic's contract). +# +# This file owns RoutingAutonomousSystem, RoutingBGPPeerGroup, and +# RoutingBGPSession for real: it adds RoutingAutonomousSystem records, wires +# local_as/remote_as onto the two peer groups already created by +# extensions/routing (matched by their name+description human_friendly_id, +# so this upserts rather than duplicates -- their mandatory fields +# description/status/device/vrf are repeated verbatim to match), adds one +# more peer group for an upstream transit uplink, and adds RoutingBGPSession +# records tying it all together. +# +# organization (RoutingAutonomousSystem) and location are cardinality-one +# relationships to Generic peers (OrganizationGeneric / LocationGeneric). +# Per convention, a plain human_friendly_id scalar is tried first since the +# target records already exist (OrganizationProvider "Acme Networks"/"Lumen" +# from base, OrganizationTenant "Globex Corp" from extensions/tenancy, LocationSite +# "NYC1" from extensions/location_minimal). +# +# RoutingBGPSession's human_friendly_id is just `description__value` (the +# live schema resolves this from the RoutingProtocol generic's unique +# `description` attribute -- RoutingBGPSession declares no HFID of its own). +# local_as/remote_as on peer groups and sessions reference +# RoutingAutonomousSystem, whose HFID is the two-part [asn, name] -- a YAML +# list. peer_group on RoutingBGPSession references RoutingBGPPeerGroup, whose +# HFID is the two-part [name, description] -- also a YAML list. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamVRF + data: + - name: TRANSIT-VRF + description: Routing table for upstream transit peering on nyc1-rtr02. + vrf_rd: "65000:0" + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingAutonomousSystem + data: + - asn: 65000 + name: NYC1-BACKBONE-AS + description: "Our own backbone AS, announced from nyc1-rtr01 and nyc1-rtr02." + organization: "Acme Networks" + location: "NYC1" + devices: + - ["nyc1-rtr01"] + - ["nyc1-rtr02"] + + - asn: 65001 + name: CUSTOMER-A-AS + description: "Customer A's autonomous system, peered via the CUST-A BGP peer groups." + organization: "Globex Corp" + + - asn: 65002 + name: TRANSIT-PROVIDER-AS + description: "Upstream transit provider autonomous system." + organization: "Lumen" + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingBGPPeerGroup + data: + # These two already exist (created by extensions/routing/routing.yml as + # a demo of the RoutingProtocol contract). Matching on name+description + # upserts them instead of creating duplicates; mandatory fields + # (description/status/device/vrf) are repeated verbatim, and local_as/ + # remote_as are added on top. + - name: CUST-A-EBGP + description: "eBGP peer group for Customer A on nyc1-rtr01" + status: active + address_family: ipv4 + device: nyc1-rtr01 + vrf: CUST-A + local_as: + - "65000" + - NYC1-BACKBONE-AS + remote_as: + - "65001" + - CUSTOMER-A-AS + + - name: CUST-A-IBGP + description: "iBGP peer group for Customer A on nyc1-rtr01" + status: active + address_family: ipv4 + device: nyc1-rtr01 + vrf: CUST-A + local_as: + - "65000" + - NYC1-BACKBONE-AS + remote_as: + - "65000" + - NYC1-BACKBONE-AS + + - name: TRANSIT-UPSTREAM-EBGP + description: "eBGP peer group for upstream transit provider on nyc1-rtr02" + status: active + address_family: ipv4 + device: nyc1-rtr02 + vrf: TRANSIT-VRF + local_as: + - "65000" + - NYC1-BACKBONE-AS + remote_as: + - "65002" + - TRANSIT-PROVIDER-AS + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingBGPSession + data: + - description: "eBGP session to Customer A via CUST-A-EBGP on nyc1-rtr01" + status: active + session_type: external + role: peering + local_pref: 100 + device: nyc1-rtr01 + vrf: CUST-A + local_as: + - "65000" + - NYC1-BACKBONE-AS + remote_as: + - "65001" + - CUSTOMER-A-AS + peer_group: + - CUST-A-EBGP + - "eBGP peer group for Customer A on nyc1-rtr01" + + - description: "iBGP session to Customer A via CUST-A-IBGP on nyc1-rtr01" + status: active + session_type: internal + role: backbone + device: nyc1-rtr01 + vrf: CUST-A + local_as: + - "65000" + - NYC1-BACKBONE-AS + remote_as: + - "65000" + - NYC1-BACKBONE-AS + peer_group: + - CUST-A-IBGP + - "iBGP peer group for Customer A on nyc1-rtr01" + + - description: "eBGP session to upstream transit provider via TRANSIT-UPSTREAM-EBGP on nyc1-rtr02" + status: active + session_type: external + role: upstream + local_pref: 50 + device: nyc1-rtr02 + vrf: TRANSIT-VRF + local_as: + - "65000" + - NYC1-BACKBONE-AS + remote_as: + - "65002" + - TRANSIT-PROVIDER-AS + peer_group: + - TRANSIT-UPSTREAM-EBGP + - "eBGP peer group for upstream transit provider on nyc1-rtr02" diff --git a/objects/extensions/routing_bgp_community/routing_bgp_community.yml b/objects/extensions/routing_bgp_community/routing_bgp_community.yml new file mode 100644 index 00000000..8c7026f4 --- /dev/null +++ b/objects/extensions/routing_bgp_community/routing_bgp_community.yml @@ -0,0 +1,26 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing_bgp_community. +# Standalone: RoutingBGPCommunity (namespace Routing, name BGPCommunity) has +# no device/vrf requirement -- it is a plain community list model with just +# name/description/community plus optional `routing_policy` (Generic +# RoutingPolicy, cardinality many) and `tags` relationships. Neither +# relationship is exercised here since no concrete RoutingPolicy +# implementer's object data exists yet in this repo. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingBGPCommunity + data: + - name: CUSTOMER-A-ROUTES + description: "Tags routes learned from Customer A's network." + community: "65000:100" + + - name: BLACKHOLE + description: "Remote-triggered black hole (RTBH) community for DDoS mitigation." + community: "65000:666" + + - name: NO-EXPORT + description: "Well-known community preventing readvertisement to any eBGP peer." + community: "65535:65281" diff --git a/objects/extensions/routing_bgp_rr/routing_bgp_rr.yml b/objects/extensions/routing_bgp_rr/routing_bgp_rr.yml new file mode 100644 index 00000000..d8df95cd --- /dev/null +++ b/objects/extensions/routing_bgp_rr/routing_bgp_rr.yml @@ -0,0 +1,81 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing_bgp_rr. +# Depends on: extensions/routing_bgp (RoutingBGPPeerGroup: CUST-A-IBGP on +# nyc1-rtr01, already loaded with data). +# +# extensions/routing_bgp_rr/bgp_rr.yml defines RoutingBGPRRCluster +# (namespace Routing, name BGPRRCluster) with: +# - name (unique, mandatory), description (optional) +# - cluster_id: cardinality-one, MANDATORY relationship to the concrete +# kind IpamIPAddress (Cluster ID represented as a reference to an IP +# Address) -- new loopback-style addresses are created below for this, +# since only 192.0.2.1/32 already exists (from objects/base/03_ipam.yml) +# and reusing it across clusters would be semantically wrong. +# IpamIPAddress's human_friendly_id is the two-part +# [ip_namespace__name__value, address__value] -- a plain address scalar +# is rejected ("HFID does not contain the same number of elements"), so +# references use the [default,
] YAML list form. +# - peer_groups: cardinality-many, optional relationship to the concrete +# kind RoutingBGPPeerGroup. +# +# It also adds an `extensions: nodes:` block wiring a reciprocal +# relationship onto RoutingBGPPeerGroup: `rr_cluster` (cardinality one, +# optional). Confirmed on the live schema that peer_groups (on +# RoutingBGPRRCluster) and rr_cluster (on RoutingBGPPeerGroup) share the same +# identifier (routingbgppeergroup__routingbgprrcluster) -- they are the same +# edge, so setting peer_groups here is sufficient; RoutingBGPPeerGroup does +# not need to be touched separately. +# +# RoutingBGPPeerGroup's human_friendly_id is the two-part +# [name__value, description__value] -- a YAML list, matching the convention +# used in objects/extensions/routing_bgp/routing_bgp.yml. +# +# Only CUST-A-IBGP (an iBGP peer group) is wired to a cluster below -- route +# reflection only applies to iBGP sessions, so the two eBGP peer groups +# (CUST-A-EBGP, TRANSIT-UPSTREAM-EBGP) are intentionally left unwired. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamIPAddress + data: + - address: 192.0.2.21/32 + description: "Cluster ID for NYC1-CORE-RR" + status: active + role: loopback + - address: 192.0.2.22/32 + description: "Cluster ID for NYC1-EDGE-RR" + status: active + role: loopback + - address: 192.0.2.23/32 + description: "Cluster ID for NYC1-DR-RR" + status: active + role: loopback + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingBGPRRCluster + data: + - name: NYC1-CORE-RR + description: "Core route reflector cluster for iBGP full-mesh avoidance at NYC1" + cluster_id: + - default + - 192.0.2.21/32 + peer_groups: + - - CUST-A-IBGP + - "iBGP peer group for Customer A on nyc1-rtr01" + + - name: NYC1-EDGE-RR + description: "Edge route reflector cluster for NYC1 edge routers" + cluster_id: + - default + - 192.0.2.22/32 + + - name: NYC1-DR-RR + description: "Disaster-recovery route reflector cluster for NYC1" + cluster_id: + - default + - 192.0.2.23/32 diff --git a/objects/extensions/routing_ospf/routing_ospf.yml b/objects/extensions/routing_ospf/routing_ospf.yml new file mode 100644 index 00000000..67fc139e --- /dev/null +++ b/objects/extensions/routing_ospf/routing_ospf.yml @@ -0,0 +1,91 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing_ospf. +# Depends on: base, extensions/rack (DcimDevice: nyc1-rtr01, in NYC1-RACK-01), +# extensions/routing (RoutingProtocol generic: device + vrf + description + +# status, all mandatory), extensions/routing (IpamVRF: CUST-A). +# +# RoutingOSPF inherits RoutingProtocol, so `device` (peer DcimDevice, +# cardinality one) and `vrf` (peer IpamVRF, cardinality one) are both +# concrete kinds -- plain human_friendly_id scalars are used. RoutingOSPF +# overrides human_friendly_id to [device__name__value, vrf__name__value, +# version__value] (see extensions/routing_ospf/ospf.yml), so references to +# it elsewhere in this file use a 3-part HFID list. +# +# Two fresh interfaces (GigabitEthernet0/0/0/5 and /6) are added on +# nyc1-rtr01 in the first document below, distinct from the interfaces +# already claimed by other extensions (GigabitEthernet0/0/0/0-4, TenGigE +# 0/0/0/1-2, Bundle-Ether1, HundredGigE0/0/0/1 + breakout children). +# +# RoutingOSPF.ospf_interfaces is a Component relationship of cardinality +# many with a CONCRETE peer (RoutingOSPFInterface), so it's nested as +# {data: [...]} (kind omitted). Each nested RoutingOSPFInterface repeats its +# own mandatory `ospf` field (Parent relationship, cardinality one, concrete +# peer RoutingOSPF) even though it's already nested under that OSPF +# instance -- same pattern as extensions/vrrp's vrrp_interfaces/vrrp_group. +# `interface` (cardinality one, GENERIC peer InterfaceLayer3) requires a +# nested {kind, data} block -- InterfaceLayer3 itself has no human_friendly_id +# defined (only its concrete implementers do), so a plain HFID scalar/list +# fails with "Unable to lookup node by HFID, schema 'InterfaceLayer3' does +# not have a HFID defined." The nested block repeats InterfacePhysical's own +# mandatory fields (name + device) and upserts against the interfaces +# created in the first document above. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimDevice + data: + - name: nyc1-rtr01 + device_type: ASR9001 + platform: Cisco IOS-XR + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + interfaces: + - kind: InterfacePhysical + data: + name: GigabitEthernet0/0/0/5 + status: active + role: core + - kind: InterfacePhysical + data: + name: GigabitEthernet0/0/0/6 + status: active + role: core + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingOSPF + data: + - description: "OSPF instance for Customer A VRF on nyc1-rtr01" + status: active + device: nyc1-rtr01 + vrf: CUST-A + version: ospf + reference_bandwidth: 1000 + ospf_interfaces: + data: + - description: "OSPF core-facing interface for Customer A on nyc1-rtr01" + area: "0.0.0.0" + mode: normal + ospf: ["nyc1-rtr01", "CUST-A", "ospf"] + interface: + kind: InterfacePhysical + data: + name: GigabitEthernet0/0/0/5 + device: nyc1-rtr01 + + - description: "OSPF passive management interface for Customer A on nyc1-rtr01" + area: "0.0.0.0" + mode: passive + ospf: ["nyc1-rtr01", "CUST-A", "ospf"] + interface: + kind: InterfacePhysical + data: + name: GigabitEthernet0/0/0/6 + device: nyc1-rtr01 diff --git a/objects/extensions/routing_pim/routing_pim.yml b/objects/extensions/routing_pim/routing_pim.yml new file mode 100644 index 00000000..6b807773 --- /dev/null +++ b/objects/extensions/routing_pim/routing_pim.yml @@ -0,0 +1,148 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing_pim. +# Depends on: base, extensions/rack (DcimDevice: nyc1-rtr01, in NYC1-RACK-01), +# extensions/routing (abstract RoutingProtocol generic: device + vrf + +# description + status, all mandatory, inherited by RoutingPIM), and +# extensions/vrf (IpamVRF: CUSTOMER-A, CUSTOMER-B). +# +# NOTE: the live schema for RoutingPIM (as loaded on the target Infrahub +# instance) differs slightly from extensions/routing_pim/pim.yml as currently +# checked into this branch: import_policies/export_policies are not plain +# Text attributes there -- they are optional many-cardinality relationships +# (import_routing_policies/export_routing_policies, peer RoutingPolicyPIM, a +# Generic with no mock fixtures of its own yet) -- so they're omitted below +# rather than guessed at. +# +# extensions/routing_pim/pim.yml defines two concrete kinds: +# - RoutingPIM (namespace Routing, name PIM): inherits RoutingProtocol, adds +# dr_priority (optional) plus rp_address (optional, peer IpamIPAddress) +# and pim_interfaces (Component, cardinality many, peer +# RoutingPIMInterface, identifier pim__piminterfaces). Its +# human_friendly_id is the 2-part [device__name__value, +# vrf__name__value] -- NOT the raw device/vrf attributes -- so +# references to an existing RoutingPIM elsewhere use +# [device_name, vrf_name]. +# - RoutingPIMInterface (namespace Routing, name PIMInterface): description +# (unique, mandatory), pim_mode (Dropdown: sparse/dense/bidirectional, +# mandatory -- no `optional: true` on it in the schema), +# hello_interval/dr_priority (optional, defaulted). Relationships: pim +# (Parent, cardinality one, concrete peer RoutingPIM, identifier +# pim__piminterfaces, mandatory) and interface (Attribute, cardinality +# one, GENERIC peer InterfaceLayer3, mandatory). Its human_friendly_id is +# the single field description__value; uniqueness_constraints is +# [pim, interface]. +# +# GigabitEthernet0/0/0/0 through /4 are already used by other extensions' +# mock data (rack, cable, vrrp, sfp, dwdm) -- new interfaces +# (GigabitEthernet0/0/0/5 and /0/0/0/6) are added below instead of +# double-using an occupied one. They are created first, as a Component +# relationship on the existing nyc1-rtr01 device (this upserts the device and +# adds the two interfaces without touching /0 through /4). +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimDevice + data: + - name: nyc1-rtr01 + status: active + role: edge + device_type: ASR9001 + platform: Cisco IOS-XR + position: 40 + rack_face: front + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + interfaces: + kind: InterfacePhysical + data: + - name: GigabitEthernet0/0/0/5 + description: "PIM-enabled interface toward Customer A multicast source" + role: core + status: active + - name: GigabitEthernet0/0/0/6 + description: "PIM-enabled interface toward Customer A multicast receivers" + role: core + status: active + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingPIM + data: + # `device` (cardinality one, peer DcimDevice) and `vrf` (cardinality one, + # peer IpamVRF) are both concrete kinds, so plain human_friendly_id + # scalars are used, same as extensions/routing's RoutingBGPPeerGroup + # mock data. These two relationships plus `description` and `status` are + # the mandatory fields inherited from RoutingProtocol. + - description: "PIM instance for Customer A multicast on nyc1-rtr01" + status: active + device: nyc1-rtr01 + vrf: CUSTOMER-A + dr_priority: 100 + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingPIMInterface + data: + # `pim` is cardinality one with a CONCRETE peer (RoutingPIM), whose + # human_friendly_id is the 2-part [device__name__value, vrf__name__value] + # -- so the reference below is the list [nyc1-rtr01, CUSTOMER-A], + # matching the RoutingPIM instance created above. + # + # `interface` is cardinality one with a GENERIC peer (InterfaceLayer3). + # Unlike a concrete peer, a Generic has no human_friendly_id of its own, + # so a plain scalar/list HFID can't be resolved against it ("Unable to + # lookup node by HFID, schema 'InterfaceLayer3' does not have a HFID + # defined") even though GigabitEthernet0/0/0/5 and /6 already exist -- a + # nested {kind: InterfacePhysical, data: {...}} block is required, and + # per interface_breakout/vrrp's mock data it must repeat every mandatory + # field down the chain (InterfacePhysical: name, device; DcimDevice: + # name, location; LocationRack: name, site -- site's peer LocationSite is + # CONCRETE, so a plain HFID string is enough there), not just enough to + # identify the interface. This upserts against the interfaces created + # above rather than duplicating them. + - description: "PIM interface on GigabitEthernet0/0/0/5 (nyc1-rtr01, Customer A)" + pim_mode: sparse + hello_interval: 30 + dr_priority: 100 + pim: ["nyc1-rtr01", "CUSTOMER-A"] + interface: + kind: InterfacePhysical + data: + name: GigabitEthernet0/0/0/5 + device: + kind: DcimDevice + data: + name: nyc1-rtr01 + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + + - description: "PIM interface on GigabitEthernet0/0/0/6 (nyc1-rtr01, Customer A)" + pim_mode: sparse + hello_interval: 30 + dr_priority: 90 + pim: ["nyc1-rtr01", "CUSTOMER-A"] + interface: + kind: InterfacePhysical + data: + name: GigabitEthernet0/0/0/6 + device: + kind: DcimDevice + data: + name: nyc1-rtr01 + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 diff --git a/objects/extensions/routing_policies_aggregate/routing_policies_aggregate.yml b/objects/extensions/routing_policies_aggregate/routing_policies_aggregate.yml new file mode 100644 index 00000000..cfb1e19e --- /dev/null +++ b/objects/extensions/routing_policies_aggregate/routing_policies_aggregate.yml @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing_policies_aggregate. +# Depends on: extensions/routing_policies (RoutingPolicy generic), +# extensions/routing_aggregate (RoutingAggregateRoute, DcimDevice nyc1-rtr01). +# +# RoutingPolicyAggregate inherits RoutingPolicy: name (Text, unique, the +# human_friendly_id), description (Text, optional), policy_type (Dropdown: +# import_policy / export_policy / import_export_policy), weight (Number, +# default 1000), address_family (Dropdown: ipv4 / ipv6 / all, default all). +# +# The `extensions: nodes:` block in +# extensions/routing_policies_aggregate/routing_policies_aggregate.yml that +# would add real import_routing_policies / export_routing_policies +# relationships onto RoutingAggregateRoute is commented out in the schema +# file and is NOT active on the live instance -- confirmed against the live +# schema, RoutingAggregateRoute only has plain import_policies / +# export_policies Text attributes, no relationship to RoutingPolicyAggregate. +# +# So there is no relationship to wire here. Instead, "wiring" is done the +# same way the existing extensions/routing_aggregate mock data already does +# it: by free-text convention. The first RoutingAggregateRoute record +# ("Aggregate summary route for Customer A allocated block on nyc1-rtr01", +# loaded by objects/extensions/routing_aggregate) already sets +# import_policies: "CUST-A-EXPORT-SUMMARY" as a plain string. The first +# RoutingPolicyAggregate record below is named to match that existing +# free-text value, so the two line up conceptually even though there is no +# actual graph edge between them. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingPolicyAggregate + data: + - name: "CUST-A-EXPORT-SUMMARY" + description: >- + Export policy controlling advertisement of the Customer A summary + aggregate route. Referenced by name from the + RoutingAggregateRoute.import_policies free-text field on nyc1-rtr01. + policy_type: "export_policy" + weight: 500 + address_family: "ipv4" + + - name: "CUST-B-DISCARD-EXPORT" + description: "Export policy suppressing advertisement of the discarded Customer B subnet aggregate." + policy_type: "export_policy" + weight: 200 + address_family: "ipv4" + + - name: "MGMT-DEFAULT-IMPORT" + description: "Import policy accepting the default route learned on management-VRF aggregates." + policy_type: "import_policy" + address_family: "all" diff --git a/objects/extensions/routing_policies_bgp/routing_policies_bgp.yml b/objects/extensions/routing_policies_bgp/routing_policies_bgp.yml new file mode 100644 index 00000000..54d0da44 --- /dev/null +++ b/objects/extensions/routing_policies_bgp/routing_policies_bgp.yml @@ -0,0 +1,85 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing_policies_bgp. +# Depends on: extensions/routing_bgp (RoutingBGPPeerGroup: CUST-A-EBGP; +# RoutingBGPSession: the transit session on nyc1-rtr02 -- both already +# created by objects/extensions/routing_bgp/routing_bgp.yml). +# +# This file owns RoutingPolicyBGP (a concrete implementation of the +# RoutingPolicy generic from extensions/routing_policies) and wires it onto +# the pre-existing peer group / session via the import_routing_policies / +# export_routing_policies relationships added by +# extensions/routing_policies_bgp/routing_policies_bgp.yml onto +# RoutingBGPPeerGroup and RoutingBGPSession. +# +# RoutingPolicyBGP's human_friendly_id is just `name__value` (inherited from +# the RoutingPolicy generic), so it's referenced as a plain scalar string. +# +# import_routing_policies / export_routing_policies are cardinality-many +# relationships whose peer (RoutingPolicyBGP) is a concrete kind, so they take +# a list of HFIDs rather than the nested kind+data form. An HFID is always a +# list of its parts, so each single-part entry is a one-element list -- a bare +# string there is read as a node ID. +# +# The RoutingBGPPeerGroup/RoutingBGPSession upserts below repeat only their +# mandatory fields (per convention -- see objects/extensions/routing_bgp for +# the same pattern): RoutingBGPPeerGroup requires +# name/description/status/device/vrf; RoutingBGPSession requires +# description/status/role/session_type/vrf. Their human_friendly_id values +# (name+description for the peer group, description alone for the session) +# are among those, so no separate identity block is needed. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingPolicyBGP + data: + - name: CUST-A-IMPORT-PREFER-CUSTOMER + description: "Import routes learned from Customer A, setting local preference for backbone selection." + policy_type: import_policy + weight: 100 + address_family: ipv4 + + - name: CUST-A-EXPORT-DEFAULT-ROUTE + description: "Export a default route and backbone summaries to Customer A." + policy_type: export_policy + weight: 100 + address_family: ipv4 + + - name: TRANSIT-EXPORT-NO-CUSTOMER-ROUTES + description: >- + Export only our own backbone prefixes to the upstream transit + provider, filtering out customer routes. + policy_type: export_policy + weight: 500 + address_family: all + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingBGPPeerGroup + data: + - name: CUST-A-EBGP + description: "eBGP peer group for Customer A on nyc1-rtr01" + status: active + device: nyc1-rtr01 + vrf: CUST-A + import_routing_policies: + - [CUST-A-IMPORT-PREFER-CUSTOMER] + export_routing_policies: + - [CUST-A-EXPORT-DEFAULT-ROUTE] + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingBGPSession + data: + - description: "eBGP session to upstream transit provider via TRANSIT-UPSTREAM-EBGP on nyc1-rtr02" + status: active + session_type: external + role: upstream + vrf: TRANSIT-VRF + export_routing_policies: + - [TRANSIT-EXPORT-NO-CUSTOMER-ROUTES] diff --git a/objects/extensions/routing_policies_ospf/routing_policies_ospf.yml b/objects/extensions/routing_policies_ospf/routing_policies_ospf.yml new file mode 100644 index 00000000..214a36df --- /dev/null +++ b/objects/extensions/routing_policies_ospf/routing_policies_ospf.yml @@ -0,0 +1,70 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing_policies_ospf. +# Depends on: extensions/routing_ospf (RoutingOSPF instance: device +# nyc1-rtr01, vrf CUST-A, version "ospf", already created with 2 +# RoutingOSPFInterface members). +# +# extensions/routing_policies_ospf/routing_policies_ospf.yml defines the +# concrete PolicyOSPF node (kind RoutingPolicyOSPF, inherits the abstract +# RoutingPolicy generic from extensions/routing_policies) and extends +# RoutingOSPF with two many-cardinality Generic relationships +# (import_routing_policies/export_routing_policies, peer RoutingPolicyOSPF), +# replacing the plain import_policies/export_policies Text attributes that +# used to live directly on RoutingOSPF. +# +# RoutingPolicyOSPF's human_friendly_id is just [name__value] (inherited +# from the RoutingPolicy generic), so references to it elsewhere in this +# file use a plain scalar string. +# +# The second document below re-specifies the existing RoutingOSPF instance +# by its 3-part HFID (device, vrf, version__value -- see +# extensions/routing_ospf/ospf.yml) together with its other mandatory fields +# (description, status, device, vrf) repeated verbatim, matching the +# upsert pattern used in objects/extensions/routing_bgp for +# RoutingBGPPeerGroup. This upserts the existing record rather than +# creating a duplicate, and adds import_routing_policies/ +# export_routing_policies -- both cardinality many with a CONCRETE peer +# (RoutingPolicyOSPF), so they're lists of HFIDs. An HFID is always a list of +# its parts, so each single-part entry is a one-element list; a bare string +# there is read as a node ID. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingPolicyOSPF + data: + - name: CUST-A-OSPF-IMPORT + description: "Import policy applied to OSPF routes learned in Customer A's VRF on nyc1-rtr01." + policy_type: import_policy + address_family: ipv4 + weight: 100 + + - name: CUST-A-OSPF-EXPORT + description: "Export policy applied to OSPF routes advertised in Customer A's VRF on nyc1-rtr01." + policy_type: export_policy + address_family: ipv4 + weight: 100 + + - name: OSPF-DEFAULT-METRIC + description: "Default metric adjustment policy applied to both imported and exported OSPF routes." + policy_type: import_export_policy + address_family: all + weight: 500 + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingOSPF + data: + - description: "OSPF instance for Customer A VRF on nyc1-rtr01" + status: active + device: nyc1-rtr01 + vrf: CUST-A + version: ospf + import_routing_policies: + - [CUST-A-OSPF-IMPORT] + export_routing_policies: + - [CUST-A-OSPF-EXPORT] + - [OSPF-DEFAULT-METRIC] diff --git a/objects/extensions/routing_policies_pim/routing_policies_pim.yml b/objects/extensions/routing_policies_pim/routing_policies_pim.yml new file mode 100644 index 00000000..4bfb8abc --- /dev/null +++ b/objects/extensions/routing_policies_pim/routing_policies_pim.yml @@ -0,0 +1,80 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/routing_policies_pim. +# Depends on: base, extensions/routing_policies (abstract RoutingPolicy +# generic: name/description/policy_type/weight/address_family), and +# extensions/routing_pim (already loaded with 1 RoutingPIM instance on +# device nyc1-rtr01 / VRF CUSTOMER-A, plus 2 RoutingPIMInterface members). +# +# extensions/routing_policies_pim/routing_policies_pim.yml: +# - Defines PolicyPIM (namespace Routing -> kind RoutingPolicyPIM), +# inheriting RoutingPolicy with no extra attributes of its own. Live +# schema confirms it adds nothing beyond the generic's fields: name +# (Text, unique, mandatory), description (Text, optional), policy_type +# (Dropdown: import_policy/export_policy/import_export_policy, +# mandatory), weight (Number, optional, default 1000), address_family +# (Dropdown: ipv4/ipv6/all, optional, default "all"). Its +# human_friendly_id is the single field name__value. +# - Extends RoutingPIM: removes its plain import_policies/export_policies +# Text attributes and adds two relationships instead -- +# import_routing_policies / export_routing_policies -- both Generic +# kind, cardinality many, peer RoutingPolicyPIM (confirmed against the +# live schema; identifiers pim__import_policies / pim__export_policies). +# These relationships live on RoutingPIM, not on RoutingPolicyPIM, so +# wiring a policy to the PIM instance means updating RoutingPIM's +# relationship lists below, not adding anything on the policy records +# themselves. +# +# RoutingPolicyPIM records are created first, then the existing RoutingPIM +# instance (device nyc1-rtr01, vrf CUSTOMER-A) is upserted with the same +# mandatory fields it already has (description, status, device, vrf, +# dr_priority) plus the two new relationship lists pointing at the policies +# below. Peer RoutingPolicyPIM is a CONCRETE kind with a human_friendly_id +# (name__value), so these cardinality-many relationships take a list of HFIDs +# and need no nested kind+data block. An HFID is always a list of its parts, so +# each single-part entry is a one-element list; a bare string is read as a +# node ID instead. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingPolicyPIM + data: + - name: PIM-ALLOW-CUSTOMER-A-SOURCES + description: "Permit PIM joins toward known multicast sources in VRF CUSTOMER-A" + policy_type: import_policy + weight: 100 + address_family: ipv4 + + - name: PIM-ALLOW-CUSTOMER-A-RECEIVERS + description: "Permit PIM joins/prunes toward known receiver interfaces in VRF CUSTOMER-A" + policy_type: export_policy + weight: 100 + address_family: ipv4 + + - name: PIM-DENY-DEFAULT + description: "Default deny-all fallback PIM policy applied to both import and export" + policy_type: import_export_policy + weight: 10 + address_family: all + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: RoutingPIM + data: + # Upsert of the existing RoutingPIM instance from + # extensions/routing_pim's mock data (objects/extensions/routing_pim) -- + # description/status/device/vrf/dr_priority repeat its existing values + # unchanged; import_routing_policies/export_routing_policies are new. + - description: "PIM instance for Customer A multicast on nyc1-rtr01" + status: active + device: nyc1-rtr01 + vrf: CUSTOMER-A + dr_priority: 100 + import_routing_policies: + - [PIM-ALLOW-CUSTOMER-A-SOURCES] + export_routing_policies: + - [PIM-ALLOW-CUSTOMER-A-RECEIVERS] + - [PIM-DENY-DEFAULT] diff --git a/objects/extensions/sfp/sfp.yml b/objects/extensions/sfp/sfp.yml new file mode 100644 index 00000000..ad994970 --- /dev/null +++ b/objects/extensions/sfp/sfp.yml @@ -0,0 +1,103 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/sfp. +# Depends on: base, extensions/location_minimal (LocationSite: NYC1, SJC1), +# extensions/rack (LocationRack: NYC1-RACK-01, DcimDevice: nyc1-rtr01 with +# interface GigabitEthernet0/0/0/0), extensions/organization (OrganizationManufacturer: +# Cisco, Dell). +# +# extensions/dwdm builds on top of extensions/sfp in a later wave -- this file +# stays self-contained and doesn't assume dwdm data exists. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimDevice + data: + # Upsert the existing fixture device to add a second physical interface, + # needed so the plugged BidiSFP below has a free interface to plug into + # (GigabitEthernet0/0/0/0 is already used by the plugged StandardSFP). + - name: nyc1-rtr01 + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + interfaces: + kind: InterfacePhysical + data: + - name: GigabitEthernet0/0/0/0 + role: core + status: active + - name: GigabitEthernet0/0/0/1 + role: core + status: active +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimStandardSFP + data: + - serial_number: "SFP-STD-0001" + sfp_type: lr + form_factor: sfp_plus + status: plugged + manufacturer: Cisco + # `interface` peer (InterfacePhysical) is a concrete kind but has a + # composite human_friendly_id ([device__name__value, name__value]), so + # the reference is a plain list of the HFID components, not a nested + # kind+data block -- this upserts against the existing interface. + interface: [nyc1-rtr01, GigabitEthernet0/0/0/0] + + - serial_number: "SFP-STD-0002" + sfp_type: sr + form_factor: sfp_plus + status: spare + manufacturer: Cisco + # `spare_location` peer (LocationHosting) is a Generic -- specify the + # concrete kind. `spare_location` is cardinality one, so `data` is a + # single mapping, not a list. LocationSite's only mandatory field is + # `name`, so this is enough to upsert against the existing site. + spare_location: + kind: LocationSite + data: + name: NYC1 + + - serial_number: "SFP-STD-0003" + sfp_type: t + form_factor: sfp + status: spare + manufacturer: Dell + # LocationRack's mandatory fields are `name` and `site`. + spare_location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: DcimBidiSFP + data: + - serial_number: "SFP-BIDI-0001" + sfp_type: zr + form_factor: sfp_plus + status: plugged + wavelength_tx: 1310 + wavelength_rx: 1550 + manufacturer: Cisco + interface: [nyc1-rtr01, GigabitEthernet0/0/0/1] + + - serial_number: "SFP-BIDI-0002" + sfp_type: zr + form_factor: sfp_plus + status: spare + wavelength_tx: 1550 + wavelength_rx: 1310 + manufacturer: Cisco + spare_location: + kind: LocationSite + data: + name: SJC1 diff --git a/objects/extensions/snmp/snmp.yml b/objects/extensions/snmp/snmp.yml new file mode 100644 index 00000000..66b7b496 --- /dev/null +++ b/objects/extensions/snmp/snmp.yml @@ -0,0 +1,77 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/snmp. +# Standalone extension -- no fixture dependencies. The `devices` relationship +# on SnmpCommunity (-> DcimGenericDevice) and `ip_addresses` on SnmpClient +# (-> IpamIPAddress) are optional and intentionally left unset here. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: SnmpCommunityV2 + data: + - name: public-ro + description: Legacy read-only community used by monitoring pollers. + community_string: public + access: read_only + - name: private-rw + description: Read-write community used by legacy management tools. + community_string: private123 + access: read_write + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: SnmpCommunityV3 + data: + - name: monitoring-v3 + description: SNMPv3 user for the monitoring platform, auth + privacy enabled. + username: svc-monitoring + auth_protocol: sha + auth_password: AuthPass123! + privacy_protocol: aes + privacy_password: PrivPass123! + security_level: auth_priv + - name: readonly-v3 + description: SNMPv3 user with authentication only, no privacy. + username: svc-readonly + auth_protocol: md5 + auth_password: ReadOnlyAuth1 + privacy_protocol: none + security_level: auth_no_priv + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: SnmpClient + data: + - name: nms-poller-01 + client_description: Primary NMS polling server. + # SnmpCommunity is a Generic -- specify the concrete kind. `communities` is + # cardinality many, so `data` is a list under the single kind mapping. + communities: + kind: SnmpCommunityV3 + data: + - name: monitoring-v3 + username: svc-monitoring + auth_protocol: sha + privacy_protocol: aes + security_level: auth_priv + - name: legacy-monitor-01 + client_description: Legacy monitoring host polling via SNMPv2c. + communities: + kind: SnmpCommunityV2 + data: + - name: public-ro + community_string: public + access: read_only + - name: netops-workstation + client_description: NetOps engineer workstation with read-write access. + communities: + kind: SnmpCommunityV2 + data: + - name: private-rw + community_string: private123 + access: read_write diff --git a/objects/extensions/tenancy/tenancy.yml b/objects/extensions/tenancy/tenancy.yml new file mode 100644 index 00000000..26db2f1f --- /dev/null +++ b/objects/extensions/tenancy/tenancy.yml @@ -0,0 +1,29 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/tenancy. +# Depends on: base. Optionally links to prefixes created by extensions/vlan +# (IpamPrefix: 10.0.0.0/16, 192.0.2.0/24 in the "default" IP namespace) if +# those have already been loaded -- the tenant-to-prefix wiring below is an +# upsert against those existing records, not a re-creation. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: OrganizationTenant + data: + - name: Acme Corp + description: Primary tenant for the NYC1 backbone. + # IpamPrefix is a concrete kind (not a Generic/interface), so cardinality-many + # references to it are a plain list of its two-part human_friendly_id + # ([ip_namespace, prefix]), same as extensions/vlan does for IpamVLAN.prefixes. + # This upserts against the prefix already created by extensions/vlan. + prefixes: + - ["default", "10.0.0.0/16"] + + - name: Globex Corp + description: Secondary tenant, owns the point-to-point link network. + prefixes: + - ["default", "192.0.2.0/24"] + + - name: Initech + description: Tenant with no infrastructure assigned yet. diff --git a/objects/extensions/vlan/vlan.yml b/objects/extensions/vlan/vlan.yml new file mode 100644 index 00000000..dea28db7 --- /dev/null +++ b/objects/extensions/vlan/vlan.yml @@ -0,0 +1,41 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/vlan. +# Depends on: base, extensions/location_minimal (LocationSite: NYC1). +# The prefix reference below assumes the built-in "default" IP namespace, which +# every Infrahub instance ships with. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamVLANGroup + data: + - name: NYC1-VLANs + description: VLAN group scoped to the NYC1 site. + # IpamVLANGroupScope is a Generic -- specify the concrete kind. + # `scope` is cardinality one, so `data` is a single mapping, not a list. + scope: + kind: LocationSite + data: + name: NYC1 + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamVLAN + data: + - name: NYC1-SERVERS + description: Server VLAN at NYC1. + vlan_id: 100 + status: active + role: server + vlan_group: NYC1-VLANs + prefixes: + - ["default", "192.0.2.0/24"] + - name: NYC1-MGMT + description: Out-of-band management VLAN at NYC1. + vlan_id: 999 + status: active + role: management + vlan_group: NYC1-VLANs diff --git a/objects/extensions/vrf/vrf.yml b/objects/extensions/vrf/vrf.yml new file mode 100644 index 00000000..b97a4f74 --- /dev/null +++ b/objects/extensions/vrf/vrf.yml @@ -0,0 +1,49 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/vrf. +# Depends on: base. Standalone otherwise -- IpamVRF has no device/location +# relationship, so these records don't need any other extension's fixtures. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamRouteTarget + data: + - name: "65000:100" + description: Shared services route target, imported by multiple customer VRFs. + - name: "65000:200" + description: Customer B dedicated route target. + - name: "65000:300" + description: Unused spare route target, reserved for future allocation. + +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: IpamVRF + data: + - name: CUSTOMER-A + vrf_rd: "65000:100" + description: Customer A dedicated VRF. + enforce_unique: true + # import_rt/export_rt are cardinality many with a CONCRETE peer + # (IpamRouteTarget). Every entry is a human_friendly_id, and an HFID is + # always a list of its parts: a bare string is read as a node ID, so even + # a single-part HFID is wrapped in a list of its own. + import_rt: + - ["65000:100"] + export_rt: + - ["65000:100"] + - name: CUSTOMER-B + vrf_rd: "65000:200" + description: Customer B VRF, also imports the shared services route target. + enforce_unique: true + import_rt: + - ["65000:100"] + - ["65000:200"] + export_rt: + - ["65000:200"] + - name: MGMT-VRF + vrf_rd: "65000:999" + description: Out-of-band management VRF, isolated with no route targets. + enforce_unique: true diff --git a/objects/extensions/vrrp/vrrp.yml b/objects/extensions/vrrp/vrrp.yml new file mode 100644 index 00000000..859f1fe4 --- /dev/null +++ b/objects/extensions/vrrp/vrrp.yml @@ -0,0 +1,118 @@ +# --------------------------------------------------------------------------- +# Mock data for extensions/vrrp. +# Depends on: base, extensions/rack (DcimDevice: nyc1-rtr01, in NYC1-RACK-01). +# +# NetworkVRRPGroup.vrrp_interfaces is a Component relationship of cardinality +# many with a CONCRETE peer (NetworkVRRPInterface), so we point it at the +# NetworkVRRPInterface records created below via a {data: [...]} block (kind +# omitted since the peer is already the schema's declared concrete type). +# +# NetworkVRRPInterface links back to its group via `vrrp_group` (cardinality +# one, CONCRETE peer NetworkVRRPGroup, HFID is the single field name__value) +# -- a plain scalar string. It links to the actual port via `interface` +# (cardinality one, GENERIC peer InterfaceLayer3), which requires a nested +# {kind, data} block whose data is a single mapping repeating every mandatory +# field of the target concrete kind, not just enough to identify it: +# - InterfacePhysical: name, device +# - DcimDevice: name, location +# - LocationRack: name, site (site's peer LocationSite is CONCRETE, so a +# plain HFID string is enough there) +# This upserts against the existing nyc1-rtr01 / NYC1-RACK-01 fixtures rather +# than duplicating them. GigabitEthernet0/0/0/1, /2 and /3 are fresh +# interfaces added here, created inline the same way. All three VRRP groups +# live on the single available fixture device -- a real deployment would +# spread group members across two physical routers for actual first-hop +# redundancy. +# +# The groups deliberately stay off GigabitEthernet0/0/0/0. That interface +# belongs to objects/extensions/rack, which re-declares it after this file has +# run, and a re-declaration clears the optional cardinality-one +# InterfaceLayer3.vrrp link this file created -- the load then fails with +# "['InterfacePhysicalUpsert'] Node has -1 peers for +# interfacelayer3__networkvrrpinterface, no fewer than 1 allowed". See the +# upsert rule at the top of objects/extensions/mlag/mlag.yml. +# +# NOTE: NetworkVRRPInterface has no human_friendly_id of its own (only +# order_by + uniqueness_constraints on [vrrp_group, interface]), so +# `infrahubctl object load` can't upsert-match an existing one -- re-running +# this file against a database that already has this data will hit a +# "Violates uniqueness constraint 'vrrp_group-interface'" error on the +# NetworkVRRPInterface record instead of upserting cleanly. This is a +# property of the schema (out of scope to change here), not a mistake in +# this file; a first load against a fresh database succeeds with zero +# errors, and the surrounding fixtures (group, rack, device, interface) all +# upsert correctly since they do have HFIDs. +# --------------------------------------------------------------------------- +--- +apiVersion: infrahub.app/v1 +kind: Object +spec: + kind: NetworkVRRPGroup + data: + - name: NYC1-CORE-VRRP + vrid: 10 + # Obviously-fake placeholder value, not a real secret. + password: "VrrpKey-CHANGEME-1!" + vrrp_interfaces: + data: + - priority: 110 + vrrp_group: NYC1-CORE-VRRP + interface: + kind: InterfacePhysical + data: + name: GigabitEthernet0/0/0/3 + status: active + role: core + device: + kind: DcimDevice + data: + name: nyc1-rtr01 + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + + - name: NYC1-DIST-VRRP + vrid: 20 + vrrp_interfaces: + data: + - priority: 100 + vrrp_group: NYC1-DIST-VRRP + interface: + kind: InterfacePhysical + data: + name: GigabitEthernet0/0/0/1 + status: active + role: core + device: + kind: DcimDevice + data: + name: nyc1-rtr01 + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 + + - name: NYC1-MGMT-VRRP + vrid: 30 + vrrp_interfaces: + data: + - priority: 90 + vrrp_group: NYC1-MGMT-VRRP + interface: + kind: InterfacePhysical + data: + name: GigabitEthernet0/0/0/2 + status: active + role: management + device: + kind: DcimDevice + data: + name: nyc1-rtr01 + location: + kind: LocationRack + data: + name: NYC1-RACK-01 + site: NYC1 diff --git a/tasks/docs.py b/tasks/docs.py index cd91d581..e5a00c8e 100644 --- a/tasks/docs.py +++ b/tasks/docs.py @@ -59,7 +59,7 @@ def _generate_schema_reference_content(schema_key: str, schema_metadata: dict) - if "dependencies" in schema_metadata: for dep in schema_metadata["dependencies"]: if dep == "base": - link = "dcim" # TODO: This is a hack, should be improved ... maybe merging all base references + link = "dcim" else: link = dep.split("/")[1] schema_data["dependencies"].append({"name": dep, "link": link}) @@ -122,7 +122,8 @@ def _generate_home_page_documentation() -> None: template_text = template_file.read_text(encoding="utf-8") # Render the template - environment = jinja2.Environment(trim_blocks=True) + # keep_trailing_newline keeps the template's final newline, which markdownlint (MD047) requires. + environment = jinja2.Environment(trim_blocks=True, keep_trailing_newline=True) template = environment.from_string(template_text) rendered_file = template.render(toc=toc_content) diff --git a/tasks/schemas.py b/tasks/schemas.py index 93882345..80188fc1 100644 --- a/tasks/schemas.py +++ b/tasks/schemas.py @@ -13,13 +13,11 @@ def _load_extension(context: Context, path: Path) -> None: # Make sure it's a dir - # TODO: here if in extensions folder we have a dir without schema it will fail if os.path.isdir(path): print("#" * 80) print(f"🏗️ Loading `{path}`") # Load extensions - # TODO: Maybe improve what we return here... context.run(f"infrahubctl schema load {path}") print("#" * 80) @@ -75,6 +73,39 @@ def _resolve_load_order(graph, all_extensions): return load_order +# Drop the extensions we must not load: the experimental ones unless the flag is set, +# and one member of every `exclusive_with` pair (two extensions defining the same kind). +# A member is only skipped once its partner is selected, so the partner is always loaded +# first and anything depending on the skipped member is satisfied by the partner instead. +def _select_extensions(metadata, load_order): + selected = [] # Extensions we keep, in load order + for extension in load_order: + # If it's experimental extension and flag is false we skip + if extension.startswith("experimental/") and not TEST_EXPERIMENTAL: + continue + + # An experimental extension always yields to the extension it collides with, + # even when the load order puts the experimental one first + blocking = [ + other + for other in metadata.get(extension, {}).get("exclusive_with") or [] + if other in selected + or ( + extension.startswith("experimental/") + and not other.startswith("experimental/") + ) + ] + if blocking: + print( + f"⏭ Skipping `{extension}`: mutually exclusive with {', '.join(blocking)}" + ) + continue + + selected.append(extension) + + return selected + + @task def load_all_schemas(context: Context) -> None: # Parse metadata file @@ -87,11 +118,34 @@ def load_all_schemas(context: Context) -> None: load_order = _resolve_load_order(graph, all_extensions) # Load each extension respecting dependencies - for extension in load_order: - # If it's experimental extension and flag is false we skip - if extension.startswith("experimental/") and not TEST_EXPERIMENTAL: - continue - + for extension in _select_extensions(metadata, load_order): _load_extension(context, Path(extension)) print("All good! ✨") + + +@task +def load_demo_ipam_dcim(context: Context) -> None: + """[DEMO] Load IPAM + DCIM base schemas and a handful of common extensions.""" + schemas_to_load = { + "base", + "extensions/aggregate", + "extensions/cable", + "extensions/circuit", + "extensions/compute", + "extensions/cluster", + "extensions/hosting_cluster", + "extensions/lag", + "extensions/location_minimal", + "extensions/vlan", + "extensions/qinq", + "extensions/rack", + "extensions/vrf", + } + + # `.metadata.yml` is the normative dependency graph, so the demo order comes from it + metadata = _load_yaml_metadata() + load_order = _resolve_load_order(*_build_dependency_graph(metadata)) + + for path in (p for p in load_order if p in schemas_to_load): + _load_extension(context, Path(path))