vast-ai/vast-python

Missing ability to get open ports

Opened this issue · 1 comments

I am opening ports like this: --env '-p 8188:8188'. The real effective port is shown in the console on the website and doesn't appear to be retrievable from this script, which is a problem since I want to automate a lot of separate instances.

@oxysoft you can get the port mapping of an instance by using the raw flag. This returns a json object with all informations:

CLI:

vastai show instance <id> --raw

Python:

from vastai import VastAI
import json

client = VastAI(api_key='1234', raw=True)
instance_raw = client.show_instance(id=instance_id)
print(json.loads(instance_raw))