Skip to main content
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
Any
required
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
Optional[str]
repo to push the snapshot to
docker_login_user
Optional[str]
Username for container registry with repo
docker_login_pass
Optional[str]
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)