mirror of
https://github.com/netbox-community/netbox.git
synced 2026-03-30 06:12:13 +02:00
Introduce `VirtualMachineType` to classify virtual machines and apply default platform, vCPU, and memory values when creating a VM. This adds the new model and its relationship to `VirtualMachine`, and wires it through forms, filtersets, tables, views, the REST API, GraphQL, navigation, search, documentation, and tests. Explicit values set on a virtual machine continue to take precedence, and changes to a type do not retroactively update existing VMs.
23 lines
679 B
Python
23 lines
679 B
Python
from netbox.api.routers import NetBoxRouter
|
|
|
|
from . import views
|
|
|
|
router = NetBoxRouter()
|
|
router.APIRootView = views.VirtualizationRootView
|
|
|
|
# Clusters
|
|
router.register('cluster-types', views.ClusterTypeViewSet)
|
|
router.register('cluster-groups', views.ClusterGroupViewSet)
|
|
router.register('clusters', views.ClusterViewSet)
|
|
|
|
# Virtual machine types
|
|
router.register('virtual-machine-types', views.VirtualMachineTypeViewSet)
|
|
|
|
# VirtualMachines
|
|
router.register('virtual-machines', views.VirtualMachineViewSet)
|
|
router.register('interfaces', views.VMInterfaceViewSet)
|
|
router.register('virtual-disks', views.VirtualDiskViewSet)
|
|
|
|
app_name = 'virtualization-api'
|
|
urlpatterns = router.urls
|