vast-ai / vast-python

Vast.ai python and cli api client
MIT License
123 stars 48 forks source link

Missing ability to get open ports #112

Closed oxysoft closed 2 weeks ago

oxysoft commented 4 months ago

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.

twinnedAI commented 4 months ago

@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))
jsbcannell commented 2 weeks ago

closed