]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/services/orchestrator.py
import 15.2.9
[ceph.git] / ceph / src / pybind / mgr / dashboard / services / orchestrator.py
index a1f22a9a0673a6190c1e3fd81134a364986bb4d2..af68e01dbf27b264eea7fbd5cd9f9a5d2f44a9cb 100644 (file)
@@ -2,14 +2,15 @@
 from __future__ import absolute_import
 import logging
 
-from typing import List, Optional
+from functools import wraps
+from typing import List, Optional, Dict
 
+from ceph.deployment.service_spec import ServiceSpec
 from orchestrator import InventoryFilter, DeviceLightLoc, Completion
 from orchestrator import ServiceDescription, DaemonDescription
 from orchestrator import OrchestratorClientMixin, raise_if_exception, OrchestratorError
 from orchestrator import HostSpec
 from .. import mgr
-from ..tools import wraps
 
 logger = logging.getLogger('orchestrator')
 
@@ -115,6 +116,15 @@ class ServiceManager(ResourceManager):
         for c in completion_list:
             raise_if_exception(c)
 
+    @wait_api_result
+    def apply(self, service_spec: Dict) -> Completion:
+        spec = ServiceSpec.from_json(service_spec)
+        return self.api.apply([spec])
+
+    @wait_api_result
+    def remove(self, service_name: str) -> List[str]:
+        return self.api.remove_service(service_name)
+
 
 class OsdManager(ResourceManager):
     @wait_api_result