Skip to main content
A newer release of this product is available.

Before you begin

Contributors netapp-aoife dmp-netapp

Python is a popular development language especially for datacenter automation. Before using the native features of Python together with several common packages, you need to prepare the environment and the required input files.

Note In addition to accessing the Astra Control REST API directly using Python, NetApp also provides a toolkit package which abstracts the API and removes some of the complexities. See NetApp Astra Control Python SDK for more information.

Prepare the environment

The basic configuration requirements to run the Python scripts are described below.

Python 3

You need to have the latest version of Python 3 installed.

Additional libraries

The Requests and urllib3 libraries must be installed. You can use pip or another Python management tool as appropriate for your environment.

Network access

The workstation where the scripts run must have network access and be able to reach Astra Control. When using Astra Control Service, you must be connected to the internet and be able to connect to the service at https://astra.netapp.io.

Identity information

You need a valid Astra account with the account identifier and API token. See Get an API token for more information.

Create the JSON input files

The Python scripts rely on configuration information contained in JSON input files. Sample files are provided below.

Note You need to update the samples as appropriate for your environment.
Identity information

The following file contains the API token and Astra account. You need to pass this file to Python scripts using the -i (or --identity) CLI parameter.

{
  "api_token": "kH4CA_uVIa8q9UuPzhJaAHaGlaR7-no901DkkrVjIXk=",
  "account_id": "5131dfdf-03a4-5218-ad4b-fe84442b9786"
}