Use the Python SDK to run Commvault operations in your CommCell environment. The Python SDK requires an installation of the Command Center.
Step 1: Install the Python SDK
Review each of the following topics to get started with the installation:
-
Prepare for the Installation
Important
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 %install_path%/python (for example: C:/Program Files/Commvault/ContentStore/python).
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.
After downloading, from within the cvpysdk directory, execute:
>>> python setup.py install
IBM i
For instructions on installing the Python software on an IBM i computer, see Installing Python on an IBM i Computer.
OpenVMS
For instructions on installing the Python software on an OpenVMS computer, see Installing Python on an OpenVMS 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(commandcenter_hostname, commcell_username, commcell_password)
where:
-
commandcenter_hostname is the host name and port number for the Command Center, 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.