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:
Prepare for the Installation
If you install the Python SDK on the CommServe computer, the CommServe services will be stopped during installation. You can install the SDK on another computer or plan for the stoppage of services.
To gather the information that you must provide during the installation and to review other considerations, see the appropriate preinstallation checklist page:
Perform the Installation
Choose the installation procedure that applies to the operating system of your computer:
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.
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)
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.
For a list of Commvault Python commands, see Operations for Developer SDK - Python.
For Commvault Python samples, see Samples for Developer SDK - Python.
For Commvault End-User Command Line (cvc) Interface operations, see Commvault End-User Command Line (cvc) Interface Operations.