Skip to content

Commit

Permalink
type=zone | introduce 'filter=(interface is.set)'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Waschkut committed Aug 10, 2023
1 parent bde9e27 commit 488c8b5
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ UTIL:
* type=service actions=exporttoexcel:file.html | correct predefined service-http/-https output
* type=address/server actions=exporttoexcel:file.html,nestedmembers | extend with column nested members location
* class Address - use $RuleReferenceLocation
* type=zone | introduce 'filter=(interface is.set)'

BUGFIX:
* class Region | bugfix - introduce method type() - to handle "type=address actions="
Expand Down
15 changes: 15 additions & 0 deletions lib/misc-classes/filters/filters-Zone.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,4 +471,19 @@
'input' => 'input/panorama-8.0.xml'
)
);

RQuery::$defaultFilters['zone']['interface']['operators']['is.set'] = array(
'Function' => function (ZoneRQueryContext $context) {
$object = $context->object;

$interfaces = $object->attachedInterfaces->getAll();
if( count($interfaces) > 0)
return TRUE;
else
return FALSE;

return null;
},
'arg' => FALSE
);
// </editor-fold>
75 changes: 73 additions & 2 deletions utils/develop/ui/json_array.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,38 @@ var subjectObject =
}
}
},
"upload-address-2cloudmanager": {
"name": "upload-address-2cloudmanager",
"GlobalInitFunction": {},
"MainFunction": {},
"GlobalFinishFunction": {},
"args": {
"panorama_file": {
"type": "string",
"default": "*nodefault*"
},
"dg_name": {
"type": "string",
"default": "*nodefault*"
}
}
},
"upload-addressgroup-2cloudmanager": {
"name": "upload-addressgroup-2cloudmanager",
"GlobalInitFunction": {},
"MainFunction": {},
"GlobalFinishFunction": {},
"args": {
"panorama_file": {
"type": "string",
"default": "*nodefault*"
},
"dg_name": {
"type": "string",
"default": "*nodefault*"
}
}
},
"value-host-object-add-netmask-m32": {
"name": "value-host-object-add-netmask-m32",
"MainFunction": {}
Expand Down Expand Up @@ -1803,6 +1835,12 @@ var subjectObject =
"name": "template-delete",
"MainFunction": {}
},
"xml-extract": {
"name": "xml-extract",
"GlobalInitFunction": {},
"MainFunction": {},
"GlobalFinishFunction": {}
},
"zoneprotectionprofile-create-bp": {
"name": "zoneprotectionprofile-create-bp",
"GlobalInitFunction": {},
Expand Down Expand Up @@ -1931,6 +1969,30 @@ var subjectObject =
"display": {
"name": "display",
"MainFunction": {}
},
"exporttoexcel": {
"name": "exportToExcel",
"MainFunction": {},
"GlobalInitFunction": {},
"GlobalFinishFunction": {},
"args": {
"filename": {
"type": "string",
"default": "*nodefault*"
},
"additionalFields": {
"type": "pipeSeparatedList",
"subtype": "string",
"default": "*NONE*",
"choices": [
"WhereUsed",
"UsedInLocation",
"ResolveIP",
"NestedMembers"
],
"help": "pipe(|) separated list of additional fields (ie: Arg1|Arg2|Arg3...) to include in the report. The following is available:\n - NestedMembers: lists all members, even the ones that may be included in nested groups\n - ResolveIP\n - UsedInLocation : list locations (vsys,dg,shared) where object is used\n - WhereUsed : list places where object is used (rules, groups ...)\n"
}
}
}
},
"filter": {
Expand Down Expand Up @@ -6153,9 +6215,10 @@ var subjectObject =
"choices": [
"WhereUsed",
"UsedInLocation",
"ResolveSRV"
"ResolveSRV",
"NestedMembers"
],
"help": "pipe(|) separated list of additional field to include in the report. The following is available:\n - WhereUsed : list places where object is used (rules, groups ...)\n - UsedInLocation : list locations (vsys,dg,shared) where object is used\n - ResolveSRV\n"
"help": "pipe(|) separated list of additional field to include in the report. The following is available:\n - WhereUsed : list places where object is used (rules, groups ...)\n - UsedInLocation : list locations (vsys,dg,shared) where object is used\n - NestedMembers: lists all members, even the ones that may be included in nested groups\n - ResolveSRV\n"
}
}
},
Expand Down Expand Up @@ -7652,6 +7715,14 @@ var subjectObject =
}
},
"filter": {
"interface": {
"operators": {
"is.set": {
"Function": {},
"arg": false
}
}
},
"location": {
"operators": {
"is": {
Expand Down
75 changes: 73 additions & 2 deletions utils/lib/util_action_filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,38 @@
}
}
},
"upload-address-2cloudmanager": {
"name": "upload-address-2cloudmanager",
"GlobalInitFunction": {},
"MainFunction": {},
"GlobalFinishFunction": {},
"args": {
"panorama_file": {
"type": "string",
"default": "*nodefault*"
},
"dg_name": {
"type": "string",
"default": "*nodefault*"
}
}
},
"upload-addressgroup-2cloudmanager": {
"name": "upload-addressgroup-2cloudmanager",
"GlobalInitFunction": {},
"MainFunction": {},
"GlobalFinishFunction": {},
"args": {
"panorama_file": {
"type": "string",
"default": "*nodefault*"
},
"dg_name": {
"type": "string",
"default": "*nodefault*"
}
}
},
"value-host-object-add-netmask-m32": {
"name": "value-host-object-add-netmask-m32",
"MainFunction": {}
Expand Down Expand Up @@ -1802,6 +1834,12 @@
"name": "template-delete",
"MainFunction": {}
},
"xml-extract": {
"name": "xml-extract",
"GlobalInitFunction": {},
"MainFunction": {},
"GlobalFinishFunction": {}
},
"zoneprotectionprofile-create-bp": {
"name": "zoneprotectionprofile-create-bp",
"GlobalInitFunction": {},
Expand Down Expand Up @@ -1930,6 +1968,30 @@
"display": {
"name": "display",
"MainFunction": {}
},
"exporttoexcel": {
"name": "exportToExcel",
"MainFunction": {},
"GlobalInitFunction": {},
"GlobalFinishFunction": {},
"args": {
"filename": {
"type": "string",
"default": "*nodefault*"
},
"additionalFields": {
"type": "pipeSeparatedList",
"subtype": "string",
"default": "*NONE*",
"choices": [
"WhereUsed",
"UsedInLocation",
"ResolveIP",
"NestedMembers"
],
"help": "pipe(|) separated list of additional fields (ie: Arg1|Arg2|Arg3...) to include in the report. The following is available:\n - NestedMembers: lists all members, even the ones that may be included in nested groups\n - ResolveIP\n - UsedInLocation : list locations (vsys,dg,shared) where object is used\n - WhereUsed : list places where object is used (rules, groups ...)\n"
}
}
}
},
"filter": {
Expand Down Expand Up @@ -6152,9 +6214,10 @@
"choices": [
"WhereUsed",
"UsedInLocation",
"ResolveSRV"
"ResolveSRV",
"NestedMembers"
],
"help": "pipe(|) separated list of additional field to include in the report. The following is available:\n - WhereUsed : list places where object is used (rules, groups ...)\n - UsedInLocation : list locations (vsys,dg,shared) where object is used\n - ResolveSRV\n"
"help": "pipe(|) separated list of additional field to include in the report. The following is available:\n - WhereUsed : list places where object is used (rules, groups ...)\n - UsedInLocation : list locations (vsys,dg,shared) where object is used\n - NestedMembers: lists all members, even the ones that may be included in nested groups\n - ResolveSRV\n"
}
}
},
Expand Down Expand Up @@ -7651,6 +7714,14 @@
}
},
"filter": {
"interface": {
"operators": {
"is.set": {
"Function": {},
"arg": false
}
}
},
"location": {
"operators": {
"is": {
Expand Down

0 comments on commit 488c8b5

Please sign in to comment.