> 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_scripts

## Classes

| Name                                                                       | Description                                               |
| -------------------------------------------------------------------------- | --------------------------------------------------------- |
| [`ZTPScript`](#air_sdkendpointsztp_scriptsztpscript)                       | A ZTP (Zero Touch Provisioning) script for a simulation.  |
| [`ZTPScriptEndpointAPI`](#air_sdkendpointsztp_scriptsztpscriptendpointapi) | Retrieve, update, and delete ZTP scripts for simulations. |

## Module Contents

```python
class air_sdk.endpoints.ztp_scripts.ZTPScript
```

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

A ZTP (Zero Touch Provisioning) script for a simulation.

ZTPScript objects should not be created directly. Use
`simulation.create_ztp_script(content='...')` instead.

When printed, the `content` field is truncated to 50 characters with newlines
collapsed to avoid flooding console/logs with large scripts.
Access the full content via `ztp_script.content`.

**Examples:**

```python
>>> # Create a ZTP script
>>> content = '#!/bin/bash\n# CUMULUS-AUTOPROVISIONING\necho Hi'
>>> ztp_script = simulation.create_ztp_script(content=content)

>>> # Update the script
>>> content = '#!/bin/bash\n# CUMULUS-AUTOPROVISIONING\necho "Updated!"'
>>> ztp_script.update(content=content)

>>> # Delete the script
>>> ztp_script.delete()
>>> print(simulation.ztp_script)
None
```

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

When the script was created.

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

When the script was last modified.

```python
content: str
```

The script content.

```python
simulation: Simulation
```

The simulation this script belongs to.

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

Returns the respective `AirModelAPI` type for this model

```python
model_api: ZTPScriptEndpointAPI
```

The current model API instance.

```python
update(
    *,
    content: str
) -> None
```

Update the content of this ZTP script.

**Parameters:**

* `content` – The new script content to use.

**Example:**

```python
>>> ztp_script = simulation.ztp_script
>>> content = '#!/bin/bash\n# CUMULUS-AUTOPROVISIONING\n'
>>> content += 'echo "Updated script"'
>>> ztp_script.update(content=content)
```

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

Delete the instance.

After deletion, accessing `simulation.ztp_script` will return `None`.

**Example:**

```python
>>> ztp_script = simulation.ztp_script
>>> ztp_script.delete()
>>> print(simulation.ztp_script)
None
```

```python
class air_sdk.endpoints.ztp_scripts.ZTPScriptEndpointAPI
```

**Bases**: `air_sdk.air_model.BaseEndpointAPI[air_sdk.endpoints.ztp_scripts.ZTPScript]`

Retrieve, update, and delete ZTP scripts for simulations.

ZTPScripts should be created during import or off of `Simulation` objects:

**Examples:**

```python
>>> # Create a ZTP script
>>> content = '#!/bin/bash\n# CUMULUS-AUTOPROVISIONING\necho "Hello!"'
>>> simulation.create_ztp_script(content=content)
<ZTPScript(content='#!/bin/bash...')>

>>> # Get a ZTP script
>>> ztp_script = api.ztp_scripts.get(simulation)
>>> print(ztp_script.content)
#!/bin/bash
# CUMULUS-AUTOPROVISIONING
echo "Hello!"

>>> # Update a ZTP script
>>> content = '#!/bin/bash\n# CUMULUS-AUTOPROVISIONING\necho "Updated!"'
>>> api.ztp_scripts.patch(simulation, content=content)

>>> # Delete a ZTP script
>>> api.ztp_scripts.delete(simulation)
```

```python
API_PATH: str
```

```python
model: type[ZTPScript]
```

```python
get(
    *,
    simulation: Simulation | PrimaryKey
) -> ZTPScript
```

Get the ZTP script for the simulation if it exists.

**Parameters:**

* `simulation` – The simulation object or simulation ID.

**Returns:**

The ZTP script for the simulation.

**Raises:**

* `AirUnexpectedResponse` – If the simulation doesn't have a ZTP script.

**Example:**

```python
>>> # Using simulation object
>>> ztp_script = api.ztp_scripts.get(simulation)

>>> # Using simulation ID
>>> ztp_script = api.ztp_scripts.get('simulation-uuid')

>>> print(ztp_script.content)
#!/bin/bash
# CUMULUS-AUTOPROVISIONING
echo "Hello, world!"
```

```python
patch(
    *,
    simulation: Simulation | PrimaryKey,
    content: str
) -> ZTPScript
```

Update the content of the ZTPScript.

**Parameters:**

* `simulation` – The simulation object or simulation ID.
* `content` – The new script content.

**Returns:**

The updated ZTP script.

**Examples:**

```python
>>> # Using simulation object
>>> with open('ztp_script.sh', 'r') as f:
...     content = f.read()
>>> updated_script = api.ztp_scripts.patch(simulation, content=content)

>>> # Using simulation ID
>>> content = '#!/bin/bash\n# CUMULUS-AUTOPROVISIONING\necho Hi'
>>> api.ztp_scripts.patch('simulation-uuid', content=content)
```

```python
update(
    *,
    simulation: Simulation | PrimaryKey,
    content: str
) -> ZTPScript
```

Update the content of the ZTPScript.

This is an alias for `patch()` provided for consistency with other endpoints.

**Parameters:**

* `simulation` – The simulation object or simulation ID.
* `content` – The new script content.

**Returns:**

The updated ZTP script.

**Examples:**

```python
>>> # Using simulation object
>>> content = '#!/bin/bash\n# CUMULUS-AUTOPROVISIONING'
>>> api.ztp_scripts.update(simulation=simulation, content=content)

>>> # Using simulation ID
>>> api.ztp_scripts.update(simulation='sim-id', content=content)
```

```python
delete(
    *,
    simulation: Simulation | PrimaryKey
) -> None
```

Delete the ZTP script for the simulation.

After deletion, `simulation.ztp_script` will return `None`.

**Parameters:**

* `simulation` – The simulation object or simulation ID.

**Examples:**

```python
>>> # Using simulation object
>>> api.ztp_scripts.delete(simulation)

>>> # Using simulation ID
>>> api.ztp_scripts.delete('simulation-uuid')

>>> print(simulation.ztp_script)
None
```