Skip to content

Commit

Permalink
PAPP-34694: adding ipv6 destination group support
Browse files Browse the repository at this point in the history
  • Loading branch information
tapishj-splunk committed Oct 21, 2024
1 parent 738a112 commit ee938f6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
17 changes: 16 additions & 1 deletion zscaler.json
Original file line number Diff line number Diff line change
Expand Up @@ -4288,6 +4288,16 @@
"default": 50,
"order": 3
},
"include_ipv6": {
"description": "Retrieve IPv6 destination groups",
"data_type": "boolean",
"example_values": [
true,
false
],
"default": false,
"order": 4
},
"lite": {
"description": "Whether to retrieve only limited information of IP destination groups. Includes ID, name and type of the IP destination groups",
"data_type": "boolean",
Expand All @@ -4296,7 +4306,7 @@
false
],
"default": false,
"order": 4
"order": 5
}
},
"output": [
Expand All @@ -4314,6 +4324,11 @@
"data_type": "boolean",
"column_name": "Lite"
},
{
"data_path": "action_result.parameter.include_ipv6",
"data_type": "boolean",
"column_name": "Include Ipv6"
},
{
"data_path": "action_result.parameter.limit",
"data_type": "numeric",
Expand Down
12 changes: 11 additions & 1 deletion zscaler_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,7 @@ def _handle_list_destination_group(self, param):
:param ip_group_ids: Destination groups to retrieve
:param exclude_type: Group types to exclude from search
:param category_type: Destination types to filter by
:param include_ipv6: Retrieve IPv6 groups
:param limit: Number of groups to retrieve
:param lite: Retrieve limited information for each group
:return: status phantom.APP_ERROR/phantom.APP_SUCCESS(along with appropriate message)
Expand All @@ -1276,6 +1277,7 @@ def _handle_list_destination_group(self, param):
exclude_type = param.get("exclude_type", "")
category_type = param.get("category_type", "")
category_type_list = [item.strip() for item in category_type.split(",") if item.strip()]
include_ipv6 = param.get("include_ipv6", False)
limit = param.get("limit", 50)
lite = param.get("lite", False)

Expand Down Expand Up @@ -1304,7 +1306,15 @@ def _handle_list_destination_group(self, param):
if phantom.is_fail(ret_val):
return action_result.get_status()

# action_result.add_data(destination_groups)
if include_ipv6:
self.save_progress("Retrieving ipv6 destination groups")
params['page'] = 1
params['pageSize'] = limit
endpoint = '/ipDestinationGroups/ipv6DestinationGroups/lite' if lite else '/ipDestinationGroups/ipv6DestinationGroups'
ret_val = self._get_batched_groups(endpoint, params, action_result)
if phantom.is_fail(ret_val):
return action_result.get_status()

summary = action_result.update_summary({})
summary["message"] = "Destination groups retrieved"
return action_result.set_status(phantom.APP_SUCCESS)
Expand Down

0 comments on commit ee938f6

Please sign in to comment.