controllers.idps_controller module

class controllers.idps_controller.IdpsController(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.

add_active_idp_principals()[source]

Does a POST request to /public/idps/principals.

After a group or user has been added to a Cohesity Cluster, the referenced Idp principal can be used by the Cohesity Cluster. In addition, this operation maps Cohesity roles with a group or user and this mapping defines the privileges allowed on the Cohesity Cluster for the group or user. For example if an ‘management’ group is created on the Cohesity Cluster for the Idp ‘management’ principal group and is associated with the Cohesity ‘View’ role, all users in the referenced Idp ‘management’ principal group can log in to the Cohesity Dashboard but will only have view-only privileges. These users cannot create new Protection Jobs, Policies, Views, etc. NOTE: Local Cohesity users and groups cannot be created by this operation. Local Cohesity users or groups do not have an associated Idp principals and are created directly in the default LOCAL domain.

Returns:

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

Does a POST request to /public/idps.

Returns the newly created IdP configuration.

Args:
body (CreateIdpConfigurationRequest, optional): Request to create

a new IdP Configuration.

Returns:

IdpServiceConfiguration: 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_idp(id)[source]

Does a DELETE request to /public/idps/{id}.

Returns Success if the IdP configuration is deleted.

Args:
id (long|int): Specifies the Id assigned for the IdP Service by

the 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_idp_login(tenant_id=None)[source]

Does a GET request to /public/idps/login.

Redirects the client to the IdP site with the URI to login.

Args:
tenant_id (string, optional): Specifies an optional tenantId for

which the SSO login should be done. If this is not specified, Cluster SSO login is done.

Returns:

void: Response from the API.

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_idps(tenant_ids=None, all_under_hierarchy=None, names=None, ids=None, domains=None)[source]

Does a GET request to /public/idps.

Returns the Idps configured on the Cohesity Cluster corresponding to the filter parameters. If no filter is given, all Idp configurations are returned.

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

names (list of string, optional): Specifies the names of the IdP

vendors like Okta. If specified, returns IdP configurations of the vendors matching the names in the parameters.

ids (list of long|int, optional): Specifies the Ids of the IdP

configuration. If specified, returns IdP configurations of the matching Ids in the IdP configuration.

domains (list of string, optional): Specifies the domains of the

IdP configurations. If specified, returns IdP configurations matching the domains in the parameters.

Returns:

list of IdpServiceConfiguration: 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_idp(id, body=None)[source]

Does a PUT request to /public/idps/{id}.

Returns the updated IdP configuration.

Args:
id (long|int): Specifies the Id assigned for the IdP Service by

the Cluster.

body (UpdateIdpConfigurationRequest, optional): Request to update

an Idp Configuration.

Returns:

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