service_edges#

The following methods allow for interaction with the ZPA Service Edge API endpoints.

Methods are accessible via zpa.service_edges

class ServiceEdgesAPI#
add_service_edge_group(name, latitude, longitude, location, **kwargs)#

Adds a new Service Edge Group to ZPA.

Parameters:
  • latitude (str) – The latitude representing the physical location of the ZPA Service Edges in this group.

  • longitude (str) – The longitude representing the physical location of the ZPA Service Edges in this group.

  • location (str) – The name of the physical location of the ZPA Service Edges in this group.

  • name (str) – The name of the Service Edge Group.

  • **kwargs – Optional keyword args.

Keyword Arguments:
  • **cityCountry (str) –

    The City and Country for where the App Connectors are located. Format is:

    <City>, <Country Code> e.g. Sydney, AU

  • **country_code (str) – The ISO<std> Country Code that represents the country where the App Connectors are located.

  • **enabled (bool) – Is the Service Edge Group enabled? Defaults to True.

  • **is_public (bool) – Is the Service Edge publicly accessible? Defaults to False.

  • **override_version_profile (bool) – Override the local App Connector version according to version_profile. Defaults to False.

  • **service_edge_ids (list) – A list of unique ids of ZPA Service Edges that belong to this Service Edge Group.

  • **trusted_network_ids (list) – A list of unique ids of Trusted Networks that are associated with this Service Edge Group.

  • **upgrade_day (str) – The day of the week that upgrades will be pushed to the App Connector.

  • **upgrade_time_in_secs (str) – The time of the day that upgrades will be pushed to the App Connector.

  • **version_profile (str) –

    The version profile to use. This will automatically set override_version_profile to True. Accepted values are:

    default, previous_default and new_release

Returns:

The resource record of the newly created Service Edge Group.

Return type:

Box

Examples

Add a new Service Edge Group for Service Edges in Sydney and set the version profile to new releases.

