air_sdk.endpoints.ztp_templates
air_sdk.endpoints.ztp_templates
Classes
Module Contents
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.
Unique identifier for the template
OS family this template applies to. It identifies the
template, so it cannot be changed: assigning another value
raises AttributeError and sends no request
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
Timestamp when the template was created
Timestamp when the template was last modified
UUID of the client that created the template, or None for a seeded template or once that client is deleted
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
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:
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:
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.
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:
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 totemplate– The body. A string for Cumulus, a JSON object for NVOS**kwargs– Additional fields for future API compatibility
Returns:
The created ZTPTemplate
Example:
Replace the body of the template for one OS type.
Parameters:
pk– The OS type identifying the templatetemplate– The new body**kwargs– Additional fields for future API compatibility
Returns:
The updated ZTPTemplate
Example:
Replace the body of a template.
Parameters:
ztp_template– The template instance, or the OS type identifying ittemplate– The new body**kwargs– Additional fields for future API compatibility
Returns:
The updated ZTPTemplate
Example:
Delete the template for one OS type.
Parameters:
pk– The OS type identifying the template**kwargs– Additional parameters
Example: