import json


def get_hosts_deployed(cls):
    """
    Method to get all the hosts deployed in the cluster
    Args:
        cls: cephadm instance object

    Returns:
        List of the names of hosts deployed in the cluster
    """
    out, _ = cls.shell(args=["ceph", "orch", "host", "ls", "-f", "json"])
    hosts = list()
    host_obj = json.loads(out)
    for host in host_obj:
        hosts.append(host["hostname"])
    return hosts