Skip to content

Instantly share code, notes, and snippets.

@progala
Created June 27, 2022 12:11
Show Gist options
  • Save progala/a0735ccde8b23e0136797fcd7d9d1203 to your computer and use it in GitHub Desktop.
Save progala/a0735ccde8b23e0136797fcd7d9d1203 to your computer and use it in GitHub Desktop.
Nautobot shell delete objects
models = [
Cable,
ConsolePort,
ConsolePortTemplate,
ConsoleServerPort,
ConsoleServerPortTemplate,
Device,
DeviceBay,
DeviceBayTemplate,
DeviceRole,
DeviceType,
FrontPort,
FrontPortTemplate,
Interface,
InterfaceTemplate,
InventoryItem,
Platform,
PowerFeed,
PowerPanel,
PowerPort,
PowerPortTemplate,
PowerOutlet,
PowerOutletTemplate,
Rack,
RackGroup,
RackReservation,
RackRole,
RearPort,
RearPortTemplate,
Circuit,
CircuitTermination,
CircuitType,
Provider,
Aggregate,
IPAddress,
Prefix,
RIR,
Role,
Service,
VLAN,
VLANGroup,
VRF,
Cluster,
ClusterGroup,
ClusterType,
VirtualMachine,
Site,
Manufacturer,
Tenant,
TenantGroup,
]
for model in models:
model.objects.all().delete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment