> ## Documentation Index
> Fetch the complete documentation index at: https://novita.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Verouderde sandbox-snapshottemplate

export const SandboxBetaVersionWarning = () => {
  if (typeof document === "undefined") {
    return null;
  } else {
    return <Warning>The following legacy features require the legacy SDK and CLI versions listed in <Link href="/docs/nl/guides/sandbox-legacy-e2b-compatible" target="self">Legacy SDKs & CLI</Link>. Please note that legacy features may be less stable than production releases. If you encounter any issues while using these features, please <Link href="https://meetings-na2.hubspot.com/junyu" target="_blank">contact us</Link>.</Warning>;
  }
};

<Warning>
  Deze verouderde pagina wordt behouden voor gebruikers die nog steeds de 1.x- of beta-SDK-lijn gebruiken. Nieuwe SDK 2.x-integraties moeten de huidige sandbox-documentatie volgen.
</Warning>

<SandboxBetaVersionWarning />

## Terminologie

* **Commit**: Een commitbewerking slaat de huidige staat van een sandbox op als een template, wat resulteert in een nieuwe template van het type snapshottemplate.
* **Oorspronkelijke sandbox**: De sandboxinstantie waarop de commit wordt uitgevoerd.
* **Snapshottemplate**: De template die na een commitbewerking wordt gegenereerd.

## Functiebeschrijving

### Een actieve sandbox committen

**Tijdens het commitproces:**

* De oorspronkelijke sandbox wordt tijdens het committen kort onderbroken;
* De sandboxinstantie is tijdens de onderbreking niet beschikbaar;
* De duur van de onderbreking ligt dicht bij de tijd die nodig is voor één pause-bewerking.

**Nadat het committen is voltooid:**

**Oorspronkelijke sandbox:**

* Het bestaande pause-record wordt vernieuwd naar een nieuw pause-record, gebaseerd op de huidige sandboxstatus;
* De oorspronkelijke sandbox blijft actief;
* Er wordt een nieuw templaterecord gegenereerd.

### Een gepauzeerde sandbox committen

**Tijdens het commitproces:**

* Het commitproces zorgt er niet voor dat de oorspronkelijke sandbox wordt gestart;
* De oorspronkelijke sandbox blijft in gepauzeerde toestand.

**Nadat het committen is voltooid:**

**Oorspronkelijke sandbox:**

* Het bestaande pause-record wordt niet gewist;
* Er wordt een nieuw templaterecord gegenereerd.

## Parameterbeschrijving

| Parameter    | Type     | Vereist | Beschrijving                                                          |
| ------------ | -------- | ------- | --------------------------------------------------------------------- |
| `sandbox_id` | `string` | Ja      | De ID van de sandboxinstantie waarop de commit moet worden uitgevoerd |
| `alias`      | `string` | Nee     | Stel een alias in voor de gegenereerde template                       |

## Retourwaarde

Na een succesvolle commitbewerking wordt een `Template`-object geretourneerd.

## Codevoorbeelden

<CodeGroup>
  ```python Python icon="python" theme={"system"}
  from novita_sandbox.core import Sandbox

  # Commit an existing sandbox by ID to create a template snapshot
  # sandbox_id: str - Required. The ID of the sandbox to commit
  # alias: Optional[str] - Optional alias name for the created template
  # Note: Default timeout is 10 minutes for commit operation
  template = Sandbox.commit(
      sandbox_id="existing-sandbox-id",
      alias="my-template-alias"
  )
  print(f"Template ID: {template.template_id}")
  print(f"Build ID: {template.build_id}")
  ```

  ```js TypeScript icon="js" theme={"system"}
  import { Sandbox } from '@novita-sandbox/core'

  // Commit an existing sandbox by ID to create a template snapshot
  // sandboxId: string - Required. The ID of the sandbox to commit
  // opts?: { alias?: string } - Optional commit options
  const template = await Sandbox.commit('existing-sandbox-id', {
    alias: 'my-template-alias'
  })
  console.log(`Template ID: ${template.templateId}`)
  console.log(`Build ID: ${template.buildId}`)
  ```
</CodeGroup>

Daarnaast kun je ook de Novita Sandbox CLI gebruiken om een opgegeven sandboxinstantie te committen:

```bash Bash icon="terminal" theme={"system"}
# Basic commit - creates a template snapshot from a sandbox
novita-sandbox-cli sandbox commit <sandboxID>

# Commit with alias - assign a friendly name to the template
novita-sandbox-cli sandbox commit <sandboxID> --alias my-template-alias

```
