Exemple #1
0
    def GET(self, cluster_id):
        try:
            cluster = db().query(Cluster).get(cluster_id)
            cluster_attrs = self.get_cluster_attrs(cluster)
            network_manager = NetworkManager()
            horizon_url = network_manager.get_horizon_url(cluster_id)
            keystone_url = network_manager.get_keystone_url(cluster_id)

            return {
                "horizon_url": horizon_url,
                "keystone_url": keystone_url,
                "admin_username": cluster_attrs["user"],
                "admin_password": cluster_attrs["password"],
                "admin_tenant_name": cluster_attrs["tenant"],
                "controller_nodes_ips": self.get_controller_nodes_ips(cluster),
                "controller_nodes_names": self.get_controller_nodes_fqdns(cluster),
            }
        except Exception as exc:
            logger.error(traceback.format_exc())
            raise web.badrequest(message=str(exc))