From e9625042e66d6fa5e5678529dab830d5facbc703 Mon Sep 17 00:00:00 2001 From: Luke Tucker Date: Sat, 12 Apr 2025 11:39:16 -0400 Subject: [PATCH] fix: accept both valid forms of protoJSON (snake and camel) --- netbox_diode_plugin/api/plugin_utils.py | 856 +++++++++--------- netbox_diode_plugin/api/transformer.py | 26 +- netbox_diode_plugin/api/views.py | 23 +- .../tests/test_api_diff_and_apply.py | 65 +- .../tests/test_api_generate_diff.py | 38 +- 5 files changed, 554 insertions(+), 454 deletions(-) diff --git a/netbox_diode_plugin/api/plugin_utils.py b/netbox_diode_plugin/api/plugin_utils.py index 9571f47..9a08f33 100644 --- a/netbox_diode_plugin/api/plugin_utils.py +++ b/netbox_diode_plugin/api/plugin_utils.py @@ -1,7 +1,7 @@ """Diode plugin helpers.""" # Generated code. DO NOT EDIT. -# Timestamp: 2025-04-10 14:44:19Z +# Timestamp: 2025-04-12 15:25:46Z from dataclasses import dataclass from functools import lru_cache @@ -44,98 +44,98 @@ class RefInfo: _JSON_REF_INFO = { 'diode.custom_field_object_reference': { 'asn': RefInfo(object_type='ipam.asn', field_name='object', is_generic=True), - 'asnRange': RefInfo(object_type='ipam.asnrange', field_name='object', is_generic=True), + 'asn_range': RefInfo(object_type='ipam.asnrange', field_name='object', is_generic=True), 'aggregate': RefInfo(object_type='ipam.aggregate', field_name='object', is_generic=True), 'cable': RefInfo(object_type='dcim.cable', field_name='object', is_generic=True), - 'cablePath': RefInfo(object_type='dcim.cablepath', field_name='object', is_generic=True), - 'cableTermination': RefInfo(object_type='dcim.cabletermination', field_name='object', is_generic=True), + 'cable_path': RefInfo(object_type='dcim.cablepath', field_name='object', is_generic=True), + 'cable_termination': RefInfo(object_type='dcim.cabletermination', field_name='object', is_generic=True), 'circuit': RefInfo(object_type='circuits.circuit', field_name='object', is_generic=True), - 'circuitGroup': RefInfo(object_type='circuits.circuitgroup', field_name='object', is_generic=True), - 'circuitGroupAssignment': RefInfo(object_type='circuits.circuitgroupassignment', field_name='object', is_generic=True), - 'circuitTermination': RefInfo(object_type='circuits.circuittermination', field_name='object', is_generic=True), - 'circuitType': RefInfo(object_type='circuits.circuittype', field_name='object', is_generic=True), + 'circuit_group': RefInfo(object_type='circuits.circuitgroup', field_name='object', is_generic=True), + 'circuit_group_assignment': RefInfo(object_type='circuits.circuitgroupassignment', field_name='object', is_generic=True), + 'circuit_termination': RefInfo(object_type='circuits.circuittermination', field_name='object', is_generic=True), + 'circuit_type': RefInfo(object_type='circuits.circuittype', field_name='object', is_generic=True), 'cluster': RefInfo(object_type='virtualization.cluster', field_name='object', is_generic=True), - 'clusterGroup': RefInfo(object_type='virtualization.clustergroup', field_name='object', is_generic=True), - 'clusterType': RefInfo(object_type='virtualization.clustertype', field_name='object', is_generic=True), - 'consolePort': RefInfo(object_type='dcim.consoleport', field_name='object', is_generic=True), - 'consoleServerPort': RefInfo(object_type='dcim.consoleserverport', field_name='object', is_generic=True), + 'cluster_group': RefInfo(object_type='virtualization.clustergroup', field_name='object', is_generic=True), + 'cluster_type': RefInfo(object_type='virtualization.clustertype', field_name='object', is_generic=True), + 'console_port': RefInfo(object_type='dcim.consoleport', field_name='object', is_generic=True), + 'console_server_port': RefInfo(object_type='dcim.consoleserverport', field_name='object', is_generic=True), 'contact': RefInfo(object_type='tenancy.contact', field_name='object', is_generic=True), - 'contactAssignment': RefInfo(object_type='tenancy.contactassignment', field_name='object', is_generic=True), - 'contactGroup': RefInfo(object_type='tenancy.contactgroup', field_name='object', is_generic=True), - 'contactRole': RefInfo(object_type='tenancy.contactrole', field_name='object', is_generic=True), + 'contact_assignment': RefInfo(object_type='tenancy.contactassignment', field_name='object', is_generic=True), + 'contact_group': RefInfo(object_type='tenancy.contactgroup', field_name='object', is_generic=True), + 'contact_role': RefInfo(object_type='tenancy.contactrole', field_name='object', is_generic=True), 'device': RefInfo(object_type='dcim.device', field_name='object', is_generic=True), - 'deviceBay': RefInfo(object_type='dcim.devicebay', field_name='object', is_generic=True), - 'deviceRole': RefInfo(object_type='dcim.devicerole', field_name='object', is_generic=True), - 'deviceType': RefInfo(object_type='dcim.devicetype', field_name='object', is_generic=True), - 'fhrpGroup': RefInfo(object_type='ipam.fhrpgroup', field_name='object', is_generic=True), - 'fhrpGroupAssignment': RefInfo(object_type='ipam.fhrpgroupassignment', field_name='object', is_generic=True), - 'frontPort': RefInfo(object_type='dcim.frontport', field_name='object', is_generic=True), - 'ikePolicy': RefInfo(object_type='vpn.ikepolicy', field_name='object', is_generic=True), - 'ikeProposal': RefInfo(object_type='vpn.ikeproposal', field_name='object', is_generic=True), - 'ipAddress': RefInfo(object_type='ipam.ipaddress', field_name='object', is_generic=True), - 'ipRange': RefInfo(object_type='ipam.iprange', field_name='object', is_generic=True), - 'ipSecPolicy': RefInfo(object_type='vpn.ipsecpolicy', field_name='object', is_generic=True), - 'ipSecProfile': RefInfo(object_type='vpn.ipsecprofile', field_name='object', is_generic=True), - 'ipSecProposal': RefInfo(object_type='vpn.ipsecproposal', field_name='object', is_generic=True), + 'device_bay': RefInfo(object_type='dcim.devicebay', field_name='object', is_generic=True), + 'device_role': RefInfo(object_type='dcim.devicerole', field_name='object', is_generic=True), + 'device_type': RefInfo(object_type='dcim.devicetype', field_name='object', is_generic=True), + 'fhrp_group': RefInfo(object_type='ipam.fhrpgroup', field_name='object', is_generic=True), + 'fhrp_group_assignment': RefInfo(object_type='ipam.fhrpgroupassignment', field_name='object', is_generic=True), + 'front_port': RefInfo(object_type='dcim.frontport', field_name='object', is_generic=True), + 'ike_policy': RefInfo(object_type='vpn.ikepolicy', field_name='object', is_generic=True), + 'ike_proposal': RefInfo(object_type='vpn.ikeproposal', field_name='object', is_generic=True), + 'ip_address': RefInfo(object_type='ipam.ipaddress', field_name='object', is_generic=True), + 'ip_range': RefInfo(object_type='ipam.iprange', field_name='object', is_generic=True), + 'ip_sec_policy': RefInfo(object_type='vpn.ipsecpolicy', field_name='object', is_generic=True), + 'ip_sec_profile': RefInfo(object_type='vpn.ipsecprofile', field_name='object', is_generic=True), + 'ip_sec_proposal': RefInfo(object_type='vpn.ipsecproposal', field_name='object', is_generic=True), 'interface': RefInfo(object_type='dcim.interface', field_name='object', is_generic=True), - 'inventoryItem': RefInfo(object_type='dcim.inventoryitem', field_name='object', is_generic=True), - 'inventoryItemRole': RefInfo(object_type='dcim.inventoryitemrole', field_name='object', is_generic=True), - 'l2Vpn': RefInfo(object_type='vpn.l2vpn', field_name='object', is_generic=True), - 'l2VpnTermination': RefInfo(object_type='vpn.l2vpntermination', field_name='object', is_generic=True), + 'inventory_item': RefInfo(object_type='dcim.inventoryitem', field_name='object', is_generic=True), + 'inventory_item_role': RefInfo(object_type='dcim.inventoryitemrole', field_name='object', is_generic=True), + 'l2vpn': RefInfo(object_type='vpn.l2vpn', field_name='object', is_generic=True), + 'l2vpn_termination': RefInfo(object_type='vpn.l2vpntermination', field_name='object', is_generic=True), 'location': RefInfo(object_type='dcim.location', field_name='object', is_generic=True), - 'macAddress': RefInfo(object_type='dcim.macaddress', field_name='object', is_generic=True), + 'mac_address': RefInfo(object_type='dcim.macaddress', field_name='object', is_generic=True), 'manufacturer': RefInfo(object_type='dcim.manufacturer', field_name='object', is_generic=True), 'module': RefInfo(object_type='dcim.module', field_name='object', is_generic=True), - 'moduleBay': RefInfo(object_type='dcim.modulebay', field_name='object', is_generic=True), - 'moduleType': RefInfo(object_type='dcim.moduletype', field_name='object', is_generic=True), + 'module_bay': RefInfo(object_type='dcim.modulebay', field_name='object', is_generic=True), + 'module_type': RefInfo(object_type='dcim.moduletype', field_name='object', is_generic=True), 'platform': RefInfo(object_type='dcim.platform', field_name='object', is_generic=True), - 'powerFeed': RefInfo(object_type='dcim.powerfeed', field_name='object', is_generic=True), - 'powerOutlet': RefInfo(object_type='dcim.poweroutlet', field_name='object', is_generic=True), - 'powerPanel': RefInfo(object_type='dcim.powerpanel', field_name='object', is_generic=True), - 'powerPort': RefInfo(object_type='dcim.powerport', field_name='object', is_generic=True), + 'power_feed': RefInfo(object_type='dcim.powerfeed', field_name='object', is_generic=True), + 'power_outlet': RefInfo(object_type='dcim.poweroutlet', field_name='object', is_generic=True), + 'power_panel': RefInfo(object_type='dcim.powerpanel', field_name='object', is_generic=True), + 'power_port': RefInfo(object_type='dcim.powerport', field_name='object', is_generic=True), 'prefix': RefInfo(object_type='ipam.prefix', field_name='object', is_generic=True), 'provider': RefInfo(object_type='circuits.provider', field_name='object', is_generic=True), - 'providerAccount': RefInfo(object_type='circuits.provideraccount', field_name='object', is_generic=True), - 'providerNetwork': RefInfo(object_type='circuits.providernetwork', field_name='object', is_generic=True), + 'provider_account': RefInfo(object_type='circuits.provideraccount', field_name='object', is_generic=True), + 'provider_network': RefInfo(object_type='circuits.providernetwork', field_name='object', is_generic=True), 'rir': RefInfo(object_type='ipam.rir', field_name='object', is_generic=True), 'rack': RefInfo(object_type='dcim.rack', field_name='object', is_generic=True), - 'rackReservation': RefInfo(object_type='dcim.rackreservation', field_name='object', is_generic=True), - 'rackRole': RefInfo(object_type='dcim.rackrole', field_name='object', is_generic=True), - 'rackType': RefInfo(object_type='dcim.racktype', field_name='object', is_generic=True), - 'rearPort': RefInfo(object_type='dcim.rearport', field_name='object', is_generic=True), + 'rack_reservation': RefInfo(object_type='dcim.rackreservation', field_name='object', is_generic=True), + 'rack_role': RefInfo(object_type='dcim.rackrole', field_name='object', is_generic=True), + 'rack_type': RefInfo(object_type='dcim.racktype', field_name='object', is_generic=True), + 'rear_port': RefInfo(object_type='dcim.rearport', field_name='object', is_generic=True), 'region': RefInfo(object_type='dcim.region', field_name='object', is_generic=True), 'role': RefInfo(object_type='ipam.role', field_name='object', is_generic=True), - 'routeTarget': RefInfo(object_type='ipam.routetarget', field_name='object', is_generic=True), + 'route_target': RefInfo(object_type='ipam.routetarget', field_name='object', is_generic=True), 'service': RefInfo(object_type='ipam.service', field_name='object', is_generic=True), 'site': RefInfo(object_type='dcim.site', field_name='object', is_generic=True), - 'siteGroup': RefInfo(object_type='dcim.sitegroup', field_name='object', is_generic=True), + 'site_group': RefInfo(object_type='dcim.sitegroup', field_name='object', is_generic=True), 'tag': RefInfo(object_type='extras.tag', field_name='object', is_generic=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='object', is_generic=True), - 'tenantGroup': RefInfo(object_type='tenancy.tenantgroup', field_name='object', is_generic=True), + 'tenant_group': RefInfo(object_type='tenancy.tenantgroup', field_name='object', is_generic=True), 'tunnel': RefInfo(object_type='vpn.tunnel', field_name='object', is_generic=True), - 'tunnelGroup': RefInfo(object_type='vpn.tunnelgroup', field_name='object', is_generic=True), - 'tunnelTermination': RefInfo(object_type='vpn.tunneltermination', field_name='object', is_generic=True), + 'tunnel_group': RefInfo(object_type='vpn.tunnelgroup', field_name='object', is_generic=True), + 'tunnel_termination': RefInfo(object_type='vpn.tunneltermination', field_name='object', is_generic=True), 'vlan': RefInfo(object_type='ipam.vlan', field_name='object', is_generic=True), - 'vlanGroup': RefInfo(object_type='ipam.vlangroup', field_name='object', is_generic=True), - 'vlanTranslationPolicy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='object', is_generic=True), - 'vlanTranslationRule': RefInfo(object_type='ipam.vlantranslationrule', field_name='object', is_generic=True), - 'vmInterface': RefInfo(object_type='virtualization.vminterface', field_name='object', is_generic=True), + 'vlan_group': RefInfo(object_type='ipam.vlangroup', field_name='object', is_generic=True), + 'vlan_translation_policy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='object', is_generic=True), + 'vlan_translation_rule': RefInfo(object_type='ipam.vlantranslationrule', field_name='object', is_generic=True), + 'vm_interface': RefInfo(object_type='virtualization.vminterface', field_name='object', is_generic=True), 'vrf': RefInfo(object_type='ipam.vrf', field_name='object', is_generic=True), - 'virtualChassis': RefInfo(object_type='dcim.virtualchassis', field_name='object', is_generic=True), - 'virtualCircuit': RefInfo(object_type='circuits.virtualcircuit', field_name='object', is_generic=True), - 'virtualCircuitTermination': RefInfo(object_type='circuits.virtualcircuittermination', field_name='object', is_generic=True), - 'virtualCircuitType': RefInfo(object_type='circuits.virtualcircuittype', field_name='object', is_generic=True), - 'virtualDeviceContext': RefInfo(object_type='dcim.virtualdevicecontext', field_name='object', is_generic=True), - 'virtualDisk': RefInfo(object_type='virtualization.virtualdisk', field_name='object', is_generic=True), - 'virtualMachine': RefInfo(object_type='virtualization.virtualmachine', field_name='object', is_generic=True), - 'wirelessLan': RefInfo(object_type='wireless.wirelesslan', field_name='object', is_generic=True), - 'wirelessLanGroup': RefInfo(object_type='wireless.wirelesslangroup', field_name='object', is_generic=True), - 'wirelessLink': RefInfo(object_type='wireless.wirelesslink', field_name='object', is_generic=True), + 'virtual_chassis': RefInfo(object_type='dcim.virtualchassis', field_name='object', is_generic=True), + 'virtual_circuit': RefInfo(object_type='circuits.virtualcircuit', field_name='object', is_generic=True), + 'virtual_circuit_termination': RefInfo(object_type='circuits.virtualcircuittermination', field_name='object', is_generic=True), + 'virtual_circuit_type': RefInfo(object_type='circuits.virtualcircuittype', field_name='object', is_generic=True), + 'virtual_device_context': RefInfo(object_type='dcim.virtualdevicecontext', field_name='object', is_generic=True), + 'virtual_disk': RefInfo(object_type='virtualization.virtualdisk', field_name='object', is_generic=True), + 'virtual_machine': RefInfo(object_type='virtualization.virtualmachine', field_name='object', is_generic=True), + 'wireless_lan': RefInfo(object_type='wireless.wirelesslan', field_name='object', is_generic=True), + 'wireless_lan_group': RefInfo(object_type='wireless.wirelesslangroup', field_name='object', is_generic=True), + 'wireless_link': RefInfo(object_type='wireless.wirelesslink', field_name='object', is_generic=True), }, 'circuits.circuit': { 'assignments': RefInfo(object_type='circuits.circuitgroupassignment', field_name='assignments', is_many=True), 'provider': RefInfo(object_type='circuits.provider', field_name='provider'), - 'providerAccount': RefInfo(object_type='circuits.provideraccount', field_name='provider_account'), + 'provider_account': RefInfo(object_type='circuits.provideraccount', field_name='provider_account'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), 'type': RefInfo(object_type='circuits.circuittype', field_name='type'), @@ -146,18 +146,18 @@ class RefInfo: }, 'circuits.circuitgroupassignment': { 'group': RefInfo(object_type='circuits.circuitgroup', field_name='group'), - 'memberCircuit': RefInfo(object_type='circuits.circuit', field_name='member', is_generic=True), - 'memberVirtualCircuit': RefInfo(object_type='circuits.virtualcircuit', field_name='member', is_generic=True), + 'member_circuit': RefInfo(object_type='circuits.circuit', field_name='member', is_generic=True), + 'member_virtual_circuit': RefInfo(object_type='circuits.virtualcircuit', field_name='member', is_generic=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'circuits.circuittermination': { 'circuit': RefInfo(object_type='circuits.circuit', field_name='circuit'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), - 'terminationLocation': RefInfo(object_type='dcim.location', field_name='termination', is_generic=True), - 'terminationProviderNetwork': RefInfo(object_type='circuits.providernetwork', field_name='termination', is_generic=True), - 'terminationRegion': RefInfo(object_type='dcim.region', field_name='termination', is_generic=True), - 'terminationSite': RefInfo(object_type='dcim.site', field_name='termination', is_generic=True), - 'terminationSiteGroup': RefInfo(object_type='dcim.sitegroup', field_name='termination', is_generic=True), + 'termination_location': RefInfo(object_type='dcim.location', field_name='termination', is_generic=True), + 'termination_provider_network': RefInfo(object_type='circuits.providernetwork', field_name='termination', is_generic=True), + 'termination_region': RefInfo(object_type='dcim.region', field_name='termination', is_generic=True), + 'termination_site': RefInfo(object_type='dcim.site', field_name='termination', is_generic=True), + 'termination_site_group': RefInfo(object_type='dcim.sitegroup', field_name='termination', is_generic=True), }, 'circuits.circuittype': { 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), @@ -176,8 +176,8 @@ class RefInfo: 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'circuits.virtualcircuit': { - 'providerAccount': RefInfo(object_type='circuits.provideraccount', field_name='provider_account'), - 'providerNetwork': RefInfo(object_type='circuits.providernetwork', field_name='provider_network'), + 'provider_account': RefInfo(object_type='circuits.provideraccount', field_name='provider_account'), + 'provider_network': RefInfo(object_type='circuits.providernetwork', field_name='provider_network'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), 'type': RefInfo(object_type='circuits.virtualcircuittype', field_name='type'), @@ -185,7 +185,7 @@ class RefInfo: 'circuits.virtualcircuittermination': { 'interface': RefInfo(object_type='dcim.interface', field_name='interface'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), - 'virtualCircuit': RefInfo(object_type='circuits.virtualcircuit', field_name='virtual_circuit'), + 'virtual_circuit': RefInfo(object_type='circuits.virtualcircuit', field_name='virtual_circuit'), }, 'circuits.virtualcircuittype': { 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), @@ -196,15 +196,15 @@ class RefInfo: }, 'dcim.cabletermination': { 'cable': RefInfo(object_type='dcim.cable', field_name='cable'), - 'terminationCircuitTermination': RefInfo(object_type='circuits.circuittermination', field_name='termination', is_generic=True), - 'terminationConsolePort': RefInfo(object_type='dcim.consoleport', field_name='termination', is_generic=True), - 'terminationConsoleServerPort': RefInfo(object_type='dcim.consoleserverport', field_name='termination', is_generic=True), - 'terminationFrontPort': RefInfo(object_type='dcim.frontport', field_name='termination', is_generic=True), - 'terminationInterface': RefInfo(object_type='dcim.interface', field_name='termination', is_generic=True), - 'terminationPowerFeed': RefInfo(object_type='dcim.powerfeed', field_name='termination', is_generic=True), - 'terminationPowerOutlet': RefInfo(object_type='dcim.poweroutlet', field_name='termination', is_generic=True), - 'terminationPowerPort': RefInfo(object_type='dcim.powerport', field_name='termination', is_generic=True), - 'terminationRearPort': RefInfo(object_type='dcim.rearport', field_name='termination', is_generic=True), + 'termination_circuit_termination': RefInfo(object_type='circuits.circuittermination', field_name='termination', is_generic=True), + 'termination_console_port': RefInfo(object_type='dcim.consoleport', field_name='termination', is_generic=True), + 'termination_console_server_port': RefInfo(object_type='dcim.consoleserverport', field_name='termination', is_generic=True), + 'termination_front_port': RefInfo(object_type='dcim.frontport', field_name='termination', is_generic=True), + 'termination_interface': RefInfo(object_type='dcim.interface', field_name='termination', is_generic=True), + 'termination_power_feed': RefInfo(object_type='dcim.powerfeed', field_name='termination', is_generic=True), + 'termination_power_outlet': RefInfo(object_type='dcim.poweroutlet', field_name='termination', is_generic=True), + 'termination_power_port': RefInfo(object_type='dcim.powerport', field_name='termination', is_generic=True), + 'termination_rear_port': RefInfo(object_type='dcim.rearport', field_name='termination', is_generic=True), }, 'dcim.consoleport': { 'device': RefInfo(object_type='dcim.device', field_name='device'), @@ -218,36 +218,36 @@ class RefInfo: }, 'dcim.device': { 'cluster': RefInfo(object_type='virtualization.cluster', field_name='cluster'), - 'deviceType': RefInfo(object_type='dcim.devicetype', field_name='device_type'), + 'device_type': RefInfo(object_type='dcim.devicetype', field_name='device_type'), 'location': RefInfo(object_type='dcim.location', field_name='location'), - 'oobIp': RefInfo(object_type='ipam.ipaddress', field_name='oob_ip'), + 'oob_ip': RefInfo(object_type='ipam.ipaddress', field_name='oob_ip'), 'platform': RefInfo(object_type='dcim.platform', field_name='platform'), - 'primaryIp4': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip4'), - 'primaryIp6': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip6'), + 'primary_ip4': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip4'), + 'primary_ip6': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip6'), 'rack': RefInfo(object_type='dcim.rack', field_name='rack'), 'role': RefInfo(object_type='dcim.devicerole', field_name='role'), 'site': RefInfo(object_type='dcim.site', field_name='site'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), - 'virtualChassis': RefInfo(object_type='dcim.virtualchassis', field_name='virtual_chassis'), + 'virtual_chassis': RefInfo(object_type='dcim.virtualchassis', field_name='virtual_chassis'), }, 'dcim.devicebay': { 'device': RefInfo(object_type='dcim.device', field_name='device'), - 'installedDevice': RefInfo(object_type='dcim.device', field_name='installed_device'), + 'installed_device': RefInfo(object_type='dcim.device', field_name='installed_device'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'dcim.devicerole': { 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'dcim.devicetype': { - 'defaultPlatform': RefInfo(object_type='dcim.platform', field_name='default_platform'), + 'default_platform': RefInfo(object_type='dcim.platform', field_name='default_platform'), 'manufacturer': RefInfo(object_type='dcim.manufacturer', field_name='manufacturer'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'dcim.frontport': { 'device': RefInfo(object_type='dcim.device', field_name='device'), 'module': RefInfo(object_type='dcim.module', field_name='module'), - 'rearPort': RefInfo(object_type='dcim.rearport', field_name='rear_port'), + 'rear_port': RefInfo(object_type='dcim.rearport', field_name='rear_port'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'dcim.interface': { @@ -256,24 +256,24 @@ class RefInfo: 'lag': RefInfo(object_type='dcim.interface', field_name='lag'), 'module': RefInfo(object_type='dcim.module', field_name='module'), 'parent': RefInfo(object_type='dcim.interface', field_name='parent'), - 'primaryMacAddress': RefInfo(object_type='dcim.macaddress', field_name='primary_mac_address'), - 'qinqSvlan': RefInfo(object_type='ipam.vlan', field_name='qinq_svlan'), - 'taggedVlans': RefInfo(object_type='ipam.vlan', field_name='tagged_vlans', is_many=True), + 'primary_mac_address': RefInfo(object_type='dcim.macaddress', field_name='primary_mac_address'), + 'qinq_svlan': RefInfo(object_type='ipam.vlan', field_name='qinq_svlan'), + 'tagged_vlans': RefInfo(object_type='ipam.vlan', field_name='tagged_vlans', is_many=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), - 'untaggedVlan': RefInfo(object_type='ipam.vlan', field_name='untagged_vlan'), + 'untagged_vlan': RefInfo(object_type='ipam.vlan', field_name='untagged_vlan'), 'vdcs': RefInfo(object_type='dcim.virtualdevicecontext', field_name='vdcs', is_many=True), - 'vlanTranslationPolicy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='vlan_translation_policy'), + 'vlan_translation_policy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='vlan_translation_policy'), 'vrf': RefInfo(object_type='ipam.vrf', field_name='vrf'), - 'wirelessLans': RefInfo(object_type='wireless.wirelesslan', field_name='wireless_lans', is_many=True), + 'wireless_lans': RefInfo(object_type='wireless.wirelesslan', field_name='wireless_lans', is_many=True), }, 'dcim.inventoryitem': { - 'componentConsolePort': RefInfo(object_type='dcim.consoleport', field_name='component', is_generic=True), - 'componentConsoleServerPort': RefInfo(object_type='dcim.consoleserverport', field_name='component', is_generic=True), - 'componentFrontPort': RefInfo(object_type='dcim.frontport', field_name='component', is_generic=True), - 'componentInterface': RefInfo(object_type='dcim.interface', field_name='component', is_generic=True), - 'componentPowerOutlet': RefInfo(object_type='dcim.poweroutlet', field_name='component', is_generic=True), - 'componentPowerPort': RefInfo(object_type='dcim.powerport', field_name='component', is_generic=True), - 'componentRearPort': RefInfo(object_type='dcim.rearport', field_name='component', is_generic=True), + 'component_console_port': RefInfo(object_type='dcim.consoleport', field_name='component', is_generic=True), + 'component_console_server_port': RefInfo(object_type='dcim.consoleserverport', field_name='component', is_generic=True), + 'component_front_port': RefInfo(object_type='dcim.frontport', field_name='component', is_generic=True), + 'component_interface': RefInfo(object_type='dcim.interface', field_name='component', is_generic=True), + 'component_power_outlet': RefInfo(object_type='dcim.poweroutlet', field_name='component', is_generic=True), + 'component_power_port': RefInfo(object_type='dcim.powerport', field_name='component', is_generic=True), + 'component_rear_port': RefInfo(object_type='dcim.rearport', field_name='component', is_generic=True), 'device': RefInfo(object_type='dcim.device', field_name='device'), 'manufacturer': RefInfo(object_type='dcim.manufacturer', field_name='manufacturer'), 'parent': RefInfo(object_type='dcim.inventoryitem', field_name='parent'), @@ -290,8 +290,8 @@ class RefInfo: 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), }, 'dcim.macaddress': { - 'assignedObjectInterface': RefInfo(object_type='dcim.interface', field_name='assigned_object', is_generic=True), - 'assignedObjectVmInterface': RefInfo(object_type='virtualization.vminterface', field_name='assigned_object', is_generic=True), + 'assigned_object_interface': RefInfo(object_type='dcim.interface', field_name='assigned_object', is_generic=True), + 'assigned_object_vm_interface': RefInfo(object_type='virtualization.vminterface', field_name='assigned_object', is_generic=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'dcim.manufacturer': { @@ -299,13 +299,13 @@ class RefInfo: }, 'dcim.module': { 'device': RefInfo(object_type='dcim.device', field_name='device'), - 'moduleBay': RefInfo(object_type='dcim.modulebay', field_name='module_bay'), - 'moduleType': RefInfo(object_type='dcim.moduletype', field_name='module_type'), + 'module_bay': RefInfo(object_type='dcim.modulebay', field_name='module_bay'), + 'module_type': RefInfo(object_type='dcim.moduletype', field_name='module_type'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'dcim.modulebay': { 'device': RefInfo(object_type='dcim.device', field_name='device'), - 'installedModule': RefInfo(object_type='dcim.module', field_name='installed_module'), + 'installed_module': RefInfo(object_type='dcim.module', field_name='installed_module'), 'module': RefInfo(object_type='dcim.module', field_name='module'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, @@ -318,7 +318,7 @@ class RefInfo: 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'dcim.powerfeed': { - 'powerPanel': RefInfo(object_type='dcim.powerpanel', field_name='power_panel'), + 'power_panel': RefInfo(object_type='dcim.powerpanel', field_name='power_panel'), 'rack': RefInfo(object_type='dcim.rack', field_name='rack'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), @@ -326,7 +326,7 @@ class RefInfo: 'dcim.poweroutlet': { 'device': RefInfo(object_type='dcim.device', field_name='device'), 'module': RefInfo(object_type='dcim.module', field_name='module'), - 'powerPort': RefInfo(object_type='dcim.powerport', field_name='power_port'), + 'power_port': RefInfo(object_type='dcim.powerport', field_name='power_port'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'dcim.powerpanel': { @@ -341,7 +341,7 @@ class RefInfo: }, 'dcim.rack': { 'location': RefInfo(object_type='dcim.location', field_name='location'), - 'rackType': RefInfo(object_type='dcim.racktype', field_name='rack_type'), + 'rack_type': RefInfo(object_type='dcim.racktype', field_name='rack_type'), 'role': RefInfo(object_type='dcim.rackrole', field_name='role'), 'site': RefInfo(object_type='dcim.site', field_name='site'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), @@ -385,8 +385,8 @@ class RefInfo: }, 'dcim.virtualdevicecontext': { 'device': RefInfo(object_type='dcim.device', field_name='device'), - 'primaryIp4': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip4'), - 'primaryIp6': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip6'), + 'primary_ip4': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip4'), + 'primary_ip6': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip6'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), }, @@ -410,100 +410,100 @@ class RefInfo: }, 'ipam.fhrpgroupassignment': { 'group': RefInfo(object_type='ipam.fhrpgroup', field_name='group'), - 'interfaceAsn': RefInfo(object_type='ipam.asn', field_name='interface', is_generic=True), - 'interfaceAsnRange': RefInfo(object_type='ipam.asnrange', field_name='interface', is_generic=True), - 'interfaceAggregate': RefInfo(object_type='ipam.aggregate', field_name='interface', is_generic=True), - 'interfaceCable': RefInfo(object_type='dcim.cable', field_name='interface', is_generic=True), - 'interfaceCablePath': RefInfo(object_type='dcim.cablepath', field_name='interface', is_generic=True), - 'interfaceCableTermination': RefInfo(object_type='dcim.cabletermination', field_name='interface', is_generic=True), - 'interfaceCircuit': RefInfo(object_type='circuits.circuit', field_name='interface', is_generic=True), - 'interfaceCircuitGroup': RefInfo(object_type='circuits.circuitgroup', field_name='interface', is_generic=True), - 'interfaceCircuitGroupAssignment': RefInfo(object_type='circuits.circuitgroupassignment', field_name='interface', is_generic=True), - 'interfaceCircuitTermination': RefInfo(object_type='circuits.circuittermination', field_name='interface', is_generic=True), - 'interfaceCircuitType': RefInfo(object_type='circuits.circuittype', field_name='interface', is_generic=True), - 'interfaceCluster': RefInfo(object_type='virtualization.cluster', field_name='interface', is_generic=True), - 'interfaceClusterGroup': RefInfo(object_type='virtualization.clustergroup', field_name='interface', is_generic=True), - 'interfaceClusterType': RefInfo(object_type='virtualization.clustertype', field_name='interface', is_generic=True), - 'interfaceConsolePort': RefInfo(object_type='dcim.consoleport', field_name='interface', is_generic=True), - 'interfaceConsoleServerPort': RefInfo(object_type='dcim.consoleserverport', field_name='interface', is_generic=True), - 'interfaceContact': RefInfo(object_type='tenancy.contact', field_name='interface', is_generic=True), - 'interfaceContactAssignment': RefInfo(object_type='tenancy.contactassignment', field_name='interface', is_generic=True), - 'interfaceContactGroup': RefInfo(object_type='tenancy.contactgroup', field_name='interface', is_generic=True), - 'interfaceContactRole': RefInfo(object_type='tenancy.contactrole', field_name='interface', is_generic=True), - 'interfaceDevice': RefInfo(object_type='dcim.device', field_name='interface', is_generic=True), - 'interfaceDeviceBay': RefInfo(object_type='dcim.devicebay', field_name='interface', is_generic=True), - 'interfaceDeviceRole': RefInfo(object_type='dcim.devicerole', field_name='interface', is_generic=True), - 'interfaceDeviceType': RefInfo(object_type='dcim.devicetype', field_name='interface', is_generic=True), - 'interfaceFhrpGroup': RefInfo(object_type='ipam.fhrpgroup', field_name='interface', is_generic=True), - 'interfaceFhrpGroupAssignment': RefInfo(object_type='ipam.fhrpgroupassignment', field_name='interface', is_generic=True), - 'interfaceFrontPort': RefInfo(object_type='dcim.frontport', field_name='interface', is_generic=True), - 'interfaceIkePolicy': RefInfo(object_type='vpn.ikepolicy', field_name='interface', is_generic=True), - 'interfaceIkeProposal': RefInfo(object_type='vpn.ikeproposal', field_name='interface', is_generic=True), - 'interfaceIpAddress': RefInfo(object_type='ipam.ipaddress', field_name='interface', is_generic=True), - 'interfaceIpRange': RefInfo(object_type='ipam.iprange', field_name='interface', is_generic=True), - 'interfaceIpSecPolicy': RefInfo(object_type='vpn.ipsecpolicy', field_name='interface', is_generic=True), - 'interfaceIpSecProfile': RefInfo(object_type='vpn.ipsecprofile', field_name='interface', is_generic=True), - 'interfaceIpSecProposal': RefInfo(object_type='vpn.ipsecproposal', field_name='interface', is_generic=True), - 'interfaceInterface': RefInfo(object_type='dcim.interface', field_name='interface', is_generic=True), - 'interfaceInventoryItem': RefInfo(object_type='dcim.inventoryitem', field_name='interface', is_generic=True), - 'interfaceInventoryItemRole': RefInfo(object_type='dcim.inventoryitemrole', field_name='interface', is_generic=True), - 'interfaceL2Vpn': RefInfo(object_type='vpn.l2vpn', field_name='interface', is_generic=True), - 'interfaceL2VpnTermination': RefInfo(object_type='vpn.l2vpntermination', field_name='interface', is_generic=True), - 'interfaceLocation': RefInfo(object_type='dcim.location', field_name='interface', is_generic=True), - 'interfaceMacAddress': RefInfo(object_type='dcim.macaddress', field_name='interface', is_generic=True), - 'interfaceManufacturer': RefInfo(object_type='dcim.manufacturer', field_name='interface', is_generic=True), - 'interfaceModule': RefInfo(object_type='dcim.module', field_name='interface', is_generic=True), - 'interfaceModuleBay': RefInfo(object_type='dcim.modulebay', field_name='interface', is_generic=True), - 'interfaceModuleType': RefInfo(object_type='dcim.moduletype', field_name='interface', is_generic=True), - 'interfacePlatform': RefInfo(object_type='dcim.platform', field_name='interface', is_generic=True), - 'interfacePowerFeed': RefInfo(object_type='dcim.powerfeed', field_name='interface', is_generic=True), - 'interfacePowerOutlet': RefInfo(object_type='dcim.poweroutlet', field_name='interface', is_generic=True), - 'interfacePowerPanel': RefInfo(object_type='dcim.powerpanel', field_name='interface', is_generic=True), - 'interfacePowerPort': RefInfo(object_type='dcim.powerport', field_name='interface', is_generic=True), - 'interfacePrefix': RefInfo(object_type='ipam.prefix', field_name='interface', is_generic=True), - 'interfaceProvider': RefInfo(object_type='circuits.provider', field_name='interface', is_generic=True), - 'interfaceProviderAccount': RefInfo(object_type='circuits.provideraccount', field_name='interface', is_generic=True), - 'interfaceProviderNetwork': RefInfo(object_type='circuits.providernetwork', field_name='interface', is_generic=True), - 'interfaceRir': RefInfo(object_type='ipam.rir', field_name='interface', is_generic=True), - 'interfaceRack': RefInfo(object_type='dcim.rack', field_name='interface', is_generic=True), - 'interfaceRackReservation': RefInfo(object_type='dcim.rackreservation', field_name='interface', is_generic=True), - 'interfaceRackRole': RefInfo(object_type='dcim.rackrole', field_name='interface', is_generic=True), - 'interfaceRackType': RefInfo(object_type='dcim.racktype', field_name='interface', is_generic=True), - 'interfaceRearPort': RefInfo(object_type='dcim.rearport', field_name='interface', is_generic=True), - 'interfaceRegion': RefInfo(object_type='dcim.region', field_name='interface', is_generic=True), - 'interfaceRole': RefInfo(object_type='ipam.role', field_name='interface', is_generic=True), - 'interfaceRouteTarget': RefInfo(object_type='ipam.routetarget', field_name='interface', is_generic=True), - 'interfaceService': RefInfo(object_type='ipam.service', field_name='interface', is_generic=True), - 'interfaceSite': RefInfo(object_type='dcim.site', field_name='interface', is_generic=True), - 'interfaceSiteGroup': RefInfo(object_type='dcim.sitegroup', field_name='interface', is_generic=True), - 'interfaceTag': RefInfo(object_type='extras.tag', field_name='interface', is_generic=True), - 'interfaceTenant': RefInfo(object_type='tenancy.tenant', field_name='interface', is_generic=True), - 'interfaceTenantGroup': RefInfo(object_type='tenancy.tenantgroup', field_name='interface', is_generic=True), - 'interfaceTunnel': RefInfo(object_type='vpn.tunnel', field_name='interface', is_generic=True), - 'interfaceTunnelGroup': RefInfo(object_type='vpn.tunnelgroup', field_name='interface', is_generic=True), - 'interfaceTunnelTermination': RefInfo(object_type='vpn.tunneltermination', field_name='interface', is_generic=True), - 'interfaceVlan': RefInfo(object_type='ipam.vlan', field_name='interface', is_generic=True), - 'interfaceVlanGroup': RefInfo(object_type='ipam.vlangroup', field_name='interface', is_generic=True), - 'interfaceVlanTranslationPolicy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='interface', is_generic=True), - 'interfaceVlanTranslationRule': RefInfo(object_type='ipam.vlantranslationrule', field_name='interface', is_generic=True), - 'interfaceVmInterface': RefInfo(object_type='virtualization.vminterface', field_name='interface', is_generic=True), - 'interfaceVrf': RefInfo(object_type='ipam.vrf', field_name='interface', is_generic=True), - 'interfaceVirtualChassis': RefInfo(object_type='dcim.virtualchassis', field_name='interface', is_generic=True), - 'interfaceVirtualCircuit': RefInfo(object_type='circuits.virtualcircuit', field_name='interface', is_generic=True), - 'interfaceVirtualCircuitTermination': RefInfo(object_type='circuits.virtualcircuittermination', field_name='interface', is_generic=True), - 'interfaceVirtualCircuitType': RefInfo(object_type='circuits.virtualcircuittype', field_name='interface', is_generic=True), - 'interfaceVirtualDeviceContext': RefInfo(object_type='dcim.virtualdevicecontext', field_name='interface', is_generic=True), - 'interfaceVirtualDisk': RefInfo(object_type='virtualization.virtualdisk', field_name='interface', is_generic=True), - 'interfaceVirtualMachine': RefInfo(object_type='virtualization.virtualmachine', field_name='interface', is_generic=True), - 'interfaceWirelessLan': RefInfo(object_type='wireless.wirelesslan', field_name='interface', is_generic=True), - 'interfaceWirelessLanGroup': RefInfo(object_type='wireless.wirelesslangroup', field_name='interface', is_generic=True), - 'interfaceWirelessLink': RefInfo(object_type='wireless.wirelesslink', field_name='interface', is_generic=True), + 'interface_asn': RefInfo(object_type='ipam.asn', field_name='interface', is_generic=True), + 'interface_asn_range': RefInfo(object_type='ipam.asnrange', field_name='interface', is_generic=True), + 'interface_aggregate': RefInfo(object_type='ipam.aggregate', field_name='interface', is_generic=True), + 'interface_cable': RefInfo(object_type='dcim.cable', field_name='interface', is_generic=True), + 'interface_cable_path': RefInfo(object_type='dcim.cablepath', field_name='interface', is_generic=True), + 'interface_cable_termination': RefInfo(object_type='dcim.cabletermination', field_name='interface', is_generic=True), + 'interface_circuit': RefInfo(object_type='circuits.circuit', field_name='interface', is_generic=True), + 'interface_circuit_group': RefInfo(object_type='circuits.circuitgroup', field_name='interface', is_generic=True), + 'interface_circuit_group_assignment': RefInfo(object_type='circuits.circuitgroupassignment', field_name='interface', is_generic=True), + 'interface_circuit_termination': RefInfo(object_type='circuits.circuittermination', field_name='interface', is_generic=True), + 'interface_circuit_type': RefInfo(object_type='circuits.circuittype', field_name='interface', is_generic=True), + 'interface_cluster': RefInfo(object_type='virtualization.cluster', field_name='interface', is_generic=True), + 'interface_cluster_group': RefInfo(object_type='virtualization.clustergroup', field_name='interface', is_generic=True), + 'interface_cluster_type': RefInfo(object_type='virtualization.clustertype', field_name='interface', is_generic=True), + 'interface_console_port': RefInfo(object_type='dcim.consoleport', field_name='interface', is_generic=True), + 'interface_console_server_port': RefInfo(object_type='dcim.consoleserverport', field_name='interface', is_generic=True), + 'interface_contact': RefInfo(object_type='tenancy.contact', field_name='interface', is_generic=True), + 'interface_contact_assignment': RefInfo(object_type='tenancy.contactassignment', field_name='interface', is_generic=True), + 'interface_contact_group': RefInfo(object_type='tenancy.contactgroup', field_name='interface', is_generic=True), + 'interface_contact_role': RefInfo(object_type='tenancy.contactrole', field_name='interface', is_generic=True), + 'interface_device': RefInfo(object_type='dcim.device', field_name='interface', is_generic=True), + 'interface_device_bay': RefInfo(object_type='dcim.devicebay', field_name='interface', is_generic=True), + 'interface_device_role': RefInfo(object_type='dcim.devicerole', field_name='interface', is_generic=True), + 'interface_device_type': RefInfo(object_type='dcim.devicetype', field_name='interface', is_generic=True), + 'interface_fhrp_group': RefInfo(object_type='ipam.fhrpgroup', field_name='interface', is_generic=True), + 'interface_fhrp_group_assignment': RefInfo(object_type='ipam.fhrpgroupassignment', field_name='interface', is_generic=True), + 'interface_front_port': RefInfo(object_type='dcim.frontport', field_name='interface', is_generic=True), + 'interface_ike_policy': RefInfo(object_type='vpn.ikepolicy', field_name='interface', is_generic=True), + 'interface_ike_proposal': RefInfo(object_type='vpn.ikeproposal', field_name='interface', is_generic=True), + 'interface_ip_address': RefInfo(object_type='ipam.ipaddress', field_name='interface', is_generic=True), + 'interface_ip_range': RefInfo(object_type='ipam.iprange', field_name='interface', is_generic=True), + 'interface_ip_sec_policy': RefInfo(object_type='vpn.ipsecpolicy', field_name='interface', is_generic=True), + 'interface_ip_sec_profile': RefInfo(object_type='vpn.ipsecprofile', field_name='interface', is_generic=True), + 'interface_ip_sec_proposal': RefInfo(object_type='vpn.ipsecproposal', field_name='interface', is_generic=True), + 'interface_interface': RefInfo(object_type='dcim.interface', field_name='interface', is_generic=True), + 'interface_inventory_item': RefInfo(object_type='dcim.inventoryitem', field_name='interface', is_generic=True), + 'interface_inventory_item_role': RefInfo(object_type='dcim.inventoryitemrole', field_name='interface', is_generic=True), + 'interface_l2vpn': RefInfo(object_type='vpn.l2vpn', field_name='interface', is_generic=True), + 'interface_l2vpn_termination': RefInfo(object_type='vpn.l2vpntermination', field_name='interface', is_generic=True), + 'interface_location': RefInfo(object_type='dcim.location', field_name='interface', is_generic=True), + 'interface_mac_address': RefInfo(object_type='dcim.macaddress', field_name='interface', is_generic=True), + 'interface_manufacturer': RefInfo(object_type='dcim.manufacturer', field_name='interface', is_generic=True), + 'interface_module': RefInfo(object_type='dcim.module', field_name='interface', is_generic=True), + 'interface_module_bay': RefInfo(object_type='dcim.modulebay', field_name='interface', is_generic=True), + 'interface_module_type': RefInfo(object_type='dcim.moduletype', field_name='interface', is_generic=True), + 'interface_platform': RefInfo(object_type='dcim.platform', field_name='interface', is_generic=True), + 'interface_power_feed': RefInfo(object_type='dcim.powerfeed', field_name='interface', is_generic=True), + 'interface_power_outlet': RefInfo(object_type='dcim.poweroutlet', field_name='interface', is_generic=True), + 'interface_power_panel': RefInfo(object_type='dcim.powerpanel', field_name='interface', is_generic=True), + 'interface_power_port': RefInfo(object_type='dcim.powerport', field_name='interface', is_generic=True), + 'interface_prefix': RefInfo(object_type='ipam.prefix', field_name='interface', is_generic=True), + 'interface_provider': RefInfo(object_type='circuits.provider', field_name='interface', is_generic=True), + 'interface_provider_account': RefInfo(object_type='circuits.provideraccount', field_name='interface', is_generic=True), + 'interface_provider_network': RefInfo(object_type='circuits.providernetwork', field_name='interface', is_generic=True), + 'interface_rir': RefInfo(object_type='ipam.rir', field_name='interface', is_generic=True), + 'interface_rack': RefInfo(object_type='dcim.rack', field_name='interface', is_generic=True), + 'interface_rack_reservation': RefInfo(object_type='dcim.rackreservation', field_name='interface', is_generic=True), + 'interface_rack_role': RefInfo(object_type='dcim.rackrole', field_name='interface', is_generic=True), + 'interface_rack_type': RefInfo(object_type='dcim.racktype', field_name='interface', is_generic=True), + 'interface_rear_port': RefInfo(object_type='dcim.rearport', field_name='interface', is_generic=True), + 'interface_region': RefInfo(object_type='dcim.region', field_name='interface', is_generic=True), + 'interface_role': RefInfo(object_type='ipam.role', field_name='interface', is_generic=True), + 'interface_route_target': RefInfo(object_type='ipam.routetarget', field_name='interface', is_generic=True), + 'interface_service': RefInfo(object_type='ipam.service', field_name='interface', is_generic=True), + 'interface_site': RefInfo(object_type='dcim.site', field_name='interface', is_generic=True), + 'interface_site_group': RefInfo(object_type='dcim.sitegroup', field_name='interface', is_generic=True), + 'interface_tag': RefInfo(object_type='extras.tag', field_name='interface', is_generic=True), + 'interface_tenant': RefInfo(object_type='tenancy.tenant', field_name='interface', is_generic=True), + 'interface_tenant_group': RefInfo(object_type='tenancy.tenantgroup', field_name='interface', is_generic=True), + 'interface_tunnel': RefInfo(object_type='vpn.tunnel', field_name='interface', is_generic=True), + 'interface_tunnel_group': RefInfo(object_type='vpn.tunnelgroup', field_name='interface', is_generic=True), + 'interface_tunnel_termination': RefInfo(object_type='vpn.tunneltermination', field_name='interface', is_generic=True), + 'interface_vlan': RefInfo(object_type='ipam.vlan', field_name='interface', is_generic=True), + 'interface_vlan_group': RefInfo(object_type='ipam.vlangroup', field_name='interface', is_generic=True), + 'interface_vlan_translation_policy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='interface', is_generic=True), + 'interface_vlan_translation_rule': RefInfo(object_type='ipam.vlantranslationrule', field_name='interface', is_generic=True), + 'interface_vm_interface': RefInfo(object_type='virtualization.vminterface', field_name='interface', is_generic=True), + 'interface_vrf': RefInfo(object_type='ipam.vrf', field_name='interface', is_generic=True), + 'interface_virtual_chassis': RefInfo(object_type='dcim.virtualchassis', field_name='interface', is_generic=True), + 'interface_virtual_circuit': RefInfo(object_type='circuits.virtualcircuit', field_name='interface', is_generic=True), + 'interface_virtual_circuit_termination': RefInfo(object_type='circuits.virtualcircuittermination', field_name='interface', is_generic=True), + 'interface_virtual_circuit_type': RefInfo(object_type='circuits.virtualcircuittype', field_name='interface', is_generic=True), + 'interface_virtual_device_context': RefInfo(object_type='dcim.virtualdevicecontext', field_name='interface', is_generic=True), + 'interface_virtual_disk': RefInfo(object_type='virtualization.virtualdisk', field_name='interface', is_generic=True), + 'interface_virtual_machine': RefInfo(object_type='virtualization.virtualmachine', field_name='interface', is_generic=True), + 'interface_wireless_lan': RefInfo(object_type='wireless.wirelesslan', field_name='interface', is_generic=True), + 'interface_wireless_lan_group': RefInfo(object_type='wireless.wirelesslangroup', field_name='interface', is_generic=True), + 'interface_wireless_link': RefInfo(object_type='wireless.wirelesslink', field_name='interface', is_generic=True), }, 'ipam.ipaddress': { - 'assignedObjectFhrpGroup': RefInfo(object_type='ipam.fhrpgroup', field_name='assigned_object', is_generic=True), - 'assignedObjectInterface': RefInfo(object_type='dcim.interface', field_name='assigned_object', is_generic=True), - 'assignedObjectVmInterface': RefInfo(object_type='virtualization.vminterface', field_name='assigned_object', is_generic=True), - 'natInside': RefInfo(object_type='ipam.ipaddress', field_name='nat_inside'), + 'assigned_object_fhrp_group': RefInfo(object_type='ipam.fhrpgroup', field_name='assigned_object', is_generic=True), + 'assigned_object_interface': RefInfo(object_type='dcim.interface', field_name='assigned_object', is_generic=True), + 'assigned_object_vm_interface': RefInfo(object_type='virtualization.vminterface', field_name='assigned_object', is_generic=True), + 'nat_inside': RefInfo(object_type='ipam.ipaddress', field_name='nat_inside'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), 'vrf': RefInfo(object_type='ipam.vrf', field_name='vrf'), @@ -516,10 +516,10 @@ class RefInfo: }, 'ipam.prefix': { 'role': RefInfo(object_type='ipam.role', field_name='role'), - 'scopeLocation': RefInfo(object_type='dcim.location', field_name='scope', is_generic=True), - 'scopeRegion': RefInfo(object_type='dcim.region', field_name='scope', is_generic=True), - 'scopeSite': RefInfo(object_type='dcim.site', field_name='scope', is_generic=True), - 'scopeSiteGroup': RefInfo(object_type='dcim.sitegroup', field_name='scope', is_generic=True), + 'scope_location': RefInfo(object_type='dcim.location', field_name='scope', is_generic=True), + 'scope_region': RefInfo(object_type='dcim.region', field_name='scope', is_generic=True), + 'scope_site': RefInfo(object_type='dcim.site', field_name='scope', is_generic=True), + 'scope_site_group': RefInfo(object_type='dcim.sitegroup', field_name='scope', is_generic=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), 'vlan': RefInfo(object_type='ipam.vlan', field_name='vlan'), @@ -539,32 +539,32 @@ class RefInfo: 'device': RefInfo(object_type='dcim.device', field_name='device'), 'ipaddresses': RefInfo(object_type='ipam.ipaddress', field_name='ipaddresses', is_many=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), - 'virtualMachine': RefInfo(object_type='virtualization.virtualmachine', field_name='virtual_machine'), + 'virtual_machine': RefInfo(object_type='virtualization.virtualmachine', field_name='virtual_machine'), }, 'ipam.vlan': { 'group': RefInfo(object_type='ipam.vlangroup', field_name='group'), - 'qinqSvlan': RefInfo(object_type='ipam.vlan', field_name='qinq_svlan'), + 'qinq_svlan': RefInfo(object_type='ipam.vlan', field_name='qinq_svlan'), 'role': RefInfo(object_type='ipam.role', field_name='role'), 'site': RefInfo(object_type='dcim.site', field_name='site'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), }, 'ipam.vlangroup': { - 'scopeCluster': RefInfo(object_type='virtualization.cluster', field_name='scope', is_generic=True), - 'scopeClusterGroup': RefInfo(object_type='virtualization.clustergroup', field_name='scope', is_generic=True), - 'scopeLocation': RefInfo(object_type='dcim.location', field_name='scope', is_generic=True), - 'scopeRack': RefInfo(object_type='dcim.rack', field_name='scope', is_generic=True), - 'scopeRegion': RefInfo(object_type='dcim.region', field_name='scope', is_generic=True), - 'scopeSite': RefInfo(object_type='dcim.site', field_name='scope', is_generic=True), - 'scopeSiteGroup': RefInfo(object_type='dcim.sitegroup', field_name='scope', is_generic=True), + 'scope_cluster': RefInfo(object_type='virtualization.cluster', field_name='scope', is_generic=True), + 'scope_cluster_group': RefInfo(object_type='virtualization.clustergroup', field_name='scope', is_generic=True), + 'scope_location': RefInfo(object_type='dcim.location', field_name='scope', is_generic=True), + 'scope_rack': RefInfo(object_type='dcim.rack', field_name='scope', is_generic=True), + 'scope_region': RefInfo(object_type='dcim.region', field_name='scope', is_generic=True), + 'scope_site': RefInfo(object_type='dcim.site', field_name='scope', is_generic=True), + 'scope_site_group': RefInfo(object_type='dcim.sitegroup', field_name='scope', is_generic=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'ipam.vlantranslationrule': { 'policy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='policy'), }, 'ipam.vrf': { - 'exportTargets': RefInfo(object_type='ipam.routetarget', field_name='export_targets', is_many=True), - 'importTargets': RefInfo(object_type='ipam.routetarget', field_name='import_targets', is_many=True), + 'export_targets': RefInfo(object_type='ipam.routetarget', field_name='export_targets', is_many=True), + 'import_targets': RefInfo(object_type='ipam.routetarget', field_name='import_targets', is_many=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), }, @@ -574,94 +574,94 @@ class RefInfo: }, 'tenancy.contactassignment': { 'contact': RefInfo(object_type='tenancy.contact', field_name='contact'), - 'objectAsn': RefInfo(object_type='ipam.asn', field_name='object', is_generic=True), - 'objectAsnRange': RefInfo(object_type='ipam.asnrange', field_name='object', is_generic=True), - 'objectAggregate': RefInfo(object_type='ipam.aggregate', field_name='object', is_generic=True), - 'objectCable': RefInfo(object_type='dcim.cable', field_name='object', is_generic=True), - 'objectCablePath': RefInfo(object_type='dcim.cablepath', field_name='object', is_generic=True), - 'objectCableTermination': RefInfo(object_type='dcim.cabletermination', field_name='object', is_generic=True), - 'objectCircuit': RefInfo(object_type='circuits.circuit', field_name='object', is_generic=True), - 'objectCircuitGroup': RefInfo(object_type='circuits.circuitgroup', field_name='object', is_generic=True), - 'objectCircuitGroupAssignment': RefInfo(object_type='circuits.circuitgroupassignment', field_name='object', is_generic=True), - 'objectCircuitTermination': RefInfo(object_type='circuits.circuittermination', field_name='object', is_generic=True), - 'objectCircuitType': RefInfo(object_type='circuits.circuittype', field_name='object', is_generic=True), - 'objectCluster': RefInfo(object_type='virtualization.cluster', field_name='object', is_generic=True), - 'objectClusterGroup': RefInfo(object_type='virtualization.clustergroup', field_name='object', is_generic=True), - 'objectClusterType': RefInfo(object_type='virtualization.clustertype', field_name='object', is_generic=True), - 'objectConsolePort': RefInfo(object_type='dcim.consoleport', field_name='object', is_generic=True), - 'objectConsoleServerPort': RefInfo(object_type='dcim.consoleserverport', field_name='object', is_generic=True), - 'objectContact': RefInfo(object_type='tenancy.contact', field_name='object', is_generic=True), - 'objectContactAssignment': RefInfo(object_type='tenancy.contactassignment', field_name='object', is_generic=True), - 'objectContactGroup': RefInfo(object_type='tenancy.contactgroup', field_name='object', is_generic=True), - 'objectContactRole': RefInfo(object_type='tenancy.contactrole', field_name='object', is_generic=True), - 'objectDevice': RefInfo(object_type='dcim.device', field_name='object', is_generic=True), - 'objectDeviceBay': RefInfo(object_type='dcim.devicebay', field_name='object', is_generic=True), - 'objectDeviceRole': RefInfo(object_type='dcim.devicerole', field_name='object', is_generic=True), - 'objectDeviceType': RefInfo(object_type='dcim.devicetype', field_name='object', is_generic=True), - 'objectFhrpGroup': RefInfo(object_type='ipam.fhrpgroup', field_name='object', is_generic=True), - 'objectFhrpGroupAssignment': RefInfo(object_type='ipam.fhrpgroupassignment', field_name='object', is_generic=True), - 'objectFrontPort': RefInfo(object_type='dcim.frontport', field_name='object', is_generic=True), - 'objectIkePolicy': RefInfo(object_type='vpn.ikepolicy', field_name='object', is_generic=True), - 'objectIkeProposal': RefInfo(object_type='vpn.ikeproposal', field_name='object', is_generic=True), - 'objectIpAddress': RefInfo(object_type='ipam.ipaddress', field_name='object', is_generic=True), - 'objectIpRange': RefInfo(object_type='ipam.iprange', field_name='object', is_generic=True), - 'objectIpSecPolicy': RefInfo(object_type='vpn.ipsecpolicy', field_name='object', is_generic=True), - 'objectIpSecProfile': RefInfo(object_type='vpn.ipsecprofile', field_name='object', is_generic=True), - 'objectIpSecProposal': RefInfo(object_type='vpn.ipsecproposal', field_name='object', is_generic=True), - 'objectInterface': RefInfo(object_type='dcim.interface', field_name='object', is_generic=True), - 'objectInventoryItem': RefInfo(object_type='dcim.inventoryitem', field_name='object', is_generic=True), - 'objectInventoryItemRole': RefInfo(object_type='dcim.inventoryitemrole', field_name='object', is_generic=True), - 'objectL2Vpn': RefInfo(object_type='vpn.l2vpn', field_name='object', is_generic=True), - 'objectL2VpnTermination': RefInfo(object_type='vpn.l2vpntermination', field_name='object', is_generic=True), - 'objectLocation': RefInfo(object_type='dcim.location', field_name='object', is_generic=True), - 'objectMacAddress': RefInfo(object_type='dcim.macaddress', field_name='object', is_generic=True), - 'objectManufacturer': RefInfo(object_type='dcim.manufacturer', field_name='object', is_generic=True), - 'objectModule': RefInfo(object_type='dcim.module', field_name='object', is_generic=True), - 'objectModuleBay': RefInfo(object_type='dcim.modulebay', field_name='object', is_generic=True), - 'objectModuleType': RefInfo(object_type='dcim.moduletype', field_name='object', is_generic=True), - 'objectPlatform': RefInfo(object_type='dcim.platform', field_name='object', is_generic=True), - 'objectPowerFeed': RefInfo(object_type='dcim.powerfeed', field_name='object', is_generic=True), - 'objectPowerOutlet': RefInfo(object_type='dcim.poweroutlet', field_name='object', is_generic=True), - 'objectPowerPanel': RefInfo(object_type='dcim.powerpanel', field_name='object', is_generic=True), - 'objectPowerPort': RefInfo(object_type='dcim.powerport', field_name='object', is_generic=True), - 'objectPrefix': RefInfo(object_type='ipam.prefix', field_name='object', is_generic=True), - 'objectProvider': RefInfo(object_type='circuits.provider', field_name='object', is_generic=True), - 'objectProviderAccount': RefInfo(object_type='circuits.provideraccount', field_name='object', is_generic=True), - 'objectProviderNetwork': RefInfo(object_type='circuits.providernetwork', field_name='object', is_generic=True), - 'objectRir': RefInfo(object_type='ipam.rir', field_name='object', is_generic=True), - 'objectRack': RefInfo(object_type='dcim.rack', field_name='object', is_generic=True), - 'objectRackReservation': RefInfo(object_type='dcim.rackreservation', field_name='object', is_generic=True), - 'objectRackRole': RefInfo(object_type='dcim.rackrole', field_name='object', is_generic=True), - 'objectRackType': RefInfo(object_type='dcim.racktype', field_name='object', is_generic=True), - 'objectRearPort': RefInfo(object_type='dcim.rearport', field_name='object', is_generic=True), - 'objectRegion': RefInfo(object_type='dcim.region', field_name='object', is_generic=True), - 'objectRole': RefInfo(object_type='ipam.role', field_name='object', is_generic=True), - 'objectRouteTarget': RefInfo(object_type='ipam.routetarget', field_name='object', is_generic=True), - 'objectService': RefInfo(object_type='ipam.service', field_name='object', is_generic=True), - 'objectSite': RefInfo(object_type='dcim.site', field_name='object', is_generic=True), - 'objectSiteGroup': RefInfo(object_type='dcim.sitegroup', field_name='object', is_generic=True), - 'objectTag': RefInfo(object_type='extras.tag', field_name='object', is_generic=True), - 'objectTenant': RefInfo(object_type='tenancy.tenant', field_name='object', is_generic=True), - 'objectTenantGroup': RefInfo(object_type='tenancy.tenantgroup', field_name='object', is_generic=True), - 'objectTunnel': RefInfo(object_type='vpn.tunnel', field_name='object', is_generic=True), - 'objectTunnelGroup': RefInfo(object_type='vpn.tunnelgroup', field_name='object', is_generic=True), - 'objectTunnelTermination': RefInfo(object_type='vpn.tunneltermination', field_name='object', is_generic=True), - 'objectVlan': RefInfo(object_type='ipam.vlan', field_name='object', is_generic=True), - 'objectVlanGroup': RefInfo(object_type='ipam.vlangroup', field_name='object', is_generic=True), - 'objectVlanTranslationPolicy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='object', is_generic=True), - 'objectVlanTranslationRule': RefInfo(object_type='ipam.vlantranslationrule', field_name='object', is_generic=True), - 'objectVmInterface': RefInfo(object_type='virtualization.vminterface', field_name='object', is_generic=True), - 'objectVrf': RefInfo(object_type='ipam.vrf', field_name='object', is_generic=True), - 'objectVirtualChassis': RefInfo(object_type='dcim.virtualchassis', field_name='object', is_generic=True), - 'objectVirtualCircuit': RefInfo(object_type='circuits.virtualcircuit', field_name='object', is_generic=True), - 'objectVirtualCircuitTermination': RefInfo(object_type='circuits.virtualcircuittermination', field_name='object', is_generic=True), - 'objectVirtualCircuitType': RefInfo(object_type='circuits.virtualcircuittype', field_name='object', is_generic=True), - 'objectVirtualDeviceContext': RefInfo(object_type='dcim.virtualdevicecontext', field_name='object', is_generic=True), - 'objectVirtualDisk': RefInfo(object_type='virtualization.virtualdisk', field_name='object', is_generic=True), - 'objectVirtualMachine': RefInfo(object_type='virtualization.virtualmachine', field_name='object', is_generic=True), - 'objectWirelessLan': RefInfo(object_type='wireless.wirelesslan', field_name='object', is_generic=True), - 'objectWirelessLanGroup': RefInfo(object_type='wireless.wirelesslangroup', field_name='object', is_generic=True), - 'objectWirelessLink': RefInfo(object_type='wireless.wirelesslink', field_name='object', is_generic=True), + 'object_asn': RefInfo(object_type='ipam.asn', field_name='object', is_generic=True), + 'object_asn_range': RefInfo(object_type='ipam.asnrange', field_name='object', is_generic=True), + 'object_aggregate': RefInfo(object_type='ipam.aggregate', field_name='object', is_generic=True), + 'object_cable': RefInfo(object_type='dcim.cable', field_name='object', is_generic=True), + 'object_cable_path': RefInfo(object_type='dcim.cablepath', field_name='object', is_generic=True), + 'object_cable_termination': RefInfo(object_type='dcim.cabletermination', field_name='object', is_generic=True), + 'object_circuit': RefInfo(object_type='circuits.circuit', field_name='object', is_generic=True), + 'object_circuit_group': RefInfo(object_type='circuits.circuitgroup', field_name='object', is_generic=True), + 'object_circuit_group_assignment': RefInfo(object_type='circuits.circuitgroupassignment', field_name='object', is_generic=True), + 'object_circuit_termination': RefInfo(object_type='circuits.circuittermination', field_name='object', is_generic=True), + 'object_circuit_type': RefInfo(object_type='circuits.circuittype', field_name='object', is_generic=True), + 'object_cluster': RefInfo(object_type='virtualization.cluster', field_name='object', is_generic=True), + 'object_cluster_group': RefInfo(object_type='virtualization.clustergroup', field_name='object', is_generic=True), + 'object_cluster_type': RefInfo(object_type='virtualization.clustertype', field_name='object', is_generic=True), + 'object_console_port': RefInfo(object_type='dcim.consoleport', field_name='object', is_generic=True), + 'object_console_server_port': RefInfo(object_type='dcim.consoleserverport', field_name='object', is_generic=True), + 'object_contact': RefInfo(object_type='tenancy.contact', field_name='object', is_generic=True), + 'object_contact_assignment': RefInfo(object_type='tenancy.contactassignment', field_name='object', is_generic=True), + 'object_contact_group': RefInfo(object_type='tenancy.contactgroup', field_name='object', is_generic=True), + 'object_contact_role': RefInfo(object_type='tenancy.contactrole', field_name='object', is_generic=True), + 'object_device': RefInfo(object_type='dcim.device', field_name='object', is_generic=True), + 'object_device_bay': RefInfo(object_type='dcim.devicebay', field_name='object', is_generic=True), + 'object_device_role': RefInfo(object_type='dcim.devicerole', field_name='object', is_generic=True), + 'object_device_type': RefInfo(object_type='dcim.devicetype', field_name='object', is_generic=True), + 'object_fhrp_group': RefInfo(object_type='ipam.fhrpgroup', field_name='object', is_generic=True), + 'object_fhrp_group_assignment': RefInfo(object_type='ipam.fhrpgroupassignment', field_name='object', is_generic=True), + 'object_front_port': RefInfo(object_type='dcim.frontport', field_name='object', is_generic=True), + 'object_ike_policy': RefInfo(object_type='vpn.ikepolicy', field_name='object', is_generic=True), + 'object_ike_proposal': RefInfo(object_type='vpn.ikeproposal', field_name='object', is_generic=True), + 'object_ip_address': RefInfo(object_type='ipam.ipaddress', field_name='object', is_generic=True), + 'object_ip_range': RefInfo(object_type='ipam.iprange', field_name='object', is_generic=True), + 'object_ip_sec_policy': RefInfo(object_type='vpn.ipsecpolicy', field_name='object', is_generic=True), + 'object_ip_sec_profile': RefInfo(object_type='vpn.ipsecprofile', field_name='object', is_generic=True), + 'object_ip_sec_proposal': RefInfo(object_type='vpn.ipsecproposal', field_name='object', is_generic=True), + 'object_interface': RefInfo(object_type='dcim.interface', field_name='object', is_generic=True), + 'object_inventory_item': RefInfo(object_type='dcim.inventoryitem', field_name='object', is_generic=True), + 'object_inventory_item_role': RefInfo(object_type='dcim.inventoryitemrole', field_name='object', is_generic=True), + 'object_l2vpn': RefInfo(object_type='vpn.l2vpn', field_name='object', is_generic=True), + 'object_l2vpn_termination': RefInfo(object_type='vpn.l2vpntermination', field_name='object', is_generic=True), + 'object_location': RefInfo(object_type='dcim.location', field_name='object', is_generic=True), + 'object_mac_address': RefInfo(object_type='dcim.macaddress', field_name='object', is_generic=True), + 'object_manufacturer': RefInfo(object_type='dcim.manufacturer', field_name='object', is_generic=True), + 'object_module': RefInfo(object_type='dcim.module', field_name='object', is_generic=True), + 'object_module_bay': RefInfo(object_type='dcim.modulebay', field_name='object', is_generic=True), + 'object_module_type': RefInfo(object_type='dcim.moduletype', field_name='object', is_generic=True), + 'object_platform': RefInfo(object_type='dcim.platform', field_name='object', is_generic=True), + 'object_power_feed': RefInfo(object_type='dcim.powerfeed', field_name='object', is_generic=True), + 'object_power_outlet': RefInfo(object_type='dcim.poweroutlet', field_name='object', is_generic=True), + 'object_power_panel': RefInfo(object_type='dcim.powerpanel', field_name='object', is_generic=True), + 'object_power_port': RefInfo(object_type='dcim.powerport', field_name='object', is_generic=True), + 'object_prefix': RefInfo(object_type='ipam.prefix', field_name='object', is_generic=True), + 'object_provider': RefInfo(object_type='circuits.provider', field_name='object', is_generic=True), + 'object_provider_account': RefInfo(object_type='circuits.provideraccount', field_name='object', is_generic=True), + 'object_provider_network': RefInfo(object_type='circuits.providernetwork', field_name='object', is_generic=True), + 'object_rir': RefInfo(object_type='ipam.rir', field_name='object', is_generic=True), + 'object_rack': RefInfo(object_type='dcim.rack', field_name='object', is_generic=True), + 'object_rack_reservation': RefInfo(object_type='dcim.rackreservation', field_name='object', is_generic=True), + 'object_rack_role': RefInfo(object_type='dcim.rackrole', field_name='object', is_generic=True), + 'object_rack_type': RefInfo(object_type='dcim.racktype', field_name='object', is_generic=True), + 'object_rear_port': RefInfo(object_type='dcim.rearport', field_name='object', is_generic=True), + 'object_region': RefInfo(object_type='dcim.region', field_name='object', is_generic=True), + 'object_role': RefInfo(object_type='ipam.role', field_name='object', is_generic=True), + 'object_route_target': RefInfo(object_type='ipam.routetarget', field_name='object', is_generic=True), + 'object_service': RefInfo(object_type='ipam.service', field_name='object', is_generic=True), + 'object_site': RefInfo(object_type='dcim.site', field_name='object', is_generic=True), + 'object_site_group': RefInfo(object_type='dcim.sitegroup', field_name='object', is_generic=True), + 'object_tag': RefInfo(object_type='extras.tag', field_name='object', is_generic=True), + 'object_tenant': RefInfo(object_type='tenancy.tenant', field_name='object', is_generic=True), + 'object_tenant_group': RefInfo(object_type='tenancy.tenantgroup', field_name='object', is_generic=True), + 'object_tunnel': RefInfo(object_type='vpn.tunnel', field_name='object', is_generic=True), + 'object_tunnel_group': RefInfo(object_type='vpn.tunnelgroup', field_name='object', is_generic=True), + 'object_tunnel_termination': RefInfo(object_type='vpn.tunneltermination', field_name='object', is_generic=True), + 'object_vlan': RefInfo(object_type='ipam.vlan', field_name='object', is_generic=True), + 'object_vlan_group': RefInfo(object_type='ipam.vlangroup', field_name='object', is_generic=True), + 'object_vlan_translation_policy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='object', is_generic=True), + 'object_vlan_translation_rule': RefInfo(object_type='ipam.vlantranslationrule', field_name='object', is_generic=True), + 'object_vm_interface': RefInfo(object_type='virtualization.vminterface', field_name='object', is_generic=True), + 'object_vrf': RefInfo(object_type='ipam.vrf', field_name='object', is_generic=True), + 'object_virtual_chassis': RefInfo(object_type='dcim.virtualchassis', field_name='object', is_generic=True), + 'object_virtual_circuit': RefInfo(object_type='circuits.virtualcircuit', field_name='object', is_generic=True), + 'object_virtual_circuit_termination': RefInfo(object_type='circuits.virtualcircuittermination', field_name='object', is_generic=True), + 'object_virtual_circuit_type': RefInfo(object_type='circuits.virtualcircuittype', field_name='object', is_generic=True), + 'object_virtual_device_context': RefInfo(object_type='dcim.virtualdevicecontext', field_name='object', is_generic=True), + 'object_virtual_disk': RefInfo(object_type='virtualization.virtualdisk', field_name='object', is_generic=True), + 'object_virtual_machine': RefInfo(object_type='virtualization.virtualmachine', field_name='object', is_generic=True), + 'object_wireless_lan': RefInfo(object_type='wireless.wirelesslan', field_name='object', is_generic=True), + 'object_wireless_lan_group': RefInfo(object_type='wireless.wirelesslangroup', field_name='object', is_generic=True), + 'object_wireless_link': RefInfo(object_type='wireless.wirelesslink', field_name='object', is_generic=True), 'role': RefInfo(object_type='tenancy.contactrole', field_name='role'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, @@ -682,10 +682,10 @@ class RefInfo: }, 'virtualization.cluster': { 'group': RefInfo(object_type='virtualization.clustergroup', field_name='group'), - 'scopeLocation': RefInfo(object_type='dcim.location', field_name='scope', is_generic=True), - 'scopeRegion': RefInfo(object_type='dcim.region', field_name='scope', is_generic=True), - 'scopeSite': RefInfo(object_type='dcim.site', field_name='scope', is_generic=True), - 'scopeSiteGroup': RefInfo(object_type='dcim.sitegroup', field_name='scope', is_generic=True), + 'scope_location': RefInfo(object_type='dcim.location', field_name='scope', is_generic=True), + 'scope_region': RefInfo(object_type='dcim.region', field_name='scope', is_generic=True), + 'scope_site': RefInfo(object_type='dcim.site', field_name='scope', is_generic=True), + 'scope_site_group': RefInfo(object_type='dcim.sitegroup', field_name='scope', is_generic=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), 'type': RefInfo(object_type='virtualization.clustertype', field_name='type'), @@ -698,14 +698,14 @@ class RefInfo: }, 'virtualization.virtualdisk': { 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), - 'virtualMachine': RefInfo(object_type='virtualization.virtualmachine', field_name='virtual_machine'), + 'virtual_machine': RefInfo(object_type='virtualization.virtualmachine', field_name='virtual_machine'), }, 'virtualization.virtualmachine': { 'cluster': RefInfo(object_type='virtualization.cluster', field_name='cluster'), 'device': RefInfo(object_type='dcim.device', field_name='device'), 'platform': RefInfo(object_type='dcim.platform', field_name='platform'), - 'primaryIp4': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip4'), - 'primaryIp6': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip6'), + 'primary_ip4': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip4'), + 'primary_ip6': RefInfo(object_type='ipam.ipaddress', field_name='primary_ip6'), 'role': RefInfo(object_type='dcim.devicerole', field_name='role'), 'site': RefInfo(object_type='dcim.site', field_name='site'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), @@ -714,13 +714,13 @@ class RefInfo: 'virtualization.vminterface': { 'bridge': RefInfo(object_type='virtualization.vminterface', field_name='bridge'), 'parent': RefInfo(object_type='virtualization.vminterface', field_name='parent'), - 'primaryMacAddress': RefInfo(object_type='dcim.macaddress', field_name='primary_mac_address'), - 'qinqSvlan': RefInfo(object_type='ipam.vlan', field_name='qinq_svlan'), - 'taggedVlans': RefInfo(object_type='ipam.vlan', field_name='tagged_vlans', is_many=True), + 'primary_mac_address': RefInfo(object_type='dcim.macaddress', field_name='primary_mac_address'), + 'qinq_svlan': RefInfo(object_type='ipam.vlan', field_name='qinq_svlan'), + 'tagged_vlans': RefInfo(object_type='ipam.vlan', field_name='tagged_vlans', is_many=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), - 'untaggedVlan': RefInfo(object_type='ipam.vlan', field_name='untagged_vlan'), - 'virtualMachine': RefInfo(object_type='virtualization.virtualmachine', field_name='virtual_machine'), - 'vlanTranslationPolicy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='vlan_translation_policy'), + 'untagged_vlan': RefInfo(object_type='ipam.vlan', field_name='untagged_vlan'), + 'virtual_machine': RefInfo(object_type='virtualization.virtualmachine', field_name='virtual_machine'), + 'vlan_translation_policy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='vlan_translation_policy'), 'vrf': RefInfo(object_type='ipam.vrf', field_name='vrf'), }, 'vpn.ikepolicy': { @@ -735,29 +735,29 @@ class RefInfo: 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'vpn.ipsecprofile': { - 'ikePolicy': RefInfo(object_type='vpn.ikepolicy', field_name='ike_policy'), - 'ipsecPolicy': RefInfo(object_type='vpn.ipsecpolicy', field_name='ipsec_policy'), + 'ike_policy': RefInfo(object_type='vpn.ikepolicy', field_name='ike_policy'), + 'ipsec_policy': RefInfo(object_type='vpn.ipsecpolicy', field_name='ipsec_policy'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'vpn.ipsecproposal': { 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'vpn.l2vpn': { - 'exportTargets': RefInfo(object_type='ipam.routetarget', field_name='export_targets', is_many=True), - 'importTargets': RefInfo(object_type='ipam.routetarget', field_name='import_targets', is_many=True), + 'export_targets': RefInfo(object_type='ipam.routetarget', field_name='export_targets', is_many=True), + 'import_targets': RefInfo(object_type='ipam.routetarget', field_name='import_targets', is_many=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), }, 'vpn.l2vpntermination': { - 'assignedObjectInterface': RefInfo(object_type='dcim.interface', field_name='assigned_object', is_generic=True), - 'assignedObjectVlan': RefInfo(object_type='ipam.vlan', field_name='assigned_object', is_generic=True), - 'assignedObjectVmInterface': RefInfo(object_type='virtualization.vminterface', field_name='assigned_object', is_generic=True), - 'l2Vpn': RefInfo(object_type='vpn.l2vpn', field_name='l2vpn'), + 'assigned_object_interface': RefInfo(object_type='dcim.interface', field_name='assigned_object', is_generic=True), + 'assigned_object_vlan': RefInfo(object_type='ipam.vlan', field_name='assigned_object', is_generic=True), + 'assigned_object_vm_interface': RefInfo(object_type='virtualization.vminterface', field_name='assigned_object', is_generic=True), + 'l2vpn': RefInfo(object_type='vpn.l2vpn', field_name='l2vpn'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'vpn.tunnel': { 'group': RefInfo(object_type='vpn.tunnelgroup', field_name='group'), - 'ipsecProfile': RefInfo(object_type='vpn.ipsecprofile', field_name='ipsec_profile'), + 'ipsec_profile': RefInfo(object_type='vpn.ipsecprofile', field_name='ipsec_profile'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), }, @@ -765,104 +765,104 @@ class RefInfo: 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'vpn.tunneltermination': { - 'outsideIp': RefInfo(object_type='ipam.ipaddress', field_name='outside_ip'), - 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), - 'terminationAsn': RefInfo(object_type='ipam.asn', field_name='termination', is_generic=True), - 'terminationAsnRange': RefInfo(object_type='ipam.asnrange', field_name='termination', is_generic=True), - 'terminationAggregate': RefInfo(object_type='ipam.aggregate', field_name='termination', is_generic=True), - 'terminationCable': RefInfo(object_type='dcim.cable', field_name='termination', is_generic=True), - 'terminationCablePath': RefInfo(object_type='dcim.cablepath', field_name='termination', is_generic=True), - 'terminationCableTermination': RefInfo(object_type='dcim.cabletermination', field_name='termination', is_generic=True), - 'terminationCircuit': RefInfo(object_type='circuits.circuit', field_name='termination', is_generic=True), - 'terminationCircuitGroup': RefInfo(object_type='circuits.circuitgroup', field_name='termination', is_generic=True), - 'terminationCircuitGroupAssignment': RefInfo(object_type='circuits.circuitgroupassignment', field_name='termination', is_generic=True), - 'terminationCircuitTermination': RefInfo(object_type='circuits.circuittermination', field_name='termination', is_generic=True), - 'terminationCircuitType': RefInfo(object_type='circuits.circuittype', field_name='termination', is_generic=True), - 'terminationCluster': RefInfo(object_type='virtualization.cluster', field_name='termination', is_generic=True), - 'terminationClusterGroup': RefInfo(object_type='virtualization.clustergroup', field_name='termination', is_generic=True), - 'terminationClusterType': RefInfo(object_type='virtualization.clustertype', field_name='termination', is_generic=True), - 'terminationConsolePort': RefInfo(object_type='dcim.consoleport', field_name='termination', is_generic=True), - 'terminationConsoleServerPort': RefInfo(object_type='dcim.consoleserverport', field_name='termination', is_generic=True), - 'terminationContact': RefInfo(object_type='tenancy.contact', field_name='termination', is_generic=True), - 'terminationContactAssignment': RefInfo(object_type='tenancy.contactassignment', field_name='termination', is_generic=True), - 'terminationContactGroup': RefInfo(object_type='tenancy.contactgroup', field_name='termination', is_generic=True), - 'terminationContactRole': RefInfo(object_type='tenancy.contactrole', field_name='termination', is_generic=True), - 'terminationDevice': RefInfo(object_type='dcim.device', field_name='termination', is_generic=True), - 'terminationDeviceBay': RefInfo(object_type='dcim.devicebay', field_name='termination', is_generic=True), - 'terminationDeviceRole': RefInfo(object_type='dcim.devicerole', field_name='termination', is_generic=True), - 'terminationDeviceType': RefInfo(object_type='dcim.devicetype', field_name='termination', is_generic=True), - 'terminationFhrpGroup': RefInfo(object_type='ipam.fhrpgroup', field_name='termination', is_generic=True), - 'terminationFhrpGroupAssignment': RefInfo(object_type='ipam.fhrpgroupassignment', field_name='termination', is_generic=True), - 'terminationFrontPort': RefInfo(object_type='dcim.frontport', field_name='termination', is_generic=True), - 'terminationIkePolicy': RefInfo(object_type='vpn.ikepolicy', field_name='termination', is_generic=True), - 'terminationIkeProposal': RefInfo(object_type='vpn.ikeproposal', field_name='termination', is_generic=True), - 'terminationIpAddress': RefInfo(object_type='ipam.ipaddress', field_name='termination', is_generic=True), - 'terminationIpRange': RefInfo(object_type='ipam.iprange', field_name='termination', is_generic=True), - 'terminationIpSecPolicy': RefInfo(object_type='vpn.ipsecpolicy', field_name='termination', is_generic=True), - 'terminationIpSecProfile': RefInfo(object_type='vpn.ipsecprofile', field_name='termination', is_generic=True), - 'terminationIpSecProposal': RefInfo(object_type='vpn.ipsecproposal', field_name='termination', is_generic=True), - 'terminationInterface': RefInfo(object_type='dcim.interface', field_name='termination', is_generic=True), - 'terminationInventoryItem': RefInfo(object_type='dcim.inventoryitem', field_name='termination', is_generic=True), - 'terminationInventoryItemRole': RefInfo(object_type='dcim.inventoryitemrole', field_name='termination', is_generic=True), - 'terminationL2Vpn': RefInfo(object_type='vpn.l2vpn', field_name='termination', is_generic=True), - 'terminationL2VpnTermination': RefInfo(object_type='vpn.l2vpntermination', field_name='termination', is_generic=True), - 'terminationLocation': RefInfo(object_type='dcim.location', field_name='termination', is_generic=True), - 'terminationMacAddress': RefInfo(object_type='dcim.macaddress', field_name='termination', is_generic=True), - 'terminationManufacturer': RefInfo(object_type='dcim.manufacturer', field_name='termination', is_generic=True), - 'terminationModule': RefInfo(object_type='dcim.module', field_name='termination', is_generic=True), - 'terminationModuleBay': RefInfo(object_type='dcim.modulebay', field_name='termination', is_generic=True), - 'terminationModuleType': RefInfo(object_type='dcim.moduletype', field_name='termination', is_generic=True), - 'terminationPlatform': RefInfo(object_type='dcim.platform', field_name='termination', is_generic=True), - 'terminationPowerFeed': RefInfo(object_type='dcim.powerfeed', field_name='termination', is_generic=True), - 'terminationPowerOutlet': RefInfo(object_type='dcim.poweroutlet', field_name='termination', is_generic=True), - 'terminationPowerPanel': RefInfo(object_type='dcim.powerpanel', field_name='termination', is_generic=True), - 'terminationPowerPort': RefInfo(object_type='dcim.powerport', field_name='termination', is_generic=True), - 'terminationPrefix': RefInfo(object_type='ipam.prefix', field_name='termination', is_generic=True), - 'terminationProvider': RefInfo(object_type='circuits.provider', field_name='termination', is_generic=True), - 'terminationProviderAccount': RefInfo(object_type='circuits.provideraccount', field_name='termination', is_generic=True), - 'terminationProviderNetwork': RefInfo(object_type='circuits.providernetwork', field_name='termination', is_generic=True), - 'terminationRir': RefInfo(object_type='ipam.rir', field_name='termination', is_generic=True), - 'terminationRack': RefInfo(object_type='dcim.rack', field_name='termination', is_generic=True), - 'terminationRackReservation': RefInfo(object_type='dcim.rackreservation', field_name='termination', is_generic=True), - 'terminationRackRole': RefInfo(object_type='dcim.rackrole', field_name='termination', is_generic=True), - 'terminationRackType': RefInfo(object_type='dcim.racktype', field_name='termination', is_generic=True), - 'terminationRearPort': RefInfo(object_type='dcim.rearport', field_name='termination', is_generic=True), - 'terminationRegion': RefInfo(object_type='dcim.region', field_name='termination', is_generic=True), - 'terminationRole': RefInfo(object_type='ipam.role', field_name='termination', is_generic=True), - 'terminationRouteTarget': RefInfo(object_type='ipam.routetarget', field_name='termination', is_generic=True), - 'terminationService': RefInfo(object_type='ipam.service', field_name='termination', is_generic=True), - 'terminationSite': RefInfo(object_type='dcim.site', field_name='termination', is_generic=True), - 'terminationSiteGroup': RefInfo(object_type='dcim.sitegroup', field_name='termination', is_generic=True), - 'terminationTag': RefInfo(object_type='extras.tag', field_name='termination', is_generic=True), - 'terminationTenant': RefInfo(object_type='tenancy.tenant', field_name='termination', is_generic=True), - 'terminationTenantGroup': RefInfo(object_type='tenancy.tenantgroup', field_name='termination', is_generic=True), - 'terminationTunnel': RefInfo(object_type='vpn.tunnel', field_name='termination', is_generic=True), - 'terminationTunnelGroup': RefInfo(object_type='vpn.tunnelgroup', field_name='termination', is_generic=True), - 'terminationTunnelTermination': RefInfo(object_type='vpn.tunneltermination', field_name='termination', is_generic=True), - 'terminationVlan': RefInfo(object_type='ipam.vlan', field_name='termination', is_generic=True), - 'terminationVlanGroup': RefInfo(object_type='ipam.vlangroup', field_name='termination', is_generic=True), - 'terminationVlanTranslationPolicy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='termination', is_generic=True), - 'terminationVlanTranslationRule': RefInfo(object_type='ipam.vlantranslationrule', field_name='termination', is_generic=True), - 'terminationVmInterface': RefInfo(object_type='virtualization.vminterface', field_name='termination', is_generic=True), - 'terminationVrf': RefInfo(object_type='ipam.vrf', field_name='termination', is_generic=True), - 'terminationVirtualChassis': RefInfo(object_type='dcim.virtualchassis', field_name='termination', is_generic=True), - 'terminationVirtualCircuit': RefInfo(object_type='circuits.virtualcircuit', field_name='termination', is_generic=True), - 'terminationVirtualCircuitTermination': RefInfo(object_type='circuits.virtualcircuittermination', field_name='termination', is_generic=True), - 'terminationVirtualCircuitType': RefInfo(object_type='circuits.virtualcircuittype', field_name='termination', is_generic=True), - 'terminationVirtualDeviceContext': RefInfo(object_type='dcim.virtualdevicecontext', field_name='termination', is_generic=True), - 'terminationVirtualDisk': RefInfo(object_type='virtualization.virtualdisk', field_name='termination', is_generic=True), - 'terminationVirtualMachine': RefInfo(object_type='virtualization.virtualmachine', field_name='termination', is_generic=True), - 'terminationWirelessLan': RefInfo(object_type='wireless.wirelesslan', field_name='termination', is_generic=True), - 'terminationWirelessLanGroup': RefInfo(object_type='wireless.wirelesslangroup', field_name='termination', is_generic=True), - 'terminationWirelessLink': RefInfo(object_type='wireless.wirelesslink', field_name='termination', is_generic=True), + 'outside_ip': RefInfo(object_type='ipam.ipaddress', field_name='outside_ip'), + 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), + 'termination_asn': RefInfo(object_type='ipam.asn', field_name='termination', is_generic=True), + 'termination_asn_range': RefInfo(object_type='ipam.asnrange', field_name='termination', is_generic=True), + 'termination_aggregate': RefInfo(object_type='ipam.aggregate', field_name='termination', is_generic=True), + 'termination_cable': RefInfo(object_type='dcim.cable', field_name='termination', is_generic=True), + 'termination_cable_path': RefInfo(object_type='dcim.cablepath', field_name='termination', is_generic=True), + 'termination_cable_termination': RefInfo(object_type='dcim.cabletermination', field_name='termination', is_generic=True), + 'termination_circuit': RefInfo(object_type='circuits.circuit', field_name='termination', is_generic=True), + 'termination_circuit_group': RefInfo(object_type='circuits.circuitgroup', field_name='termination', is_generic=True), + 'termination_circuit_group_assignment': RefInfo(object_type='circuits.circuitgroupassignment', field_name='termination', is_generic=True), + 'termination_circuit_termination': RefInfo(object_type='circuits.circuittermination', field_name='termination', is_generic=True), + 'termination_circuit_type': RefInfo(object_type='circuits.circuittype', field_name='termination', is_generic=True), + 'termination_cluster': RefInfo(object_type='virtualization.cluster', field_name='termination', is_generic=True), + 'termination_cluster_group': RefInfo(object_type='virtualization.clustergroup', field_name='termination', is_generic=True), + 'termination_cluster_type': RefInfo(object_type='virtualization.clustertype', field_name='termination', is_generic=True), + 'termination_console_port': RefInfo(object_type='dcim.consoleport', field_name='termination', is_generic=True), + 'termination_console_server_port': RefInfo(object_type='dcim.consoleserverport', field_name='termination', is_generic=True), + 'termination_contact': RefInfo(object_type='tenancy.contact', field_name='termination', is_generic=True), + 'termination_contact_assignment': RefInfo(object_type='tenancy.contactassignment', field_name='termination', is_generic=True), + 'termination_contact_group': RefInfo(object_type='tenancy.contactgroup', field_name='termination', is_generic=True), + 'termination_contact_role': RefInfo(object_type='tenancy.contactrole', field_name='termination', is_generic=True), + 'termination_device': RefInfo(object_type='dcim.device', field_name='termination', is_generic=True), + 'termination_device_bay': RefInfo(object_type='dcim.devicebay', field_name='termination', is_generic=True), + 'termination_device_role': RefInfo(object_type='dcim.devicerole', field_name='termination', is_generic=True), + 'termination_device_type': RefInfo(object_type='dcim.devicetype', field_name='termination', is_generic=True), + 'termination_fhrp_group': RefInfo(object_type='ipam.fhrpgroup', field_name='termination', is_generic=True), + 'termination_fhrp_group_assignment': RefInfo(object_type='ipam.fhrpgroupassignment', field_name='termination', is_generic=True), + 'termination_front_port': RefInfo(object_type='dcim.frontport', field_name='termination', is_generic=True), + 'termination_ike_policy': RefInfo(object_type='vpn.ikepolicy', field_name='termination', is_generic=True), + 'termination_ike_proposal': RefInfo(object_type='vpn.ikeproposal', field_name='termination', is_generic=True), + 'termination_ip_address': RefInfo(object_type='ipam.ipaddress', field_name='termination', is_generic=True), + 'termination_ip_range': RefInfo(object_type='ipam.iprange', field_name='termination', is_generic=True), + 'termination_ip_sec_policy': RefInfo(object_type='vpn.ipsecpolicy', field_name='termination', is_generic=True), + 'termination_ip_sec_profile': RefInfo(object_type='vpn.ipsecprofile', field_name='termination', is_generic=True), + 'termination_ip_sec_proposal': RefInfo(object_type='vpn.ipsecproposal', field_name='termination', is_generic=True), + 'termination_interface': RefInfo(object_type='dcim.interface', field_name='termination', is_generic=True), + 'termination_inventory_item': RefInfo(object_type='dcim.inventoryitem', field_name='termination', is_generic=True), + 'termination_inventory_item_role': RefInfo(object_type='dcim.inventoryitemrole', field_name='termination', is_generic=True), + 'termination_l2vpn': RefInfo(object_type='vpn.l2vpn', field_name='termination', is_generic=True), + 'termination_l2vpn_termination': RefInfo(object_type='vpn.l2vpntermination', field_name='termination', is_generic=True), + 'termination_location': RefInfo(object_type='dcim.location', field_name='termination', is_generic=True), + 'termination_mac_address': RefInfo(object_type='dcim.macaddress', field_name='termination', is_generic=True), + 'termination_manufacturer': RefInfo(object_type='dcim.manufacturer', field_name='termination', is_generic=True), + 'termination_module': RefInfo(object_type='dcim.module', field_name='termination', is_generic=True), + 'termination_module_bay': RefInfo(object_type='dcim.modulebay', field_name='termination', is_generic=True), + 'termination_module_type': RefInfo(object_type='dcim.moduletype', field_name='termination', is_generic=True), + 'termination_platform': RefInfo(object_type='dcim.platform', field_name='termination', is_generic=True), + 'termination_power_feed': RefInfo(object_type='dcim.powerfeed', field_name='termination', is_generic=True), + 'termination_power_outlet': RefInfo(object_type='dcim.poweroutlet', field_name='termination', is_generic=True), + 'termination_power_panel': RefInfo(object_type='dcim.powerpanel', field_name='termination', is_generic=True), + 'termination_power_port': RefInfo(object_type='dcim.powerport', field_name='termination', is_generic=True), + 'termination_prefix': RefInfo(object_type='ipam.prefix', field_name='termination', is_generic=True), + 'termination_provider': RefInfo(object_type='circuits.provider', field_name='termination', is_generic=True), + 'termination_provider_account': RefInfo(object_type='circuits.provideraccount', field_name='termination', is_generic=True), + 'termination_provider_network': RefInfo(object_type='circuits.providernetwork', field_name='termination', is_generic=True), + 'termination_rir': RefInfo(object_type='ipam.rir', field_name='termination', is_generic=True), + 'termination_rack': RefInfo(object_type='dcim.rack', field_name='termination', is_generic=True), + 'termination_rack_reservation': RefInfo(object_type='dcim.rackreservation', field_name='termination', is_generic=True), + 'termination_rack_role': RefInfo(object_type='dcim.rackrole', field_name='termination', is_generic=True), + 'termination_rack_type': RefInfo(object_type='dcim.racktype', field_name='termination', is_generic=True), + 'termination_rear_port': RefInfo(object_type='dcim.rearport', field_name='termination', is_generic=True), + 'termination_region': RefInfo(object_type='dcim.region', field_name='termination', is_generic=True), + 'termination_role': RefInfo(object_type='ipam.role', field_name='termination', is_generic=True), + 'termination_route_target': RefInfo(object_type='ipam.routetarget', field_name='termination', is_generic=True), + 'termination_service': RefInfo(object_type='ipam.service', field_name='termination', is_generic=True), + 'termination_site': RefInfo(object_type='dcim.site', field_name='termination', is_generic=True), + 'termination_site_group': RefInfo(object_type='dcim.sitegroup', field_name='termination', is_generic=True), + 'termination_tag': RefInfo(object_type='extras.tag', field_name='termination', is_generic=True), + 'termination_tenant': RefInfo(object_type='tenancy.tenant', field_name='termination', is_generic=True), + 'termination_tenant_group': RefInfo(object_type='tenancy.tenantgroup', field_name='termination', is_generic=True), + 'termination_tunnel': RefInfo(object_type='vpn.tunnel', field_name='termination', is_generic=True), + 'termination_tunnel_group': RefInfo(object_type='vpn.tunnelgroup', field_name='termination', is_generic=True), + 'termination_tunnel_termination': RefInfo(object_type='vpn.tunneltermination', field_name='termination', is_generic=True), + 'termination_vlan': RefInfo(object_type='ipam.vlan', field_name='termination', is_generic=True), + 'termination_vlan_group': RefInfo(object_type='ipam.vlangroup', field_name='termination', is_generic=True), + 'termination_vlan_translation_policy': RefInfo(object_type='ipam.vlantranslationpolicy', field_name='termination', is_generic=True), + 'termination_vlan_translation_rule': RefInfo(object_type='ipam.vlantranslationrule', field_name='termination', is_generic=True), + 'termination_vm_interface': RefInfo(object_type='virtualization.vminterface', field_name='termination', is_generic=True), + 'termination_vrf': RefInfo(object_type='ipam.vrf', field_name='termination', is_generic=True), + 'termination_virtual_chassis': RefInfo(object_type='dcim.virtualchassis', field_name='termination', is_generic=True), + 'termination_virtual_circuit': RefInfo(object_type='circuits.virtualcircuit', field_name='termination', is_generic=True), + 'termination_virtual_circuit_termination': RefInfo(object_type='circuits.virtualcircuittermination', field_name='termination', is_generic=True), + 'termination_virtual_circuit_type': RefInfo(object_type='circuits.virtualcircuittype', field_name='termination', is_generic=True), + 'termination_virtual_device_context': RefInfo(object_type='dcim.virtualdevicecontext', field_name='termination', is_generic=True), + 'termination_virtual_disk': RefInfo(object_type='virtualization.virtualdisk', field_name='termination', is_generic=True), + 'termination_virtual_machine': RefInfo(object_type='virtualization.virtualmachine', field_name='termination', is_generic=True), + 'termination_wireless_lan': RefInfo(object_type='wireless.wirelesslan', field_name='termination', is_generic=True), + 'termination_wireless_lan_group': RefInfo(object_type='wireless.wirelesslangroup', field_name='termination', is_generic=True), + 'termination_wireless_link': RefInfo(object_type='wireless.wirelesslink', field_name='termination', is_generic=True), 'tunnel': RefInfo(object_type='vpn.tunnel', field_name='tunnel'), }, 'wireless.wirelesslan': { 'group': RefInfo(object_type='wireless.wirelesslangroup', field_name='group'), - 'scopeLocation': RefInfo(object_type='dcim.location', field_name='scope', is_generic=True), - 'scopeRegion': RefInfo(object_type='dcim.region', field_name='scope', is_generic=True), - 'scopeSite': RefInfo(object_type='dcim.site', field_name='scope', is_generic=True), - 'scopeSiteGroup': RefInfo(object_type='dcim.sitegroup', field_name='scope', is_generic=True), + 'scope_location': RefInfo(object_type='dcim.location', field_name='scope', is_generic=True), + 'scope_region': RefInfo(object_type='dcim.region', field_name='scope', is_generic=True), + 'scope_site': RefInfo(object_type='dcim.site', field_name='scope', is_generic=True), + 'scope_site_group': RefInfo(object_type='dcim.sitegroup', field_name='scope', is_generic=True), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), 'vlan': RefInfo(object_type='ipam.vlan', field_name='vlan'), @@ -872,8 +872,8 @@ class RefInfo: 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), }, 'wireless.wirelesslink': { - 'interfaceA': RefInfo(object_type='dcim.interface', field_name='interface_a'), - 'interfaceB': RefInfo(object_type='dcim.interface', field_name='interface_b'), + 'interface_a': RefInfo(object_type='dcim.interface', field_name='interface_a'), + 'interface_b': RefInfo(object_type='dcim.interface', field_name='interface_b'), 'tags': RefInfo(object_type='extras.tag', field_name='tags', is_many=True), 'tenant': RefInfo(object_type='tenancy.tenant', field_name='tenant'), }, diff --git a/netbox_diode_plugin/api/transformer.py b/netbox_diode_plugin/api/transformer.py index 59949e2..10234f0 100644 --- a/netbox_diode_plugin/api/transformer.py +++ b/netbox_diode_plugin/api/transformer.py @@ -18,7 +18,7 @@ from .common import AutoSlug, ChangeSetException, UnresolvedReference from .matcher import find_existing_object, fingerprint -from .plugin_utils import CUSTOM_FIELD_OBJECT_REFERENCE_TYPE, get_json_ref_info, get_primary_value +from .plugin_utils import CUSTOM_FIELD_OBJECT_REFERENCE_TYPE, get_json_ref_info, get_primary_value, legal_fields logger = logging.getLogger("netbox.diode_data") @@ -28,7 +28,6 @@ def _camel_to_snake_case(name): name = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name) return re.sub("([a-z0-9])([A-Z])", r"\1_\2", name).lower() - # these are implied values pushed down to referenced objects. _NESTED_CONTEXT = { "dcim.interface": { @@ -104,6 +103,9 @@ def _transform_proto_json_1(proto_json: dict, object_type: str, context=None) -> "_refs": set(), } + # handle camelCase protoJSON if provided... + proto_json = _ensure_snake_case(proto_json, object_type) + # context pushed down from parent nodes if context is not None: for k, v in context.items(): @@ -115,7 +117,7 @@ def _transform_proto_json_1(proto_json: dict, object_type: str, context=None) -> post_create = None # special handling for custom fields - custom_fields = dict.pop(proto_json, "customFields", {}) + custom_fields = dict.pop(proto_json, "custom_fields", {}) if custom_fields: custom_fields, custom_fields_refs, nested = _prepare_custom_fields(object_type, custom_fields) node['custom_fields'] = custom_fields @@ -125,7 +127,7 @@ def _transform_proto_json_1(proto_json: dict, object_type: str, context=None) -> for key, value in proto_json.items(): ref_info = get_json_ref_info(object_type, key) if ref_info is None: - node[_camel_to_snake_case(key)] = copy.deepcopy(value) + node[key] = copy.deepcopy(value) continue nested_context = _nested_context(object_type, uuid, ref_info.field_name) @@ -181,6 +183,22 @@ def _transform_proto_json_1(proto_json: dict, object_type: str, context=None) -> return nodes +def _ensure_snake_case(proto_json: dict, object_type: str) -> dict: + fields = legal_fields(object_type) + out = {} + for k, v in proto_json.items(): + if k in fields or get_json_ref_info(object_type, k): + out[k] = v + continue + snake_key = _camel_to_snake_case(k) + if snake_key in fields or get_json_ref_info(object_type, snake_key): + out[snake_key] = v + else: + # error? + logger.warning(f"Unknown field {k}/{snake_key} is not legal for {object_type}, skipping...") + return out + + def _topo_sort(entities: list[dict]) -> list[dict]: """Topologically sort entities by reference.""" by_uuid = {e['_uuid']: e for e in entities} diff --git a/netbox_diode_plugin/api/views.py b/netbox_diode_plugin/api/views.py index ce5c879..d286175 100644 --- a/netbox_diode_plugin/api/views.py +++ b/netbox_diode_plugin/api/views.py @@ -30,13 +30,19 @@ ) -def get_entity_key(model_name): - """Get the entity key for a model name.""" +def get_valid_entity_keys(model_name): + """ + Get the valid entity keys for a model name. + + This can be snake or lowerCamel case (both are valid for protoJSON) + """ s = re.sub(r'([A-Z0-9]{2,})([A-Z])([a-z])', r'\1_\2\3', model_name) s = re.sub(r'([a-z])([A-Z])', r'\1_\2', s) - s = re.sub(r'_+', '_', s.lower()) # snake - s = ''.join([word.capitalize() for word in s.split("_")]) # upperCamelCase - return s[0].lower() + s[1:] # lowerCamelCase + snake = re.sub(r'_+', '_', s.lower()) # snake + upperCamel = ''.join([word.capitalize() for word in snake.split("_")]) # upperCamelCase + lowerCamel = upperCamel[0].lower() + upperCamel[1:] # lowerCamelCase + + return (snake, lowerCamel) class GenerateDiffView(views.APIView): @@ -65,9 +71,10 @@ def _post(self, request, *args, **kwargs): app_label, model_name = object_type.split(".") model_class = apps.get_model(app_label, model_name) - # Convert model name to lowerCamelCase for entity lookup - entity_key = get_entity_key(model_class.__name__) - original_entity_data = entity.get(entity_key) + for entity_key in get_valid_entity_keys(model_class.__name__): + original_entity_data = entity.get(entity_key) + if original_entity_data: + break if original_entity_data is None: raise ValidationError( diff --git a/netbox_diode_plugin/tests/test_api_diff_and_apply.py b/netbox_diode_plugin/tests/test_api_diff_and_apply.py index a0814cb..6303735 100644 --- a/netbox_diode_plugin/tests/test_api_diff_and_apply.py +++ b/netbox_diode_plugin/tests/test_api_diff_and_apply.py @@ -89,7 +89,7 @@ def test_generate_diff_and_apply_create_interface_with_tags(self): "type": "1000base-t", "device": { "name": f"Device {uuid4()}", - "deviceType": { + "device_type": { "model": f"Device Type {uuid4()}", "manufacturer": { "name": f"Manufacturer {uuid4()}" @@ -125,7 +125,7 @@ def test_generate_diff_and_apply_create_and_update_device_role(self): "entity": { "device": { "name": f"Device {device_uuid}", - "deviceType": { + "device_type": { "model": f"Device Type {uuid4()}", "manufacturer": { "name": f"Manufacturer {uuid4()}" @@ -298,14 +298,14 @@ def test_generate_diff_and_apply_create_interface_with_primay_mac_address(self): "site": { "Name": f"Site {uuid4()}", }, - "deviceType": { + "device_type": { "manufacturer": { "Name": f"Manufacturer {uuid4()}", }, "model": f"Device Type {uuid4()}", }, }, - "primaryMacAddress": { + "primary_mac_address": { "mac_address": "00:00:00:00:00:01", }, }, @@ -316,8 +316,8 @@ def test_generate_diff_and_apply_create_interface_with_primay_mac_address(self): new_interface = Interface.objects.get(name=f"Interface {interface_uuid}") self.assertEqual(new_interface.primary_mac_address.mac_address, "00:00:00:00:00:01") - def test_generate_diff_and_apply_create_device_with_primary_ip4(self): - """Test generate diff and apply create device with primary ip4.""" + def test_generate_diff_and_apply_create_device_with_primary_ip4_camel_case(self): + """Test generate diff and apply create device with primary ip4 (camel case).""" device_uuid = str(uuid4()) interface_uuid = str(uuid4()) addr = "192.168.1.1" @@ -359,6 +359,49 @@ def test_generate_diff_and_apply_create_device_with_primary_ip4(self): device = Device.objects.get(name=f"Device {device_uuid}") self.assertEqual(device.primary_ip4.pk, new_ipaddress.pk) + def test_generate_diff_and_apply_create_device_with_primary_ip4(self): + """Test generate diff and apply create device with primary ip4.""" + device_uuid = str(uuid4()) + interface_uuid = str(uuid4()) + addr = "192.168.1.1" + payload = { + "timestamp": 1, + "object_type": "ipam.ipaddress", + "entity": { + "ip_address": { + "address": addr, + "assigned_object_interface": { + "name": f"Interface {interface_uuid}", + "type": "1000base-t", + "device": { + "name": f"Device {device_uuid}", + "role": { + "name": f"Role {uuid4()}", + }, + "site": { + "name": f"Site {uuid4()}", + }, + "device_type": { + "manufacturer": { + "name": f"Manufacturer {uuid4()}", + }, + "model": f"Device Type {uuid4()}", + }, + "primary_ip4": { + "address": addr, + }, + }, + }, + }, + }, + } + + _, response = self.diff_and_apply(payload) + new_ipaddress = IPAddress.objects.get(address=addr) + self.assertEqual(new_ipaddress.assigned_object.name, f"Interface {interface_uuid}") + device = Device.objects.get(name=f"Device {device_uuid}") + self.assertEqual(device.primary_ip4.pk, new_ipaddress.pk) + def test_generate_diff_and_apply_create_and_update_site_with_custom_field(self): """Test generate diff and apply create and update site with custom field.""" site_uuid = str(uuid4()) @@ -369,7 +412,7 @@ def test_generate_diff_and_apply_create_and_update_site_with_custom_field(self): "site": { "name": "A New Custom Site", "slug": "a-new-custom-site", - "customFields": { + "custom_fields": { "myuuid": { "text": site_uuid, }, @@ -392,7 +435,7 @@ def test_generate_diff_and_apply_create_and_update_site_with_custom_field(self): "entity": { "site": { "comments": "An updated comment", - "customFields": { + "custom_fields": { "myuuid": { "text": site_uuid, }, @@ -422,7 +465,7 @@ def test_generate_diff_and_apply_create_and_update_site_with_custom_field(self): "object_type": "dcim.site", "entity": { "site": { - "customFields": { + "custom_fields": { "myuuid": { "text": site_uuid, }, @@ -449,7 +492,7 @@ def test_generate_diff_and_apply_create_and_update_site_with_custom_field(self): "object_type": "dcim.site", "entity": { "site": { - "customFields": { + "custom_fields": { "myuuid": { "text": site_uuid, }, @@ -479,7 +522,7 @@ def test_generate_diff_wrong_type_date(self): "site": { "name": "Site Generate Diff 1", "slug": "site-generate-diff-1", - "customFields": { + "custom_fields": { "mydate": { "date": 12, }, diff --git a/netbox_diode_plugin/tests/test_api_generate_diff.py b/netbox_diode_plugin/tests/test_api_generate_diff.py index d7b1dd2..0c84fd9 100644 --- a/netbox_diode_plugin/tests/test_api_generate_diff.py +++ b/netbox_diode_plugin/tests/test_api_generate_diff.py @@ -112,7 +112,7 @@ def test_generate_diff_create_site_with_custom_field(self): "site": { "name": "A New Site", "slug": "a-new-site", - "customFields": { + "custom_fields": { "some_json": { "json": '{"some_key": 1234567890}', }, @@ -182,7 +182,7 @@ def test_match_site_by_custom_field(self): # but we expect to match the existing site by the # unique custom field myuuid "comments": "A custom comment", - "customFields": { + "custom_fields": { "myuuid": { "text": self.site_uuid, }, @@ -217,7 +217,7 @@ def test_generate_diff_update_rack_type_autoslug(self): "timestamp": 1, "object_type": "dcim.racktype", "entity": { - "rackType": { + "rack_type": { "model": "Rack Type 1", "form_factor": "wall-frame", }, @@ -246,6 +246,38 @@ def test_generate_diff_update_rack_type_autoslug(self): # correct slug is present in before data self.assertEqual(before.get("slug"), "rack-type-1") + def test_generate_diff_update_rack_type_camel_case(self): + """Test generate diff update rack type with came cased protoJSON.""" + payload = { + "timestamp": 1, + "object_type": "dcim.racktype", + "entity": { + "rackType": { + "slug": "rack-type-1", + "model": "Rack Type 1", + "formFactor": "wall-frame", + }, + } + } + + response = self.send_request(payload) + self.assertEqual(response.status_code, status.HTTP_200_OK) + cs = response.json().get("change_set", {}) + self.assertIsNotNone(cs.get("id")) + changes = cs.get("changes", []) + self.assertEqual(len(changes), 1) + change = changes[0] + self.assertEqual(change.get("object_type"), "dcim.racktype") + self.assertEqual(change.get("change_type"), "update") + self.assertEqual(change.get("object_id"), self.rack_type.id) + self.assertEqual(change.get("ref_id"), None) + + data = change.get("data", {}) + self.assertEqual(data.get("model"), "Rack Type 1") + self.assertEqual(data.get("form_factor"), "wall-frame") + + before = change.get("before", {}) + self.assertEqual(before.get("model"), "Rack Type 1") def send_request(self, payload, status_code=status.HTTP_200_OK): """Post the payload to the url and return the response."""