mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* 8356 add virtual disk model * 8356 add supplemental forms * 8356 add menu * 8356 cleanup views * 8356 virtual machine tab * 8356 migrations * 8356 vm disk tables * 8356 cleanup * 8356 graphql * 8356 graphql * 8356 add components button * 8356 bulk add on virtualmachine * 8356 bulk add fixes * 8356 api tests * 8356 news tests add rename * 8356 VirtualDiskCreateForm * 8356 fix test * 8356 add todo to remove disk from vm * 8356 review changes * 8356 fix test * 8356 deprecate disk field * 8356 review changes * 8356 fix test * 8356 fix test * Simplify view actions * 8356 review changes * 8356 split trans tag * 8356 add total virtual disk size to api * 8356 add virtual disk list to virtual machine detail view * 8356 move virtual disk size to property * 8356 revert property * Tweak display of deprecated disk field * 8356 render single disk field * 8356 update serializer * 8356 model property * 8356 fix test * 8356 review changes * Revert disk space annotation * Use existing disk field to store aggregate virtual disk size * Introduce abstract ComponentModel for VM components * Add search index for VirtualDisk * Misc cleanup --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
69 lines
1.5 KiB
Python
69 lines
1.5 KiB
Python
from netbox.search import SearchIndex, register_search
|
|
from . import models
|
|
|
|
|
|
@register_search
|
|
class ClusterIndex(SearchIndex):
|
|
model = models.Cluster
|
|
fields = (
|
|
('name', 100),
|
|
('description', 500),
|
|
('comments', 5000),
|
|
)
|
|
display_attrs = ('type', 'group', 'status', 'tenant', 'site', 'description')
|
|
|
|
|
|
@register_search
|
|
class ClusterGroupIndex(SearchIndex):
|
|
model = models.ClusterGroup
|
|
fields = (
|
|
('name', 100),
|
|
('slug', 110),
|
|
('description', 500),
|
|
)
|
|
display_attrs = ('description',)
|
|
|
|
|
|
@register_search
|
|
class ClusterTypeIndex(SearchIndex):
|
|
model = models.ClusterType
|
|
fields = (
|
|
('name', 100),
|
|
('slug', 110),
|
|
('description', 500),
|
|
)
|
|
display_attrs = ('description',)
|
|
|
|
|
|
@register_search
|
|
class VirtualMachineIndex(SearchIndex):
|
|
model = models.VirtualMachine
|
|
fields = (
|
|
('name', 100),
|
|
('description', 500),
|
|
('comments', 5000),
|
|
)
|
|
display_attrs = ('site', 'cluster', 'device', 'tenant', 'platform', 'status', 'role', 'description')
|
|
|
|
|
|
@register_search
|
|
class VMInterfaceIndex(SearchIndex):
|
|
model = models.VMInterface
|
|
fields = (
|
|
('name', 100),
|
|
('mac_address', 300),
|
|
('description', 500),
|
|
('mtu', 2000),
|
|
)
|
|
display_attrs = ('virtual_machine', 'description')
|
|
|
|
|
|
@register_search
|
|
class VirtualDiskIndex(SearchIndex):
|
|
model = models.VirtualDisk
|
|
fields = (
|
|
('name', 100),
|
|
('description', 500),
|
|
)
|
|
display_attrs = ('virtual_machine', 'description')
|