controllers_v2.objects_controller module

class controllers_v2.objects_controller.ObjectsController(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.

get_indexed_object_snapshots(protection_group_id, object_id, indexed_object_name, include_indexed_snapshots_only=False, from_time_usecs=None, to_time_usecs=None, run_types=None)[source]

Does a GET request to /data-protect/objects/{objectId}/protection-groups/{protectionGroupId}/indexed-objects/snapshots.

Get snapshots of indexed object.

Args:

protection_group_id (string): Specifies the protection group id. object_id (long|int): Specifies the object id. indexed_object_name (string): Specifies the indexed object name. include_indexed_snapshots_only (bool, optional): Specifies whether

to only return snapshots which are indexed. In an indexed snapshots file are guaranteened to exist, while in a non-indexed snapshots file may not exist.

from_time_usecs (long|int, optional): Specifies the timestamp in

Unix time epoch in microseconds to filter indexed object’s snapshots which are taken after this value.

to_time_usecs (long|int, optional): Specifies the timestamp in

Unix time epoch in microseconds to filter indexed object’s snapshots which are taken before this value.

run_types (list of RunType6Enum, optional): Filter by run type.

Only protection run matching the specified types will be returned. By default, CDP hydration snapshots are not included, unless explicitly queried using this field.

Returns:
GetIndexedObjectSnapshotsResponseBody: 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_object_by_id(id, include_tenants=None)[source]

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

Get an object by object id.

Args:

id (long|int): Specifies the id of Object. include_tenants (bool, optional): If true, the response will

include Objects which belongs to all tenants which the current user has permission to see.

Returns:

ObjectInformation: 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_object_runs(id, run_id=None, start_time_usecs=None, end_time_usecs=None, tenant_ids=None, include_tenants=None, run_types=None, local_backup_run_status=None, replication_run_status=None, archival_run_status=None, cloud_spin_run_status=None, num_runs=None, exclude_non_restorable_runs=False)[source]

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

Get the runs for a particular object.

Args:

id (long|int): Specifies a unique id of the object. run_id (string, optional): Specifies the protection run id. start_time_usecs (long|int, optional): Filter by a start time.

Specify the start time as a Unix epoch Timestamp (in microseconds).

end_time_usecs (long|int, optional): Filter by a end time. Specify

the start time as a Unix epoch Timestamp (in microseconds).

tenant_ids (list of string, optional): TenantIds contains ids of

the tenants for which objects are to be returned.

include_tenants (bool, optional): If true, the response will

include Protection Group Runs which were created by all tenants which the current user has permission to see. If false, then only Protection Group Runs created by the current user will be returned.

run_types (list of RunType5Enum, optional): Filter by run type.

Only protection run matching the specified types will be returned.

local_backup_run_status (list of LocalBackupRunStatusEnum,

optional): Specifies a list of local backup status, runs matching the status will be returned.<br> ‘Running’ indicates that the run is still running.<br> ‘Canceled’ indicates that the run has been canceled.<br> ‘Canceling’ indicates that the run is in the process of being canceled.<br> ‘Failed’ indicates that the run has failed.<br> ‘Missed’ indicates that the run was unable to take place at the scheduled time because the previous run was still happening.<br> ‘Succeeded’ indicates that the run has finished successfully.<br> ‘SucceededWithWarning’ indicates that the run finished successfully, but there were some warning messages.

replication_run_status (list of ReplicationRunStatusEnum,

optional): Specifies a list of replication status, runs matching the status will be returned.<br> ‘Running’ indicates that the run is still running.<br> ‘Canceled’ indicates that the run has been canceled.<br> ‘Canceling’ indicates that the run is in the process of being canceled.<br> ‘Failed’ indicates that the run has failed.<br> ‘Missed’ indicates that the run was unable to take place at the scheduled time because the previous run was still happening.<br> ‘Succeeded’ indicates that the run has finished successfully.<br> ‘SucceededWithWarning’ indicates that the run finished successfully, but there were some warning messages.

archival_run_status (list of ArchivalRunStatusEnum, optional):

Specifies a list of archival status, runs matching the status will be returned.<br> ‘Running’ indicates that the run is still running.<br> ‘Canceled’ indicates that the run has been canceled.<br> ‘Canceling’ indicates that the run is in the process of being canceled.<br> ‘Failed’ indicates that the run has failed.<br> ‘Missed’ indicates that the run was unable to take place at the scheduled time because the previous run was still happening.<br> ‘Succeeded’ indicates that the run has finished successfully.<br> ‘SucceededWithWarning’ indicates that the run finished successfully, but there were some warning messages.

cloud_spin_run_status (list of CloudSpinRunStatusEnum, optional):

Specifies a list of cloud spin status, runs matching the status will be returned.<br> ‘Running’ indicates that the run is still running.<br> ‘Canceled’ indicates that the run has been canceled.<br> ‘Canceling’ indicates that the run is in the process of being canceled.<br> ‘Failed’ indicates that the run has failed.<br> ‘Missed’ indicates that the run was unable to take place at the scheduled time because the previous run was still happening.<br> ‘Succeeded’ indicates that the run has finished successfully.<br> ‘SucceededWithWarning’ indicates that the run finished successfully, but there were some warning messages.

num_runs (long|int, optional): Specifies the max number of runs.

If not specified, at most 100 runs will be returned.

exclude_non_restorable_runs (bool, optional): Specifies whether to

exclude non restorable runs. Run is treated restorable only if there is atleast one object snapshot (which may be either a local or an archival snapshot) which is not deleted or expired. Default value is false.

Returns:

ObjectRuns: 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_object_snapshot_info(snapshot_id)[source]

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

Get details of object snapshot.

Args:

snapshot_id (string): Specifies the snapshot id.

Returns:

ObjectSnapshot: 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_object_snapshot_volume_info(snapshot_id, include_supported_only=None)[source]

Does a GET request to /data-protect/snapshots/{snapshotId}/volume.

Get volume info of object snapshot.

Args:

snapshot_id (string): Specifies the snapshot id. include_supported_only (bool, optional): Specifies whether to only

return supported volumes.

Returns:

CommonObjectSnapshotVolumeParams: 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_object_snapshots(id, from_time_usecs=None, to_time_usecs=None, run_types=None, run_instance_ids=None, protection_group_ids=None)[source]

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

List the snapshots for a given object.

Args:

id (long|int): Specifies the id of the Object. from_time_usecs (long|int, optional): Specifies the timestamp in

Unix time epoch in microseconds to filter Object’s snapshots which are taken after this value.

to_time_usecs (long|int, optional): Specifies the timestamp in

Unix time epoch in microseconds to filter Object’s snapshots which are taken before this value.

run_types (list of RunType6Enum, optional): Filter by run type.

Only protection run matching the specified types will be returned. By default, CDP hydration snapshots are not included, unless explicitly queried using this field.

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

run instance ids. If specified, only snapshots created by these protection runs will be returned.

protection_group_ids (list of string, optional): If specified,

this returns only the snapshots of the specified object ID, which belong to the provided protection group IDs.

Returns:

ObjectSnapshots: 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_object_tree(id)[source]

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

Get the objects tree hierarchy for for an Object. If the object does not have a hierarchy then a single object will be returned.

Args:

id (long|int): Specifies the id of the Object.

Returns:

ObjectInformation1: 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_objects(environments=None, tenant_ids=None, include_tenants=None)[source]

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

List objects which can be used for data protection.

Args:
environments (list of Environment20Enum, optional): Specifies the

environment type to filter objects.

tenant_ids (list of string, optional): TenantIds contains ids of

the tenants for which objects are to be returned.

include_tenants (bool, optional): If true, the response will

include Objects which belongs to all tenants which the current user has permission to see.

Returns:

Objects: 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_source_hierarchy_objects(source_id, parent_id=None, tenant_ids=None, include_tenants=None, vmware_object_types=None, netapp_object_types=None, o_365_object_types=None, cassandra_object_types=None, mongodb_object_types=None, couchbase_object_types=None, hdfs_object_types=None, hbase_object_types=None, hive_object_types=None, hyperv_object_types=None, azure_object_types=None, kvm_object_types=None, aws_object_types=None, gcp_object_types=None, acropolis_object_types=None, generic_nas_object_types=None, isilon_object_types=None, flashblade_object_types=None, elastifile_object_types=None, gpfs_object_types=None, pure_object_types=None, nimble_object_types=None, physical_object_types=None, kubernetes_object_types=None, exchange_object_types=None, ad_object_types=None, mssql_object_types=None, oracle_object_types=None)[source]

Does a GET request to /data-protect/sources/{sourceId}/objects.

List objects which can be used for data protection.

Args:
source_id (long|int): Specifies the source ID for which objects

should be returned.

parent_id (long|int, optional): Specifies the parent ID under

which objects should be returned.

tenant_ids (list of string, optional): TenantIds contains ids of

the tenants for which objects are to be returned.

include_tenants (bool, optional): If true, the response will

include Objects which belongs to all tenants which the current user has permission to see.

vmware_object_types (list of VmwareObjectTypeEnum, optional):

Specifies the VMware object types to filter objects.

netapp_object_types (list of NetappObjectTypeEnum, optional):

Specifies the Netapp object types to filter objects.

o_365_object_types (list of O365ObjectTypeEnum, optional):

Specifies the Office 365 object types to filter objects.

cassandra_object_types (list of CassandraObjectType1Enum,

optional): Specifies the Cassandra object types to filter objects.

mongodb_object_types (list of MongodbObjectType1Enum, optional):

Specifies the Mongo DB object types to filter objects.

couchbase_object_types (list of CouchbaseObjectType1Enum,

optional): Specifies the Couchbase object types to filter objects.

hdfs_object_types (list of HdfsObjectTypeEnum, optional):

Specifies the HDFS object types to filter objects.

hbase_object_types (list of HbaseObjectType1Enum, optional):

Specifies the Hbase object types to filter objects.

hive_object_types (list of HiveObjectType1Enum, optional):

Specifies the Hive object types to filter objects.

hyperv_object_types (list of HypervObjectTypeEnum, optional):

Specifies the HyperV object types to filter objects.

azure_object_types (list of AzureObjectTypeEnum, optional):

Specifies the Azure object types to filter objects.

kvm_object_types (list of KvmObjectTypeEnum, optional): Specifies

the KVM object types to filter objects.

aws_object_types (list of AwsObjectTypeEnum, optional): Specifies

the AWS object types to filter objects.

gcp_object_types (list of GcpObjectTypeEnum, optional): Specifies

the GCP object types to filter objects.

acropolis_object_types (list of AcropolisObjectTypeEnum,

optional): Specifies the Acropolis object types to filter objects.

generic_nas_object_types (list of GenericNasObjectTypeEnum,

optional): Specifies the generic NAS object types to filter objects.

isilon_object_types (list of IsilonObjectTypeEnum, optional):

Specifies the Isilon object types to filter objects.

flashblade_object_types (list of FlashbladeObjectTypeEnum,

optional): Specifies the Flashblade object types to filter objects.

elastifile_object_types (list of ElastifileObjectTypeEnum,

optional): Specifies the Elastifile object types to filter objects.

gpfs_object_types (list of GpfsObjectTypeEnum, optional):

Specifies the GPFS object types to filter objects.

pure_object_types (list of PureObjectTypeEnum, optional):

Specifies the Pure object types to filter objects.

nimble_object_types (list of NimbleObjectTypeEnum, optional):

Specifies the Nimble object types to filter objects.

physical_object_types (list of PhysicalObjectTypeEnum, optional):

Specifies the Physical object types to filter objects.

kubernetes_object_types (list of KubernetesObjectTypeEnum,

optional): Specifies the Kubernetes object types to filter objects.

exchange_object_types (list of ExchangeObjectTypeEnum, optional):

Specifies the Exchange object types to filter objects.

ad_object_types (list of AdObjectTypeEnum, optional): Specifies

the AD object types to filter objects.

mssql_object_types (list of MssqlObjectTypeEnum, optional):

Specifies the MSSQL object types to filter objects.

oracle_object_types (list of OracleObjectTypeEnum, optional):

Specifies the Oracle object types to filter objects.

Returns:

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

perform_action_on_object(id, body)[source]

Does a POST request to /data-protect/objects/{id}/actions.

Perform an action on an object. Depending on the object environment type, different actions are available.

Args:

id (long|int): Specifies the id of the Object. body (PeformAnActionOnAnObject): Specifies the parameters to

perform an action on an object.

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.

update_object_snapshot(id, snapshot_id, body)[source]

Does a PUT request to /data-protect/objects/{id}/snapshots/{snapshotId}.

Update an object snapshot.

Args:

id (long|int): Specifies the id of the Object. snapshot_id (string): Specifies the id of the snapshot.<br> Note:

1. If the snapshotid of one of the apps is specified, it applies for all the databases in the Protection Run.<br> 2. In case of volume based jobs, please specify the snapshotid of the source not the database. if source snapshot is specified, applied to source snapshot. if database snapshotid is specified in case of volume based jobs, then it is applicable for host’s snapshot.

body (UpdateObjectSnapshotRequest): Specifies the parameters

update an object snapshot.

Returns:

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