connectors#

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

Methods are accessible via zpa.connectors

class AppConnectorControllerAPI#

Bases: object

add_connector_group(name, latitude, location, longitude, **kwargs)#

Adds a new ZPA App Connector Group.

Parameters:
  • name (str) – The name of the App Connector Group.

  • latitude (int) – The latitude representing the App Connector’s physical location.

  • location (str) – The name of the location that the App Connector Group represents.

  • longitude (int) – The longitude representing the App Connector’s physical location.

  • **kwargs – Optional keyword args.

Keyword Arguments:
  • **connector_ids (list) – The unique ids for the App Connectors that will be added to this App Connector Group.

  • **city_country (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.

  • **description (str) – Additional information about the App Connector Group.

  • **dns_query_type (str) – The type of DNS queries that are enabled for this App Connector Group. Accepted values are: IPV4_IPV6, IPV4 and IPV6

  • **enabled (bool) – Is the App Connector Group enabled? Defaults to True.

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

  • **server_group_ids (list) – The unique ids of the Server Groups that are associated with this App Connector Group

  • **lss_app_connector_group (bool) –

  • **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 App Connector Group.

Return type:

Box

Examples

Add a new ZPA App Connector Group with parameters.

>>> group = zpa.connectors.add_connector_group(name="New App Connector Group",
...    location="Sydney",
...    latitude="33.8688",
...    longitude="151.2093",
...    version_profile="default")
add_connector_schedule(frequency, interval, disabled, **kwargs)#

Configure an App Connector schedule frequency to delete inactive connectors based on the configured frequency.

Parameters:
  • frequency (str) – Frequency at which disconnected App Connectors are deleted.

  • interval (str) – Interval for the frequency value, minimum supported is 5.

  • disabled (bool) – If true, includes connectors for deletion if disconnected.

  • **kwargs – Optional keyword arguments.

Keyword Arguments:
  • name (str) – Name of the schedule.

  • customer_id (str) – Unique identifier of the ZPA tenant.

  • delete_disabled (bool) – Includes App Connectors for deletion if they are disconnected, based on frequency and interval values.

  • enabled (bool) – Enables or disables the deletion setting for App Connectors.

  • description (str) – Additional information about the Connector Schedule.

Returns:

Auto Delete frequency of the App Connector for the specified customer.

Return type:

Box

Examples

>>> schedule = zpa.connectors.add_connector_schedule(
...    frequency='weekly',
...    interval='5',
...    disabled=False,
...    name='Weekly Deletion',
...    description='Deletes disconnected connectors weekly.'
)
bulk_delete_connectors(connector_ids)#

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:

int

Examples

>>> zpa.connectors.bulk_delete_connectors(['111111', '222222', '333333'])
delete_connector(connector_id)#

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:

int

Examples

>>> zpa.connectors.delete_connector('999999')
delete_connector_group(group_id)#

Deletes the specified App Connector Group from ZPA.

Parameters:

group_id (str) – The unique identifier for the App Connector Group.

Returns:

The status code for the operation.

Return type:

int

Examples

>>> zpa.connectors.delete_connector_group('1876541121')
get_connector(connector_id)#

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:

Box

Examples

>>> app_connector = zpa.connectors.get_connector('99999')
get_connector_by_name(name)#
get_connector_group(group_id)#

Gets information for a specified connector group.

Parameters:

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

Returns:

The connector group resource record.

Return type:

Box

Examples

>>> connector_group = zpa.connectors.get_connector_group('99999')
get_connector_group_by_name(name)#
get_connector_schedule()#

Returns the configured App Connector Schedule frequency.

Parameters:
  • id (str) – Unique identifier for the App Connector auto deletion config. Required for the PUT request to update the App Connector Settings frequency.

  • customer_id (str) – Unique identifier of the ZPA tenant.

  • delete_disabled (bool) – If true, includes App Connectors for deletion if they are disconnected, based on frequencyInterval and frequency values.

  • enabled (bool) – If true, the deletion of App Connectors setting is enabled.

  • frequency (str) – Frequency at which disconnected App Connectors are deleted.

  • frequency_interval (str) – Interval for the frequency value, minimum is 5.

Returns:

The Auto Delete frequency of the App Connector for the specified customer.

Return type:

Box

Examples

>>> pprint(zpa.connectors.get_connector_schedule)
list_connector_groups(**kwargs)#

Returns a list of all connector groups.

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 of all configured connector groups.

Return type:

BoxList

Examples

>>> connector_groups = zpa.connectors.list_connector_groups()
list_connectors(**kwargs)#

Returns a list of all configured App Connectors.

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 all configured ZPA App Connectors.

Return type:

BoxList

Examples

List all configured App Connectors:

>>> for connector in zpa.connectors.list_connectors():
...    print(connector)
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.

  • **kwargs – Optional keyword args.

Keyword Arguments:
  • **description (str) – Additional information about the App Connector.

  • **enabled (bool) – True if the App Connector is enabled.

  • **name (str) – The name of the App Connector.

Returns:

The updated App Connector resource record.

Return type:

Box

Examples

Update an App Connector name and disable it.

>>> app_connector = zpa.connectors.update_connector('999999',
...    name="Updated App Connector Name",
...    enabled=False)
update_connector_group(group_id, **kwargs)#

Updates an existing ZPA App Connector Group.

Parameters:
  • group_id (str) – The unique id for the App Connector Group in ZPA.

  • **kwargs – Optional keyword args.

Keyword Arguments:
  • **connector_ids (list) – The unique ids for the App Connectors that will be added to this App Connector Group.

  • **city_country (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.

  • **description (str) – Additional information about the App Connector Group.

  • **dns_query_type (str) – The type of DNS queries that are enabled for this App Connector Group. Accepted values are: IPV4_IPV6, IPV4 and IPV6

  • **enabled (bool) – Is the App Connector Group enabled? Defaults to True.

  • **name (str) – The name of the App Connector Group.

  • **latitude (int) – The latitude representing the App Connector’s physical location.

  • **location (str) – The name of the location that the App Connector Group represents.

  • **longitude (int) – The longitude representing the App Connector’s physical location.

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

  • **server_group_ids (list) – The unique ids of the Server Groups that are associated with this App Connector Group

  • **lss_app_connector_group (bool) –

  • **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 updated ZPA App Connector Group resource record.

Return type:

Box

Examples

Update the name of an App Connector Group in ZPA, change the version profile to new releases and disable the group.

>>> group = zpa.connectors.update_connector_group('99999',
...    name="Updated App Connector Group",
...    version_profile="new_release",
...    enabled=False)
update_schedule(scheduler_id, **kwargs)#

Updates App Connector schedule frequency to delete the inactive connectors based on the configured frequency.

Parameters:
  • scheduler_id (str) – Unique identifier for the scheduler.

  • customer_id (str) – Unique identifier of the ZPA tenant.

  • delete_disabled (bool) – Include App Connectors for deletion if disconnected, based on frequencyInterval and frequency values.

  • enabled (bool) – Enable or disable deletion of App Connectors.

  • frequency (str) – Frequency at which disconnected App Connectors are deleted.

  • frequency_interval (str) – Interval for the frequency value, minimum is 5. Supported: 5, 7, 14, 30, 60, 90.

Keyword Arguments:

description (str) – Additional information about the Connector Schedule.

Returns:

True if update was successful, False otherwise.

Return type:

bool

Examples

Updating connector schedule:

>>> result = zpa.connectors.update_schedule('10', frequency_interval='10')
>>> print(result)  # True if successful, False otherwise