controllers.clusters_controller module

class controllers.clusters_controller.ClustersController(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.

change_service_state(body)[source]

Does a POST request to /public/clusters/services/states.

Sends a request to either stop, start, or restart one or more of the services on a Cohesity Cluster and returns a message describing the result.

WARNING: This is a destructive operation.

Args:
body (ChangeServiceStateParameters): TODO: type description here.

Example:

Returns:

ChangeServiceStateResult: 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_cloud_cluster(body)[source]

Does a POST request to /public/clusters/cloudEdition.

Sends a request to create a new Cloud Edition Cohesity Cluster and returns the IDs, name, and software version of the new cluster. Also returns the status of each node.

Args:
body (CreateCloudClusterParameters): TODO: type description here.

Example:

Returns:

CreateClusterResult: 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_expand_cloud_cluster(body)[source]

Does a POST request to /public/clusters/cloudEdition/nodes.

Sends a request to expand a Cloud Edition Cohesity Cluster and returns some information about the request and each new Node.

Args:
body (ExpandCloudClusterParameters): TODO: type description here.

Example:

Returns:

CreateClusterResult: 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_expand_physical_cluster(body)[source]

Does a POST request to /public/clusters/physicalEdition/nodes.

Sends a request to expand a Physical Edition Cohesity Cluster and returns some information about the request and each new Node.

Args:
body (ExpandPhysicalClusterParameters): TODO: type description

here. Example:

Returns:

CreateClusterResult: 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_physical_cluster(body)[source]

Does a POST request to /public/clusters/physicalEdition.

Sends a request to create a new Physical Edition Cohesity Cluster and returns the IDs, name, and software version of the new cluster. Also returns the status of each node.

Args:
body (CreatePhysicalClusterParameters): TODO: type description

here. Example:

Returns:

CreateClusterResult: 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_virtual_cluster(body)[source]

Does a POST request to /public/clusters/virtualEdition.

Sends a request to create a new Virtual Edition Cohesity Cluster and returns the IDs, name and software version of the new cluster.

Args:
body (CreateVirtualClusterParameters): TODO: type description

here. Example:

Returns:

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

destroy_cluster()[source]

Does a DELETE request to /public/clusters.

Sends a request to destroy a Cohesity Cluster and returns some information about the operation and each Node.

WARNING: This is a destructive operation.

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_background_activity_schedule()[source]

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

Sends a request to get the apollo throttling settings applied for the cluster.

Returns:

BandwidthLimit: 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_cluster_creation_progress()[source]

Does a GET request to /public/clusters/creationProgress.

Sends a request to check the progress of the creation of a new Cohesity Cluster and returns some information about the creation process along with an estimated time remaining and completion percentage.

Returns:

ClusterCreationProgressResult: 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_cluster_keys()[source]

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

Returns the Public Keys for the cluster.

Returns:

ClusterPublicKeys: 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_external_client_subnets(tenant_ids=None, all_under_hierarchy=None)[source]

Does a GET request to /public/externalClientSubnets.

Returns the external Client Subnets for the cluster.

Args:
tenant_ids (list of string): TenantIds contains ids of the tenants

for which objects are to be returned.

all_under_hierarchy (bool): AllUnderHierarchy specifies if objects

of all the tenants under the hierarchy of the logged in user’s organization should be returned.

Returns:

ExternalClientSubnets: 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_io_preferential_tier()[source]

Does a GET request to /public/clusters/ioPreferentialTier.

Get the IO preferential tiers of the cluster.

Returns:

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

list_service_states()[source]

Does a GET request to /public/clusters/services/states.

Sends a request to list the states of all of the services on a Cluster.

Returns:

list of ServiceStateResult: 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.

put_io_preferential_tier(body)[source]

Does a PUT request to /public/clusters/ioPreferentialTier.

Update the IO preferential tiers of the cluster.

Args:

body (IoPreferentialTier): TODO: type description here. Example:

Returns:

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

remove_node(id)[source]

Does a DELETE request to /public/clusters/nodes/{id}.

Sends a request to remove a Node from a Cohesity Cluster.

Args:

id (long|int): Specifies the ID of the node being removed.

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.

update_external_client_subnets(body=None)[source]

Does a PUT request to /public/externalClientSubnets.

Returns the updated external Client Subnets of the cluster.

Args:
body (ExternalClientSubnets, optional): TODO: type description

here. Example:

Returns:

ExternalClientSubnets: 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_upgrade_cluster(body)[source]

Does a PUT request to /public/clusters/software.

Sends a request to upgrade the software version of a Cohesity Cluster and returns a message specifying the result. Before using this, you need to use the /public/packages endpoint to upload a new package to the Cluster.

Args:
body (UpgradeClusterParameters): TODO: type description here.

Example:

Returns:

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