Package: netapp-astra-toolkits
NetApp Astra Control Python SDKThe NetApp Astra Control Python SDK is designed to provide guidance for working with the NetApp Astra Control API.You can use theastraSDK.pylibrary out of the box, and as a set of example recommended code and processes, "cookbook" style. Thetoolkit.pyscript is a helpful sandbox tool for learning how to use the Astra API.We don't recommend the use oftoolkit.pyin production, but the code is heavily-documented, so you can see how the parts come together, and use it as a starting point for your own code.InstallationThe NetApp Astra Control Toolkit can be run in a Docker container. This makes it easy for you to launch and use the SDK, because the prepared Docker image has all the dependencies and requirements configured and ready to go.PrerequisitesTo use the prepared Docker image (recommended) to run the NetApp Astra Control Toolkit:One or more running compute clusters managed by NetApp Astra Control.Required software installed:Docker 20.10.7+To manually run the NetApp Astra Control Toolkit:One or more running compute clusters managed by NetApp Astra Control.Required software installed:Python 3.5+Pip 21.1.2+Virtualenv 20.4.7+Git 2.30.2+Kubectl 1.17+Azure CLI (az) 2.25.0+ or Google Cloud SDK (gcloud) 345.0.0+Helm 3.2.1+Install Using Docker (Recommended)Launch the prepared Docker image. Docker will automatically download the image if you don't already have it on your system.sudodockerrun-itjpaetzel0614/k8scloudcontrol:1.0/bin/bashNOTE: From this point forward, you will be working in the Docker container you just launched.Set 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, oraz aks get-credentials).Clone the NetApp Astra Control SDK repo.gitclonehttps://github.com/NetApp/netapp-astra-toolkits.gitMove into the repo directory.cdnetapp-astra-toolkitsEdit theconfig.yamlfile to add your NetApp Astra Control account information.Authorization: Bearer: Your API tokenuid: Your Astra Control Account IDastra_project: Your Astra Control instance (previewordemoACC users put a FQDN here)verifySSL: True or False, useful for self-signed certs. (If this field isn't included it's treated as true)You can find this information in your NetApp Astra Control account profile. Click the user icon in the upper right-hand corner, then chooseAPI Accessfrom the drop-down menu which appears.Copy and paste your Astra Control account ID into theconfig.yamlfile.To get your API token, click+ Generate API token. Generate a new API token, then copy and paste the token into theconfig.yamlWhen you are done, theconfig.yamllooks like:headers:Authorization:BearerABCDEFGHI0123456789
uid:123456789-1234-123456789
astra_project:previewSave and exit the file.Run the following commands to add the required Python elements:virtualenvtoolkitsourcetoolkit/bin/activate
pipinstall-rrequirements.txtYou can now use./toolkit.pyto invoke the NetApp Astra Control SDK. For example, list your Astra clusters with the command:./toolkit.pylistclustersSeethe documentationfor more info.Install ManuallySet 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, oraz aks get-credentials).Clone the NetApp Astra SDK repo.gitclonehttps://github.com/NetApp/netapp-astra-toolkits.gitMove into the repo directory.cdnetapp-astra-toolkitsEdit theconfig.yamlfile to add your NetApp Astra account information.Authorization: Bearer: Your API tokenuid: Your Astra Account IDastra_project: Your Astra instance (previewordemo)You can find this information in your NetApp Astra account profile. Click the user icon in the upper right-hand corner, then chooseAPI Accessfrom the drop-down menu which appears.Copy and paste your Astra account ID into theconfig.yamlfile.To get your API token, click+ Generate API token. Generate a new API token, then copy and paste the token into theconfig.yamlWhen you are done, theconfig.yamllooks like:headers:Authorization:BearerABCDEFGHI0123456789
uid:123456789-1234-123456789
astra_project:previewSave and exit the file.Run the following commands to add the required Python elements:virtualenvtoolkitsourcetoolkit/bin/activate
pipinstall-rrequirements.txtYou can now use./toolkit.pyto invoke the NetApp Astra SDK. For example, list your Astra clusters with the command:./toolkit.pylistclustersSeethe documentationfor more info.