private_cloud_controller

The following methods allow for interaction with the Private Cloud Controller API endpoints.

Methods are accessible via zpa.private_cloud_controller

Copyright (c) 2023, Zscaler Inc.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

class PrivateCloudControllerAPI

Bases: APIClient

A Client object for the Private Cloud Controller resource.

delete_cloud_controller(controller_id, microtenant_id=None)

Deletes the specified Private Cloud Controller from ZPA.

Parameters:

controller_id (str) – The unique id for the ZPA Private Cloud Controller that will be deleted.

Returns:

The status code for the operation.

Return type:

int

Examples

>>> _, _, err = client.zpa.private_cloud_controller.delete_cloud_controller(
...     controller_id='999999'
... )
... if err:
...     print(f"Error deleting Private Cloud Controller: {err}")
...     return
... print(f"Private Cloud Controller with ID {'999999'} deleted successfully.")
get_cloud_controller(controller_id, query_params=None)

Returns information on the specified Private Cloud Controller.

Parameters:

controller_id (str) – The unique id for the ZPA Private Cloud Controller.

Returns:

The specified Private Cloud Controller resource record.

Return type:

Tuple

Examples

>>> fetched_controller, _, err = client.zpa.private_cloud_controller.get_cloud_controller('999999')
... if err:
...     print(f"Error fetching controller by ID: {err}")
...     return
... print(f"Fetched controller by ID: {fetched_controller.as_dict()}")
list_cloud_controllers(query_params=None)

Enumerates Private Cloud Controller in your organization with pagination. A subset of Private Cloud Controller can be returned that match a supported filter expression or query.

Parameters:

{dict} (query_params) –

Map of query parameters for the request.

[query_params.page] {str}: Specifies the page number.

[query_params.page_size] {str}: Specifies the page size.

If not provided, the default page size is 20. The max page size is 500.

[query_params.search] {str}: Search string for filtering results. [query_params.sort_by] {str}: Indicates the parameter to sort by.

[query_params.sort_dir] {(str, optional): Sort results by ascending (asc) or descending (dsc) order.

Default: dsc.

[query_params.microtenant_id] {str}: The unique identifier of the microtenant of ZPA tenant.

Returns:

A tuple containing (list of Private Cloud Controller instances, Response, error)

Return type:

Tuple

Examples

>>> controller_list, _, err = client.zpa.private_cloud_controller.list_cloud_controllers(
... query_params={'search': 'PCController01', 'page': '1', 'page_size': '100'})
... if err:
...     print(f"Error listing Private Cloud Controller: {err}")
...     return
... print(f"Total Private Cloud Controller found: {len(controller_list)}")
... for controller in controller_list:
...     print(controller.as_dict())
restart_private_controller(controller_id, microtenant_id=None)

Triggers restart of the Private Cloud Controller

Parameters:

controller_id (str) – The unique id for the ZPA Private Cloud Controller that will be restarted.

Returns:

The status code for the operation.

Return type:

int

Examples

>>> _, _, err = client.zpa.private_cloud_controller.restart_private_controller(
...     controller_id='999999'
... )
... if err:
...     print(f"Error restarting Private Cloud Controller: {err}")
...     return
... print(f"Private Cloud Controller with ID {'999999'} restarted successfully.")
update_cloud_controller(controller_id, **kwargs)

Updates an existing ZPA Private Cloud Controller.

Parameters:

controller_id (str) – The unique id of the ZPA Private Cloud Controller.

Keyword Arguments:
  • **name (str) – The name of the Private Cloud Controller.

  • **description (str) – Additional information about the Private Cloud Controller.

  • **enabled (bool) – True if the Private Cloud Controller is enabled.

Returns:

The updated Private Cloud Controller resource record.

Return type:

Tuple

Examples

Update an Private Cloud Controller name, description and disable it.

>>> update_controller, _, err = client.zpa.private_cloud_controller.update_cloud_controller(
...     controller_id='99999'
...     name=f"UpdatePrivateController_{random.randint(1000, 10000)}",
...     description=f"UpdatePrivateController_{random.randint(1000, 10000)}",
...     enabled=False,
... )
... if err:
...     print(f"Error creating private controller: {err}")
...     return
... print(f"private controller created successfully: {update_group.as_dict()}")