mirror of
https://github.com/ceph/ceph
synced 2025-02-23 11:07:35 +00:00
mgr/orchestrator: orchestrator host label {add,rm}
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
454906fceb
commit
292a9927a4
@ -466,6 +466,20 @@ class Orchestrator(object):
|
||||
"""
|
||||
return self.get_inventory()
|
||||
|
||||
def add_host_label(self, host, label):
|
||||
# type: (str) -> WriteCompletion
|
||||
"""
|
||||
Add a host label
|
||||
"""
|
||||
return NotImplementedError()
|
||||
|
||||
def remove_host_label(self, host, label):
|
||||
# type: (str) -> WriteCompletion
|
||||
"""
|
||||
Remove a host label
|
||||
"""
|
||||
return NotImplementedError()
|
||||
|
||||
def get_inventory(self, node_filter=None, refresh=False):
|
||||
# type: (InventoryFilter, bool) -> ReadCompletion[List[InventoryNode]]
|
||||
"""
|
||||
|
@ -174,6 +174,28 @@ class OrchestratorCli(orchestrator.OrchestratorClientMixin, MgrModule):
|
||||
result = "\n".join(map(lambda node: node.name, completion.result))
|
||||
return HandleCommandResult(stdout=result)
|
||||
|
||||
@orchestrator._cli_write_command(
|
||||
'orchestrator host label add',
|
||||
'name=host,type=CephString '
|
||||
'name=label,type=CephString',
|
||||
'Add a host label')
|
||||
def _host_label_add(self, host, label):
|
||||
completion = self.add_host_label(host, label)
|
||||
self._orchestrator_wait([completion])
|
||||
orchestrator.raise_if_exception(completion)
|
||||
return HandleCommandResult(stdout=completion.result_str())
|
||||
|
||||
@orchestrator._cli_write_command(
|
||||
'orchestrator host label rm',
|
||||
'name=host,type=CephString '
|
||||
'name=label,type=CephString',
|
||||
'Add a host label')
|
||||
def _host_label_add(self, host, label):
|
||||
completion = self.remove_host_label(host, label)
|
||||
self._orchestrator_wait([completion])
|
||||
orchestrator.raise_if_exception(completion)
|
||||
return HandleCommandResult(stdout=completion.result_str())
|
||||
|
||||
@orchestrator._cli_read_command(
|
||||
'orchestrator device ls',
|
||||
"name=host,type=CephString,n=N,req=false "
|
||||
|
Loading…
Reference in New Issue
Block a user