Following on from my quick look at using PowerShell with Cohesity, I want to highlight the developer resources page at developer.cohesity.com. The developer portal has a few useful resources for automation around Cohesity, some detailed documentation of the REST API that is the core of all developer access to Cohesity and a repository of sample scripts that you can re-use and re-purpose to your needs. There are samples in Python, PowerShell, and Ansible as well as details of how to build an application to run on a Cohesity cluster.
Disclosure: This post is part of my work with Cohesity.
API Documentation
The API documentation is comprehensive with all of the API endpoints and methods listed. Below is an example, the Create Protection Policy API endpoint.
Even more importantly, there is plenty of detail about the objects that you must pass to these endpoints. For example, below is the Protection Policy Request object, with its collection of child objects.
Swagger
If you prefer a more hands-on method to learn about the Cohesity API, then I suggest you use the Swagger interface to directly experiment with the API. You will find the Swagger interface in the documentation on your Cohesity cluster, https://<cluster>/doc/restAPiDocs/browse/ From there you can directly execute APIs and see the results.
Code Samples
The samples of Python code are equally useful, with samples that cover core management function such as adding a list of VMs to a protection job as shown below.
There are a dozen Python samples, around sixty PowerShell samples, and a small collection of samples that work with the Cohesity modules for Ansible. The large number of PowerShell samples reflects that PowerShell is a ubiquitous automation platform for infrastructure automation.
Applications on the Cohesity Cluster
You will recall that there is a marketplace of applications that can run directly on your Cohesity cluster to interact with data stored on the cluster. The Developer Portal has some basic information about building your application for deployment on the cluster, and publication through the marketplace. The most important thing to understand here is that the applications run in containers on the cluster. The cluster retains control of resources for the application, and developers get the benefit of portability from container-targeted development.
There is an extensive collection of developer tools available from Cohesity, everything available by starting at the developer Portal.
© 2019, Alastair. All rights reserved.