1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

45 lines
914 B
Python
Raw Normal View History

from dcim.choices import InterfaceTypeChoices
2019-12-04 20:40:18 -05:00
from utilities.choices import ChoiceSet
#
# VirtualMachines
#
class VirtualMachineStatusChoices(ChoiceSet):
STATUS_OFFLINE = 'offline'
2020-02-12 22:43:40 -05:00
STATUS_ACTIVE = 'active'
STATUS_PLANNED = 'planned'
2019-12-04 20:40:18 -05:00
STATUS_STAGED = 'staged'
2020-02-12 22:43:40 -05:00
STATUS_FAILED = 'failed'
STATUS_DECOMMISSIONING = 'decommissioning'
2019-12-04 20:40:18 -05:00
CHOICES = (
(STATUS_OFFLINE, 'Offline'),
2020-02-12 22:43:40 -05:00
(STATUS_ACTIVE, 'Active'),
(STATUS_PLANNED, 'Planned'),
2019-12-04 20:40:18 -05:00
(STATUS_STAGED, 'Staged'),
2020-02-12 22:43:40 -05:00
(STATUS_FAILED, 'Failed'),
(STATUS_DECOMMISSIONING, 'Decommissioning'),
2019-12-04 20:40:18 -05:00
)
LEGACY_MAP = {
STATUS_OFFLINE: 0,
STATUS_ACTIVE: 1,
STATUS_STAGED: 3,
}
#
# Interface types (for VirtualMachines)
#
class VMInterfaceTypeChoices(ChoiceSet):
TYPE_VIRTUAL = InterfaceTypeChoices.TYPE_VIRTUAL
CHOICES = (
(TYPE_VIRTUAL, 'Virtual'),
)