Getting Started with the Developer SDK for Python

Use the Python SDK to run Commvault operations in your CommCell environment. The Python SDK requires an installation of the Web Console.

Step 1: Install the Python SDK

Review each of the following topics to get started with the installation:

Step 2: Install the Python Software

Windows and UNIX

If you installed the Python SDK on a Windows computer or a UNIX computer, no action is required. Python 3.6 is automatically installed along with the Python SDK.

On a Windows computer, the installation location is C:\Program Files\Python36. On a UNIX computer, the software is packaged inside the Commvault installation directory: %INSTALL_PATH%/python/bin/python3 (for example: /opt/commvault/python/bin/python3).

For both Windows computers and UNIX computers, to avoid overwriting any other installed instance of Python, the Python executable is not added to environment variables.

IBM i

For instructions on installing the Python software on an IBM i computer, see Installing Python on an IBM i Computer.

Step 3: Establish a Connection

Applies to: Windows and UNIX clients

Import the Commcell class and log on to the CommCell environment. The following is the Python commandlet for establishing a connection:

>>> from cvpysdk.commcell import Commcell >>> commcell = Commcell(webconsole_hostname, commcell_username, commcell_password)

where:

  • webconsole_hostname is the host name and port number for the Web Console, for example: client.mydomain.com:85. If port 80 is used, you do not need to specify it.

  • commcell_username is the user name used to log on to the CommCell environment.

  • commcell_password is the user password in plain text. If you do not provide the password in the command, you are prompted to enter the password at run time.

Step 4: Where to Go From Here

Run Commvault operations through the Python SDK or incorporate the Commvault Python commands into scripts or other code.

Loading...