controllers.vlan_controller module

class controllers.vlan_controller.VlanController(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_bifrost_vlan()[source]

Does a POST request to /public/bifrost/vlans.

Returns the created Bifrost VLAN on the Cohesity Cluster.

Args:

:TODO Add description here.

Returns:

BifrostConfig: 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_vlan(body)[source]

Does a POST request to /public/vlans.

Returns the created VLAN on the Cohesity Cluster.

Args:

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

Returns:

Vlan: 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_bifrost_tenant_vlans()[source]

Does a GET request to /public/bifrost/vlans.

Returns the Bifrost Tenant VLANs for the Cohesity Cluster.

Returns:

GetBifrostConfigsResponse: 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_vlan_by_id(id)[source]

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

Returns the VLAN corresponding to the specified VLAN ID or a specified vlan interface group name. Example: /public/vlans/intf_group1.20

Args:

id (int): Specifies the id of the VLAN.

Returns:

Vlan: 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_vlans(tenant_ids=None, all_under_hierarchy=None, skip_primary_and_bond_iface=None, compress_ips_to_ranges=None, vlan_id=None)[source]

Does a GET request to /public/vlans.

Returns the VLANs for the Cohesity Cluster.

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.

skip_primary_and_bond_iface (bool, optional):

SkipPrimaryAndBondIface is to filter interfaces entries which are primary interface or bond interfaces.

compress_ips_to_ranges (bool): Compress Ips list to list of

contigous ip ranges with(startIp, endIp)

vlan_id (int): Vlan Id to filter vlans.

Returns:

list of Vlan: 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_vlan(id)[source]

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

Returns the delete status upon completion.

Args:

id (int): Specifies the id of the VLAN.

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_vlan(id, body=None)[source]

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

Returns the created or updated VLAN on the Cohesity Cluster.

Args:

id (int): Specifies the id of the VLAN. body (Vlan, optional): TODO: type description here. Example:

Returns:

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