# Cohesity

> Watch and run your Cohesity backups through Helios: list clusters and alerts, start, pause or cancel protection group runs, check policies, objects and snapshots, and follow recoveries.

App · 21 actions. Web page: https://docs.lodol.com/docs/integrations/cohesity

## Actions

### Back up protection group now

Start a backup of a protection group now, outside its schedule. Use 'List protection group runs' to follow it.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Protection group (`protection_group_id`, text, required): The protection group. Pick one, or give its id from an earlier step.
- Backup type (`run_type`, text): Incremental (default), full, log or system. One of: `kRegular` (Incremental), `kFull` (Full), `kLog` (Log), `kSystem` (System).

**Outputs**

- `protection_group_id` (text): The protection group backed up
- `run_type` (text): The kind of backup started
- `started` (true/false): True once Cohesity has accepted the run

**Example output**

```json
{
  "protection_group_id": "1234567890:1600000000000:42",
  "run_type": "kRegular",
  "started": true
}
```

### Cancel protection group run

Cancel a protection group run that is still going.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Protection group (`protection_group_id`, text, required): The protection group. Pick one, or give its id from an earlier step.
- Run ID (`run_id`, text, required): The run's id, such as 42:1700000000000000, from 'List protection group runs'.

**Outputs**

- `canceled` (true/false): True once Cohesity accepted the cancel
- `results` (list): What Cohesity said for each run
- `run_id` (text): The run canceled

**Example output**

```json
{
  "canceled": true,
  "results": [
    {
      "runId": "42:1764500000000000"
    }
  ],
  "run_id": "42:1764500000000000"
}
```

### Cancel recovery

Cancel a recovery that is still running.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Recovery ID (`recovery_id`, text, required): The recovery's id, from 'List recoveries'.

**Outputs**

- `canceled` (true/false): True once Cohesity accepted the cancel
- `recovery_id` (text): The recovery canceled

**Example output**

```json
{
  "canceled": true,
  "recovery_id": "1234567890:1600000000000:99"
}
```

### Delete protection group

Delete a protection group. Its snapshots are kept unless you choose to delete them too.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Protection group (`protection_group_id`, text, required): The protection group. Pick one, or give its id from an earlier step.
- Delete its snapshots (`delete_snapshots`, true/false): Also delete every snapshot the group took. This can't be undone.

**Outputs**

- `deleted` (true/false): True once deleted
- `protection_group_id` (text): The protection group deleted
- `snapshots_deleted` (true/false): Whether its snapshots were deleted too

**Example output**

```json
{
  "deleted": true,
  "protection_group_id": "1234567890:1600000000000:42",
  "snapshots_deleted": false
}
```

### Get protected object

Get one object and how it is protected.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Object ID (`object_id`, number, required): The object's id, a number from 'List protected objects'. At least 0.
- Include last run (`include_last_run_info`, true/false): Also return the details of the last run.

**Outputs**

- `object` (object): An object Cohesity can protect (a VM, server, database, mailbox...)

**Example output**

```json
{
  "object": {
    "environment": "kPhysical",
    "id": 1001,
    "logicalSizeBytes": 500000000000,
    "name": "sql-01",
    "objectType": "kHost",
    "protectionType": "kFile",
    "sourceId": 1000,
    "sourceName": "Physical servers"
  }
}
```

### Get protection group

Get one protection group: what it protects, its policy, whether it is paused and, if asked, its last run.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Protection group (`protection_group_id`, text, required): The protection group. Pick one, or give its id from an earlier step.
- Include last run (`include_last_run_info`, true/false): Also return the details of the last run.

**Outputs**

- `protection_group` (object): A protection group

**Example output**

