def get_inventory_hosts(inventory_endpoint, cluster_id):
    configs = Configuration()
    configs.host = inventory_endpoint
    apiClient = ApiClient(configuration=configs)
    client = api.InstallerApi(api_client=apiClient)
    hosts_list = client.list_hosts(cluster_id=cluster_id)
    return [InventoryHost(host) for host in hosts_list if host['status'] != 'disabled']
Ejemplo n.º 2
0
 def __init__(self, inventory_url):
     self.inventory_url = inventory_url
     configs = Configuration()
     configs.host = self.inventory_url + "/api/assisted-install/v1"
     self.api = ApiClient(configuration=configs)
     self.client = api.InstallerApi(api_client=self.api)