controllers_v2.recoveries_controller module

class controllers_v2.recoveries_controller.RecoveriesController(config=None, client=None, call_back=None)[source]

Bases: cohesity_management_sdk.controllers_v2.base_controller.BaseController

A Controller to access Endpoints in the cohesity_management_sdk API.

cancel_recovery_by_id(id)[source]

Does a POST request to /data-protect/recoveries/{id}/cancel.

Cancel Recovery for a given id.

Args:

id (string): Specifies the id of a Recovery.

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.

create_download_files_and_folders_recovery(body)[source]

Does a POST request to /data-protect/recoveries/downloadFilesAndFoldersRecovery.

Creates a download files and folders recovery.

Args:
body (DownloadFilesAndFoldersRecoveryParams): Specifies the

parameters to create a download files and folder recovery.

Returns:

Recovery: 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.

create_recovery(body)[source]

Does a POST request to /data-protect/recoveries.

Performs a Recovery.

Args:
body (CreateRecoveryRequestParams): Specifies the parameters to

create a Recovery.

Returns:

Recovery: 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.

download_files_from_recovery(id, start_offset=None, length=None)[source]

Does a GET request to /data-protect/recoveries/{id}/downloadFiles.

Download files from the given download file recovery.

Args:

id (string): Specifies the id of a Recovery. start_offset (long|int, optional): Specifies the start offset of

file chunk to be downloaded.

length (long|int, optional): Specifies the length of bytes to

download. This can not be greater than 8MB (8388608 byets)

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.

download_indexed_file(snapshots_id, file_path=None, retry_attempt=None, start_offset=None, length=None)[source]

Does a GET request to /data-protect/snapshots/{snapshotsId}/downloadFile.

Download an indexed file from a snapshot.

Args:
snapshots_id (string): Specifies the snapshot id to download

from.

file_path (string, optional): Specifies the path to the file to

download. If no path is specified and snapshot environment is kVMWare, VMX file for VMware will be downloaded. For other snapshot environments, this field must be specified.

retry_attempt (long|int, optional): Specifies the number of

attempts the protection run took to create this file.

start_offset (long|int, optional): Specifies the start offset of

file chunk to be downloaded.

length (long|int, optional): Specifies the length of bytes to

download. This can not be greater than 8MB (8388608 byets)

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_recoveries(ids=None, tenant_ids=None, include_tenants=None, start_time_usecs=None, end_time_usecs=None, snapshot_target_type=None, archival_target_type=None, snapshot_environments=None, status=None, recovery_actions=None)[source]

Does a GET request to /data-protect/recoveries.

Lists the Recoveries.

Args:

ids (list of string, optional): Filter Recoveries for given ids. tenant_ids (list of string, optional): TenantIds contains ids of

the organizations for which recoveries are to be returned.

include_tenants (bool, optional): Specifies if objects of all the

organizations under the hierarchy of the logged in user’s organization should be returned.

start_time_usecs (long|int, optional): Returns the recoveries

which are started after the specific time. This value should be in Unix timestamp epoch in microseconds.

end_time_usecs (long|int, optional): Returns the recoveries which

are started before the specific time. This value should be in Unix timestamp epoch in microseconds.

snapshot_target_type (list of SnapshotTargetType2Enum, optional):

Specifies the snapshot’s target type from which recovery has been performed.

archival_target_type (list of ArchivalTargetType2Enum, optional):

Specifies the snapshot’s archival target type from which recovery has been performed. This parameter applies only if ‘snapshotTargetType’ is ‘Archival’.

snapshot_environments (list of SnapshotEnvironment2Enum,

optional): Specifies the list of snapshot environment types to filter Recoveries. If empty, Recoveries related to all environments will be returned.

status (list of Status18Enum, optional): Specifies the list of run

status to filter Recoveries. If empty, Recoveries with all run status will be returned.

recovery_actions (list of RecoveryAction14Enum, optional):

Specifies the list of recovery actions to filter Recoveries. If empty, Recoveries related to all actions will be returned.

Returns:

ListOfRecoveries: 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_recovery_by_id(id, include_tenants=None)[source]

Does a GET request to /data-protect/recoveries/{id}.

Get Recovery for a given id.

Args:

id (string): Specifies the id of a Recovery. include_tenants (bool, optional): Specifies if objects of all the

organizations under the hierarchy of the logged in user’s organization should be returned.

Returns:

Recovery: 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.

tear_down_recovery_by_id(id)[source]

Does a POST request to /data-protect/recoveries/{id}/tearDown.

Tear down Recovery for a given id.

Args:

id (string): Specifies the id of a Recovery.

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.