-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lungroups -> datastores, vmdk object type added
- Loading branch information
Showing
21 changed files
with
413 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
from netbox.api.viewsets import NetBoxModelViewSet | ||
|
||
from .. import filtersets, models | ||
from .serializers import StoragePoolSerializer, StorageLUNSerializer, StorageSessionSerializer, StorageLUNGroupSerializer | ||
from .serializers import StoragePoolSerializer, LUNSerializer, StorageSessionSerializer, DatastoreSerializer, VMDKSerializer | ||
|
||
|
||
class StoragePoolViewSet(NetBoxModelViewSet): | ||
queryset = models.StoragePool.objects.prefetch_related('device', 'tags') | ||
serializer_class = StoragePoolSerializer | ||
|
||
|
||
class StorageLUNViewSet(NetBoxModelViewSet): | ||
queryset = models.StorageLUN.objects.prefetch_related( | ||
class LUNViewSet(NetBoxModelViewSet): | ||
queryset = models.LUN.objects.prefetch_related( | ||
'storage_pool', 'tags' | ||
) | ||
serializer_class = StorageLUNSerializer | ||
serializer_class = LUNSerializer | ||
|
||
|
||
class StorageLUNGroupViewSet(NetBoxModelViewSet): | ||
queryset = models.StorageLUNGroup.objects.prefetch_related( | ||
'storage_lun', 'tags' | ||
class DatastoreViewSet(NetBoxModelViewSet): | ||
queryset = models.Datastore.objects.prefetch_related( | ||
'lun', 'tags' | ||
) | ||
serializer_class = StorageLUNGroupSerializer | ||
serializer_class = DatastoreSerializer | ||
|
||
|
||
class StorageSessionViewSet(NetBoxModelViewSet): | ||
queryset = models.StorageSession.objects.prefetch_related( | ||
'cluster', 'storage_lun_groups', 'tags' | ||
'cluster', 'datastores', 'tags' | ||
) | ||
serializer_class = StorageSessionSerializer | ||
|
||
|
||
class VMDKViewSet(NetBoxModelViewSet): | ||
queryset = models.VMDK.objects.prefetch_related( | ||
'datastore', 'vm', 'tags' | ||
) | ||
serializer_class = VMDKSerializer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.