controllers.network_controller module

class controllers.network_controller.NetworkController(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_append_hosts(body)[source]

Does a POST request to /public/network/hosts.

Sends a request to add one or more new entries to the Cluster’s /etc/hosts file.

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

Example:

Returns:

HostResult: 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_bond(body)[source]

Does a POST request to /public/network/bonds.

Sends a request to create a new network bond on the Cluster. This can only be performed on a Node before it is part of a Cluster.

Args:

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

Returns:

CreateBondResult: 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_bond(name)[source]

Does a DELETE request to /public/network/bonds/{name}.

Sends a request to delete a network bond from the Cluster. This can only be performed on a Node before it is part of a Cluster.

Args:

name (string): Specifies the name of the bond being deleted.

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.

delete_hosts(ips)[source]

Does a DELETE request to /public/network/hosts.

Sends a request to remove one or more entries from the Cluster’s etc/hosts file.

Args:
ips (list of string): Specifies a list of the IP addresses of

entries to remove from the Cluster’s /etc/hosts file.

Returns:

HostResult: 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_hosts()[source]

Does a GET request to /public/network/hosts.

Sends a request to get a list of the current entries in the hosts file on the Cluster.

Returns:

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

Does a PUT request to /public/network/hosts.

Sends a request to edit one or more entries in the Cluster’s /etc/hosts file.

Args:

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

Returns:

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