SMBClusterPublicIPSpec,
SpecValidationError,
)
+from ceph.smb.constants import REMOTE_CONTROL, REMOTE_CONTROL_LOCAL
from ceph.smb.network import to_network
from object_format import ErrorResponseBase
class RemoteControl(_RBase):
# enabled can be set to explicitly toggle the remote control server
enabled: Optional[bool] = None
+ # locally_enabled can be set to explicitly toggle the remote control
+ # servers local unix socket mode
+ locally_enabled: Optional[bool] = None
# cert specifies the ssl/tls certificate to use
cert: Optional[TLSSource] = None
# cert specifies the ssl/tls server key to use
@property
def is_enabled(self) -> bool:
+ return self._locally_enabled() or self._remotely_enabled()
+
+ def _locally_enabled(self) -> bool:
+ return bool(self.locally_enabled)
+
+ def _remotely_enabled(self) -> bool:
if self.enabled is not None:
return self.enabled
return bool(self.cert and self.key)
+ def enabled_features(self) -> list[str]:
+ out = []
+ if self._locally_enabled():
+ out.append(REMOTE_CONTROL_LOCAL)
+ if self._remotely_enabled():
+ out.append(REMOTE_CONTROL)
+ return out
+
@resourcelib.resource('ceph.smb.cluster')
class Cluster(_RBase):