Skip to main content

CVPySDK is a Python Package for Commvault Software.

CVPySDK uses REST APIs to perform CommCell operations.

Requirements

  • Python 3.9 and above

  • requests Python package

  • xmltodict Python package

  • Commvault Software v11 SP7 or later release with WebConsole installed

Installing CVPySDK

CVPySDK can be installed directly from PyPI using pip:

>>> pip install cvpysdk

CVPySDK is available on GitHub here

It can also be installed from source.

After downloading, from within the cvpysdk directory, execute:

>>> pip install .

Using CVPySDK

Login to Commcell:
>>> from cvpysdk.commcell import Commcell
>>> commcell = Commcell(webconsole_hostname, commcell_username, commcell_password)
Print all clients:
>>> print(commcell.clients)
Get a client:
>>> client = commcell.clients.get(client_name)
Get an agent:
>>> agent = client.agents.get(agent_name)
Get an instance:
>>> instance = agent.instances.get(instance_name)
Browsing content at instance level:
>>> paths, dictionary = instance.browse(path='c:\\', show_deleted=True)
Browsing content of a instance in a specific time range:
>>> paths, dictionary = instance.browse(path='f:\\', from_time='2010-04-19 02:30:00', to_time='2014-12-20 12:00:00')
Searching a file in instance backup content:
>>> paths, dictionary = instance.find(file_name="*.csv")
Get a backupset:
>>> backupset = instance.backupsets.get(backupset_name)
Run backup for a backupset:
>>> job = backupset.backup()
Browsing content at backupset level:
>>> paths, dictionary = backupset.browse(path='c:\\', show_deleted=True)
Browsing content of a backupset in a specific time range:
>>> paths, dictionary = backupset.browse(path='f:\\', from_time='2010-04-19 02:30:00', to_time='2014-12-20 12:00:00')
Searching a file in backupset backup content:
>>> paths, dictionary = backupset.find(file_name="*.csv")
Get a subclient:
>>> subclient = backupset.subclients.get(subclient_name)
Run backup for a subclient:
>>> job = subclient.backup(backup_level, incremental_backup, incremental_level)
Browsing content at subclient level:
>>> paths, dictionary = subclient.browse(path='c:\\', show_deleted=True)
Browsing content of a subclient in a specific time range:
>>> paths, dictionary = subclient.browse(path='f:\\', from_time='2010-04-19 02:30:00', to_time='2014-12-20 12:00:00')
Searching a file in subclient backup content:
>>> paths, dictionary = subclient.find(file_name="*.txt")
Run restore in place job for a subclient:
>>> job = subclient.restore_in_place(paths, overwrite, restore_data_and_acl)
Run restore out of place job for a subclient:
>>> job = subclient.restore_out_of_place(client, destination_path, paths, overwrite, restore_data_and_acl)
Job Operations:
>>> job.pause()             # Suspends the Job
>>> job.resume()            # Resumes the Job
>>> job.kill()              # Kills the Job
>>> job.status              # Current Status the Job  --  Completed / Pending / Failed / .... / etc.
>>> job.is_finished         # Job finished or not     --  True / False
>>> job.delay_reason        # Job delay reason (if any)
>>> job.pending_reason      # Job pending reason (if any)

Uninstalling

On Windows, if CVPySDK was installed using an .exe or .msi installer, simply use the uninstall feature of “Add/Remove Programs” in the Control Panel.

Alternatively, you can uninstall using the pip command:

>>> pip uninstall cvpysdk

Subclient Support

Subclient operations are currently supported for the following Agents:

  1. File System

  2. Virtual Server

  3. Cloud Apps

  4. SQL Server

  5. NAS / NDMP

  6. SAP HANA

  7. ORACLE

  8. Sybase

  9. SAP ORACLE

  10. Exchange Database

  11. Exchange Mailbox

  12. Informix

  13. Notes Database

  14. MySQL

  15. PostgreS

  16. Big Data Apps

