You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jumpserver/apps/assets/const/device.py

41 lines
1.0 KiB

from django.utils.translation import gettext_lazy as _
from .base import BaseType
class DeviceTypes(BaseType):
GENERAL = 'general', _("General device")
SWITCH = 'switch', _("Switch")
ROUTER = 'router', _("Router")
FIREWALL = 'firewall', _("Firewall")
@classmethod
def _get_base_constrains(cls) -> dict:
return {
'*': {
'domain_enabled': True,
'su_enabled': False,
}
}
@classmethod
def _get_protocol_constrains(cls) -> dict:
return {
'*': {
'choices': ['ssh', 'telnet']
}
}
@classmethod
def _get_automation_constrains(cls) -> dict:
return {
'*': {
'ping_enabled': True,
'gather_facts_enabled': False,
'gather_accounts_enabled': False,
'verify_account_enabled': False,
'change_password_enabled': False,
'create_account_enabled': False,
}
}