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

Adds filtering sandboxes by state in the SDKs #564

Open
wants to merge 10 commits into
base: beta
Choose a base branch
from

Conversation

mishushakov
Copy link
Member

@mishushakov mishushakov commented Jan 30, 2025

Adds a new optional param to filter sandboxes by state

Copy link

changeset-bot bot commented Jan 30, 2025

🦋 Changeset detected

Latest commit: d688463

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@e2b/python-sdk Minor
e2b Minor
@e2b/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@mlejva mlejva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mishushakov please add a section to docs here mentioning how to list and delete paused sandboxes

@ValentaTomas ValentaTomas added feature New feature or request sdk Improvements or additions to SDKs labels Feb 3, 2025
Copy link
Member

@mlejva mlejva Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mishushakov will deleting paused sandboxes be included in a separate PR? I'm asking because the new docs addition doesn't mention anything about deleting paused sandboxes.

Other than that, this looks good to me on the docs level

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this will be a separate PR.

@mlejva
Copy link
Member

mlejva commented Feb 4, 2025

One more thing, I noticed that in Python, we support importing the state type:

from e2b.api.client.models.get_sandboxes_state import GetSandboxesState

sandboxes = Sandbox.list(state=GetSandboxesState.PAUSED)

but in JS we expect users to just pass a string:

const sandboxes = await Sandbox.list({ state: 'paused' })

Why not passing just a string for Python as well?

@mishushakov
Copy link
Member Author

Has to do with the way we generate enum types for Python SDK, I will look, maybe there's a flag for string-style enums in the generator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request sdk Improvements or additions to SDKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants