Skip to main content

Cohesity Cluster SDK

License: Apache2 Maintenance

Python client library for the Cohesity v2 REST API (/v2).

Table of Contents


Overview

cohesity-cluster-sdk exposes typed models, controllers, and a single entry-point client for calling Cohesity cluster APIs from Python.

  • Client: CohesityClientV2 — lazy-loaded controllers for each API area (protection groups, sources, recovery, and more).
  • Models: request/response objects under cohesity_cluster_sdk.models.v2 with from_dictionary() deserialization.
  • Enums: typed constants for enum fields (for example AgentHostSummaryObjectTypeEnum.K_DATABASE).
  • Configuration: ConfigurationV2 on client.configuration — cluster VIP, credentials, SSL, and auth mode.

Requirements

  • Python 3.9 or higher
  • Dependencies (installed automatically): requests, cachecontrol, python-dateutil

Installation

Install from PyPI:

pip install cohesity-cluster-sdk

Import in your application:

from cohesity_cluster_sdk.cohesity_client_v2 import CohesityClientV2

Compatibility

Cluster version SDK version Python
7.4 7.4.0 ≥ 3.9

This package targets the v2 REST API only (base_path: /v2).


Quick Start

from cohesity_cluster_sdk.cohesity_client_v2 import CohesityClientV2

client = CohesityClientV2(
    cluster_vip="your-cluster-vip",
    username="admin",
    password="password",
    domain="LOCAL",
)

# List protection groups
response = client.protection_group.get_protection_groups()
for group in response.protection_groups or []:
    print(group.name, group.environment)

# Fetch a source registration
registration = client.source.get_protection_source_registration(id=1)
print(registration.name)

Controllers are available as properties on the client (for example client.protection_group, client.source, client.recovery, client.config). See cohesity_cluster_sdk.cohesity_client_v2 for the full list.

Using enum constants

Enum fields accept the same string values sent on the wire. Use the generated enum classes to avoid typos:

from cohesity_cluster_sdk.models.v2.create_or_update_protection_group_request_environment_enum import (
    CreateOrUpdateProtectionGroupRequestEnvironmentEnum,
)

body.environment = CreateOrUpdateProtectionGroupRequestEnvironmentEnum.K_SQL

Authentication and SSL

Cluster settings live on ConfigurationV2 via client.configuration.

Field Default Purpose
cluster_vip (required) Cluster hostname or VIP — no https:// prefix
username / password None Cohesity credentials
domain None Auth domain; use LOCAL for local users
skip_ssl_verification True Disable TLS verification when True
api_key None Static API key (bypasses token auth)
use_session None Session auth via session-id header

Auth modes (in priority order):

  1. API key — sends apiKey header when api_key is set.
  2. Session — creates a session when use_session=True; sends session-id.
  3. Bearer token (default) — POSTs credentials to https://{cluster_vip}/v2/access-tokens, then sends Authorization: {tokenType} {accessToken}.

SSL: When skip_ssl_verification is True, the HTTP client passes verify=False on every request. To enable verification, set it before making calls:

from cohesity_cluster_sdk.configuration_v2 import ConfigurationV2

ConfigurationV2.skip_ssl_verification = False

For self-signed lab clusters, the default (True) is usually appropriate.

Tips:

  • List endpoints return wrapper objects — iterate with response.protection_groups or [].
  • Nullable model fields may be None; guard before access.
  • client.configuration holds runtime settings; client.config is the cluster configuration API controller.

Package Layout

cohesity_cluster_sdk/
├── cohesity_client_v2.py        # Entry point — CohesityClientV2
├── configuration_v2.py          # Cluster VIP, auth, SSL — ConfigurationV2
├── api_helper.py                  # Serialization and URL building
├── decorators.py                  # lazy_property
├── models/v2/                     # Request/response models and enum classes
├── api/v2/                        # API controllers (one per API area)
├── http/                          # HTTP client, auth, retry logic
└── exceptions/                    # APIException, ExpiredTokenException

License

Apache 2.0 — see LICENSE.

Download files

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

Source Distribution

cohesity_cluster_sdk-7.4.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

cohesity_cluster_sdk-7.4.0-py3-none-any.whl (3.7 MB view details)

Uploaded Python 3

File details

Details for the file cohesity_cluster_sdk-7.4.0.tar.gz.

File metadata

  • Download URL: cohesity_cluster_sdk-7.4.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for cohesity_cluster_sdk-7.4.0.tar.gz
Algorithm Hash digest
SHA256 3e407636a48450e174829e6e2fd6f07255b5aaff530ef787f414e84be6c2e0a5
MD5 f5f23a40bff5ddde71abc21eb6f4b87e
BLAKE2b-256 3b9b2586c1324205a7d3f1734661899e9d306423587ddf2a03f6b99c348ff382

See more details on using hashes here.

File details

Details for the file cohesity_cluster_sdk-7.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cohesity_cluster_sdk-7.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0d628363908e47d2c65a44833e92050844e5f29d1607e7e2f7d972289161918
MD5 d05285cc95c6b9c46fddb43dd443b160
BLAKE2b-256 6f090b8b6abe469e9577d88ab0420c4436d69656bf6f636d9983c63e101c5d2c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

7.4.0 This release

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