Take a container snapshot and push to a registry.
Signature
VastAI.take_snapshot(
instance_id: Any,
container_registry: Optional[str] = 'docker.io',
repo: Optional[str] = None,
docker_login_user: Optional[str] = None,
docker_login_pass: Optional[str] = None,
pause: Optional[str] = 'true'
) -> dict
Parameters
instance_id of the container instance to snapshot
container_registry
Optional[str]
default:"docker.io"
Container registry to push the snapshot to. Default will be docker.io
repo to push the snapshot to
Username for container registry with repo
Password or token for container registry with repo
pause
Optional[str]
default:"true"
Pause container’s processes being executed by the CPU to take snapshot (true/false). Default will be true
Returns
dict
Example
from vastai import VastAI
client = VastAI(api_key="YOUR_API_KEY")
result = client.take_snapshot(instance_id="value")
print(result)