Before you begin

Contributors dmp-netapp Download PDF of this page

Python is a popular development language especially for datacenter automation. Before using Python to access the Astra REST API, you need to prepare the environment and the required input files.

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. 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"
}