ListInstalledContentPacks

This script will show all installed content packs and whether they have an update.

python · XSOAR Content Update Notifications

Source

import demistomock as demisto  # noqa: F401
from CommonServerPython import *  # noqa: F401

args = demisto.args()
updated = args.get("updates") == "true"

packs = demisto.executeCommand("core-api-get", {"uri": "/contentpacks/installed-expired"})[0]["Contents"].get("response")
parsed_packs = [
    {"name": x.get("name"), "version": x.get("currentVersion"), "update": x.get("updateAvailable", False)} for x in packs
]

if updated:
    parsed_packs[:] = [x for x in parsed_packs if x.get("update")]

command_results = CommandResults(
    outputs_prefix="InstalledPacks",
    outputs_key_field="name",
    outputs=parsed_packs,
    readable_output=tableToMarkdown("Installed Content Packs:", parsed_packs, ["name", "version", "update"]),
)

return_results(command_results)

README

This script will show all installed content packs and whether they have an update.

Script Data


Name Description
Script Type python3
Tags  

Dependencies


This script uses the following commands and scripts.

  • core-api-get

Inputs


Argument Name Description
updates Whether to only show packs that have updates available.

Outputs


Path Description Type
InstalledPacks.Name Pack Name string
InstalledPacks.Version Pack Version string
InstalledPacks.Update Is there an update available boolean

Troubleshooting

Multi-tenant environments should be configured with the Cortex Rest API instance when using this
automation. Make sure the Use tenant parameter (in the Cortex Rest API integration) is checked
to ensure that API calls are made to the current tenant instead of the master tenant.