zpa_gateway#
The following methods allow for interaction with the ZPA Gateway API endpoints.
Methods are accessible via zia.zpa_gateway
- class ZPAGatewayAPI#
Bases:
object
- add_gateway(name, zpa_server_group=None, zpa_app_segments=None, **kwargs)#
Creates a new ZPA Gateway.
- Parameters:
name (str) – The name of the ZPA Gateway.
zpa_server_group (dict, required) – The ZPA Server Group that is configured for Source IP Anchoring.
zpa_app_segments (list, optional) – All the Application Segments that are associated with the selected ZPA Server Group for which Source IP Anchoring is enabled.
- Keyword Arguments:
description (str) – Additional details about the ZPA gateway.
type (str) – Indicates whether the ZPA gateway is configured for Zscaler Internet Access (using option ZPA) or Zscaler Cloud Connector (using option ECZPA). Accepted values are ‘ZPA’ or ‘ECZPA’.
zpa_tenant_id (int) – The ID of the ZPA tenant where Source IP Anchoring is configured
- Returns:
The newly added ZPA Gateway resource record.
- Return type:
Box
- delete_gateway(gateway_id)#
Deletes the specified ZPA Gateway.
- Parameters:
gateway_id (str) – The unique identifier of the ZPA Gateway that will be deleted.
- Returns:
The response code for the request.
- Return type:
- Examples
>>> gateway = zia.zpa_gateway.delete_gateway('99999')
- get_gateway(gateway_id)#
Returns the zpa gateway details for a given ZPA Gateway.
- Parameters:
gatewayId (str) – The unique identifier for the ZPA Gateway.
- Returns:
The ZPA Gateway resource record.
- Return type:
Box
Examples
>>> gw = zia.zpa_gateway.get_gateway('99999')
- list_gateways(**kwargs)#
Returns a list of all ZPA Gateways.
- Returns:
The list of all ZPA Gateways Items
- Return type:
BoxList
- Returns:
The list of all ZPA Gateways Items
- Return type:
BoxList
Examples
Get a list of all ZPA Gateways Items
>>> results = zia.zpa_gateway.list_gateways() ... for item in results: ... print(item)
- update_gateway(gateway_id, **kwargs)#
Updates information for the specified ZPA Gateway.
- Parameters:
gateway_id (str) – The unique id for the ZPA Gateway to be updated.
- Keyword Arguments:
name (str) – The name of the ZPA gateway.
description (str) – Additional details about the ZPA gateway.
type (str) – Indicates whether the ZPA gateway is configured for Zscaler Internet Access (using option ZPA) or Zscaler Cloud Connector (using option ECZPA). Accepted values are ‘ZPA’ or ‘ECZPA’.
zpa_server_group (dict, optional) – The ZPA Server Group configured for Source IP Anchoring.
zpa_app_segments (list, optional) – All the Application Segments associated with the selected ZPA Server Group for which Source IP Anchoring is enabled.
zpa_tenant_id (int) – The ID of the ZPA tenant where Source IP Anchoring is configured
- Returns:
The updated ZPA Gateway resource record.
- Return type:
Box