|
| 1 | +# Diode Go SDK - Entity Examples |
| 2 | + |
| 3 | +Source: NetBox v4.5.0 |
| 4 | +Generated: 2026-02-13 17:55:35Z |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | + |
| 8 | +- Go 1.25 or later |
| 9 | +- Diode SDK for Go |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +```bash |
| 14 | +go get github.com/netboxlabs/diode-sdk-go@latest |
| 15 | +``` |
| 16 | + |
| 17 | +## Configuration |
| 18 | + |
| 19 | +Each example uses constants for configuration. You can modify these in the example code: |
| 20 | + |
| 21 | +```go |
| 22 | +target = "grpc://localhost:8080/diode" |
| 23 | +appName = "example-app" |
| 24 | +appVersion = "1.0.0" |
| 25 | +``` |
| 26 | + |
| 27 | +## Quick Start |
| 28 | + |
| 29 | +Each entity example is in its own directory with a complete Go module. To run an example: |
| 30 | + |
| 31 | +```bash |
| 32 | +cd examples/device |
| 33 | +go run main.go |
| 34 | +``` |
| 35 | + |
| 36 | +## Example Patterns |
| 37 | + |
| 38 | +Each example includes three patterns: |
| 39 | + |
| 40 | +- **Minimal**: Only required fields |
| 41 | +- **Extended**: Required fields plus common optional fields |
| 42 | +- **Explicit**: Fully nested objects with all common fields |
| 43 | + |
| 44 | +Switch between patterns by uncommenting the desired function call in `main()`. |
| 45 | + |
| 46 | +## Available Entity Examples |
| 47 | + |
| 48 | +### Circuits |
| 49 | + |
| 50 | +- [Circuit](examples/circuit/) |
| 51 | +- [CircuitGroup](examples/circuit_group/) |
| 52 | +- [CircuitGroupAssignment](examples/circuit_group_assignment/) |
| 53 | +- [CircuitTermination](examples/circuit_termination/) |
| 54 | +- [CircuitType](examples/circuit_type/) |
| 55 | +- [Provider](examples/provider/) |
| 56 | +- [ProviderAccount](examples/provider_account/) |
| 57 | +- [ProviderNetwork](examples/provider_network/) |
| 58 | +- [VirtualCircuit](examples/virtual_circuit/) |
| 59 | +- [VirtualCircuitTermination](examples/virtual_circuit_termination/) |
| 60 | +- [VirtualCircuitType](examples/virtual_circuit_type/) |
| 61 | + |
| 62 | +### DCIM |
| 63 | + |
| 64 | +- [Cable](examples/cable/) |
| 65 | +- [CablePath](examples/cable_path/) |
| 66 | +- [CableTermination](examples/cable_termination/) |
| 67 | +- [ConsolePort](examples/console_port/) |
| 68 | +- [ConsoleServerPort](examples/console_server_port/) |
| 69 | +- [Device](examples/device/) |
| 70 | +- [DeviceBay](examples/device_bay/) |
| 71 | +- [DeviceRole](examples/device_role/) |
| 72 | +- [DeviceType](examples/device_type/) |
| 73 | +- [FrontPort](examples/front_port/) |
| 74 | +- [Interface](examples/interface_entity/) |
| 75 | +- [InventoryItem](examples/inventory_item/) |
| 76 | +- [InventoryItemRole](examples/inventory_item_role/) |
| 77 | +- [Location](examples/location/) |
| 78 | +- [Manufacturer](examples/manufacturer/) |
| 79 | +- [Module](examples/module/) |
| 80 | +- [ModuleBay](examples/module_bay/) |
| 81 | +- [ModuleType](examples/module_type/) |
| 82 | +- [ModuleTypeProfile](examples/module_type_profile/) |
| 83 | +- [Platform](examples/platform/) |
| 84 | +- [PowerFeed](examples/power_feed/) |
| 85 | +- [PowerOutlet](examples/power_outlet/) |
| 86 | +- [PowerPanel](examples/power_panel/) |
| 87 | +- [PowerPort](examples/power_port/) |
| 88 | +- [Rack](examples/rack/) |
| 89 | +- [RackReservation](examples/rack_reservation/) |
| 90 | +- [RackRole](examples/rack_role/) |
| 91 | +- [RackType](examples/rack_type/) |
| 92 | +- [RearPort](examples/rear_port/) |
| 93 | +- [Region](examples/region/) |
| 94 | +- [Site](examples/site/) |
| 95 | +- [SiteGroup](examples/site_group/) |
| 96 | +- [VirtualChassis](examples/virtual_chassis/) |
| 97 | +- [VirtualDeviceContext](examples/virtual_device_context/) |
| 98 | + |
| 99 | +### Extras |
| 100 | + |
| 101 | +- [CustomField](examples/custom_field/) |
| 102 | +- [CustomFieldChoiceSet](examples/custom_field_choice_set/) |
| 103 | +- [CustomLink](examples/custom_link/) |
| 104 | +- [JournalEntry](examples/journal_entry/) |
| 105 | +- [Tag](examples/tag/) |
| 106 | + |
| 107 | +### IPAM |
| 108 | + |
| 109 | +- [ASN](examples/asn/) |
| 110 | +- [ASNRange](examples/asn_range/) |
| 111 | +- [Aggregate](examples/aggregate/) |
| 112 | +- [FHRPGroup](examples/fhrp_group/) |
| 113 | +- [FHRPGroupAssignment](examples/fhrp_group_assignment/) |
| 114 | +- [IPAddress](examples/ip_address/) |
| 115 | +- [IPRange](examples/ip_range/) |
| 116 | +- [MACAddress](examples/mac_address/) |
| 117 | +- [Prefix](examples/prefix/) |
| 118 | +- [RIR](examples/rir/) |
| 119 | +- [Role](examples/role/) |
| 120 | +- [RouteTarget](examples/route_target/) |
| 121 | +- [Service](examples/service/) |
| 122 | +- [VLAN](examples/vlan/) |
| 123 | +- [VLANGroup](examples/vlan_group/) |
| 124 | +- [VLANTranslationPolicy](examples/vlan_translation_policy/) |
| 125 | +- [VLANTranslationRule](examples/vlan_translation_rule/) |
| 126 | +- [VRF](examples/vrf/) |
| 127 | + |
| 128 | +### Other |
| 129 | + |
| 130 | +- [DeviceConfig](examples/device_config/) |
| 131 | + |
| 132 | +### Tenancy |
| 133 | + |
| 134 | +- [Contact](examples/contact/) |
| 135 | +- [ContactAssignment](examples/contact_assignment/) |
| 136 | +- [ContactGroup](examples/contact_group/) |
| 137 | +- [ContactRole](examples/contact_role/) |
| 138 | +- [Owner](examples/owner/) |
| 139 | +- [OwnerGroup](examples/owner_group/) |
| 140 | +- [Tenant](examples/tenant/) |
| 141 | +- [TenantGroup](examples/tenant_group/) |
| 142 | + |
| 143 | +### VPN |
| 144 | + |
| 145 | +- [IKEPolicy](examples/ike_policy/) |
| 146 | +- [IKEProposal](examples/ike_proposal/) |
| 147 | +- [IPSecPolicy](examples/ip_sec_policy/) |
| 148 | +- [IPSecProfile](examples/ip_sec_profile/) |
| 149 | +- [IPSecProposal](examples/ip_sec_proposal/) |
| 150 | +- [L2VPN](examples/l2vpn/) |
| 151 | +- [L2VPNTermination](examples/l2vpn_termination/) |
| 152 | +- [Tunnel](examples/tunnel/) |
| 153 | +- [TunnelGroup](examples/tunnel_group/) |
| 154 | +- [TunnelTermination](examples/tunnel_termination/) |
| 155 | + |
| 156 | +### Virtualization |
| 157 | + |
| 158 | +- [Cluster](examples/cluster/) |
| 159 | +- [ClusterGroup](examples/cluster_group/) |
| 160 | +- [ClusterType](examples/cluster_type/) |
| 161 | +- [VMInterface](examples/vm_interface/) |
| 162 | +- [VirtualDisk](examples/virtual_disk/) |
| 163 | +- [VirtualMachine](examples/virtual_machine/) |
| 164 | + |
| 165 | +### Wireless |
| 166 | + |
| 167 | +- [WirelessLAN](examples/wireless_lan/) |
| 168 | +- [WirelessLANGroup](examples/wireless_lan_group/) |
| 169 | +- [WirelessLink](examples/wireless_link/) |
0 commit comments