{"id":21526377,"url":"https://github.com/netapp/netapp-astra-toolkits","last_synced_at":"2026-02-04T12:33:01.631Z","repository":{"id":37792102,"uuid":"370431884","full_name":"NetApp/netapp-astra-toolkits","owner":"NetApp","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-16T11:47:21.000Z","size":60117,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-12-16T20:34:51.931Z","etag":null,"topics":["netapp-public"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NetApp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-24T17:23:29.000Z","updated_at":"2024-10-23T17:04:51.000Z","dependencies_parsed_at":"2024-01-10T16:07:32.467Z","dependency_job_id":"460407e4-5891-45db-81b5-42ae8da23455","html_url":"https://github.com/NetApp/netapp-astra-toolkits","commit_stats":{"total_commits":309,"total_committers":11,"mean_commits":28.09090909090909,"dds":0.5663430420711975,"last_synced_commit":"1e1271e671b69e442766b53f71b035604e7880ba"},"previous_names":[],"tags_count":67,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetApp%2Fnetapp-astra-toolkits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetApp%2Fnetapp-astra-toolkits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetApp%2Fnetapp-astra-toolkits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetApp%2Fnetapp-astra-toolkits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NetApp","download_url":"https://codeload.github.com/NetApp/netapp-astra-toolkits/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248130058,"owners_count":21052690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["netapp-public"],"created_at":"2024-11-24T01:44:46.138Z","updated_at":"2026-02-04T12:33:01.587Z","avatar_url":"https://github.com/NetApp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetApp Astra Control Python SDK\n\nThe NetApp Astra Control Python SDK is designed to provide guidance for working with the NetApp Astra Control API.\n\nYou can use the `astraSDK/` library out of the box, and as a set of example recommended code and processes, \"cookbook\" style. The `toolkit.py` script provides a command line interface to interact with Astra Control with built-in guardrails, and since it utilizes `astraSDK/` it can provide additional context around the requirements of the astraSDK classes.\n\n![Astra SDK Component and Installation Diagram](/docs/install/img/components-install.png)\n\nWhen using `toolkit.py`/`actoolkit` in automation, it is **highly** recommended to tie your workflows to a specific [tag](https://github.com/NetApp/netapp-astra-toolkits/tags) or [release](https://pypi.org/project/actoolkit/#history) (as functionality may change over time), and be sure to thoroughly test all workflows to ensure expected behavior.\n\n\u003e **Note**: Support for all components of the Astra Control Python SDK is exclusively handled in a best effort fashion by the **community** via [GitHub issues](https://github.com/NetApp/netapp-astra-toolkits/issues), and is **not** supported by NetApp Support. Use of this SDK is entirely at your own risk.\n\n## Installation\n\nThe NetApp Astra Control SDK can be utilized three different ways, depending upon your use case:\n\n1. **Administrator**: if you want to use the toolkit as quickly as possible without modifications, it is recommended to utilize the [prepared Docker image](#1-docker-installation), as it has all of the required dependencies and binaries configured and ready to go (including `actoolkit`).\n1. **DevOps / GitOps**: if utilizing the toolkit in a software pipeline, the [python package](#2-python-package-installation) ([actoolkit](https://pypi.org/project/actoolkit/)) is *typically* the most straightforward method of consumption. A simple `pip install` command results in toolkit.py (as `actoolkit`) being available in the user's PATH and all python-related dependencies installed.  It also installs the `astraSDK/` library for use in custom scripts.\n1. **Developer**: if you plan to modify the SDK for internal consumption, [manual installation](#3-manual-installation) is recommended by cloning (or forking) this repository and working in your local development environment. Ensure that all dependencies mentioned below are met.\n\nThis [Python SDK Installation video](https://www.youtube.com/watch?v=r6lBQ2I7O7M) walks through all three use cases / installation methods.\n\n### Prerequisites\n\nFor the **administrator** use case with the [prepared Docker image](#1-docker-installation):\n\n* Docker 20.10.7+\n\nFor the **DevOps / GitOps** use case with the [python package](#2-python-package-installation) ([actoolkit](https://pypi.org/project/actoolkit/)):\n\n* Python 3.8+\n* Pip 21.1.2+\n\nFor the **developer** use case or to [manually install](#3-manual-installation) the NetApp Astra Control SDK:\n\n* Python 3.8+\n* Pip 21.1.2+\n* Git 2.30.2+\n* Kubectl 1.23+\n* Azure CLI (`az`) 2.25.0+ or Google Cloud SDK (`gcloud`) 345.0.0+ or AWS CLI (`aws`) 1.22.0+\n* Helm 3.2.1+\n\n### Authentication\n\nNo matter the method of installation, the SDK authenticates by reading in the `config.yaml` file from the following locations (in order):\n\n1. The current working directory that the executed function is located in\n1. `~/.config/astra-toolkits/`\n1. `/etc/astra-toolkits/`\n1. The directory pointed to by the shell env var `ASTRATOOLKITS_CONF`\n\nAgain, no matter the method of installation, the `config.yaml` file should have the following syntax:\n\n```text\nheaders:\n  Authorization: Bearer \u003cBearer-Token-From-API-Access-Page\u003e\nuid: \u003cAccount-ID-From-API-Access-Page\u003e\nastra_project: \u003cShortname-or-FQDN\u003e\nverifySSL: \u003cTrue-or-False\u003e\n```\n\nThis [Astra Control API Credentials](https://www.youtube.com/watch?v=o-q-q_41A5A) video walks through creating the `config.yaml` file, or follow the instructions below.\n\nCreate (if using `actoolkit`) or edit (if using the git repo) the `config.yaml` file in one of the above mentioned locations with your NetApp Astra Control account information:\n\n* `Authorization: Bearer`: Your API token\n* `uid`: Your Astra Control Account ID\n* `astra_project`: Your Astra Control instance (shortnames get astra.netapp.io appended to them, FQDNs [anything with a `.`] are used unchanged)\n* `verifySSL`: True or False, useful for self-signed certs (if this field isn't included it's treated as True)\n\nYou can find this information in your NetApp Astra Control account profile. Click the user icon in the upper right-hand corner, then choose **API Access** from the drop-down menu which appears.\n\n![Locate your Astra Control profile](/docs/install/img/astra-profile.png)\n\nCopy and paste your Astra Control account ID into the `config.yaml` file.\n\n![Locate your Astra Control account ID](/docs/install/img/astra-account-info.png)\n\nTo get your API token, click **+ Generate API token**. Generate a new API token, then copy and paste the token into the `config.yaml`\n\nWhen you are done, the `config.yaml` looks like:\n\n```text\nheaders:\n  Authorization: Bearer thisIsJustAnExample_token-replaceWithYours==\nuid: 12345678-abcd-4efg-1234-567890abcdef\nastra_project: astra.netapp.io\nverifySSL: True\n```\n\n### 1. Docker Installation\n\nLaunch the prepared Docker image. Docker will automatically download the image if you don't already have it on your system.\n\n```text\ndocker run -it netapp/astra-toolkits:latest /bin/bash\n```\n\nNOTE: From this point forward, you will be working in the Docker container you just launched.\n\nSet up your kubeconfig to successfully run kubectl commands against your cluster with the appropriate command (e.g. `export KUBECONFIG=/path/to/kubeconfig`, `gcloud container clusters get-credentials`, `az aks get-credentials`, or `aws eks update-kubeconfig`).\n\nConfigure your `config.yaml` as detailed in the [authentication](#authentication) section.\n\nSince the [actoolkit](https://pypi.org/project/actoolkit/) python package is bundled with the Docker image, you can immediately use it to interact with Astra Control:\n\n```text\nactoolkit list clusters\n```\n\nAlternatively, you can also follow the [manual installation](#3-manual-installation) steps to clone the git repo and optionally make modifications to the code base, all while not having to worry about software dependencies.\n\n### 2. Python Package Installation\n\nInstall [actoolkit](https://pypi.org/project/actoolkit/) with the following command:\n\n```text\npython3 -m pip install actoolkit\n```\n\nConfigure your `config.yaml` as detailed in the [authentication](#authentication) section.\n\nYou can now use `actoolkit` to invoke the NetApp Astra Control SDK. For example, [list](docs/toolkit/list/README.md#clusters) your Astra Control Kubernetes clusters with the command:\n\n```text\nactoolkit list clusters\n```\n\nAdditionally, the `astraSDK/` library is available for import for use when creating custom scripts:\n\n```text\n\u003e\u003e\u003e import astraSDK\n\u003e\u003e\u003e print(astraSDK.clusters.getClusters(output=\"table\").main())\n+----------------------+--------------------------------------+---------------+----------------+\n| clusterName          | clusterID                            | clusterType   | managedState   |\n+======================+======================================+===============+================+\n| uscentral1-cluster   | 0412fd41-51b8-478a-b055-0bd50e34b1fe | gke           | managed        |\n+----------------------+--------------------------------------+---------------+----------------+\n| prod-cluster         | c69d8281-d4ea-4902-b03e-0c39c7da4543 | gke           | managed        |\n+----------------------+--------------------------------------+---------------+----------------+\n```\n\n### 3. Manual Installation\n\nClone the NetApp Astra Control SDK repo.\n\n```text\ngit clone https://github.com/NetApp/netapp-astra-toolkits.git\n```\n\nMove into the repo directory.\n\n```text\ncd netapp-astra-toolkits\n```\n\nRun the following commands to add the required Python elements:\n\n```text\npython3 -m venv toolkit\nsource toolkit/bin/activate\npip install -r requirements.txt\n```\n\nConfigure your `config.yaml` as detailed in the [authentication](#authentication) section.\n\nYou can now use `./toolkit.py` to invoke the NetApp Astra Control SDK. For example, [list](docs/toolkit/list/README.md#clusters) your Astra Control Kubernetes clusters with the command:\n\n```text\n./toolkit.py list clusters\n```\n\n## Additional Resources\n\nSee [the documentation](/docs) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetapp%2Fnetapp-astra-toolkits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetapp%2Fnetapp-astra-toolkits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetapp%2Fnetapp-astra-toolkits/lists"}