Documentation

To get started, please see the full documentation for this library

Contribution Guidelines

  1. We welcome all the enhancements from everyone although we request the developer to follow some guidelines while interacting with the CVPySDK codebase.

  2. Before adding any enhancements/bug-fixes, we request you to open an Issue first.

  3. The SDK team will go over the Issue and notify if it is required or already been worked on.

  4. If the Issue is approved, the contributor can then make the changes to their fork and open a pull request.

Pull Requests

  • CVPySDK has 2 active branches, namely:
    • master

    • dev

  • The contributor should Fork the dev branch, and make their changes on top of it, and open a Pull Request

  • The master branch will then be updated with the dev branch, once everything is verified

Note: The SDK team will not accept any Pull Requests on the master branch

Coding Considerations

  • All python code should be PEP8 compliant.

  • All changes should be consistent with the design of the SDK.

  • The code should be formatted using autopep8 with line-length set to 99 instead of default 79.

  • All changes and any new methods/classes should be properly documented.

  • The doc strings should be of the same format as existing docs.

Questions/Comments/Suggestions

If you have any questions or comments, please contact us here. Also Check out our community for Automation incase of queries.

Code of Conduct

Everyone interacting in the CVPySDK project’s codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PyPA Code of Conduct.

License

CVPySDK and its contents are licensed under Commvault License

About Commvault

https://commvault.github.io/cvpysdk/logo.png

Commvault (NASDAQ: CVLT) is a publicly traded data protection and information management software company headquartered in Tinton Falls, New Jersey.

It was formed in 1988 as a development group in Bell Labs, and later became a business unit of AT&T Network Systems. It was incorporated in 1996.

Commvault software assists organizations with data backup and recovery, cloud and infrastructure management, and retention and compliance.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cvpysdk-11.44.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cvpysdk-11.44-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file cvpysdk-11.44.tar.gz.

File metadata

  • Download URL: cvpysdk-11.44.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for cvpysdk-11.44.tar.gz
Algorithm Hash digest
SHA256 86a19068c61017bd9af26e0eaafd17c3c09d56ae1fa7042d93d5699cb3212658
MD5 03d3e9bdcf5aaa3844921438e98ec149
BLAKE2b-256 b254cb8f3c97df18315eedf9a9650b479d407f62af860b401e07ee1e8c6970ed

See more details on using hashes here.

File details

Details for the file cvpysdk-11.44-py3-none-any.whl.

File metadata

  • Download URL: cvpysdk-11.44-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for cvpysdk-11.44-py3-none-any.whl
Algorithm Hash digest
SHA256 6b72578875bf9ab31651756d854b2cb7e182ecf80d90f4b6e6be00667074e42c
MD5 5fabf90fa94fffe802b9d153d9bb37ea
BLAKE2b-256 24cae6d7b3da732f8bdc4e9c55e16c022b58aadb530d1f5637072454316eca6b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

11.44 This release

2 files

11.40.2

2 files

11.40.1

2 files

11.40

2 files

11.38

2 files

11.36.3

2 files

11.36.1

2 files

11.36

2 files

11.34

2 files

11.32.6

2 files

11.32.5

2 files

11.32.4

2 files

11.32.3

2 files

11.32.1

2 files

11.32

2 files

11.30.1

3 files

11.30

2 files

11.28

2 files

11.26

2 files

11.25

2 files

11.24

2 files

11.23

2 files

11.22

2 files

11.21.2

2 files

11.21.1

2 files

11.21

2 files

11.20.1

2 files

11.20

2 files

11.19.1

2 files

11.19

2 files

11.18.2

2 files

11.18.1

2 files

11.18

2 files

11.17.1

2 files

11.17

2 files

11.16.2

2 files

11.16

2 files

11.15

2 files

11.14

2 files

11.13

2 files

11.12

2 files

11.11

2 files

11.10.0

2 files

11

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page