service_edges¶
The following methods allow for interaction with the ZPA Service Edge API endpoints.
Methods are accessible via zpa.service_edges
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 ServiceEdgeControllerAPI¶
Bases:
APIClient- bulk_delete_service_edges(service_edge_ids, **kwargs)¶
Bulk deletes the specified Service Edges from ZPA.
- delete_service_edge(service_edge_id, **kwargs)¶
Deletes the specified ZPA Service Edge.
- Parameters:
service_edge_id (str) – The unique ID of the Service Edge to be deleted.
- Returns:
Status code of the delete operation.
- Return type:
Examples
>>> _, _, err = client.zpa.service_edges.delete_service_edge( ... service_edge_id='999999' ... ) ... if err: ... print(f"Error deleting service edge: {err}") ... return ... print(f"Service Edge with ID {'999999'} deleted successfully.")
- get_service_edge(service_edge_id, **kwargs)¶
Returns information on the specified Service Edge.
- Parameters:
- Returns:
ServiceEdge: The corresponding Service Edge object.
- Return type:
Tuple
Examples
>>> fetched_service_edge, _, err = client.zpa.service_edges.get_service_edge('999999') ... if err: ... print(f"Error fetching service edge by ID: {err}") ... return ... print(f"Fetched service edge by ID: {fetched_service_edge.as_dict()}")
- list_service_edges(query_params=None)¶
Enumerates service edges in your organization with pagination. A subset of service edges 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]{int}: 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 used to support search by features.- Returns:
A tuple containing (list of ServiceEdge instances, Response, error)
- Return type:
Tuple
Examples
>>> service_edge_list, _, err = client.zpa.service_edges.list_service_edges( ... query_params={'search': 'ServiceEdge01', 'page': '1', 'page_size': '100'}) ... if err: ... print(f"Error listing service edges: {err}") ... return ... print(f"Total service edges found: {len(service_edge_list)}") ... for edge in service_edge_list: ... print(edge.as_dict())
- reformat_params = [('service_edge_ids', 'serviceEdges'), ('trusted_network_ids', 'trustedNetworks')]¶
- update_service_edge(service_edge_id, **kwargs)¶
Updates the specified ZPA Service Edge.
- Parameters:
- Keyword Arguments:
- Returns:
ServiceEdge: The updated Service Edge object.
- Return type:
Tuple
Examples
Update an Service Edge name, description and disable it.
>>> update_service_edge, _, err = client.zpa.service_edges.update_service_edge( ... service_edge_id='99999' ... name=f"UpdateServiceEdge_{random.randint(1000, 10000)}", ... description=f"UpdateServiceEdge_{random.randint(1000, 10000)}", ... enabled=False, ... ) ... if err: ... print(f"Error creating service edge: {err}") ... return ... print(f"Service Edge created successfully: {update_service_edge.as_dict()}")