connectors#

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

Methods are accessible via zpa.connectors

class ConnectorsAPI#
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")
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_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')
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)
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)