Skip to main content

NetApp Astra Control Python SDK

The NetApp Astra Control Python SDK is designed to provide guidance for working with the NetApp Astra Control API.

You can use the astraSDK.py library out of the box, and as a set of example recommended code and processes, "cookbook" style. The toolkit.py script is a helpful sandbox tool for learning how to use the Astra API.

We don't recommend the use of toolkit.py in 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.

Installation

The 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.

Prerequisites

To 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.8+
    • 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.

docker run -it netapp/astra-toolkits:2.2 /bin/bash

NOTE: 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, or az aks get-credentials).

Clone the NetApp Astra Control SDK repo.

git clone https://github.com/NetApp/netapp-astra-toolkits.git

Move into the repo directory.

cd netapp-astra-toolkits

Edit the config.yaml file to add your NetApp Astra Control account information.

  • Authorization: Bearer: Your API token
  • uid: Your Astra Control Account ID
  • astra_project: Your Astra Control instance (Shortnames get astra.netapp.io appended to them for ACS. FQDNs are used unchanged for ACC instances)
  • 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 choose API Access from the drop-down menu which appears.

Locate your Astra Control profile

Copy and paste your Astra Control account ID into the config.yaml file.

Locate your Astra Control account ID

To get your API token, click + Generate API token. Generate a new API token, then copy and paste the token into the config.yaml

When you are done, the config.yaml looks like:

headers:
  Authorization: Bearer ABCDEFGHI0123456789
uid: 123456789-1234-123456789
astra_project: preview

Save and exit the file.

Run the following commands to add the required Python elements:

virtualenv toolkit
source toolkit/bin/activate
pip install -r requirements.txt

You can now use ./toolkit.py to invoke the NetApp Astra Control SDK. For example, list your Astra clusters with the command:

./toolkit.py list clusters

See the documentation for more info.

Install Manually

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, or az aks get-credentials).

Clone the NetApp Astra SDK repo.

git clone https://github.com/NetApp/netapp-astra-toolkits.git

Move into the repo directory.

cd netapp-astra-toolkits

Edit the config.yaml file to add your NetApp Astra account information.

  • Authorization: Bearer: Your API token
  • uid: Your Astra Account ID
  • astra_project: Your Astra instance (preview or demo)

You can find this information in your NetApp Astra account profile. Click the user icon in the upper right-hand corner, then choose API Access from the drop-down menu which appears.

Locate your Astra profile

Copy and paste your Astra account ID into the config.yaml file.

Locate your Astra account ID

To get your API token, click + Generate API token. Generate a new API token, then copy and paste the token into the config.yaml

When you are done, the config.yaml looks like:

headers:
  Authorization: Bearer ABCDEFGHI0123456789
uid: 123456789-1234-123456789
astra_project: preview

Save and exit the file.

Run the following commands to add the required Python elements:

virtualenv toolkit
source toolkit/bin/activate
pip install -r requirements.txt

You can now use ./toolkit.py to invoke the NetApp Astra SDK. For example, list your Astra clusters with the command:

./toolkit.py list clusters

See the documentation for more info.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

actoolkit-2.2.0-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

actoolkit-2.2-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

File details

Details for the file actoolkit-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: actoolkit-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 31.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for actoolkit-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1ed8f91007d6251e23b7a53fd0ebcbaf36e9ebf2327cba1cf367354785347e5
MD5 1516e524cc59477d5da2dd98b406b47b
BLAKE2b-256 16b9f1c4f5cdb5ee5d0e7e6b18e28553a2f00cad815d52bf8400897ddd3a5c47

See more details on using hashes here.

File details

Details for the file actoolkit-2.2-py3-none-any.whl.

File metadata

  • Download URL: actoolkit-2.2-py3-none-any.whl
  • Upload date:
  • Size: 31.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for actoolkit-2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1b469ec5530c8d432dec6bdda14b08ae0ce95aeb0be46a582bb0db83f9844c64
MD5 8fa433aa7dc5e578d37d7197065a38cb
BLAKE2b-256 a21955a7bf9aae9c5f719e36b931038048018e2da0b4c3727814f2934b8b5aa1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page