```json
{
  "protection_group": {
    "description": "Nightly backup of the SQL servers",
    "environment": "kPhysical",
    "id": "1234567890:1600000000000:42",
    "isActive": true,
    "isDeleted": false,
    "isPaused": false,
    "lastRun": {
      "environment": "kPhysical",
      "id": "42:1764500000000000",
      "isReplicationRun": false,
      "localBackupInfo": {
        "endTimeUsecs": 1764500900000000,
        "failedObjectsCount": 0,
        "messages": [],
        "runType": "kRegular",
        "startTimeUsecs": 1764500000000000,
        "status": "Succeeded",
        "successfulObjectsCount": 12
      },
      "protectionGroupId": "1234567890:1600000000000:42",
      "protectionGroupName": "SQL servers"
    },
    "name": "SQL servers",
    "numProtectedObjects": 12,
    "policyId": "1234567890:1600000000000:7",
    "priority": "kMedium",
    "storageDomainId": 5
  }
}
```

### Get protection group run

Get one run of a protection group with its status, times and counts of objects backed up and failed.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Protection group (`protection_group_id`, text, required): The protection group. Pick one, or give its id from an earlier step.
- Run ID (`run_id`, text, required): The run's id, such as 42:1700000000000000, from 'List protection group runs'.
- Include each object (`include_object_details`, true/false): Also return the result for each object in the run.

**Outputs**

- `run` (object): A protection group run

**Example output**

```json
{
  "run": {
    "environment": "kPhysical",
    "id": "42:1764500000000000",
    "isReplicationRun": false,
    "localBackupInfo": {
      "endTimeUsecs": 1764500900000000,
      "failedObjectsCount": 0,
      "messages": [],
      "runType": "kRegular",
      "startTimeUsecs": 1764500000000000,
      "status": "Succeeded",
      "successfulObjectsCount": 12
    },
    "protectionGroupId": "1234567890:1600000000000:42",
    "protectionGroupName": "SQL servers"
  }
}
```

### Get protection policy

Get one protection policy with its backup schedule and retention.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Policy (`policy_id`, text, required): The protection policy. Pick one, or give its id.

**Outputs**

- `policy` (object): A protection policy

**Example output**

```json
{
  "policy": {
    "backupPolicy": {},
    "description": "Daily, kept 30 days",
    "id": "1234567890:1600000000000:7",
    "isReplicated": false,
    "name": "Gold",
    "numProtectedObjects": 40,
    "numProtectionGroups": 3
  }
}
```

### Get recovery

Get one recovery with its status, times and messages.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Recovery ID (`recovery_id`, text, required): The recovery's id, from 'List recoveries'.

**Outputs**

- `recovery` (object): A recovery (restore)

**Example output**

```json
{
  "recovery": {
    "endTimeUsecs": 1764500600000000,
    "id": "1234567890:1600000000000:99",
    "messages": [],
    "name": "Recover sql-01 files",
    "recoveryAction": "RecoverFiles",
    "snapshotEnvironment": "kPhysical",
    "startTimeUsecs": 1764500000000000,
    "status": "Succeeded"
  }
}
```

### List alerts

List alerts from every cluster connected to Helios, filtered by state, severity and when they were raised.

**Inputs**

- State (`states`, list): Only alerts in one of these states. One or more of: `kOpen` (Open), `kResolved` (Resolved), `kNote` (Note), `kSuppressed` (Suppressed).
- Severity (`severities`, list): Only alerts of one of these severities. One or more of: `kCritical` (Critical), `kWarning` (Warning), `kInfo` (Info).
- Raised after (`start_time`, date and time): Only alerts raised after this time.
- Raised before (`end_time`, date and time): Only alerts raised before this time.
- Most alerts (`max_alerts`, number): The most alerts to return, 1 to 1000. From 1 to 1000.

**Outputs**

- `alerts` (list): The alerts
- `count` (number): How many were returned

**Example output**

```json
{
  "alerts": [
    {
      "alertCategory": "kBackupRestore",
      "alertCode": "CE00610007",
      "alertDocument": {
        "alertCause": "The source could not be reached.",
        "alertDescription": "Backup of protection group 'SQL servers' failed.",
        "alertHelpText": "Check the source's network connection.",
        "alertName": "ProtectionGroupFailed"
      },
      "alertState": "kOpen",
      "clusterName": "dc1-cohesity",
      "firstTimestampUsecs": 1764500000000000,
      "id": "1234567890:1700000000000:5",
      "latestTimestampUsecs": 1764500000000000,
      "severity": "kCritical"
    }
  ],
  "count": 1
}
```

### List all protection runs

List a summary of every protection group's runs on a cluster in a time range, filtered by status: a quick way to find failed backups.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Started after (`start_time`, date and time): Only runs that started after this time.
- Started before (`end_time`, date and time): Only runs that started before this time.
- Status (`statuses`, list): Only runs with one of these statuses. Leave empty for all. One or more of: `Accepted`, `Running`, `Succeeded`, `SucceededWithWarning` (Succeeded with warning), `Failed`, `Canceled`, `Canceling`, `Missed`, `Skipped`, `OnHold` (On hold), `Finalizing`, `Paused`.

**Outputs**

- `count` (number): How many were returned
- `runs` (list): The runs

**Example output**

```json
{
  "count": 1,
  "runs": [
    {
      "bytesWritten": 2000000000,
      "endTimeUsecs": 1764500900000000,
      "environment": "kPhysical",
      "id": "42:1764500000000000",
      "isFullRun": false,
      "isSlaViolated": false,
      "protectionGroupId": "1234567890:1600000000000:42",
      "protectionGroupName": "SQL servers",
      "startTimeUsecs": 1764500000000000,
      "status": "Succeeded",
      "successObjectsCount": 12,
      "totalObjectsCount": 12
    }
  ]
}
```

### List clusters

List the Cohesity clusters connected to Helios, with each one's id, health, version and capacity.

**Inputs**: None.

**Outputs**

- `clusters` (list): The clusters
- `count` (number): How many were returned

**Example output**

```json
{
  "clusters": [
    {
      "clusterId": 1234567890,
      "clusterName": "dc1-cohesity",
      "currentVersion": "7.1.2",
      "health": "NonCritical",
      "isConnectedToHelios": true,
      "numberOfNodes": 4,
      "totalCapacity": 100000000000000,
      "usedCapacity": 42000000000000
    }
  ],
  "count": 1
}
```

### List object snapshots

List the snapshots (restore points) of one object, optionally in a time range or from one protection group.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Object ID (`object_id`, number, required): The object's id, a number from 'List protected objects'. At least 0.
- Taken after (`from_time`, date and time): Only snapshots taken after this time.
- Taken before (`to_time`, date and time): Only snapshots taken before this time.
- Protection group (`protection_group_id`, text): Only snapshots taken by this protection group.

**Outputs**

- `count` (number): How many were returned
- `snapshots` (list): The snapshots

**Example output**

```json
{
  "count": 1,
  "snapshots": [
    {
      "expiryTimeUsecs": 1767100000000000,
      "hasDataLock": false,
      "id": "snap-1001-1764500000000000",
      "objectId": 1001,
      "objectName": "sql-01",
      "protectionGroupId": "1234567890:1600000000000:42",
      "protectionGroupName": "SQL servers",
      "protectionGroupRunId": "42:1764500000000000",
      "runType": "kRegular",
      "snapshotTargetType": "Local",
      "snapshotTimestampUsecs": 1764500000000000
    }
  ]
}
```

### List protected objects

List the objects a cluster knows (VMs, servers, databases, mailboxes), optionally only protected ones. Gets one page; to see more, run it again with the next cookie it gives.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Protected only (`only_protected_objects`, true/false): On for only objects that are protected.
- Include last run (`include_last_run_info`, true/false): Also return the details of the last run.
- Page size (`max_count`, number): How many objects to return, 1 to 1000. From 1 to 1000.
- Next page cookie (`cookie`, text): The 'next_cookie' from an earlier page.

**Outputs**

- `count` (number): How many were returned
- `next_cookie` (text): Pass as the next page cookie for more; empty on the last page
- `objects` (list): The objects

**Example output**

```json
{
  "count": 1,
  "next_cookie": "",
  "objects": [
    {
      "environment": "kPhysical",
      "id": 1001,
      "logicalSizeBytes": 500000000000,
      "name": "sql-01",
      "objectType": "kHost",
      "protectionType": "kFile",
      "sourceId": 1000,
      "sourceName": "Physical servers"
    }
  ]
}
```

### List protection group runs

List a protection group's runs, newest first, filtered by time, status and backup type.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Protection group (`protection_group_id`, text, required): The protection group. Pick one, or give its id from an earlier step.
- Started after (`start_time`, date and time): Only runs that started after this time.
- Started before (`end_time`, date and time): Only runs that started before this time.
- Status (`statuses`, list): Only runs with one of these statuses. Leave empty for all. One or more of: `Accepted`, `Running`, `Succeeded`, `SucceededWithWarning` (Succeeded with warning), `Failed`, `Canceled`, `Canceling`, `Missed`, `Skipped`, `OnHold` (On hold), `Finalizing`, `Paused`.
- Backup type (`run_types`, list): Only runs of these types. One or more of: `kRegular` (Incremental), `kFull` (Full), `kLog` (Log), `kSystem` (System).
- Most runs (`num_runs`, number): The most runs to return, 1 to 1000. Cohesity's default is 100. From 1 to 1000.
- Include each object (`include_object_details`, true/false): Also return the result for each object in the run.

**Outputs**

- `count` (number): How many were returned
- `runs` (list): The runs
- `total_runs` (number): How many runs match in all

**Example output**

```json
{
  "count": 1,
  "runs": [
    {
      "environment": "kPhysical",
      "id": "42:1764500000000000",
      "isReplicationRun": false,
      "localBackupInfo": {
        "endTimeUsecs": 1764500900000000,
        "failedObjectsCount": 0,
        "messages": [],
        "runType": "kRegular",
        "startTimeUsecs": 1764500000000000,
        "status": "Succeeded",
        "successfulObjectsCount": 12
      },
      "protectionGroupId": "1234567890:1600000000000:42",
      "protectionGroupName": "SQL servers"
    }
  ],
  "total_runs": 1
}
```

### List protection groups

List a cluster's protection groups (its backup jobs), filtered by the status of their last run or whether they are paused. Gets one page; to see more, run it again with the next page cookie it gives.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Last run status (`last_run_status`, list): Only groups whose last run ended in one of these. One or more of: `Succeeded`, `SucceededWithWarning` (Succeeded with warning), `Failed`, `Running`, `Canceled`, `Canceling`, `Missed`.
- Paused only (`is_paused`, true/false): On for only paused groups. Leave off for all.
- Active only (`is_active`, true/false): On for only groups active on this cluster (not replicas).
- Include last run (`include_last_run_info`, true/false): Also return the details of the last run.
- Page size (`max_result_count`, number): How many groups to return, 1 to 1000. From 1 to 1000.
- Next page cookie (`pagination_cookie`, text): The 'next_pagination_cookie' from an earlier page.

**Outputs**

- `count` (number): How many were returned
- `next_pagination_cookie` (text): Pass as the next page cookie for more; empty on the last page
- `protection_groups` (list): The protection groups

**Example output**

```json
{
  "count": 1,
  "next_pagination_cookie": "",
  "protection_groups": [
    {
      "description": "Nightly backup of the SQL servers",
      "environment": "kPhysical",
      "id": "1234567890:1600000000000:42",
      "isActive": true,
      "isDeleted": false,
      "isPaused": false,
      "lastRun": {
        "environment": "kPhysical",
        "id": "42:1764500000000000",
        "isReplicationRun": false,
        "localBackupInfo": {
          "endTimeUsecs": 1764500900000000,
          "failedObjectsCount": 0,
          "messages": [],
          "runType": "kRegular",
          "startTimeUsecs": 1764500000000000,
          "status": "Succeeded",
          "successfulObjectsCount": 12
        },
        "protectionGroupId": "1234567890:1600000000000:42",
        "protectionGroupName": "SQL servers"
      },
      "name": "SQL servers",
      "numProtectedObjects": 12,
      "policyId": "1234567890:1600000000000:7",
      "priority": "kMedium",
      "storageDomainId": 5
    }
  ]
}
```

