diff --git a/core/app/handlers/core.py b/core/app/handlers/core.py index 657cb86..d1019b7 100644 --- a/core/app/handlers/core.py +++ b/core/app/handlers/core.py @@ -1,8 +1,15 @@ import hug +from kubernetes import client, config @hug.post('/create-room') def create_room(): - return "" + config.load_kube_config(config_file='./kubernetes-config') + v1 = client.CoreV1Api() + print("Listing pods with their IPs:") + ret = v1.list_pod_for_all_namespaces(watch=False) + for i in ret.items: + print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name)) + return ret.items[0].metadata.name @hug.post('/delete-room') def delete_room(body):