controllers.nodes_controller module

class controllers.nodes_controller.NodesController(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.

get_node_by_id(id)[source]

Does a GET request to /public/nodes/{id}.

Returns the Node corresponding to the specified Node Id.

Args:

id (long|int): Id of the Node

Returns:

list of Node: 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_node_status()[source]

Does a GET request to /public/node/status.

Sends a request to a Node to get the status of that node.

Returns:

NodeStatusResult: 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_nodes(ids=None, include_marked_for_removal=None, include_only_unassigned_nodes=None, cluster_partition_ids=None, fetch_stats=None, show_system_disks=None)[source]

Does a GET request to /public/nodes.

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

ids (long|int, optional): IdList is the ids of nodes to be

returned. If empty, all nodes are returned.

include_marked_for_removal (bool, optional):

IncludeMarkedForRemoval is used to specify whether to include nodes marked for removal.

include_only_unassigned_nodes (bool, optional):

IncludeOnlyUnassignedNodes will return nodes that are not yet assigned to any cluster partition. If this parameter is specified as true and ClusterPartitionIdList is also non-empty, then no nodes will be returned.

cluster_partition_ids (long|int, optional): ClusterPartitionIdList

specifies the list of Ids used to filter the nodes by specified cluster partition.

fetch_stats (bool, optional): FetchStats is used to specify whether

to call Stats service to fetch the stats for the nodes.

show_system_disks (bool, optional): ShowSystemdisks is used to

specify whether to display system disks for the nodes.

Returns:

list of Node: 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_free_nodes()[source]

Does a GET request to /public/freeNodes.

Sends a request to any Node to list all of the free Nodes that are present on the network.

Returns:

list of FreeNodeInformation: 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_node(body)[source]

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

Sends a request to upgrade the software version of a Node. By default, the Node that the request is sent to is the only one upgraded, but the user can specify if they want to attempt to upgrade all free nodes on the network. Before using this, you need to upload a new package to the Node you want to upgrade by using the /public/packages endpoint.

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

Example:

Returns:

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