segment_groups#

The following methods allow for interaction with the ZPA Segment Groups API endpoints.

Methods are accessible via zpa.segment_groups

class SegmentGroupsAPI#
add_group(name, enabled=False, **kwargs)#

Adds a new segment group.

Parameters:
  • name (str) – The name of the new segment group.

  • enabled (bool) – Enable the segment group. Defaults to False.

  • **kwargs

Keyword Arguments:
  • application_ids (list of dict) – Unique application IDs to associate with the segment group.

  • config_space (str) – The config space for the segment group. Can either be DEFAULT or SIEM.

  • description (str) – A description for the segment group.

  • policy_migrated (bool) –

Returns:

The resource record for the newly created segment group.

Return type:

Box

Examples

Creating a segment group with the minimum required parameters:

>>> zpa.segment_groups.add_group('new_segment_group',
...    True)
delete_group(group_id)#

Deletes the specified segment group.

Parameters:

group_id (str) – The unique identifier for the segment group to be deleted.

Returns:

The response code for the operation.

Return type:

int

Examples

>>> zpa.segment_groups.delete_group('99999')
get_group(group_id)#

Returns information on the specified segment group.

Parameters:

group_id (str) – The unique identifier for the segment group.

Returns:

The resource record for the segment group.

Return type:

Box

Examples

>>> pprint(zpa.segment_groups.get_group('99999'))
list_groups(**kwargs)#

Returns a list of all configured segment groups.

Returns:

A list of all configured segment groups.

Return type:

BoxList

Examples

>>> for segment_group in zpa.segment_groups.list_groups():
...    pprint(segment_group)
update_group(group_id, **kwargs)#

Updates an existing segment group.

Parameters:
  • group_id (str) – The unique identifier for the segment group to be updated.

  • **kwargs – Optional keyword args.

Keyword Arguments:
  • name (str) – The name of the new segment group.

  • enabled (bool) – Enable the segment group.

  • application_ids (list of dict) – Unique application IDs to associate with the segment group.

  • config_space (str) – The config space for the segment group. Can either be DEFAULT or SIEM.

  • description (str) – A description for the segment group.

  • policy_migrated (bool) –

Returns:

The resource record for the updated segment group.

Return type:

Box

Examples

Updating the name of a segment group:

>>> zpa.segment_groups.update_group('99999',
...    name='updated_name')