-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Panorama instance singleselect on new incident layouts
Add single select incident field to select panorama instance on new Upgrade Assurance and Device Upgrade incidents create layout. GetPanoramaInstances script implemented to display panorama instances on singleselect field.
- Loading branch information
1 parent
53ce933
commit 28d8629
Showing
10 changed files
with
271 additions
and
15 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
...ices/IncidentFields/incidentfield-PAN-OS_Network_Operations_-_Panorama_Instance_Name.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"XDRBuiltInField": false, | ||
"XsiamIncidentFieldExtraData": { | ||
"incidentsFilter": null, | ||
"slaGoals": null, | ||
"slaTimer": null, | ||
"timerConditions": null | ||
}, | ||
"aliasTo": "", | ||
"aliases": null, | ||
"associatedToAll": false, | ||
"associatedTypes": [ | ||
"PAN-OS Network Operations - Device Upgrade", | ||
"PAN-OS Network Operations - Upgrade Assurance" | ||
], | ||
"autoCompleteTags": null, | ||
"breachScript": "", | ||
"cacheVersn": 0, | ||
"caseInsensitive": true, | ||
"cliName": "panosnetworkoperationspanoramainstancename", | ||
"closeForm": false, | ||
"columns": null, | ||
"content": false, | ||
"defaultRows": null, | ||
"definitionId": "", | ||
"description": "The XSOAR PAN-OS integration instance used in playbook", | ||
"editForm": true, | ||
"fieldCalcScript": "GetPanoramaInstances", | ||
"fromServerVersion": "", | ||
"group": 0, | ||
"hidden": false, | ||
"id": "incident_panosnetworkoperationspanoramainstancename", | ||
"ipVersion": "", | ||
"isReadOnly": false, | ||
"itemVersion": "", | ||
"locked": false, | ||
"mergeStrategy": "", | ||
"name": "PAN-OS Network Operations - Panorama Instance Name", | ||
"neverSetAsRequired": false, | ||
"openEnded": false, | ||
"orgType": "singleSelect", | ||
"ownerOnly": false, | ||
"packID": "", | ||
"packName": "", | ||
"placeholder": "", | ||
"pretty_name": "PAN-OS Network Operations - Panorama Instance Name", | ||
"required": false, | ||
"runScriptAfterUpdate": false, | ||
"script": "", | ||
"selectValues": [ | ||
"" | ||
], | ||
"selectValuesMap": null, | ||
"sla": 0, | ||
"system": false, | ||
"systemAssociatedTypes": null, | ||
"template": "", | ||
"threshold": 72, | ||
"toServerVersion": "", | ||
"type": "singleSelect", | ||
"unmapped": false, | ||
"unsearchable": false, | ||
"useAsKpi": false, | ||
"validatedError": "", | ||
"validationRegex": "", | ||
"version": -1, | ||
"x2_fields": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
Packs/PAN_OS_Upgrade_Services/Scripts/GetPanoramaInstances/GetPanoramaInstances.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import demistomock as demisto # noqa: F401 | ||
from CommonServerPython import * # noqa: F401 | ||
from typing import Dict, Any | ||
import traceback | ||
|
||
|
||
def get_panorama_instances() -> Dict[str, Any]: | ||
""" | ||
Get instances of Panorama integration for SingleSelect field. | ||
:rtype: ``dict`` | ||
:return: dict with the ids as options for SingleSelect field e.g | ||
{"hidden": False, "options": sorted(panorama_instance_names)} | ||
""" | ||
res = demisto.executeCommand("GetInstanceName", { | ||
"integration_name": "Panorama", | ||
"return_all_instances": True | ||
}) | ||
if is_error(res): | ||
return_error(get_error(res)) | ||
|
||
if not res: | ||
raise DemistoException('Got an empty list object after executing the command !GetPanoramaInstances') | ||
|
||
panorama_instances = res[0].get('Contents', []) | ||
|
||
panorama_instance_names = [] | ||
# panorama_instances is a list of dict(instanceName, integrationName) | ||
for instance in panorama_instances: | ||
panorama_instance_names.append(instance.get('instanceName')) | ||
|
||
return {"hidden": False, "options": sorted(panorama_instance_names)} | ||
|
||
|
||
def main(): | ||
try: | ||
result = get_panorama_instances() | ||
return_results(result) | ||
|
||
except Exception as ex: | ||
demisto.error(traceback.format_exc()) # print the traceback | ||
return_error(f'Failed to execute GetPanoramaInstances. Error: {str(ex)}') | ||
|
||
|
||
''' ENTRY POINT ''' | ||
|
||
if __name__ in ('__main__', '__builtin__', 'builtins'): | ||
main() |
18 changes: 18 additions & 0 deletions
18
Packs/PAN_OS_Upgrade_Services/Scripts/GetPanoramaInstances/GetPanoramaInstances.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
comment: Gets all instances of Panorama integration, in the output format of a single select field. | ||
commonfields: | ||
id: GetPanoramaInstances | ||
version: -1 | ||
dockerimage: demisto/python3:3.11.10.111526 | ||
enabled: true | ||
engineinfo: {} | ||
mainengineinfo: {} | ||
name: GetPanoramaInstances | ||
pswd: '' | ||
runas: DBotWeakRole | ||
runonce: false | ||
script: '' | ||
scripttarget: 0 | ||
subtype: python3 | ||
tags: | ||
- field-display | ||
type: python |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.