You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/python-sdk/e2b/sandbox/sandbox_api.py
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -296,6 +296,8 @@ class SnapshotInfo:
296
296
297
297
snapshot_id: str
298
298
"""Snapshot identifier — template ID with tag, or namespaced name with tag (e.g. my-snapshot:latest). Can be used with Sandbox.create() to create a new sandbox from this snapshot."""
299
+
names: List[str] =field(default_factory=list)
300
+
"""Full names of the snapshot template including team namespace and tag (e.g. team-slug/my-snapshot:v2)."""
Copy file name to clipboardExpand all lines: packages/python-sdk/e2b/sandbox_async/main.py
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -694,6 +694,7 @@ async def beta_pause(
694
694
@overload
695
695
asyncdefcreate_snapshot(
696
696
self,
697
+
name: Optional[str] =None,
697
698
**opts: Unpack[ApiParams],
698
699
) ->SnapshotInfo:
699
700
"""
@@ -705,14 +706,17 @@ async def create_snapshot(
705
706
706
707
Use the returned `snapshot_id` with `AsyncSandbox.create(snapshot_id)` to create a new sandbox from the snapshot.
707
708
708
-
:return: Snapshot information including the snapshot ID
709
+
:param name: Optional name for the snapshot template. If a snapshot template with this name already exists, a new build will be assigned to the existing template instead of creating a new one.
710
+
711
+
:return: Snapshot information including the snapshot ID and names
709
712
"""
710
713
...
711
714
712
715
@overload
713
716
@staticmethod
714
717
asyncdefcreate_snapshot(
715
718
sandbox_id: str,
719
+
name: Optional[str] =None,
716
720
**opts: Unpack[ApiParams],
717
721
) ->SnapshotInfo:
718
722
"""
@@ -721,14 +725,16 @@ async def create_snapshot(
721
725
The sandbox will be paused while the snapshot is being created.
722
726
723
727
:param sandbox_id: Sandbox ID
728
+
:param name: Optional name for the snapshot template. If a snapshot template with this name already exists, a new build will be assigned to the existing template instead of creating a new one.
724
729
725
-
:return: Snapshot information including the snapshot ID
730
+
:return: Snapshot information including the snapshot ID and names
726
731
"""
727
732
...
728
733
729
734
@class_method_variant("_cls_create_snapshot")
730
735
asyncdefcreate_snapshot(
731
736
self,
737
+
name: Optional[str] =None,
732
738
**opts: Unpack[ApiParams],
733
739
) ->SnapshotInfo:
734
740
"""
@@ -740,10 +746,13 @@ async def create_snapshot(
740
746
741
747
Use the returned `snapshot_id` with `AsyncSandbox.create(snapshot_id)` to create a new sandbox from the snapshot.
742
748
743
-
:return: Snapshot information including the snapshot ID
749
+
:param name: Optional name for the snapshot template. If a snapshot template with this name already exists, a new build will be assigned to the existing template instead of creating a new one.
750
+
751
+
:return: Snapshot information including the snapshot ID and names
Copy file name to clipboardExpand all lines: packages/python-sdk/e2b/sandbox_sync/main.py
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -691,6 +691,7 @@ def beta_pause(
691
691
@overload
692
692
defcreate_snapshot(
693
693
self,
694
+
name: Optional[str] =None,
694
695
**opts: Unpack[ApiParams],
695
696
) ->SnapshotInfo:
696
697
"""
@@ -702,14 +703,17 @@ def create_snapshot(
702
703
703
704
Use the returned `snapshot_id` with `Sandbox.create(snapshot_id)` to create a new sandbox from the snapshot.
704
705
705
-
:return: Snapshot information including the snapshot ID
706
+
:param name: Optional name for the snapshot template. If a snapshot template with this name already exists, a new build will be assigned to the existing template instead of creating a new one.
707
+
708
+
:return: Snapshot information including the snapshot ID and names
706
709
"""
707
710
...
708
711
709
712
@overload
710
713
@staticmethod
711
714
defcreate_snapshot(
712
715
sandbox_id: str,
716
+
name: Optional[str] =None,
713
717
**opts: Unpack[ApiParams],
714
718
) ->SnapshotInfo:
715
719
"""
@@ -718,14 +722,16 @@ def create_snapshot(
718
722
The sandbox will be paused while the snapshot is being created.
719
723
720
724
:param sandbox_id: Sandbox ID
725
+
:param name: Optional name for the snapshot template. If a snapshot template with this name already exists, a new build will be assigned to the existing template instead of creating a new one.
721
726
722
-
:return: Snapshot information including the snapshot ID
727
+
:return: Snapshot information including the snapshot ID and names
723
728
"""
724
729
...
725
730
726
731
@class_method_variant("_cls_create_snapshot")
727
732
defcreate_snapshot(
728
733
self,
734
+
name: Optional[str] =None,
729
735
**opts: Unpack[ApiParams],
730
736
) ->SnapshotInfo:
731
737
"""
@@ -737,10 +743,13 @@ def create_snapshot(
737
743
738
744
Use the returned `snapshot_id` with `Sandbox.create(snapshot_id)` to create a new sandbox from the snapshot.
739
745
740
-
:return: Snapshot information including the snapshot ID
746
+
:param name: Optional name for the snapshot template. If a snapshot template with this name already exists, a new build will be assigned to the existing template instead of creating a new one.
747
+
748
+
:return: Snapshot information including the snapshot ID and names
0 commit comments