mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-01 07:03:22 +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.
19 lines
517 B
Python
19 lines
517 B
Python
from django.apps import AppConfig
|
|
|
|
|
|
class VirtualizationConfig(AppConfig):
|
|
name = 'virtualization'
|
|
|
|
def ready(self):
|
|
from netbox.models.features import register_models
|
|
from utilities.counters import connect_counters
|
|
|
|
from . import search, signals # noqa: F401
|
|
from .models import VirtualMachine, VirtualMachineType
|
|
|
|
# Register models
|
|
register_models(*self.get_models())
|
|
|
|
# Register counters
|
|
connect_counters(VirtualMachine, VirtualMachineType)
|