mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-05 08:57:19 +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.
29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
import strawberry
|
|
import strawberry_django
|
|
|
|
from .types import *
|
|
|
|
|
|
@strawberry.type(name='Query')
|
|
class VirtualizationQuery:
|
|
cluster: ClusterType = strawberry_django.field()
|
|
cluster_list: list[ClusterType] = strawberry_django.field()
|
|
|
|
cluster_group: ClusterGroupType = strawberry_django.field()
|
|
cluster_group_list: list[ClusterGroupType] = strawberry_django.field()
|
|
|
|
cluster_type: ClusterTypeType = strawberry_django.field()
|
|
cluster_type_list: list[ClusterTypeType] = strawberry_django.field()
|
|
|
|
virtual_machine_type: VirtualMachineTypeType = strawberry_django.field()
|
|
virtual_machine_type_list: list[VirtualMachineTypeType] = strawberry_django.field()
|
|
|
|
virtual_machine: VirtualMachineType = strawberry_django.field()
|
|
virtual_machine_list: list[VirtualMachineType] = strawberry_django.field()
|
|
|
|
vm_interface: VMInterfaceType = strawberry_django.field()
|
|
vm_interface_list: list[VMInterfaceType] = strawberry_django.field()
|
|
|
|
virtual_disk: VirtualDiskType = strawberry_django.field()
|
|
virtual_disk_list: list[VirtualDiskType] = strawberry_django.field()
|