app_connectors¶
The following methods allow for interaction with the ZPA ZPA Connectors API endpoints.
Methods are accessible via zpa.app_connectors
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 AppConnectorControllerAPI¶
Bases:
APIClientA Client object for the App Connectors resource.
- bulk_delete_connectors(connector_ids, microtenant_id=None)¶
Deletes all specified App Connectors from ZPA.
- Parameters:
connector_ids (list) – The list of unique ids for the ZPA App Connectors that will be deleted.
- Returns:
The status code for the operation.
- Return type:
Examples
>>> _, _, err = client.zpa.app_connectors.bulk_delete_connectors( ... connector_ids=['72058304855098016', '72058304855098017']) ... if err: ... print(f"Error deleting connectors: {err}") ... return ... print("Connectors deleted successfully.")
- delete_connector(connector_id, microtenant_id=None)¶
Deletes the specified App Connector from ZPA.
- Parameters:
connector_id (str) – The unique id for the ZPA App Connector that will be deleted.
- Returns:
The status code for the operation.
- Return type:
Examples
>>> _, _, err = client.zpa.app_connectors.delete_connector( ... connector_id='999999' ... ) ... if err: ... print(f"Error deleting app connector: {err}") ... return ... print(f"app connector with ID {'999999'} deleted successfully.")
- get_connector(connector_id, query_params=None)¶
Returns information on the specified App Connector.
- Parameters:
connector_id (str) – The unique id for the ZPA App Connector.
- Returns:
The specified App Connector resource record.
- Return type:
Tuple
Examples
>>> fetched_connector, _, err = client.zpa.app_connectors.get_connector('999999') ... if err: ... print(f"Error fetching connector by ID: {err}") ... return ... print(f"Fetched connector by ID: {fetched_connector.as_dict()}")
- list_connectors(query_params=None)¶
Enumerates app connectors in your organization with pagination. A subset of app connectors 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.microtenant_id]{str}: The unique identifier of the microtenant of ZPA tenant.- Returns:
A tuple containing (list of App Connector instances, Response, error)
- Return type:
Tuple
Examples
>>> connector_list, _, err = client.zpa.app_connectors.list_connectors( ... query_params={'search': 'Connector01', 'page': '1', 'page_size': '100'}) ... if err: ... print(f"Error listing app connector: {err}") ... return ... print(f"Total app connector found: {len(connector_list)}") ... for connector in connector_list: ... print(connector.as_dict())
- reformat_params = [('connector_ids', 'connectors'), ('server_group_ids', 'serverGroups')]¶
- update_connector(connector_id, **kwargs)¶
Updates an existing ZPA App Connector.
- Parameters:
connector_id (str) – The unique id of the ZPA App Connector.
- Keyword Arguments:
- Returns:
The updated App Connector resource record.
- Return type:
Tuple
Examples
Update an App Connector name, description and disable it.
>>> update_group, _, err = client.zpa.app_connectors.update_connector( ... connector_id='99999' ... name=f"UpdateAppConnector_{random.randint(1000, 10000)}", ... description=f"UpdateAppConnector_{random.randint(1000, 10000)}", ... enabled=False, ... ) ... if err: ... print(f"Error creating connector: {err}") ... return ... print(f"connector created successfully: {update_group.as_dict()}")