diff --git a/docs/docs/guides/create-schema.mdx b/docs/docs/guides/create-schema.mdx index 9fc80fb7b5..332af3c7ac 100644 --- a/docs/docs/guides/create-schema.mdx +++ b/docs/docs/guides/create-schema.mdx @@ -59,7 +59,7 @@ version: "1.0" nodes: - name: Device namespace: Network - default_filter: hostname__value + human_friendly_id: ["hostname__value"] attributes: - name: hostname kind: Text @@ -149,7 +149,7 @@ version: "1.0" nodes: - name: Device namespace: Network - default_filter: hostname__value + human_friendly_id: ["hostname__value"] attributes: - name: hostname kind: Text @@ -201,7 +201,7 @@ mutation { id } } - NetworkInterfaceCreate(data: {name: {value: "Ethernet1"}, description: {value: "WAN interface"}, device: {id: "atl1-edge1"} }) { + NetworkInterfaceCreate(data: {name: {value: "Ethernet1"}, description: {value: "WAN interface"}, device: {hfid: ["atl1-edge1"]}}) { ok object { id @@ -251,7 +251,7 @@ generics: nodes: - name: Device namespace: Network - default_filter: hostname__value + human_friendly_id: ["hostname__value"] attributes: - name: hostname kind: Text @@ -300,13 +300,13 @@ mutation { id } } - NetworkPhysicalInterfaceCreate(data: {name: {value: "Ethernet1"}, description: {value: "WAN interface"}, speed: {value: 1000000000}, device: {id: "atl1-edge1"}}) { + NetworkPhysicalInterfaceCreate(data: {name: {value: "Ethernet1"}, description: {value: "WAN interface"}, speed: {value: 1000000000}, device: {hfid: ["atl1-edge1"]}}) { ok object { id } } - NetworkLogicalInterfaceCreate(data: {name: {value: "Vlan1"}, description: {value: "SVI for Vlan 1"}, device: {id: "atl1-edge1"}}) { + NetworkLogicalInterfaceCreate(data: {name: {value: "Vlan1"}, description: {value: "SVI for Vlan 1"}, device: {hfid: ["atl1-edge1"]}}) { ok object { id @@ -373,7 +373,7 @@ generics: nodes: - name: Device namespace: Network - default_filter: hostname__value + human_friendly_id: ["hostname__value"] attributes: - name: hostname kind: Text diff --git a/docs/docs/guides/generator.mdx b/docs/docs/guides/generator.mdx index 6e8b6ddae0..4c10b5ca75 100644 --- a/docs/docs/guides/generator.mdx +++ b/docs/docs/guides/generator.mdx @@ -35,7 +35,7 @@ nodes: - name: Widget namespace: Test label: "Widget" - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value attributes: @@ -47,7 +47,7 @@ nodes: - name: Resource namespace: Test label: "Resource" - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value attributes: diff --git a/docs/docs/topics/groups.mdx b/docs/docs/topics/groups.mdx index 5e3aea8883..531d1ac4b8 100644 --- a/docs/docs/topics/groups.mdx +++ b/docs/docs/topics/groups.mdx @@ -36,7 +36,7 @@ Infrahub automatically adds relationships to all objects for seamless integratio ```graphql query { - device(id: "device-123") { + InfraDevice(hfid: ["device-123"]) { member_of_groups { name description @@ -75,4 +75,4 @@ The group functionality in Infrahub is designed to be extensible and is expected - Dynamic Membership Rules: Ability to define dynamic rules for group membership based on object attributes or conditions. - Integration with Access Control: Deeper integration with permission systems to control access and operations based on group memberships. -- Performance Optimizations: Efficient handling and querying of large groups for better scalability. \ No newline at end of file +- Performance Optimizations: Efficient handling and querying of large groups for better scalability. diff --git a/models/base/dcim.yml b/models/base/dcim.yml index b4cf2aa222..32028b4aed 100644 --- a/models/base/dcim.yml +++ b/models/base/dcim.yml @@ -170,7 +170,6 @@ nodes: description: "Generic Device object" label: "Device" icon: "mdi:server" - default_filter: name__value human_friendly_id: ["name__value"] inherit_from: - "CoreArtifactTarget" @@ -431,7 +430,7 @@ nodes: description: "A Platform represents the type of software running on a device" label: "Platform" icon: "mdi:application-cog-outline" - default_filter: name__value + menu_placement: "InfraDevice" human_friendly_id: ["name__value"] order_by: - name__value @@ -467,7 +466,7 @@ nodes: namespace: Infra description: "A Circuit represent a single physical link between two locations" label: "Circuit" - default_filter: circuit_id__value + icon: "mdi:cable-data" human_friendly_id: ["circuit_id__value"] order_by: - circuit_id__value diff --git a/models/base/ipam.yml b/models/base/ipam.yml index 929c9c51a3..c32e611baf 100644 --- a/models/base/ipam.yml +++ b/models/base/ipam.yml @@ -29,7 +29,6 @@ nodes: description: "A VLAN is a logical grouping of devices in the same broadcast domain" label: "VLAN" icon: "mdi:lan-pending" # mdi:lan - default_filter: name__value human_friendly_id: ["name__value", "vlan_id__value"] order_by: - name__value diff --git a/models/base/location.yml b/models/base/location.yml index 797995e648..064b6d9008 100644 --- a/models/base/location.yml +++ b/models/base/location.yml @@ -27,7 +27,7 @@ nodes: inherit_from: - "LocationGeneric" generate_profile: false - default_filter: "name__value" + human_friendly_id: ["name__value"] order_by: - "name__value" display_labels: @@ -41,7 +41,7 @@ nodes: inherit_from: - "LocationGeneric" generate_profile: false - default_filter: "name__value" + human_friendly_id: ["name__value"] order_by: - "name__value" display_labels: @@ -54,7 +54,7 @@ nodes: icon: "ri:building-line" inherit_from: - "LocationGeneric" - default_filter: "name__value" + human_friendly_id: ["name__value"] order_by: - "name__value" display_labels: diff --git a/models/base/organization.yml b/models/base/organization.yml index 2940071bfe..3c41c0a40a 100644 --- a/models/base/organization.yml +++ b/models/base/organization.yml @@ -6,7 +6,6 @@ generics: namespace: Organization label: Organization description: An organization represent a legal entity, a company. - default_filter: name__value icon: mdi:domain human_friendly_id: ["name__value"] include_in_menu: true @@ -37,7 +36,7 @@ nodes: - name: Manufacturer namespace: Organization description: Device Manufacturer - default_filter: name__value + human_friendly_id: ["name__value"] order_by: [name__value] display_labels: - name__value @@ -54,7 +53,7 @@ nodes: - name: Provider namespace: Organization description: Circuit or Location Provider - default_filter: name__value + human_friendly_id: ["name__value"] order_by: [name__value] display_labels: - name__value @@ -74,7 +73,7 @@ nodes: - name: Tenant namespace: Organization description: Customer - default_filter: name__value + human_friendly_id: ["name__value"] order_by: [name__value] display_labels: - name__value diff --git a/models/base/routing.yml b/models/base/routing.yml index ba9a720d25..03be1d70fc 100644 --- a/models/base/routing.yml +++ b/models/base/routing.yml @@ -8,7 +8,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" - default_filter: name__value + menu_placement: InfraBGPSession human_friendly_id: ["name__value", "asn__value"] order_by: ["asn__value"] display_labels: @@ -38,7 +38,7 @@ nodes: 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" - default_filter: name__value + menu_placement: InfraBGPSession human_friendly_id: ["name__value"] order_by: - name__value diff --git a/models/base/service.yml b/models/base/service.yml index ba31d0c35e..5c8e5b10de 100644 --- a/models/base/service.yml +++ b/models/base/service.yml @@ -5,7 +5,7 @@ generics: - name: Service namespace: Infra description: "Services" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: diff --git a/models/examples/extension_rack.yml b/models/examples/extension_rack.yml index 33548c3a97..69234aa495 100644 --- a/models/examples/extension_rack.yml +++ b/models/examples/extension_rack.yml @@ -6,7 +6,7 @@ nodes: namespace: Infra description: "A Rack represents a physical two- or four-post equipment rack in which devices can be installed" label: "Rack" - default_filter: name__value + human_friendly_id: ["name__value"] icon: clarity:rack-server-solid display_labels: - name__value diff --git a/models/examples/ipfabric/ipfabric.yml b/models/examples/ipfabric/ipfabric.yml index 682fda6fda..d8cd2873bb 100644 --- a/models/examples/ipfabric/ipfabric.yml +++ b/models/examples/ipfabric/ipfabric.yml @@ -48,7 +48,7 @@ generics: description: "Generic Choice" include_in_menu: false label: "Choice" - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value order_by: @@ -80,7 +80,7 @@ nodes: namespace: Organization label: Organization description: An organization represent a legal entity, a company. - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [label__value] order_by: [name__value] icon: mdi:domain @@ -109,7 +109,7 @@ nodes: namespace: Location label: Location description: 'A location represent a physical element: a building, a site, a city' - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [name__value] order_by: [name__value] icon: mdi:map-marker-radius-outline @@ -141,7 +141,7 @@ nodes: label: "Platform" icon: "mdi:application-cog-outline" # mdi:application-brackets-outline menu_placement: "InfraDevice" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -176,7 +176,7 @@ nodes: label: "Device Type" icon: "mdi:poll" menu_placement: "InfraDevice" - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value order_by: @@ -386,7 +386,7 @@ nodes: description: "A VRF is isolated layer three domain" label: "VRF" icon: "mdi:router" - default_filter: name__value + human_friendly_id: ["name__value"] menu_placement: "InfraIPAddress" order_by: - name__value @@ -439,7 +439,7 @@ nodes: description: "IP Address" label: "IP Address" icon: "mdi:ip" - default_filter: address__value + human_friendly_id: ["address__value"] order_by: - "address__value" display_labels: @@ -464,7 +464,7 @@ nodes: description: "IPv4 or IPv6 network (with mask)" icon: "mdi:ip-network" label: "Prefix" - default_filter: prefix__value + human_friendly_id: ["prefix__value"] menu_placement: "InfraIPAddress" order_by: - vrf__name__value diff --git a/models/examples/nautobot/nautobot-v1.yml b/models/examples/nautobot/nautobot-v1.yml index 600cf3dc74..050de086bb 100644 --- a/models/examples/nautobot/nautobot-v1.yml +++ b/models/examples/nautobot/nautobot-v1.yml @@ -138,7 +138,7 @@ nodes: label: "Autonomous System" icon: "mdi:bank-circle-outline" menu_placement: InfraBGPSession - default_filter: name__value + human_friendly_id: ["name__value"] order_by: ["asn__value"] display_labels: - name__value @@ -165,7 +165,7 @@ nodes: label: "BGP Peer Group" icon: "mdi:view-grid-plus-outline" menu_placement: InfraBGPSession - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -272,7 +272,7 @@ nodes: description: "A Circuit represent a single physical link between two locations" label: "Circuit" icon: "mdi:transit-connection-variant" - default_filter: circuit_id__value + human_friendly_id: ["circuit_id__value"] order_by: - circuit_id__value display_labels: @@ -361,7 +361,7 @@ nodes: description: "Generic Device object" label: "Device" icon: "mdi:router-network" - default_filter: name__value + human_friendly_id: ["name__value"] inherit_from: - "CoreArtifactTarget" order_by: @@ -554,7 +554,7 @@ nodes: label: "IP Address" icon: "mdi:ip-outline" menu_placement: "InfraPrefix" - default_filter: address__value + human_friendly_id: ["address__value"] order_by: - "address__value" display_labels: @@ -615,7 +615,7 @@ nodes: label: "Platform" icon: "mdi:application-cog-outline" menu_placement: "InfraDevice" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - manufacturer__name__value - name__value @@ -653,7 +653,7 @@ nodes: label: "Provider Network" icon: "mdi:cloud" menu_placement: "InfraCircuit" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -691,7 +691,7 @@ nodes: description: "IPv4 or IPv6 network (with mask)" icon: "mdi:ip-network" label: "Prefix" - default_filter: prefix__value + human_friendly_id: ["prefix__value"] order_by: - prefix__value display_labels: @@ -751,7 +751,7 @@ nodes: label: "Rack" icon: "mdi:server" menu_placement: "LocationGeneric" - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value attributes: @@ -826,7 +826,7 @@ nodes: label: "Route Target" icon: "mdi:target" menu_placement: "InfraVRF" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -854,7 +854,7 @@ nodes: description: "A VLAN is isolated layer two domain" label: "VLAN" icon: "mdi:lan-pending" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - vlan_id__value display_labels: @@ -905,7 +905,7 @@ nodes: description: "A VRF is isolated layer three domain" label: "VRF" icon: "mdi:router" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -961,7 +961,7 @@ nodes: namespace: Organization label: Organization description: An organization represent a legal entity, a company. - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [label__value] order_by: [name__value] icon: mdi:domain @@ -995,7 +995,7 @@ nodes: namespace: Status label: Status description: 'Represent the status of an object: active, maintenance' - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [label__value] icon: mdi:list-status include_in_menu: false @@ -1013,7 +1013,7 @@ nodes: namespace: Role label: Role description: Represent the role of an object - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [label__value] order_by: [name__value] icon: mdi:ballot @@ -1032,7 +1032,7 @@ nodes: namespace: Location label: Location description: 'A location represent a physical element: a building, a site, a city' - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [name__value] order_by: [name__value] icon: mdi:map-marker-radius-outline diff --git a/models/examples/nautobot/nautobot-v2.yml b/models/examples/nautobot/nautobot-v2.yml index 45d37abba8..4dbecd6d3a 100644 --- a/models/examples/nautobot/nautobot-v2.yml +++ b/models/examples/nautobot/nautobot-v2.yml @@ -82,7 +82,7 @@ generics: description: "Generic Choice" include_in_menu: false label: "Choice" - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value order_by: @@ -141,7 +141,7 @@ nodes: label: "Autonomous System" icon: "mdi:bank-circle-outline" menu_placement: InfraBGPSession - default_filter: name__value + human_friendly_id: ["name__value"] order_by: ["asn__value"] display_labels: - name__value @@ -168,7 +168,7 @@ nodes: label: "BGP Peer Group" icon: "mdi:view-grid-plus-outline" menu_placement: InfraBGPSession - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -275,7 +275,7 @@ nodes: description: "A Circuit represent a single physical link between two locations" label: "Circuit" icon: "mdi:transit-connection-variant" - default_filter: circuit_id__value + human_friendly_id: ["circuit_id__value"] order_by: - circuit_id__value display_labels: @@ -369,7 +369,7 @@ nodes: description: "Generic Device object" label: "Device" icon: "mdi:router-network" - default_filter: name__value + human_friendly_id: ["name__value"] inherit_from: - "CoreArtifactTarget" order_by: @@ -458,7 +458,7 @@ nodes: label: "Device Type" icon: "mdi:poll" menu_placement: "InfraDevice" - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value order_by: @@ -603,7 +603,7 @@ nodes: namespace: Nautobot label: "Nautobot Namespace" include_in_menu: false - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value order_by: @@ -622,7 +622,7 @@ nodes: label: "Platform" icon: "mdi:application-cog-outline" menu_placement: "InfraDevice" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -659,7 +659,7 @@ nodes: label: "Provider Network" icon: "mdi:cloud" menu_placement: "InfraCircuit" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -744,7 +744,7 @@ nodes: label: "Rack" icon: "mdi:server" menu_placement: "LocationGeneric" - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value attributes: @@ -814,7 +814,7 @@ nodes: label: "Route Target" icon: "mdi:target" menu_placement: "InfraVRF" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -842,7 +842,7 @@ nodes: description: "A VLAN is isolated layer two domain" label: "VLAN" icon: "mdi:lan-pending" - default_filter: name__value + human_friendly_id: ["name__value"] uniqueness_constraints: - ["name__value"] order_by: @@ -961,7 +961,7 @@ nodes: namespace: Organization label: Organization description: An organization represent a legal entity, a company. - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [label__value] order_by: [name__value] icon: mdi:domain @@ -995,7 +995,7 @@ nodes: namespace: Status label: Status description: 'Represent the status of an object: active, maintenance' - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [label__value] icon: mdi:list-status include_in_menu: false @@ -1013,7 +1013,7 @@ nodes: namespace: Role label: Role description: Represent the role of an object - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [label__value] order_by: [name__value] icon: mdi:ballot @@ -1032,7 +1032,7 @@ nodes: namespace: Location label: Location description: 'A location represent a physical element: a building, a site, a city' - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [name__value] order_by: [name__value] icon: mdi:map-marker-radius-outline diff --git a/models/examples/netbox/netbox.yml b/models/examples/netbox/netbox.yml index ae3f0c8008..946eb61f90 100644 --- a/models/examples/netbox/netbox.yml +++ b/models/examples/netbox/netbox.yml @@ -79,7 +79,7 @@ generics: description: "Generic Choice" include_in_menu: false label: "Choice" - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value order_by: @@ -108,7 +108,7 @@ nodes: label: "Autonomous System" icon: "mdi:bank-circle-outline" menu_placement: InfraBGPSession - default_filter: name__value + human_friendly_id: ["name__value"] order_by: ["asn__value"] display_labels: - name__value @@ -135,7 +135,7 @@ nodes: label: "BGP Peer Group" icon: "mdi:view-grid-plus-outline" menu_placement: InfraBGPSession - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -242,7 +242,7 @@ nodes: description: "A Circuit represent a single physical link between two locations" label: "Circuit" icon: "mdi:transit-connection-variant" - default_filter: circuit_id__value + human_friendly_id: ["circuit_id__value"] order_by: - circuit_id__value display_labels: @@ -423,7 +423,7 @@ nodes: label: "Device Type" icon: "mdi:poll" menu_placement: "InfraDevice" - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: - name__value order_by: @@ -584,7 +584,7 @@ nodes: label: "Platform" icon: "mdi:application-cog-outline" # mdi:application-brackets-outline menu_placement: "InfraDevice" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -619,7 +619,7 @@ nodes: label: "Provider Network" icon: "mdi:cloud" menu_placement: "InfraCircuit" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -753,7 +753,7 @@ nodes: label: "Route Target" icon: "mdi:target" menu_placement: "InfraVRF" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -831,7 +831,7 @@ nodes: description: "A VRF is isolated layer three domain" label: "VRF" icon: "mdi:router" - default_filter: name__value + human_friendly_id: ["name__value"] order_by: - name__value display_labels: @@ -887,7 +887,7 @@ nodes: namespace: Organization label: Organization description: An organization represent a legal entity, a company. - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [label__value] order_by: [name__value] icon: mdi:domain @@ -921,7 +921,7 @@ nodes: namespace: Status label: Status description: 'Represent the status of an object: active, maintenance' - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [label__value] icon: mdi:list-status include_in_menu: true @@ -939,7 +939,7 @@ nodes: namespace: Role label: Role description: Represent the role of an object - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [label__value] order_by: [name__value] icon: mdi:ballot @@ -958,7 +958,7 @@ nodes: namespace: Location label: Location description: 'A location represent a physical element: a building, a site, a city' - default_filter: name__value + human_friendly_id: ["name__value"] display_labels: [name__value] order_by: [name__value] icon: mdi:map-marker-radius-outline diff --git a/models/infrastructure_edge.py b/models/infrastructure_edge.py index 66a397e3c3..06f1f533e6 100644 --- a/models/infrastructure_edge.py +++ b/models/infrastructure_edge.py @@ -884,7 +884,7 @@ async def create_backbone_connectivity( branch=branch, kind=InfraCircuitEndpoint, description=f"Endpoint {backbone_link.circuit} to {backbone_link.site1_device}", - site=backbone_link.site1, + site={"hfid": [backbone_link.site1]}, circuit=obj, connected_endpoint=intf1, ) @@ -894,7 +894,7 @@ async def create_backbone_connectivity( branch=branch, kind=InfraCircuitEndpoint, description=f"Endpoint {backbone_link.circuit} to {backbone_link.site2_device}", - site=backbone_link.site2, + site={"hfid": [backbone_link.site2]}, circuit=obj, connected_endpoint=intf2, )