]
def _select_orchestrator(self):
- o = self.get_module_option("orchestrator")
- if o is None:
- raise NoOrchestrator()
-
- return o
+ return self.get_module_option("orchestrator")
+ @CLIWriteCommand('orchestrator host add',
+ "name=host,type=CephString,req=true",
+ 'Add a host')
+ @handle_exceptions
+ def _add_host(self, host):
+ completion = self.add_host(host)
+ self._orchestrator_wait([completion])
+ return HandleCommandResult(stdout=str(completion.result))
+
+ @CLIWriteCommand('orchestrator host rm',
+ "name=host,type=CephString,req=true",
+ 'Remove a host')
+ @handle_exceptions
+ def _remove_host(self, host):
+ completion = self.remove_host(host)
+ self._orchestrator_wait([completion])
+ return HandleCommandResult(stdout=str(completion.result))
+
+ @CLIReadCommand('orchestrator host ls',
+ desc='List hosts')
+ @handle_exceptions
+ def _get_hosts(self):
+ completion = self.get_hosts()
+ self._orchestrator_wait([completion])
+ result = "\n".join(map(lambda node: node.name, completion.result))
+ return HandleCommandResult(stdout=result)
+
@CLIReadCommand('orchestrator device ls',
"name=host,type=CephString,n=N,req=false "
- "name=format,type=CephChoices,strings=json|plain,req=false",
+ "name=format,type=CephChoices,strings=json|plain,req=false "
+ "name=refresh,type=CephBool,req=false",
'List devices on a node')
@handle_exceptions
- def _list_devices(self, host=None, format='plain'):
- # type: (List[str], str) -> HandleCommandResult
+ def _list_devices(self, host=None, format='plain', refresh=False):
+ # type: (List[str], str, bool) -> HandleCommandResult
"""
Provide information about storage devices present in cluster hosts