controllers.vaults_controller module

class controllers.vaults_controller.VaultsController(config=None, client=None, call_back=None)[source]

Bases: cohesity_management_sdk.controllers.base_controller.BaseController

A Controller to access Endpoints in the cohesity_management_sdk API.

create_vault(body)[source]

Does a POST request to /public/vaults.

Returns the created Vault. A Vault is equivalent to an External Target in the Cohesity Dashboard.

Args:

body (Vault): Request to create a new Vault.

Returns:

Vault: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

delete_vault(id, body)[source]

Does a DELETE request to /public/vaults/{id}.

Returns delete status upon completion. A Vault is equivalent to an External Target in the Cohesity Dashboard.

Args:

id (long|int): Specifies a unique id of the Vault. body (VaultDeleteParams): Request to delete vault.

Returns:

void: Response from the API. No Content

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

get_archive_media_info(cluster_id, cluster_incarnation_id, qstar_archive_job_id, qstar_restore_task_id=None, entity_ids=None)[source]

Does a GET request to /public/vaults/archiveMediaInfo.

Returns the media information about the specified archive service uid (such as a QStar tape archive service). An archive service uid is uniquely identified using a combination of the following fields: clusterIncarnationId, entityIds and clusterId. These are all required fields.

Args:
cluster_id (long|int): Specifies the id of the Cohesity Cluster

that archived to a QStar media Vault.

cluster_incarnation_id (long|int): Specifies the incarnation id of

the Cohesity Cluster that archived to a QStar media Vault.

qstar_archive_job_id (long|int): Specifies the id of the Job that

archived to a QStar media Vault.

qstar_restore_task_id (long|int, optional): Specifies the id of

the restore task to optionally filter by. The restore task that is restoring data from the specified media Vault.

entity_ids (list of long|int, optional): Specifies an array of

entityIds to optionally filter by. An entityId is a unique id for a VM assigned by the Cohesity Cluster.

Returns:

list of TapeMediaInformation: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

get_bandwidth_settings()[source]

Does a GET request to /public/vaults/bandwidthSettings.

Returns the upload and download bandwidth limits.

Returns:

VaultBandwidthLimits: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

get_vault_by_id(id)[source]

Does a GET request to /public/vaults/{id}.

Returns the Vault corresponding to the specified Vault Id. A Vault is equivalent to an External Target in the Cohesity Dashboard.

Args:

id (long|int): Specifies a unique id of the Vault.

Returns:

Vault: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

get_vault_encryption_key(id)[source]

Does a GET request to /public/vaults/encryptionKey/{id}.

Get encryption information (such as the encryption key) for the specified Vault (External Target). To restore data to a remote Cluster (for example to support a disaster recovery scenario), you must get the encryption key of the Vault and store it outside the local source Cluster, before disaster strikes. If you have the encryption key and the local source Cluster goes down, you can restore the data to a remote Cluster from the Vault. The local source Cluster is the Cluster that archived the data on the Vault.

Args:

id (long|int): Specifies a unique id of the Vault.

Returns:

VaultEncryptionKey: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

get_vaults(id=None, name=None, include_marked_for_removal=None)[source]

Does a GET request to /public/vaults.

If no parameters are specified, all Vaults (External Targets) currently registered on the Cohesity Cluster are returned. Specifying parameters filters the results that are returned. A Vault is equivalent to an External Target in the Cohesity Dashboard.

Args:
id (long|int, optional): Specifies the id of Vault to return. If

empty, all Vaults are returned.

name (string, optional): Specifies the name of the Vault to

return. If empty, all Vaults are returned.

include_marked_for_removal (bool, optional): Specifies if Vaults

that are marked for removal should be returned.

Returns:

list of Vault: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

update_bandwidth_settings(body)[source]

Does a PUT request to /public/vaults/bandwidthSettings.

Returns the updated bandwidth limits.

Args:
body (VaultBandwidthLimits): Request to update global bandwidth

limits settings.

Returns:

VaultBandwidthLimits: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

update_vault(id, body)[source]

Does a PUT request to /public/vaults/{id}.

Update the settings of a Vault. A Vault is equivalent to an External Target in the Cohesity Dashboard. Returns the updated Vault.

Args:

id (long|int): Specifies a unique id of the Vault. body (Vault): Request to update a Vault’s settings.

Returns:

Vault: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.