controllers.groups_controller module

class controllers.groups_controller.GroupsController(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_group(body=None)[source]

Does a POST request to /public/groups.

If an Active Directory domain is specified, a new group is added to the Cohesity Cluster for the specified Active Directory group principal. If the LOCAL domain is specified, a new group is created directly in the default LOCAL domain on the Cohesity Cluster. Returns the created or added group.

Args:
body (GroupParameters, optional): Request to add or create a

Group.

Returns:

Group: 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_groups(body=None)[source]

Does a DELETE request to /public/groups.

If the group on the Cohesity Cluster was added for an Active Directory user, the referenced principal group on the Active Directory domain is NOT deleted. Only the group on the Cohesity Cluster is deleted. Returns Success if the specified groups are deleted.

Args:
body (GroupDeleteParameters, optional): Request to delete one or

more groups on the Cohesity Cluster.

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_groups(name=None, domain=None, filter_by_owned_domains=None, tenant_ids=None, all_under_hierarchy=None)[source]

Does a GET request to /public/groups.

If no parameters are specified, all groups currently on the Cohesity Cluster are returned. Specifying parameters filters the results that are returned.

Args:
name (string, optional): Optionally specify a group name to filter

by. All groups containing name will be returned.

domain (string, optional): If no domain is specified, all groups

on the Cohesity Cluster are searched. If a domain is specified, only groups on the Cohesity Cluster associated with that domain are searched.

filter_by_owned_domains (bool, optional): If FilterByOwnedDomains

is set to true, then the groups are filtered to show only the ones that are in the domains owned by the current tenant or user.

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

the tenants for which objects are to be returned.

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.

Returns:

list of Group: 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_group(body=None)[source]

Does a PUT request to /public/groups.

Returns the group that was updated on the Cohesity Cluster.

Args:

body (GroupParameters, optional): Request to update a group.

Returns:

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