Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing ability to get open ports #112

Open
oxysoft opened this issue Jul 14, 2024 · 1 comment
Open

Missing ability to get open ports #112

oxysoft opened this issue Jul 14, 2024 · 1 comment

Comments

@oxysoft
Copy link

oxysoft commented Jul 14, 2024

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
Copy link

twinnedAI commented Jul 26, 2024

@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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants