controllers.audit_controller module

class controllers.audit_controller.AuditController(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.

get_audit_logs_actions()[source]

Does a GET request to /public/auditLogs/actions.

A string array of all the actions used to filter audit logs.

Returns:

list of string: 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_audit_logs_categories()[source]

Does a GET request to /public/auditLogs/categories.

A string array of all the categories used to filter audit logs.

Returns:

list of string: 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_cluster_audit_logs(user_names=None, domains=None, entity_types=None, actions=None, search=None, start_time_usecs=None, end_time_usecs=None, start_index=None, page_count=None, output_format=None, tenant_id=None, all_under_hierarchy=None)[source]

Does a GET request to /public/auditLogs/cluster.

When actions (such as a login or a Job being paused) occur on the Cohesity Cluster, the Cluster generates Audit Logs. If no parameters are specified, all logs currently on the Cohesity Cluster are returned. Specifying parameters filters the results that are returned.

Args:
user_names (list of string, optional): Filter by user names who

cause the actions that generate Cluster Audit Logs.

domains (list of string, optional): Filter by domains of users who

cause the actions that trigger Cluster audit logs.

entity_types (list of string, optional): Filter by entity types

involved in the actions that generate the Cluster audit logs, such as User, Protection Job, View, etc. For a complete list, see the Category drop-down in the Admin > Audit Logs page of the Cohesity Dashboard.

actions (list of string, optional): Filter by the actions that

generate Cluster audit logs such as Activate, Cancel, Clone, Create, etc. For a complete list, see the Actions drop-down in the Admin > Audit Logs page of the Cohesity Dashboard.

search (string, optional): Filter by matching a substring in

entity name or details of the Cluster audit log.

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

Only Cluster audit logs that were generated after the specified time are returned. Specify the start time as a Unix epoch Timestamp (in microseconds).

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

specified as a Unix epoch Timestamp (in microseconds). Only Cluster audit logs that were generated before the specified end time 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 startIndex to return a subsets of items in the search result. For example, set startIndex to 0 to get the first set of pageCount items for the first request. Increment startIndex by pageCount to get the next set of pageCount items for a next request. Continue until all items are returned and therefore the total number of returned items is equal to totalCount. Default value is 0.

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

return in the response for pagination purposes. Default value is 1000.

output_format (string, optional): Specifies the format of the

output such as csv and json. If not specified, the json format is returned. If csv is specified, a comma-separated list with a heading row is 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:

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