> 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.os_templates

## Classes

| Name                                                                                          | Description                                                          |
| --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [`_OSTemplateRenderFileRequired`](#air_sdkendpointsos_templates_ostemplaterenderfilerequired) | Required fields for OSTemplateRenderFile.                            |
| [`OSTemplateRenderFile`](#air_sdkendpointsos_templatesostemplaterenderfile)                   | A single OS template render entry: file content plus POSIX metadata. |
| [`OSTemplate`](#air_sdkendpointsos_templatesostemplate)                                       | An OS template: the files injected into a node at boot.              |
| [`OSTemplateEndpointAPI`](#air_sdkendpointsos_templatesostemplateendpointapi)                 | Endpoint API for managing OS templates.                              |

## Module Contents

```python
class air_sdk.endpoints.os_templates._OSTemplateRenderFileRequired
```

**Bases**: `typing.TypedDict`

Required fields for OSTemplateRenderFile.

```python
content: str
```

```python
class air_sdk.endpoints.os_templates.OSTemplateRenderFile
```

**Bases**: `air_sdk.endpoints.os_templates._OSTemplateRenderFileRequired`

A single OS template render entry: file content plus POSIX metadata.

```python
owner: str
```

POSIX owner — user name or numeric uid. Defaults to `root`

```python
group: str
```

POSIX group — group name or numeric gid. Defaults to `root`

```python
mode: str
```

POSIX octal file mode. Defaults to `0644`

**content**

Template body, rendered with the merged vars/generate context

```python
class air_sdk.endpoints.os_templates.OSTemplate
```

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

An OS template: the files injected into a node at boot.

A template describes, for one OS type and version, which files to render
onto the node and which variables feed that rendering. An
`OSImageManifest` pins a specific template version per hardware model.

id: Unique identifier for the template
created: Timestamp when the template was created
modified: Timestamp when the template was last modified
os\_type: The OS type this template applies to
os\_template\_version: Version of this template
org: Organization owning the template
render: Absolute POSIX path to render entry. Each value has a
required `content` plus optional `owner`, `group` and `mode`
(defaulting to root/root/0644)
creator: Email of the user who created the template
generate: Variable names mapped to generation strategies
vars: Variable names the render templates reference, declared for
upload-time verification. Must exactly match the variables used
across the render bodies.

```python
id: str
```

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

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

```python
os_type: str
```

```python
os_template_version: str
```

```python
org: str
```

```python
render: dict[str, OSTemplateRenderFile]
```

```python
creator: str | None
```

```python
generate: dict[str, str]
```

```python
vars: list[str]
```

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

```python
model_api: OSTemplateEndpointAPI
```

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

Delete this OS template.

**Returns:**

None

**Example:**

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

```python
class air_sdk.endpoints.os_templates.OSTemplateEndpointAPI
```

**Bases**: `air_sdk.air_model.BaseEndpointAPI[air_sdk.endpoints.os_templates.OSTemplate]`

Endpoint API for managing OS templates.

Provides listing, retrieval, creation, and deletion of the templates that
define which files are rendered onto a booting node. The API does not
support partial or full updates on this resource.

```python
API_PATH: str
```

```python
model: type[OSTemplate]
```

```python
list(
    *,
    os_type: str = ...,
    os_template_version: str = ...,
    limit: int = ...,
    offset: int = ...,
    ordering: str = ...,
    search: str = ...,
    **kwargs: Any
) -> Iterator[OSTemplate]
```

List OS templates.

**Parameters:**

* `os_type` – Filter by OS type
* `os_template_version` – Filter by template version
* `limit` – Number of results to return per page
* `offset` – Initial index from which to return results
* `ordering` – Order by field (prefix with "-" for descending)
* `search` – Search across template fields
* `**kwargs` – Additional filter parameters

**Returns:**

Iterator of OSTemplate instances

**Example:**

```python
>>> for template in api.os_templates.list(os_type='cumulus-linux'):
...     print(template.os_template_version)
```

```python
get(
    pk: PrimaryKey,
    **kwargs: Any
) -> OSTemplate
```

Retrieve a specific OS template.

**Parameters:**

* `pk` – OS template UUID
* `**kwargs` – Additional query parameters

**Returns:**

OSTemplate instance

**Example:**

```python
>>> template = api.os_templates.get('template-uuid')
>>> print(template.os_type, template.os_template_version)
```

```python
create(
    *,
    os_type: str,
    os_template_version: str,
    render: dict[str, OSTemplateRenderFile],
    generate: dict[str, str] = ...,
    vars: List[str] = ...,
    **kwargs: Any
) -> OSTemplate
```

Create an OS template.

**Parameters:**

* `os_type` – The OS type this template applies to
* `os_template_version` – Version of this template
* `render` – Render entries keyed by absolute POSIX path. Each value requires `content`; `owner`, `group` and `mode` are optional and default to root/root/0644
* `generate` – Variable names mapped to generation strategies
* `vars` – Names of the variables this template expects
* `**kwargs` – Additional fields for future API compatibility

**Returns:**

The created OSTemplate instance

**Example:**

```python
>>> template = api.os_templates.create(
...     os_type='cumulus-linux',
...     os_template_version='5.9',
...     render={
...         '/etc/hostname': {'content': '{{ hostname }}'},
...     },
...     vars=['hostname'],
... )
```

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

Delete an OS template.

**Parameters:**

* `pk` – OS template UUID
* `**kwargs` – Additional parameters

**Returns:**

None

**Example:**

```python
>>> api.os_templates.delete('template-uuid')
```