controllers_v2.views_controller module¶
- 
class 
controllers_v2.views_controller.ViewsController(config=None, client=None, call_back=None)[source]¶ Bases:
cohesity_management_sdk.controllers_v2.base_controller.BaseControllerA Controller to access Endpoints in the cohesity_management_sdk API.
- 
create_view(body)[source]¶ Does a POST request to /file-services/views.
Create a View.
- Args:
 body (CreateViewRequest): Request to create a View.
- Returns:
 View1: 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_view_template(body)[source]¶ Does a POST request to /file-services/view-template.
Create a view template.
- Args:
 body (Template): Request to create a view template.
- Returns:
 Template: 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_view(id)[source]¶ Does a DELETE request to /file-services/views/{id}.
Deletes a View based on given view id.”
- Args:
 id (long|int): Specifies a unique id of the View to delete.
- 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.
- 
delete_view_template(id)[source]¶ Does a DELETE request to /file-services/view-template/{id}.
Deletes a view template based on given template id.”
- Args:
 - id (long|int): Specifies a unique id of the view template to
 delete.
- 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_view_by_id(id)[source]¶ Does a GET request to /file-services/views/{id}.
Get a View based on given view Id.”
- Args:
 id (long|int): Specifies a unique id of the View to delete.
- Returns:
 View1: 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_views(view_names=None, view_ids=None, storage_domain_ids=None, storage_domain_names=None, protocol_accesses=None, match_partial_names=None, max_count=None, include_internal_views=None, include_protection_groups=None, max_view_id=None, include_inactive=None, protection_group_ids=None, view_count_only=None, sort_by_logical_usage=None, internal_access_sids=None, match_alias_names=None, tenant_ids=None, include_tenants=None, include_stats=None, include_views_with_antivirus_enabled_only=None, include_views_with_data_lock_enabled_only=None, filer_audit_log_enabled=None)[source]¶ Does a GET request to /file-services/views.
If no parameters are specified, all Views on the Cohesity Cluster are returned. Specifying parameters filters the results that are returned. NOTE: If maxCount is set and the number of Views returned exceeds the maxCount, there are more Views to return. To get the next set of Views, send another request and specify the id of the last View returned in viewList from the previous response.
- Args:
 - view_names (list of string, optional): Filter by a list of View
 names.
- view_ids (list of long|int, optional): Filter by a list of View
 ids.
- storage_domain_ids (list of long|int, optional): Filter by a list
 of Storage Domains (View Boxes) specified by id.
- storage_domain_names (list of string, optional): Filter by a list
 of View Box names.
- protocol_accesses (list of ProtocolAccessEnum, optional): Filter
 by a list of protocol accesses. Only views with protocol accesses in these specified accesses list will be returned.
- match_partial_names (bool, optional): If true, the names in
 viewNames are matched by any partial rather than exactly matched.
- max_count (int, optional): Specifies a limit on the number of
 Views returned.
- include_internal_views (bool, optional): Specifies if internal
 Views created by the Cohesity Cluster are also returned. In addition, regular Views are returned.
- include_protection_groups (bool, optional): Specifies if
 Protection Groups information needs to be returned along with view metadata. By default, if not set or set to true, Group information is returned.
- max_view_id (long|int, optional): If the number of Views to return
 exceeds the maxCount specified in the original request, specify the id of the last View from the viewList in the previous response to get the next set of Views.
- include_inactive (bool, optional): Specifies if inactive Views on
 this Remote Cluster (which have Snapshots copied by replication) should also be returned. Inactive Views are not counted towards the maxCount. By default, this field is set to false.
- protection_group_ids (list of long|int, optional): Filter by
 Protection Group ids. Return Views that are being protected by listed Groups, which are specified by ids.
- view_count_only (bool, optional): Whether to get just the total
 number of views with the given input filters. If the flag is true, we ignore the parameter ‘maxViews’ for the count. Also, if flag is true, list of views will not be returned. hidden: true
- sort_by_logical_usage (bool, optional): If set to true, the list
 is sorted descending by logical usage.
- internal_access_sids (list of string, optional): Sids of
 restricted principals who can access the view. This is an internal field and therefore does not have json tag. hidden: true
- match_alias_names (bool, optional): If true, view aliases are also
 matched with the names in viewNames.
- tenant_ids (list of string, optional): TenantIds contains ids of
 the tenants for which objects are to be returned.
- include_tenants (bool, optional): IncludeTenants specifies if
 objects of all the tenants under the hierarchy of the logged in user’s organization should be returned.
- include_stats (bool, optional): If set to true, stats of views
 will be returned. By default this parameter is set to false.
- include_views_with_antivirus_enabled_only (bool, optional): If set
 to true, the list will contain only the views for which antivirus scan is enabled.
- include_views_with_data_lock_enabled_only (bool, optional): If set
 to true, the list will contain only the views for which either file level data lock is enabled or view level data lock is enabled.
- filer_audit_log_enabled (bool, optional): If set to true, only
 views with filer audit log enabled will be returned. If set to false, only views with filer audit log disabled will be returned.
- Returns:
 GetViewsResult: 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.
- 
read_view_template_by_id(id)[source]¶ Does a GET request to /file-services/view-template/{id}.
Reads a view template based on given template id.”
- Args:
 id (long|int): Specifies a unique id of the view template.
- Returns:
 Template: 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.
- 
read_view_templates()[source]¶ Does a GET request to /file-services/view-template.
All view templates on the Cohesity Cluster are returned. Specifying parameters filters the results that are returned.
- Returns:
 GetViewTemplatesResult: 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_view(id, body)[source]¶ Does a PUT request to /file-services/views/{id}.
Returns the updated View.
- Args:
 id (long|int): Specifies a unique id of the View to update. body (View1): Request to update a view.
- Returns:
 View1: 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_view_template(id, body)[source]¶ Does a PUT request to /file-services/view-template/{id}.
Updates the view template.
- Args:
 id (long|int): Specifies a unique id of the view template. body (Template): Request to update a view template.
- Returns:
 Template: 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.
-