API Integrations: Cohesity Management SDK for Python

By Ashish Bhat • March 8, 2019

I recently boarded the rocketship that is Cohesity. As I’m learning the ropes, I see engineering culture at Cohesity embracing the values of GetThingsDone, Accelerate, and Deliver which reflects right from filesystem layer: SpanFS to management layer: Cohesity APIs. We want a similar experience for the Cohesity ecosystem (customers, partners, service providers and developers) as well. Simplicity is one of the core principles of Cohesity. Our API-driven architecture makes managing backup and other secondary workloads easier. Our enterprise customers leverage our Open APIs and ready-to-use integrations to further simplify their operations.

To continue expanding our integrations and capabilities, I’m excited to announce the availability of Cohesity’s Python Software Development Kit for Cohesity DataPlatform – called cohesity_management_sdk – it provides a one-stop-shop for managing functions related to the Cohesity DataProtect (Protection Job, Policy Management, Recovery) our hyperconverged backup and recovery solution, and the DataPlatform (Configure Cluster, External targets, Alerts, Audits, Reports, etc). Our goal is to further simplify the user experience by integrating with Python-based orchestration engines and libraries for the developer community.

Features of this SDK include:

  1. Completeness: v1.0.0 of the SDK is compatible with the complete set of API for Cohesity Pegasus 6.2 and beyond.
  2. Logging: We have provided a toggle to Enable/Disable logging. One can easily debug by logging the actions by the SDK to an external file or to the standard output.
  3. Samples: For ease of use, we have included illustrative samples showing how to run a protection job; add a VM to protection job; display alerts, etc. We are also working on few recipes that highlight our integrations with other python based libraries.
  4. Documentation: We have a well-documented page for our SDKs; as a bonus, the page includes a playground, which can take in user input and provides a way to copy paste the code.

Getting started, the Cohesity Management SDK for Python can be consumed with these simple steps:
Clone the repository:

  1. Clone the repository:
    git clone https://github.com/cohesity/management-sdk-python.git
  2. Install package and dependencies.
    pip install -r requirements.txt && python setup.py install
  3. Initialize the client.
    username = ‘Username’
    password = ‘Password’
    cluster_vip = ‘prod-cluster.eng.cohesity.com’
    client = CohesityClient(cluster_vip, username, password)

Enabling Python developers is a significant milestone towards realizing the vision of building an ecosystem around Cohesity APIs. We plan to enable this SDK natively as a part of Python package manager pip – this streamlines the installation and make it easier to find us on pypi. It also assures the developer community of our long term commitment to support the SDK. Developers can now focus on Application and Business logic and SDKs will serve as their building blocks. This is inline with Cohesity’s vision of bringing compute closer to data and recent announcement of the Cohesity MarketPlace.

I am excited to be part of this stellar company and welcome you to join our journey towards simplifying Data Protection and Management. Please send your questions and feedback to: cohesity-api-sdks@cohesity.com.To all the Python developers out there:

from cohesity.api_integrations_team import happy_developing

madison