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.

Metadata

Release files for cohesity-cluster-sdk 7.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cohesity-cluster-sdk 7.4.0
File Size Uploaded Provenance Actions
cohesity_cluster_sdk-7.4.0.tar.gz 1.6 MB Without provenance Details for cohesity_cluster_sdk-7.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cohesity-cluster-sdk 7.4.0
File Interpreter ABI Platform Actions
cohesity_cluster_sdk-7.4.0-py3-none-any.whl Python 3 none any Details for cohesity_cluster_sdk-7.4.0-py3-none-any.whl

Total release size: 5.3 MB

Release files / cohesity_cluster_sdk-7.4.0.tar.gz

Download URL cohesity_cluster_sdk-7.4.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
3e407636a48450e174829e6e2fd6f07255b5aaff530ef787f414e84be6c2e0a5
BLAKE2b-256 checksum
How to use checksums
3b9b2586c1324205a7d3f1734661899e9d306423587ddf2a03f6b99c348ff382
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / cohesity_cluster_sdk-7.4.0-py3-none-any.whl

Download URL cohesity_cluster_sdk-7.4.0-py3-none-any.whl
Size 3.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c0d628363908e47d2c65a44833e92050844e5f29d1607e7e2f7d972289161918
BLAKE2b-256 checksum
How to use checksums
6f090b8b6abe469e9577d88ab0420c4436d69656bf6f636d9983c63e101c5d2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for cohesity-cluster-sdk 7.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

7.4.0 This release

2 release files No provenance

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