from orchestrator import DaemonDescription
from ceph.deployment.service_spec import AlertManagerSpec, GrafanaSpec, ServiceSpec, \
SNMPGatewaySpec, PrometheusSpec, MgmtGatewaySpec
-from cephadm.services.cephadmservice import CephadmService, CephadmDaemonDeploySpec, get_dashboard_urls
+from cephadm.services.cephadmservice import (
+ CephadmDaemonDeploySpec,
+ CephadmService,
+ get_dashboard_urls,
+ next_action_for_mgmt_stack_service,
+)
from mgr_util import build_url, password_hash
from ceph.deployment.utils import wrap_ipv6
from .. import utils
return HandleCommandResult(-errno.EBUSY, '', warn_message)
return HandleCommandResult(0, warn_message, '')
+ manages_own_next_action = True
+
+ def choose_next_action(
+ self,
+ scheduled_action: utils.Action,
+ daemon_type: Optional[str],
+ spec: Optional[ServiceSpec],
+ curr_deps: List[str],
+ last_deps: List[str],
+ ) -> utils.Action:
+ """Given the scheduled_action, service spec, daemon_type, and
+ current and previous dependency lists return the next action that
+ this service would prefer cephadm take.
+ """
+ return next_action_for_mgmt_stack_service(
+ scheduled_action, daemon_type, spec, curr_deps, last_deps
+ )
+
@register_cephadm_service
class PrometheusService(CephadmService):
return '/federate'
return '/prometheus/federate'
+ manages_own_next_action = True
+
+ def choose_next_action(
+ self,
+ scheduled_action: utils.Action,
+ daemon_type: Optional[str],
+ spec: Optional[ServiceSpec],
+ curr_deps: List[str],
+ last_deps: List[str],
+ ) -> utils.Action:
+ """Given the scheduled_action, service spec, daemon_type, and
+ current and previous dependency lists return the next action that
+ this service would prefer cephadm take.
+ """
+ return next_action_for_mgmt_stack_service(
+ scheduled_action, daemon_type, spec, curr_deps, last_deps
+ )
+
@register_cephadm_service
class NodeExporterService(CephadmService):
out = f'It is presumed safe to stop {names}'
return HandleCommandResult(0, out, '')
+ manages_own_next_action = True
+
+ def choose_next_action(
+ self,
+ scheduled_action: utils.Action,
+ daemon_type: Optional[str],
+ spec: Optional[ServiceSpec],
+ curr_deps: List[str],
+ last_deps: List[str],
+ ) -> utils.Action:
+ """Given the scheduled_action, service spec, daemon_type, and
+ current and previous dependency lists return the next action that
+ this service would prefer cephadm take.
+ """
+ return next_action_for_mgmt_stack_service(
+ scheduled_action, daemon_type, spec, curr_deps, last_deps
+ )
+
@register_cephadm_service
class LokiService(CephadmService):