controllers_v2.active_directory_controller module¶
-
class
controllers_v2.active_directory_controller.
ActiveDirectoryController
(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.
-
create_active_directory
(body)[source]¶ Does a POST request to /active-directories.
Create an Active Directory.
- Args:
- body (CreateActiveDirectoryRequest): Specifies the parameters to
create an Active Directory.
- Returns:
ActiveDirectory: 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_active_directory
(id, active_directory_admin_username, active_directory_admin_password)[source]¶ Does a DELETE request to /active-directories/{id}.
Delete an Active Directory.
- Args:
id (long|int): Specifies id of an Active Directory. active_directory_admin_username (string): Specifies the username
of the Active Direcotry Admin.
- active_directory_admin_password (string): Specifies the password
of the Active Direcotry Admin.
- 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_active_directory
(domain_names=None, ids=None, tenant_ids=None, include_tenants=None)[source]¶ Does a GET request to /active-directories.
Get the list of Active Directories.
- Args:
- domain_names (list of string, optional): Filter by a list of
Active Directory domain names.
- ids (list of long|int, optional): Filter by a list of Active
Directory Ids.
- 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 Groups which were created by all tenants which the current user has permission to see. If false, then only Protection Groups created by the current user will be returned.
- Returns:
ActiveDirectories: 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_active_directory_by_id
(id, include_centrify_zones=None, include_domain_controllers=None, include_security_principals=None, prefix=None, object_class=None)[source]¶ Does a GET request to /active-directories/{id}.
Get an Active Directory by id.
- Args:
id (long|int): Specifies id of an Active Directory. include_centrify_zones (bool, optional): Specifies whether to
include Centrify Zones of the Active Directory in response.
- include_domain_controllers (bool, optional): Specifies whether to
include Domain Controllers of the Active Directory in response.
- include_security_principals (bool, optional): Specifies whether to
include Security Principals of the Active Directory in response.
- prefix (string, optional): Specifies a prefix, only security
principals with name or sAMAccountName having this prefix (ignoring cases) will be returned. This field is appliciable and mandatory if ‘includeSecurityPrincipals’ is set to true.
- object_class (list of ObjectClass1Enum, optional): Specifies a
list of object classes, only security principals with object class in this list will be returned. This field is appliciable if ‘includeSecurityPrincipals’ is set to true.
- Returns:
ActiveDirectory: 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_domain_controllers
(domain_names)[source]¶ Does a GET request to /domain-controllers.
Get Domain Controllers of specified domains.
- Args:
domain_names (list of string): Specifies a list of domain names.
- Returns:
DomainControllersResponse: 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_active_directory
(id, body)[source]¶ Does a PUT request to /active-directories/{id}.
Update an Active Directory.
- Args:
id (long|int): Specifies id of an Active Directory. body (UpdateActiveDirectoryRequest): Request to update an Active
Directory.
- Returns:
ActiveDirectory: 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.
-