i have an integration with runpod in python. after i deploy a pod, i want to show the user the ip
and ports
4 Replies
bagel@192 bagel % curl --request POST \
--header 'content-type: application/json' \
--url 'https://api.runpod.io/graphql?api_key=rpa_S8G1...EU41wuktix' \
--data '{"query": "query Pod { pod(input: {podId: "{podid}"}) { id runtime { uptimeInSeconds ports { ip isIpPublic privatePort publicPort type } } } }"}'
{"data":{"pod":null}}
that doesn't seem to work either. there is a pod running, and api key is right
I need to be able to deploy a pod programmatically and get the ip.
I faced the same issue and had to find out the hard way that it doesn't seem possible to do this via API alone (even GraphQL). I tried creating community / secure pods and neither provided an IP from even a GraphQL machine subquery (I had to dig hard to reverse engineer how to do this). I gave up and had to rely on the UI for information on how to ssh in.
i just tried this and it works, output:
you can see where isIpPublic is true and ip is a public ip, it exposes 22 port on 55073 public port
i create a pod in secure cloud using 4090
you also have to make sure a port is exposed in tcp, that will expose a port using public ip