>>> group = zpa.service_edges.add_service_edge_group(name="My SE Group",
...    latitude="33.8688",
...    longitude="151.2093",
...    location="Sydney",
...    version_profile="new_release)
bulk_delete_service_edges(service_edge_ids)#

Bulk deletes the specified Service Edges from ZPA.

Parameters:

service_edge_ids (list) – A list of Service Edge ids that will be deleted from ZPA.

Returns:

The status code for the operation.

Return type:

int

Examples

>>> zpa.service_edges.bulk_delete_service_edges(['99999', '88888'])
delete_service_edge(service_edge_id)#

Deletes the specified Service Edge from ZPA.

Parameters:

service_edge_id (str) – The unique id of the ZPA Service Edge that will be deleted.

Returns:

The status code of the operation.

Return type:

int

Examples

>>> zpa.service_edges.delete_service_edge('99999')
delete_service_edge_group(service_edge_group_id)#

Deletes the specified Service Edge Group from ZPA.

Parameters:

service_edge_group_id (str) – The unique id of the ZPA Service Edge Group.

Returns:

The status code for the operation.

Return type:

int

Examples

>>> zpa.service_edges.delete_service_edge_group("99999")
get_service_edge(service_edge_id)#

Returns information on the specified Service Edge.

Parameters:

service_edge_id (str) – The unique id of the ZPA Service Edge.

Returns:

The Service Edge resource record.

Return type:

Box

Examples

>>> service_edge = zpa.service_edges.get_service_edge('999999')
get_service_edge_group(group_id)#

Returns information on the specified ZPA Service Edge Group.

Parameters:

group_id (str) – The unique id of the ZPA Service Edge Group.

Returns:

The specified ZPA Service Edge Group resource record.

Return type:

Box

Examples

>>> group = zpa.service_edges.get_service_edge_group("99999")
list_service_edge_groups(**kwargs)#

Returns information on all configured Service Edge Groups in ZPA.

Parameters:

**kwargs – Optional keyword args.

Keyword Arguments:
  • **max_items (int, optional) – The maximum number of items to request before stopping iteration.

  • **max_pages (int, optional) – The maximum number of pages to request before stopping iteration.

  • **pagesize (int, optional) – Specifies the page size. The default size is 100, but the maximum size is 1000.

  • **search (str, optional) – The search string used to match against a department’s name or comments attributes.

Returns:

A list of all ZPA Service Edge Group resource records.

Return type:

BoxList

Examples

Print all Service Edge Groups in ZPA.

>>> for group in zpa.service_edges.list_service_edge_groups():
...    print(group)
list_service_edges(**kwargs)#

Returns information on all configured ZPA Service Edges.

Parameters:

**kwargs – Optional keyword args.

Keyword Arguments:
  • **max_items (int, optional) – The maximum number of items to request before stopping iteration.

  • **max_pages (int, optional) – The maximum number of pages to request before stopping iteration.

  • **pagesize (int, optional) – Specifies the page size. The default size is 100, but the maximum size is 1000.

  • **search (str, optional) – The search string used to match against a department’s name or comments attributes.

Returns:

List containing information on all configured ZPA Service Edges.

Return type:

BoxList

Examples

>>> for service_edge in zpa.service_edges.list_service_edges():
...    print(service_edge)
update_service_edge(service_edge_id, **kwargs)#

Updates the specified ZPA Service Edge.

Parameters:
  • service_edge_id (str) – The unique id of the Service Edge that will be updated in ZPA.

  • **kwargs – Optional keyword args.

Keyword Arguments:
  • **description (str) – Additional information about the Service Edge.

  • **enabled (bool) – Enable the Service Edge. Defaults to True.

  • **name (str) – The name of the Service Edge in ZPA.

Returns:

The updated Service Edge resource record.

Return type:

Box

Examples

>>> updated_service_edge = zpa.service_edge.update_service_edge('99999',
...    description="Updated Description",
...    name="Updated Name")
update_service_edge_group(group_id, **kwargs)#

Updates the specified ZPA Service Edge Group.

Parameters:
  • group_id (str) – The unique id of the ZPA Service Edge Group that will be updated.

  • **kwargs – Optional keyword args.

Keyword Arguments:
  • **cityCountry (str) –

    The City and Country for where the App Connectors are located. Format is:

    <City>, <Country Code> e.g. Sydney, AU

  • **country_code (str) – The ISO<std> Country Code that represents the country where the App Connectors are located.

  • **enabled (bool) – Is the Service Edge Group enabled? Defaults to True.

  • **is_public (bool) – Is the Service Edge publicly accessible? Defaults to False.

  • **latitude (str) – The latitude representing the physical location of the ZPA Service Edges in this group.

  • **longitude (str) – The longitude representing the physical location of the ZPA Service Edges in this group.

  • **location (str) – T he name of the physical location of the ZPA Service Edges in this group.

  • **name (str) – The name of the Service Edge Group.

  • **override_version_profile (bool) – Override the local App Connector version according to version_profile. Defaults to False.

  • **service_edge_ids (list) – A list of unique ids of ZPA Service Edges that belong to this Service Edge Group.

  • **trusted_network_ids (list) – A list of unique ids of Trusted Networks that are associated with this Service Edge Group.

  • **upgrade_day (str) – The day of the week that upgrades will be pushed to the Service Edges in this group.

  • **upgrade_time_in_secs (str) – The time of the day that upgrades will be pushed to the Service Edges in this group.

  • **version_profile (str) –

    The version profile to use. This will automatically set override_version_profile to True. Accepted values are:

    default, previous_default and new_release

Returns:

The updated ZPA Service Edge Group resource record.

Return type:

Box

Examples

Update the name of a Service Edge Group, change the Version Profile to ‘default’ and the upgrade day to Friday.

>>> group = zpa.service_edges.update_service_edge_group('99999',
...    name="Updated Name",
...    version_profile="default",
...    upgrade_day="friday")