Package: cohesity-management-sdk
Cohesity Management SDKOverviewTheCohesity Management SDKprovides an easy-to-use language binding to
harness the power ofCohesity REST APIsin your python applications.Table of contents :scroll:Getting StartedCluster Version and Compatibility MatrixDocumentationHow to useMore samplesHow can you contributeSuggestions and FeedbackLet's get started :hammer_and_pick:InstallationInstall via pip:pip install cohesity-management-sdkInstall from source:The generated code uses Python packages named requests, jsonpickle and dateutil.
You can resolve these dependencies usingpip.
This SDK uses the Requests library and will work for Python2 >=2.7.9and Python3 >=3.4.git clone https://github.com/cohesity/management-sdk-python.git
cd management-sdk-python
pip install -r requirements.txt
python setup.py installUpgradeTo upgrade the package:pip install cohesity-management-sdk --upgradeTo upgade the package to specific release:pip install cohesity-management-sdk==1.5.1Compatibility MatrixCluster VersionSDK Version7.01.10.16.8.1_u11.9.26.8.1_u11.9.16.8.1_u11.9.06.6.0x1.8.16.6x1.6.06.5.1x1.5.06.5.0x1.4.06.4.1x1.2.06.3.1x1.1.36.4x1.1.16.3x1.1.0Documentation :books:Refer Python docs for your cluster version.How to Use: :mag_right:This SDK exposes all the functionality provided byCohesity REST API.Initializing the Client usingusernameandpassword:username = 'Username'
password = 'Password'
domain = 'Domain' #optional
cluster_vip = 'prod-cluster.eng.cohesity.com'
client = CohesityClient(cluster_vip, username, password, domain)
cluster_controller = client.cluster
result = cluster_controller.get_basic_cluster_info()
result_dict =  result.__dict__
print(result_dict['cluster_software_version'])

#OUTPUT
6.4.1_release-20191219_aafe3274Initializing the Client UsingSession Id:cluster_vip = 'prod-cluster.eng.cohesity.com'
session_id = '<session_id>'
client = CohesityClient(cluster_vip=cluster_vip, session_id = session_id)
cluster_controller = client.cluster
result = cluster_controller.get_basic_cluster_info()
print(result_dict['cluster_software_version'])


#OUTPUT
6.4.1_release-20191219_aafe3274Initializing the Client UsingApi Key:cluster_vip = 'prod-cluster.eng.cohesity.com'
api_key = '<api_key>'
client = CohesityClient(cluster_vip=cluster_vip, api_key = api_key)
cluster_controller = client.cluster
result = cluster_controller.get_basic_cluster_info()
print(result_dict['cluster_software_version'])


#OUTPUT
6.4.1_release-20191219_aafe3274Initializing the Client UsingOpen-Id token:cluster_vip = 'prod-cluster.eng.cohesity.com'
open_id_token = '<token>'
client = CohesityClient(cluster_vip=cluster_vip, open_id_token = open_id_token)
cluster_controller = client.cluster
result = cluster_controller.get_basic_cluster_info()
print(result_dict['cluster_software_version'])


#OUTPUT
6.4.1_release-20191219_aafe3274Initializing the Client UsingMFA:username = 'Username'
password = 'Password'
otp_type = 'Email'
otp_code = '123456'
domain = 'Domain' #optional
cluster_vip = 'prod-cluster.eng.cohesity.com'
client = CohesityClient(cluster_vip=cluster_vip, username=username, password=password, domain=domain, otp_type=otp_type, otp_code=otp_code)
cluster_controller = client.cluster
result = cluster_controller.get_basic_cluster_info()
print(result_dict['cluster_software_version'])


#OUTPUT
6.4.1_release-20191219_aafe3274More sample code to get going: :bulb:Check out the scripts included undersamplesfor reference.Contribute :handshake:Refer our contribution guideline.Questions or Feedback :raised_hand:We would love to hear from you. Please send your questions and feedback to:cohesity-api-sdks@cohesity.com