controllers.restore_tasks_controller module

class controllers.restore_tasks_controller.RestoreTasksController(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_applications_clone_task(body)[source]

Does a POST request to /public/restore/applicationsClone.

Returns the created Restore Task.

Args:
body (ApplicationsRestoreTaskRequest): Request to create a Restore

Task for cloning Applications like SQL DB.

Returns:

RestoreTask: 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_applications_recover_task(body)[source]

Does a POST request to /public/restore/applicationsRecover.

Returns the created Restore Task.

Args:
body (ApplicationsRestoreTaskRequest): Request to create a Restore

Task for recovering Applications like SQL DB. volumes to mount points.

Returns:

RestoreTask: 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_clone_task(body)[source]

Does a POST request to /public/restore/clone.

Returns the created Restore Task that clones VMs or a View.

Args:
body (CloneTaskRequest): Request to create a Restore Task for

cloning VMs or a View.

Returns:

RestoreTask: 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_compare_ad_objects(body)[source]

Does a POST request to /public/restore/adObjectAttributes.

Returns the list of AD Objects after comparing attributes of AD Object from both Snapshot and Production AD.

Args:
body (CompareAdObjectsRequest): Specifies the Request to compare

the AD Objects from both Snapshot and Production AD.

Returns:

list of ComparedADObject: 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_deploy_task(body)[source]

Does a POST request to /public/restore/deploy.

Returns the created Restore Task that deploys VMs on cloud. This operation returns the target where cloud is deployed. Currently, VMs can be deployed in either AWS target or Azure target.

Args:
body (DeployTaskRequest): Request to create a Restore Task for

deploying VMs or a View on cloud.

Returns:

RestoreTask: 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_download_files_and_folders(body)[source]

Does a POST request to /public/restore/downloadFilesAndFolders.

Returns the created download Task information that downloads files and folders.

Args:
body (DownloadFilesAndFoldersParams): Request to create a task for

downloading list of files or folders.

Returns:

RestoreTask: 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_get_restore_points_for_time_range(body)[source]

Does a POST request to /public/restore/pointsForTimeRange.

Returns the snapshots in the time range specified.

Args:
body (RestorePointsForTimeRangeParam): TODO: type description

here. Example:

Returns:

RestorePointsForTimeRange: 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_recover_task(body)[source]

Does a POST request to /public/restore/recover.

Returns the created Restore Task. This operation returns the following types of Restore Tasks: 1) A Restore Task that recovers VMs back to the original location or a new location. 2) A Restore Task that mounts the volumes of a Server (such as a VM or Physical Server) onto the specified target system. The Snapshots of the Server that contains the volumes that are mounted is determined by Array of Objects. The content of the Server is available from the mount point for the Granular Level Recovery (GLR) of application data. For example recovering Microsoft Exchange data using Kroll Ontrack® PowerControls™. NOTE: Volumes are mounted “instantly” if the Snapshot is stored locally on the Cohesity Cluster. If the Snapshot is archival target, it will take longer because it must be retrieved.

Args:
body (RecoverTaskRequest): Request to create a Restore Task for

recovering VMs or mounting volumes to mount points.

Returns:

RestoreTask: 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_restore_files_task(body)[source]

Does a POST request to /public/restore/files.

Returns the created Restore Task that recovers files and folders.

Args:
body (RestoreFilesTaskRequest): Request to create a Restore Task

for recovering files or folders.

Returns:

RestoreTask: 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_search_production_ad_objects(body)[source]

Does a POST request to /public/restore/adObjects.

Returns the list of AD Objects that match the list of object guids, sam account names and distinguished names provided in the request.

Args:
body (SearchProductionAdObjectsRequest): Specifies the Request to

search the AD Objects from Production AD.

Returns:

list of ADObject: 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_public_destroy_clone_task(id)[source]

Does a DELETE request to /public/restore/clone/{id}.

Destroy a clone task with specified id.

Args:
id (long|int): Specifies a unique id of the Clone Task to

destroy.

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_ad_domain_root_topology(restore_task_id)[source]

Does a GET request to /public/restore/adDomainRootTopology.

Returns the root topology for an AD domain.

Args:
restore_task_id (long|int): Specifies the restoreTaskId

corresponding to which we need to get the ad topology.

Returns:

list of AdRootTopologyObject: 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_ad_objects(name=None, sam_account_name=None, object_type=None, email=None, registered_source_ids=None, job_ids=None, view_box_ids=None, domain=None, tenant_id=None, all_under_hierarchy=None)[source]

Does a GET request to /public/restore/adObjects/searchResults.

Search for AD objects to recover that match the specified search and filter criterias provided in the request.

Args:

name (string, optional): Specifies the name of the AD object. sam_account_name (string, optional): Specifies the sam account

name of the AD object.

object_type (string, optional): Specifies the type of the AD

Object. The type may be user, computer, group or ou(organizational unit).

email (string, optional): Specifies the email of the AD object of

type user or group.

registered_source_ids (list of long|int, optional): Specifies the

Active Directory Application Server Ids which contains the AD objects.

job_ids (list of long|int, optional): Specifies the protection job

Ids which have backed up Active Directory Application Server.

view_box_ids (list of long|int, optional): Filter by a list of

Domains (View Boxes) ids. Only items stored in the listed Domains (View Boxes) are returned.

domain (string, optional): domain of the AD object. tenant_id (string, optional): TenantId specifies the tenant whose

action resulted in the audit log.

all_under_hierarchy (bool, optional): AllUnderHierarchy specifies

if logs of all the tenants under the hierarchy of tenant with id TenantId should be returned.

Returns:

FileSearchResults: 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_ad_objects_restore_status(restore_task_id=None)[source]

Does a GET request to /public/restore/adObjects/status.

Returns the Restore status of the AD objects which were restored from the snapshot AD to production AD as part of the restore task id specified in the parameters.

Args:
restore_task_id (long|int, optional): Specifies the restoreTaskId

corresponding to which we need to get information about the restore of the AD objects.

Returns:

AdObjectsRestoreStatus: 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_file_fstat_information(job_id, job_uid_object_id, entity_id, job_instance_id, job_start_time_usecs, file_path, attempt_num=None, volume_name=None, view_box_id=None, view_name=None, volume_info_cookie=None, use_librarian=None)[source]

Does a GET request to /public/restore/files/fstats.

Get the fstat information about file provided using query parameters.

Args:
job_id (long|int): JobId is the id of the local job that took the

snapshot, which may or may not match the JobUidObjectId below depending on whether the object originally belonged to this local job or to a different remote job.

job_uid_object_id (long|int): JobUidObjectId is the globally

unique id of the job that the object originally belonged to. If this object originally belonged to a job from a remote cluster, this field will contain the JobId of the remote job, else it will contain the JobId of the local job.

entity_id (long|int): EntityId is the Id of the VM. job_instance_id (long|int): JobInstanceId is the Id of the job run

that backed up the entity.

job_start_time_usecs (long|int): JobStartTimeUsecs is the start

time in usecs of the job run that backed up the entity.

file_path (string): FilePath is the full path of the file or

directory whose stat needed.

attempt_num (long|int, optional): AttemptNum is the attempt number

of the run that successfully created the snapshot.

volume_name (string, optional): VolumeName is the name of the

volume that needs to be browsed. This should match the name returned in VolumeInfo.

view_box_id (long|int, optional): Id of the View Box if a View is

being browsed.

view_name (string, optional): Name of the View if a View is being

browsed.

volume_info_cookie (int, optional): VolumeInfoCookie is the cookie

to be passed in calls to reading a VM dir for this volume.

use_librarian (bool, optional): Specifies whether to use Librarian

for file stat. This will be true if the browse is enabled via librarian.

Returns:

FileFstatResult: 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_file_snapshots_information(job_id, cluster_id, cluster_incarnation_id, source_id, filename)[source]

Does a GET request to /public/restore/files/snapshotsInformation.

Get the information about snapshots that contain the specified file or folder. In addition, information about the file or folder is provided.

Args:
job_id (long|int): Specifies the id of the Job that captured the

snapshots. These snapshots are searched for the specified files or folders. This field is required.

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

Job was created. This field is required.

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

the Cohesity Cluster where the Job was created. An incarnation id is generated when a Cohesity Cluster is initially created. This field is required.

source_id (long|int): Specifies the id of the Protection Source

object (such as a VM) to search. When a Job Run executes, snapshots of the specified Protection Source object are captured. This operation searches the snapshots of the object for the file or folder. This field is required.

filename (string): Specifies the name of the file or folder to

find in the snapshots. This field is required.

Returns:

list of FileSnapshotInformation: 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_one_drive_documents(tenant_ids=None, all_under_hierarchy=None, document_name=None, domain_ids=None, mailbox_ids=None, protection_job_ids=None)[source]

Does a GET request to /public/restore/office365/onedrive/documents.

Search for OneDrive files and folder to recover that match the specified search and filter criterias on the Cohesity cluster.

Args:
tenant_ids (string, optional): TenantId specifies the tenant

whose action resulted in the audit log.

all_under_hierarchy (bool, optional): AllUnderHierarchy specifies

if logs of all the tenants under the hierarchy of tenant with id TenantId should be returned.

document_name (string, optional): Specifies the document

(file/folder) name.

domain_ids (list of int, optional): Specifies the domain Ids in

which Users’ OneDrives are registered.

mailbox_ids (list of int, optional): Specifies the Office365 User

Ids which is the owner of the OneDrive.

protection_job_ids (list of string, optional): Specifies the

protection job Ids which have backed up mailbox(es) contianing emails/folders.

Returns:

FileSearchResults: 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_outlook_emails(has_attachments=None, sender_address=None, recipient_addresses=None, cc_recipient_addresses=None, bcc_recipient_addresses=None, sent_time_seconds=None, received_time_seconds=None, received_start_time=None, received_end_time=None, email_subject=None, folder_name=None, show_only_email_folders=None, domain_ids=None, mailbox_ids=None, protection_job_ids=None, tenant_id=None, all_under_hierarchy=None)[source]

Does a GET request to /public/restore/office365/outlook/emails.

Search for Emails and Emails’ folders to recover that match the specified search and filter criterias on the Cohesity cluster.

Args:
has_attachments (bool, optional): Specifies whether the emails

have any attachments.

sender_address (string, optional): Specifies the email address of

the sender.

recipient_addresses (list of string, optional): Specifies the

email addresses of the recipients.

cc_recipient_addresses (list of string, optional): Specifies the

email addresses of the cc recipients.

bcc_recipient_addresses (list of string, optional): Specifies the

email addresses of the bcc recipients.

sent_time_seconds (long|int, optional): Specifies the unix time

when the email was sent.

received_time_seconds (long|int, optional): Specifies the unix

time when the email was received.

received_start_time (long|int, optional): Specifies the unix start

time for querying on email’s received time.

received_end_time (long|int, optional): Specifies the unix end

time for querying on email’s received time.

email_subject (string, optional): Specifies the subject of the

email.

folder_name (string, optional): Specifies the parent folder name

of the email.

show_only_email_folders (bool, optional): Specifies whether the

query result should include only Email folders.

domain_ids (list of long|int, optional): Specifies the domain Ids

in which mailboxes are registered.

mailbox_ids (list of long|int, optional): Specifies the mailbox

Ids which contains the emails/folders.

protection_job_ids (list of long|int, optional): Specifies the

protection job Ids which have backed up mailbox(es) continaing emails/folders.

tenant_id (string, optional): TenantId specifies the tenant whose

action resulted in the audit log.

all_under_hierarchy (bool, optional): AllUnderHierarchy specifies

if logs of all the tenants under the hierarchy of tenant with id TenantId should be returned.

Returns:

FileSearchResults: 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_restore_task_by_id(id)[source]

Does a GET request to /public/restore/tasks/{id}.

Returns the Restore Task corresponding to the specified Restore Task id.

Args:

id (long|int): Specifies a unique id for the Restore Task.

Returns:

RestoreTask: 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_restore_tasks(task_ids=None, start_time_usecs=None, end_time_usecs=None, page_count=None, task_types=None, environment=None, storage_domain_ids=None)[source]

Does a GET request to /public/restore/tasks.

If no parameters are specified, all Restore Tasks found on the Cohesity Cluster are returned. Both running and completed Restore Tasks are reported. Specifying parameters filters the results that are returned.

Args:
task_ids (list of long|int, optional): Filter by a list of Restore

Task ids.

start_time_usecs (long|int, optional): Filter by a start time

specified as a Unix epoch Timestamp (in microseconds). All Restore Tasks (both completed and running) on the Cohesity Cluster that started after the specified start time but before the specified end time are returned. If not set, the start time is creation time of the Cohesity Cluster.

end_time_usecs (long|int, optional): Filter by an end time

specified as a Unix epoch Timestamp (in microseconds). All Restore Tasks (both completed and running) on the Cohesity Cluster that started after the specified start time but before the specified end time are returned. If not set, the end time is the current time.

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

Restore Tasks to return in the response for pagination purposes. Running Restore Tasks are always returned. The newest completed Restore Tasks are returned.

task_types (list of string, optional): Filter by the types of

Restore Tasks such as ‘kRecoverVMs’, ‘kCloneVMs’, ‘kCloneView’ or ‘kMountVolumes’.

environment (EnvironmentGetRestoreTasksEnum, optional): Specifies

the environment like VMware, SQL, where the Protection Source exists. Supported environment types such as ‘kView’, ‘kSQL’, ‘kVMware’, etc. NOTE: ‘kPuppeteer’ refers to Cohesity’s Remote Adapter. ‘kVMware’ indicates the VMware Protection Source environment. ‘kHyperV’ indicates the HyperV Protection Source environment. ‘kSQL’ indicates the SQL Protection Source environment. ‘kView’ indicates the View Protection Source environment. ‘kPuppeteer’ indicates the Cohesity’s Remote Adapter. ‘kPhysical’ indicates the physical Protection Source environment. ‘kPure’ indicates the Pure Storage Protection Source environment. ‘Nimble’ indicates the Nimble Storage Protection Source environment. ‘kAzure’ indicates the Microsoft’s Azure Protection Source environment. ‘kNetapp’ indicates the Netapp Protection Source environment. ‘kAgent’ indicates the Agent Protection Source environment. ‘kGenericNas’ indicates the Generic Network Attached Storage Protection Source environment. ‘kAcropolis’ indicates the Acropolis Protection Source environment. ‘kPhsicalFiles’ indicates the Physical Files Protection Source environment. ‘kIsilon’ indicates the Dell EMC’s Isilon Protection Source environment. ‘kGPFS’ indicates IBM’s GPFS Protection Source environment. ‘kKVM’ indicates the KVM Protection Source environment. ‘kAWS’ indicates the AWS Protection Source environment. ‘kExchange’ indicates the Exchange Protection Source environment. ‘kHyperVVSS’ indicates the HyperV VSS Protection Source environment. ‘kOracle’ indicates the Oracle Protection Source environment. ‘kGCP’ indicates the Google Cloud Platform Protection Source environment. ‘kFlashBlade’ indicates the Flash Blade Protection Source environment. ‘kAWSNative’ indicates the AWS Native Protection Source environment. ‘kO365’ indicates the Office 365 Protection Source environment. ‘kO365Outlook’ indicates Office 365 outlook Protection Source environment. ‘kHyperFlex’ indicates the Hyper Flex Protection Source environment. ‘kGCPNative’ indicates the GCP Native Protection Source environment. ‘kAzureNative’ indicates the Azure Native Protection Source environment. ‘kKubernetes’ indicates a Kubernetes Protection Source environment. ‘kElastifile’ indicates Elastifile Protection Source environment. ‘kAD’ indicates Active Directory Protection Source environment. ‘kRDSSnapshotManager’ indicates AWS RDS Protection Source environment. ‘kCassandra’ indicates Cassandra Protection Source environment. ‘kMongoDB’ indicates MongoDB Protection Source environment. ‘kCouchbase’ indicates Couchbase Protection Source environment. ‘kHdfs’ indicates Hdfs Protection Source environment. ‘kHive’ indicates Hive Protection Source environment. ‘kHBase’ indicates HBase Protection Source environment.

storage_domain_ids (long|int): Filter by a list of Storage Domain

IDs. This field applies only if ‘TaskTypes’ includes ‘kCloneView’. Only task writing data to these storage domains will be returned.

Returns:

list of RestoreTask: 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_sharepoint_documents(tenant_id=None, all_under_hierarchy=None, document_name=None, domain_ids=None, site_ids=None, protection_job_ids=None)[source]

Does a GET request to /public/restore/office365/sharepoint/documents.

Search for Sharepoint files and folder to recover that match the specified search and filter criterias on the Cohesity cluster.

Args:
tenant_id (string, optional): TenantId specifies the tenant whose

action resulted in the audit log.

all_under_hierarchy (bool, optional): AllUnderHierarchy specifies

if objects of all the tenants under the hierarchy of the logged in user’s organization should be returned.

document_name (string, optional): Specifies the document

(file/folder) name.

domain_ids (list of int|long, optional): Specifies the domain Ids

in which Sharepoint Site’s are registered.

site_ids (list of int|long, optional): Specifies the Office365

Sharepoint Site Id.

protection_job_ids (list of int|long, optional): Specifies the

protection job Ids which have backed up sites containing the documents.

Returns:

FileSearchResults: 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_virtual_disk_information(cluster_id, cluster_incarnation_id, job_id, job_run_id, start_time_usecs, source_id, point_in_time_usecs=None, vault_id=None, vault_name=None, vault_type=None)[source]

Does a GET request to /public/restore/virtualDiskInformation.

Fetches information of virtual disk.

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

Job was created.

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

the Cohesity Cluster where the Job was created.

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

snapshot.

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

captured the snapshot.

start_time_usecs (long|int): Specifies the start time of the job

run as a Unix epoch Timestamp in microseconds.

source_id (long|int): Specifies the Id of the Protection Source

object.

point_in_time_usecs (long|int): PointInTimeUsecs is the time to

get volume virtual disk info from previously available full/incremental snapshot.

vault_id (int|long): Specifies the Id of the vault where snapshot

was taken.

vault_name (string): Specifies the name of the vault where snapshot

was taken.

vault_type (VaultTypeEnum): Specifes the type of the vault where

snapshot was taken.

Returns:

list of VirtualDiskInformation: 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_vm_directory_list(job_id, job_uid_object_id, entity_id, job_instance_id, job_start_time_usecs, dir_path, attempt_num=None, volume_name=None, view_box_id=None, view_name=None, max_entries=None, volume_info_cookie=None, cookie=None, stat_file_entries=None, browse_indexed_data=None)[source]

Does a GET request to /public/restore/vms/directoryList.

Get the directory list based on the given directory name and other query parameters.

Args:
job_id (long|int): JobId is the id of the local job that took the

snapshot, which may or may not match the JobUidObjectId below depending on whether the object originally belonged to this local job or to a different remote job.

job_uid_object_id (long|int): JobUidObjectId is the globally

unique id of the job that the object originally belonged to. If this object originally belonged to a job from a remote cluster, this field will contain the JobId of the remote job, else it will contain the JobId of the local job.

entity_id (long|int): EntityId is the Id of the VM. job_instance_id (long|int): JobInstanceId is the Id of the job run

that backed up the entity.

job_start_time_usecs (long|int): JobStartTimeUsecs is the start

time in usecs of the job run that backed up the entity.

dir_path (string): DirPath is the full path of the directory whose

contents need to be listed.

attempt_num (long|int, optional): AttemptNum is the attempt number

of the run that successfully created the snapshot.

volume_name (string, optional): VolumeName is the name of the

volume that needs to be browsed. This should match the name returned in VolumeInfo.

view_box_id (long|int, optional): Id of the View Box if a View is

being browsed.

view_name (string, optional): Name of the View if a View is being

browsed.

max_entries (int, optional): MaxEntries is the maximum number of

entries to return in this call. If there are more entries, server will return a cookie in the response that can be used to continue enumeration from the last call.

volume_info_cookie (int, optional): VolumeInfoCookie is the cookie

to be passed in calls to reading a VM dir for this volume.

cookie (string, optional): Cookie is used for paginating results.

If ReadDirResult returned partial results, it will also return a cookie that can be used to resume the listing. The value returned in ReadDirResult should be passed in the next call. The first call should not have this value set. Note that this value is only a suggestion and server is free to do a short read (return fewer entries along with a cookie).

stat_file_entries (bool, optional): StatFileEntries specifies

whether file stat data is returned.

browse_indexed_data (bool, optional): Specifies whether to use

indexed data in Librarian for browse.

Returns:

VmDirectoryListResult: 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_vm_volumes_information(job_id, cluster_id, cluster_incarnation_id, job_run_id, started_time_usecs, source_id, original_job_id, attempt_number=None, supported_volumes_only=None, compute_volume_info=None)[source]

Does a GET request to /public/restore/vms/volumesInformation.

All required fields must be specified for this operation. To get values for these fields, invoke the GET /public/restore/objects operation. A specific Job Run is defined by the jobRunId, startedTimeUsecs, and attemptNumber fields.

Args:
job_id (long|int): Specifies the Job id for the Protection Job

that is currently associated with the object. If the object was backed up on current Cohesity Cluster, this field contains the id for the Job that captured this backup object. If the object was backed up on a Primary Cluster and replicated to this Cohesity Cluster, a new Inactive Job is created, the object is now associated with new Inactive Job, and this field contains the id of the new Inactive Job.

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

Job was created.

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

the Cohesity Cluster where the Job was created. An incarnation id is generated when a Cohesity Cluster is initially created.

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

captured the snapshot.

started_time_usecs (long|int): Specifies the time when the Job Run

starts capturing a snapshot. Specified as a Unix epoch Timestamp (in microseconds).

source_id (long|int): Specifies the id of the VM object to search

for volumes.

original_job_id (long|int): Specifies the id for the Protection

Job that originally captured the snapshots of the original object. If the object was backed up on a Primary Cluster replicated to this Cohesity Cluster, and a new Inactive Job is created, this field still contains the id of the original Job and NOT the id of the new Inactive Job. This field is used in combination with the clusterId and clusterIncarnationId to uniquely identify a Job.

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

attempts made by the Job Run to capture a snapshot of the object. For example, if an snapshot is successfully captured after three attempts, this field equals 3.

supported_volumes_only (bool, optional): Specifies to return only

supported volumes information. Unsupported volumes are not returned if this flag is set to true. Default is false.

compute_volume_info (bool, optional): Specifies whether to compute

volume information if it is not found. If ComputeVolumeInfo is false and volume information is not found it skips computation of volume information and returns KNotFound.

Returns:

list of VmVolumesInformation: 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.

list_org_vdc_networks(id)[source]

Does a GET request to /public/virtualDatacenters/{id}/orgVdcNetworks.

Returns the Org VDC Network under a VDC in a VMware environment.

Args:

id (long|int): Specifies the ID of the virtual datacenter.

Returns:

list of OrgVdcNetwork: 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.

list_storage_profiles(id)[source]

Does a GET request to /public/virtualDatacenters/{id}/storageProfiles.

Fetches information of virtual disk.

Args:

id (int|long): Specifies a unique id for the VDC.

Returns:

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

search_ad_objects(restore_task_id, num_objects=None, search_base_dn=None, subtree_search_scope=None, compare_objects=None, exclude_system_properties=None, filter=None, record_offset=None)[source]

Does a GET request to /public/restore/adObjects.

Returns the list of AD Objects along with status whether they are missing in Production AD, equal or not equal.

Args:
restore_task_id (long|int): Specifies the restoreTaskId

corresponding to which we need to search AD objects.

num_objects (int, optional): Specifies the number of AD Objects to

be fetched.

search_base_dn (string, optional): Specifies the search base

distinguished name from where the search should begin in the hierarchy of the AD in both Production and Snapshot AD.

subtree_search_scope (bool, optional): Specifies the search scope

for the request. If subtree search scope is true all the children of Search Base DN are returned from given offset. If subtree search scope is false only all objects which are one level from the Search Base DN are returned.

compare_objects (bool, optional): Specifies the option to compare

the properties from Snapshot AD and Production AD if specifed and sets kNotEqual flag in the result when there is mismatch.

exclude_system_properties (bool, optional): Specifies the option

to exclude the system attributes while comparing the the objects from the Production AD and Snapshot AD.

filter (string, optional): Specifies the filter which can be used

for searching the AD Objects from given Search Base DN. There are two types of filters supported. They are: 1) If the string does not contain LDAP delimiters ‘(‘ and ‘)’, then it is assumed to be ANR search “(anr=<ldap_filter>)” Eg: “a” will result in query to return all ANR fields with “a” characters (case insensitive) in them 2) Search with OR and AND combination: “(|(&(objectClass=user)(distinguishedName=CN=Jone Doe,OU=Users,DC=corp,DC=cohesity,DC=com))(&(objectClass=user) (sAMAccountName=jdoe)))”

record_offset (int, optional): Specifies the offset from which AD

objects should be searched in both the Snapshot and Production AD.

Returns:

list of ADObject: 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.

search_objects(search=None, job_ids=None, registered_source_ids=None, view_box_ids=None, environments=None, office365_source_types=None, start_time_usecs=None, end_time_usecs=None, start_index=None, page_count=None, operating_systems=None, application=None, owner_entity_id=None, tenant_id=None, all_under_hierarchy=None)[source]

Does a GET request to /public/restore/objects.

If no search pattern or filter parameters are specified, all backup objects currently found on the Cohesity Cluster are returned. Only leaf objects that have been protected by a Job are returned such as VMs, Views and databases. Specify a search pattern or parameters to filter the results that are returned. The term “items” below refers to leaf backup objects such as VMs, Views and databases.

Args:
search (string, optional): Filter by searching for sub-strings in

the item name. The specified string can match any part of the item name. For example: “vm” or “123” both match the item name of “vm-123”.

job_ids (list of long|int, optional): Filter by a list of

Protection Job ids. Only items backed up by the specified Jobs are listed.

registered_source_ids (list of long|int, optional): Filter by a

list of Registered Sources ids. Only items from the listed Registered Sources are returned.

view_box_ids (list of long|int, optional): Filter by a list of

Domains (View Boxes) ids. Only items stored in the listed Domains (View Boxes) are returned.

environments (list of EnvironmentSearchObjectsEnum, optional):

Filter by environment types such as ‘kVMware’, ‘kView’, etc. Only items from the specified environment types are returned. NOTE: ‘kPuppeteer’ refers to Cohesity’s Remote Adapter.

office365_source_types (Office365SourceTypesEnum, optional): Filter

by Office365 types such as ‘kUser’, ‘kSite’, etc. Only items from the specified source types are returned.

start_time_usecs (long|int, optional): Filter by backup completion

time by specifying a backup completion start and end times. Specified as a Unix epoch Timestamp (in microseconds). Only items created by backups that completed between the specified start and end times are returned.

end_time_usecs (long|int, optional): Filter by backup completion

time by specify a backup completion start and end times. Specified as a Unix epoch Timestamp (in microseconds). Only items created by backups that completed between the specified start and end times are returned.

start_index (long|int, optional): Specifies an index number that

can be used to return subsets of items in multiple requests. Break up the items to return into multiple requests by setting pageCount and using startIndex to return a subsets of items. For example, set startIndex to 0 to get the first set of items for the first request. Increment startIndex by pageCount to get the next set of items for a next request. Continue until all items are returned and therefore the total number of returned items is equal to totalCount.

page_count (long|int, optional): Limit the number of items to

return in the response for pagination purposes.

operating_systems (list of string, optional): Filter by the

Operating Systems running on VMs and Physical Servers. This filter is applicable only to VMs and physical servers.

application (string, optional): Filter by application when the

environment type is kSQL. For example, if SQL is specified the SQL databases are returned.

owner_entity_id (long|int, optional): Filter objects by the Entity

id of the owner VM. For example, if a ownerEntityId is provided while searching for SQL databases, only SQL databases belonging to the VM with the specified id are returned. ownerEntityId is only significant if application is set to SQL.

tenant_id (string, optional): TenantId specifies the tenant whose

action resulted in the audit log.

all_under_hierarchy (bool, optional): AllUnderHierarchy specifies

if logs of all the tenants under the hierarchy of tenant with id TenantId should be returned.

Returns:

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

search_restored_files(must_have_tags=None, might_have_tags=None, must_have_snapshot_tags=None, might_have_snapshot_tags=None, paginate=None, page_size=None, pagination_cookie=None, search=None, job_ids=None, registered_source_ids=None, view_box_ids=None, environments=None, start_time_usecs=None, end_time_usecs=None, start_index=None, page_count=None, source_ids=None, folder_only=None, tenant_id=None, all_under_hierarchy=None)[source]

Does a GET request to /public/restore/files.

Use the files and folders returned by this operation to populate the list of files and folders to recover in the POST /public/restore/files operation. If no search pattern or filter parameters are specified, all files and folders currently found on the Cohesity Cluster are returned. Specify a search pattern or parameters to filter the results that are returned. The term “items” below refers to files and folders that are found in the source objects (such as VMs).

Args:
must_have_tags(list of string, optional): Specifies tags which must

be all present in the document.

might_have_tags(list of string, optional): Specifies list of tags,

one of which might be present in the document. These are OR’ed together and the resulting criteria AND’ed with the rest of the query.

must_have_snapshot_tags(list of string, optional): Specifies

snapshot tags which must be all present in the document.

might_have_snapshot_tags(list of string, optional): Specifies list

of snapshot tags, one of which might be present in the document. These are OR’ed together and the resulting criteria AND’ed with the rest of the query.

paginate(bool, optional): Specifies bool to control pagination of

search results. Only valid for librarian queries. If this is set to true and a pagination cookie is provided, search will be resumed.

page_size(int , optional): Specifies pagesize for pagination. Only

valid for librarian queries. Effective only when Paginate is set to true.

pagination_cookie(string, optional): Specifies cookie for resuming

search if pagination is being used. Only valid for librarian queries. Effective only when Paginate is set to true.

search (string, optional): Filter by searching for sub-strings in

the item name. The specified string can match any part of the item name. For example: “vm” or “123” both match the item name of “vm-123”.

job_ids (list of long|int, optional): Filter by a list of

Protection Job ids. Only items backed up by the specified Jobs are listed.

registered_source_ids (list of long|int, optional): Filter by a

list of Registered Sources ids. Only items from the listed Registered Sources are returned.

view_box_ids (list of long|int, optional): Filter by a list of

Domains (View Boxes) ids. Only items stored in the listed Domains (View Boxes) are returned.

environments (list of EnvironmentSearchRestoredFilesEnum,

optional): Filter by environment types such as ‘kVMware’, ‘kView’, etc. Only items from the specified environment types are returned. NOTE: ‘kPuppeteer’ refers to Cohesity’s Remote Adapter.

start_time_usecs (long|int, optional): Filter by backup completion

time by specifying a backup completion start and end times. Specified as a Unix epoch Timestamp (in microseconds). Only items created by backups that completed between the specified start and end times are returned.

end_time_usecs (long|int, optional): Filter by backup completion

time by specify a backup completion start and end times. Specified as a Unix epoch Timestamp (in microseconds). Only items created by backups that completed between the specified start and end times are returned.

start_index (long|int, optional): Specifies an index number that

can be used to return subsets of items in multiple requests. Break up the items to return into multiple requests by setting pageCount and using startIndex to return a subsets of items. For example, set startIndex to 0 to get the first set of items for the first request. Increment startIndex by pageCount to get the next set of items for a next request. Continue until all items are returned and therefore the total number of returned items is equal to totalCount.

page_count (long|int, optional): Limit the number of items to

return in the response for pagination purposes.

source_ids (list of long|int, optional): Filter by source ids.

Only files and folders found in the listed sources (such as VMs) are returned.

folder_only (bool, optional): Filter by folders or files. If true,

only folders are returned. If false, only files are returned. If not specified, both files and folders are returned.

tenant_id (string, optional): TenantId specifies the tenant whose

action resulted in the audit log.

all_under_hierarchy (bool, optional): AllUnderHierarchy specifies

if logs of all the tenants under the hierarchy of tenant with id TenantId should be returned.

Returns:

FileSearchResults: 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_cancel_restore_task(id)[source]

Does a PUT request to /public/restore/tasks/cancel/{id}.

Cancel a recover or clone task with specified id.

Args:

id (long|int): Specifies a unique id for the Restore Task.

Returns:

void: Response from the API. Success Response

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_restore_task(body)[source]

Does a PUT request to /public/restore/recover.

Updates an existing restore task with additional params which are needed for features like Hot-Standby.

Args:
body (UpdateRestoreTaskParams): TODO: type description here.

Example:

Returns:
RestoreTask: Response from the API. Specifies the response of the

UpdateRestoreTask 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.