Automation templates

Updated at:

Automation templates are script functions written in Python that support input parameters and common third-party libraries. The system abstracts device logon, connection, and command-line interface (CLI) execution into built-in methods and functions. Templates can be nested to create any combination of device operations and business logic.

Device templates

Note

Device templates use different scripts for different device vendors and models. When a task runs, the system selects a script based on the device parameters and configured rules.

  1. Create a new template: Click Create Device Template. Enter a template name, template category, and description. Then, click Confirm.

  2. Edit template information: In the Actions column, click Edit. Modify the template category and description. Click Confirm to update the information.

  3. Edit template rules: In the Actions column, click Edit Rules. The script list for the template opens. Click Add Script or Edit to add or delete rules. Click Confirm to save the changes.

  4. Edit a script: In the template's script list, click a script number to open the template update page. Click Edit, write the script code, and enter a description of the changes. Click Save and Create to create a new version.

Note

If the script contains a Python syntax error, the save operation fails.

5. Publish a script: On the template update page, select a template version from the version history and click Publish.

Note

Tasks are executed using the published version.

User templates

Note

User templates are not device-specific and therefore do not require rules. Each template has only one script. All other operations are the same as those for device templates.

  1. Create a new template: Click Create Single-Device Template. Enter a template name, template category, and description. Then, click Confirm.

  2. Edit template information: In the Actions column, click Edit. Modify the template category and description. Click Confirm to update the information.

  3. Edit a script: Click the script number to open the script editor page. Click Edit, write the script code, and enter a description of the changes. Click Save and Create to create a new version.

  4. Publish a script: On the template update page, select a template version from the version history and click Publish.