> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/dsx-air/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/dsx-air/_mcp/server.

# air_sdk.endpoints.ztp_templates

## Classes

| Name                                                                             | Description                                          |
| -------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [`ZTPTemplate`](#air_sdkendpointsztp_templatesztptemplate)                       | A starting-point ZTP configuration, one per OS type. |
| [`ZTPTemplateEndpointAPI`](#air_sdkendpointsztp_templatesztptemplateendpointapi) | Endpoint API for managing ZTP templates.             |

## Module Contents

```python
class air_sdk.endpoints.ztp_templates.ZTPTemplate
```

**Bases**: `air_sdk.air_model.AirModel`

A starting-point ZTP configuration, one per OS type.

A template is example content offered in the ZTP editor, not a
simulation's own configuration. Editing a template never changes any
existing simulation. Templates are platform-wide rather than per
organization, and `os_type` identifies the row in the URL.

```python
id: str
```

Unique identifier for the template

```python
os_type: Literal[cumulus, nvos]
```

OS family this template applies to. It identifies the
template, so it cannot be changed: assigning another value
raises `AttributeError` and sends no request

```python
template: str | dict[str, Any]
```

Template body. Cumulus holds a string containing the
provisioning script; NVOS holds a JSON object containing
the ZTP configuration. Object keys are returned sorted by
name, which for NVOS is the order the sections run in.
Array order is left as stored

```python
created: datetime.datetime
```

Timestamp when the template was created

```python
modified: datetime.datetime
```

Timestamp when the template was last modified

```python
created_by: str | None
```

UUID of the client that created the template, or None
for a seeded template or once that client is deleted

```python
last_modified_by: str | None
```

UUID of the client that created or last updated the
template, or None for a seeded template no client
has edited yet or once that client is deleted

```python
get_model_api() -> type[ZTPTemplateEndpointAPI]
```

```python
model_api: ZTPTemplateEndpointAPI
```

```python
update(
    *,
    template: str | dict[str, Any] = ...,
    **kwargs: Any
) -> None
```

Replace the body of this template.

`os_type` identifies the template and cannot be changed; create a
separate template to cover another OS type.

**Parameters:**

* `template` – The new body. A string for Cumulus, a JSON object for NVOS
* `**kwargs` – Additional fields for future API compatibility

**Example:**

```python
>>> template.update(template='#!/bin/bash\n#CUMULUS-AUTOPROVISIONING\n')
```

```python
delete() -> None
```

Delete this template.

Simulations keep the ZTP configuration they already saved; only the
starting point offered in the editor is removed. After deletion, the
instance's `os_type` is set to None.

**Example:**

```python
>>> template.delete()
```

```python
class air_sdk.endpoints.ztp_templates.ZTPTemplateEndpointAPI
```

**Bases**: `air_sdk.air_model.BaseEndpointAPI[air_sdk.endpoints.ztp_templates.ZTPTemplate]`

Endpoint API for managing ZTP templates.

Any client with an Air role can read a template. Creating, updating and
deleting are restricted to Admin and SRE clients.

```python
API_PATH: str
```

```python
model: type[ZTPTemplate]
```

```python
get(
    pk: PrimaryKey,
    **params: Any
) -> ZTPTemplate
```

Retrieve the template for one OS type.

**Parameters:**

* `pk` – The OS type identifying the template, e.g. `'cumulus'`
* `**params` – Additional query parameters

**Returns:**

The matching ZTPTemplate

**Example:**

```python
>>> template = api.ztp_templates.get('cumulus')
```

```python
create(
    *,
    os_type: Literal[cumulus, nvos],
    template: str | dict[str, Any],
    **kwargs: Any
) -> ZTPTemplate
```

Create the template for one OS type.

Only one template may exist per OS type, and Air seeds a Cumulus and an
NVOS template when it's deployed, so `create()` returns 400 while that
OS type has a template. To change a template, use `patch()` or the
template's `update()`.

**Parameters:**

* `os_type` – OS family the template applies to
* `template` – The body. A string for Cumulus, a JSON object for NVOS
* `**kwargs` – Additional fields for future API compatibility

**Returns:**

The created ZTPTemplate

**Example:**

```python
>>> # Works only when the OS type has no template
>>> api.ztp_templates.create(
...     os_type='nvos',
...     template={'ztp': {'01-image': {'uninstall': True}}},
... )
```

```python
patch(
    pk: PrimaryKey,
    *,
    template: str | dict[str, Any] = ...,
    **kwargs: Any
) -> ZTPTemplate
```

Replace the body of the template for one OS type.

**Parameters:**

* `pk` – The OS type identifying the template
* `template` – The new body
* `**kwargs` – Additional fields for future API compatibility

**Returns:**

The updated ZTPTemplate

**Example:**

```python
>>> api.ztp_templates.patch(
...     'nvos',
...     template={'ztp': {'01-image': {'uninstall': True}}},
... )
```

```python
update(
    *,
    ztp_template: ZTPTemplate | PrimaryKey,
    template: str | dict[str, Any] = ...,
    **kwargs: Any
) -> ZTPTemplate
```

Replace the body of a template.

**Parameters:**

* `ztp_template` – The template instance, or the OS type identifying it
* `template` – The new body
* `**kwargs` – Additional fields for future API compatibility

**Returns:**

The updated ZTPTemplate

**Example:**

```python
>>> api.ztp_templates.update(
...     ztp_template='nvos',
...     template={'ztp': {'01-image': {'uninstall': True}}},
... )
```

```python
delete(
    pk: PrimaryKey,
    **kwargs: Any
) -> None
```

Delete the template for one OS type.

**Parameters:**

* `pk` – The OS type identifying the template
* `**kwargs` – Additional parameters

**Example:**

```python
>>> api.ztp_templates.delete('nvos')
```