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/cloud.py

52 lines
1.3 KiB

2 years ago
from .base import BaseType
2 years ago
class CloudTypes(BaseType):
PUBLIC = 'public', 'Public cloud'
PRIVATE = 'private', 'Private cloud'
K8S = 'k8s', 'Kubernetes'
2 years ago
@classmethod
def _get_base_constrains(cls) -> dict:
return {
2 years ago
'*': {
'charset_enabled': False,
2 years ago
'domain_enabled': False,
'su_enabled': False,
}
}
@classmethod
def _get_automation_constrains(cls) -> dict:
constrains = {
'*': {
'ansible_enabled': False,
'ansible_config': {},
2 years ago
'gather_facts_enabled': False,
'verify_account_enabled': False,
'change_secret_enabled': False,
2 years ago
'create_account_enabled': False,
'gather_accounts_enabled': False,
}
}
2 years ago
return constrains
@classmethod
2 years ago
def _get_protocol_constrains(cls) -> dict:
return {
2 years ago
'*': {
'choices': ['http'],
2 years ago
},
cls.K8S: {
2 years ago
'choices': ['k8s']
}
}
@classmethod
def internal_platforms(cls):
return {
cls.PUBLIC: [],
cls.PRIVATE: [{'name': 'Vmware-vSphere'}],
cls.K8S: [{'name': 'Kubernetes'}],
}