This repository contains NetApp storage automation examples in Python, Ansible, Terraform, and Go. Each approach implements the same use cases so users can compare side-by-side and pick the tool their team already knows.
Python and Go are both imperative scripting; Ansible is declarative; Terraform is stateful. The repository presents three styles across four tools.
Examples are grouped first by tool, then by the NetApp product they target:
python/<product>/ # Python script examples (snake_case files)
ansible/<product>/ # Ansible playbook examples (snake_case files)
terraform/<product>/ # Terraform module examples (kebab-case dirs)
go/<product>/ # Go program examples (snake_case subdirs, one main.go each)
docs/ # Guides, API patterns, comparison docs
ai/ # Source of truth for these instructions and the prompts
Products: ontap holds every example today. console (NetApp Console) adds a
deployment level — <tool>/console/local/ — and is currently an empty
placeholder. Put new work under the product it targets; never at the tool root.
Product-specific conventions live alongside the code they govern and are attached automatically when you work in that product's directories.
Task prompts are available as slash commands in both GitHub Copilot and Cursor.
They are named <product>-<task>, so typing /ontap- lists everything scoped
to ONTAP.
| Prompt | What it does |
|---|---|
/ontap-generate-ansible |
Generate an Ansible playbook that automates a NetApp storage task using REST APIs |
/ontap-generate-go |
Generate a Go program that automates a NetApp storage task using REST APIs |
/ontap-generate-python |
Generate a Python script that automates a NetApp storage task using REST APIs |
/ontap-generate-terraform |
Generate a Terraform module that automates a NetApp storage task using REST APIs |
/ontap-generate-workflow |
Generate a complete NetApp storage workflow - Python + Ansible + Terraform + Go - for a storage task |
/ontap-plan-api-sequence |
Design the REST API call sequence for a NetApp storage operation before writing code |
/review-contribution |
Review generated NetApp storage code for repository conventions, CI compliance, and PR readiness |
- Python >= 3.11; use modern syntax (PEP 604 unions, f-strings,
matchwhere appropriate). - Linter:
ruff(line length 99, target py311). Runruff check python/. - All new Python code should have type hints.
- Go 1.22+.
- Never hardcode credentials - use env vars, Ansible Vault, or Terraform
sensitive. - Every generated source file (
.py,.yml,.tf,.sh,.html,.go) MUST start with the standard NetApp copyright header (see below).
Use the comment syntax of the file. Year is 2026. Full trademark text
lives in NOTICE; do not duplicate it in source files.
© 2026 NetApp, Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
See the NOTICE file in the repo root for trademark and attribution details.
The insert-license pre-commit hook adds and verifies it automatically.
Exempt files: Markdown, requirements.*, ansible/*/inventory/*,
ansible/*/group_vars/*, *.example, dependabot.yml.
AGENTS.md, .github/copilot-instructions.md, .github/prompts/,
.github/instructions/, and .cursor/ are all generated. Edit the matching
file under ai/ and run make ai-assets; CI fails if the two drift apart.
See CONTRIBUTING.md for the full flow.