### List protection policies

List a cluster's protection policies: the schedules and retention protection groups follow.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Include usage figures (`include_stats`, true/false): Also return how much each is used.

**Outputs**

- `count` (number): How many were returned
- `policies` (list): The policies

**Example output**

```json
{
  "count": 1,
  "policies": [
    {
      "backupPolicy": {},
      "description": "Daily, kept 30 days",
      "id": "1234567890:1600000000000:7",
      "isReplicated": false,
      "name": "Gold",
      "numProtectedObjects": 40,
      "numProtectionGroups": 3
    }
  ]
}
```

### List protection sources

List the sources registered on a cluster, such as vCenters, physical servers, NAS and Microsoft 365.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.

**Outputs**

- `count` (number): How many were returned
- `sources` (list): The sources

**Example output**

```json
{
  "count": 1,
  "sources": [
    {
      "environment": "kVMware",
      "id": 1000,
      "name": "vcenter.example.com",
      "objectType": "kVCenter",
      "registrationId": 1000
    }
  ]
}
```

### List recoveries

List a cluster's recoveries (restores), filtered by when they started and their status.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Started after (`start_time`, date and time): Only recoveries that started after this time.
- Started before (`end_time`, date and time): Only recoveries that started before this time.
- Status (`statuses`, list): Only recoveries with one of these statuses. One or more of: `Accepted`, `Running`, `Succeeded`, `SucceededWithWarning` (Succeeded with warning), `Failed`, `Canceled`, `Canceling`, `Missed`, `Skipped`, `OnHold` (On hold), `Finalizing`.

**Outputs**

- `count` (number): How many were returned
- `recoveries` (list): The recoveries

**Example output**

```json
{
  "count": 1,
  "recoveries": [
    {
      "endTimeUsecs": 1764500600000000,
      "id": "1234567890:1600000000000:99",
      "messages": [],
      "name": "Recover sql-01 files",
      "recoveryAction": "RecoverFiles",
      "snapshotEnvironment": "kPhysical",
      "startTimeUsecs": 1764500000000000,
      "status": "Succeeded"
    }
  ]
}
```

### List storage domains

List a cluster's storage domains, optionally with how much each uses.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Include usage figures (`include_stats`, true/false): Also return how much each is used.

**Outputs**

- `count` (number): How many were returned
- `storage_domains` (list): The storage domains

**Example output**

```json
{
  "count": 1,
  "storage_domains": [
    {
      "clusterPartitionName": "primary",
      "id": 5,
      "name": "DefaultStorageDomain",
      "removalState": "DontRemove",
      "s3BucketsEnabled": false
    }
  ]
}
```

### Set protection group state

Pause a protection group's schedule so no new runs start, or resume it. A run already going carries on.

**Inputs**

- Cluster (`cluster_id`, text, required): The Cohesity cluster. Pick one, or give its id from 'List clusters'.
- Protection group (`protection_group_id`, text, required): The protection group. Pick one, or give its id from an earlier step.
- State (`state`, text, required): Paused, or running on its schedule. One of: `kPause` (Paused), `kResume` (Running on schedule).

**Outputs**

- `paused` (true/false): Whether it is now paused
- `protection_group_id` (text): The protection group changed
- `successful_ids` (list): The groups Cohesity changed

**Example output**

```json
{
  "paused": true,
  "protection_group_id": "1234567890:1600000000000:42",
  "successful_ids": [
    "1234567890:1600000000000:42"
  ]
}
```
