def get_hosts() -> List[HostModel]: orch = Orchestrator() orch_hosts = orch.host_ls() hosts: List[HostModel] = [] for h in orch_hosts: hosts.append(HostModel(hostname=h.hostname, address=h.addr)) return hosts
def get_hosts(request: Request, _=Depends(jwt_auth_scheme)) -> List[HostModel]: orch = Orchestrator(request.app.state.gstate.ceph_mgr) orch_hosts = orch.host_ls() hosts: List[HostModel] = [] for h in orch_hosts: hosts.append(HostModel(hostname=h.hostname, address=h.addr)) return hosts
def get_hosts() -> HostsReplyModel: orch = Orchestrator() orch_hosts = orch.host_ls() hosts: HostsReplyModel = HostsReplyModel(hosts=[]) for h in orch_hosts: hosts.hosts.append(HostModel(hostname=h.hostname, address=h.addr)) return hosts